Announcing Earn API for DeFi

Securo.dev
4 min readJan 7, 2023

--

As builders, we understand first-hand how frustrating it can be to connect liquidity pools to your dapp and your product manually. It involves researching the liquidity pools in each chain and working on the smart contract, even writing your own code to enable the users to provide liquidity in certain pools.

We’re proud to announce Earn API for DeFi.

As part of Securo’s mission, this Earn API allows developers to seamlessly deploy funds into DeFi liquidity pools and earn LP rewards in corresponding pools. Eventually, this will save time implementing and maintaining your DeFi product.

What does Earn API do?

Earn API is an API function for providing liquidity to liquidity pools on decentralized exchanges. It provides token assets to liquidity pools to earn rewards from fees generated when other people trade or swap with those pools. You can learn more about the liquidity providers and pools at https://docs.uniswap.org/contracts/v2/concepts/advanced-topics/understanding-returns.

How does Earn API work?

Users can first get the actual liquidity pool ratio for the token pairs in the blockchain network they chose. Then users can use the amounts to create an earn request. Once all the parameters are set, and the request has been sent, users will be provided a webview URL to execute the transaction.

Securo supports gasless transactions to Earn API, too, powered by Biconomy. Once the transaction is confirmed and processed, the users will receive ‘liquidity tokens’.

At launch, we’re providing support for these liquidity pools in 6 blockchain networks.

Ethereum

USDC-ETH
DAI-USDC
ETH-USDT
UNI-ETH
WBTC-ETH

Avalanche

AVAX-USDC
WETH.e-AVAX
USDT-AVAX
BTC.b-AVAX
AVAX-USDC.e
AVAX-USDT.e

Polygon

MATIC-SAND
USDC-WETH
MATIC-USDC
USDT-USDC
MATIC-WETH

Arbitrum

ETH-USDC
ETH-MIM
WBTC-ETH
USDT-ETH
SPELL-ETH

BNB

USDT-BNB
BNB-BUSD
USDT-BUSD
CAKE-BNB
BTCB-BNB
DOGE-BNB

Optimism

OP-USDC
ETH-USDC
VELO-USDC
USDC-DAI

*To see the full information on the supported liquidity pools, please visit https://docs.securo.dev/securo-services/earn

Here is a simple step-by-step guide on how to use the Earn API.

  1. Create an account on Securo Developer Portal.
  2. Create the API key, set the whitelist IP address, and the permission.
  3. Open Postman to use the Earn API — Liquidity Provider (LP).
  4. Before creating an LP session, we need Postman to get ‘lpInfo’ first. Set the following parameters:
    - chain: blockchain network you want to use.
    - tokenA & tokenB: the token pairs you want to use for providing liquidity.
    - amountA & amountB: the value of tokens you want to provide liquidity with the token pair.

7. Click Send and get the lpInfo. Then you will get the result for tokenB value amount.

8. Create an LP(Liquidity Provider) session. Edit the parameters and click Send. The amount0 and amount1 can be copied from where we set the lpInfo.

9. After clicking Send, the LP session is successfully created, and it will provide a URL to access the portal.

10. Click the URL to review the transaction details. Once you confirm the transaction, click the Confirm button.

11. Metamask will show a pop-up message. It is a signature request from Biconomy to enable gasless transactions. Click the Sign button to proceed with the transaction without any gas fee.

12. Once the transaction is through, you can review the transaction's status in the Securo app.

Hope you enjoy this Earn API for DeFi, to easily provide liquidity into various liquidity pools.

As this is the first version of the Earn API, we’re still looking to add more liquidity pools and improve this API. We’re excited to see how our users will use these in their dapps and look forward to any feedback on how we can further improve!

Written with ❤,

Team Securo

https://linktr.ee/securo

--

--

Securo.dev

All-in-1 DeFi Infrastructure API Build, invest, and manage your DeFi product at http://app.securo.dev