Decentralised Exchanges (DeX)
ThirdFi offers Earn (Providing Liquidity) and Swap functions on-chain with REST API. Currently we are supporting UniswapV2
forked version swapping protocols, such as Uniswap, Sushiswap, Pancakeswap, Quickswap, TraderJoe, Velodrome, OKCSwap, Kuswap, VSS Finance, Swappi, PoseiSwap.
Earn
What is Earn?
Earn is a liquidity provider who provides token assets to liquidity pools in order to earn rewards from fees generated when others 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 work?
- Get actual liquidity pool ratio for the token pairs via https://thirdfi.readme.io/reference/get-liquidity-ratio.
- Use the amounts returned to create earn request via https://thirdfi.readme.io/reference/create-liquidity-session.
- Redirect user to webview URL provided from API.
- User is able to add liquidity to pools by connecting user wallet with Metamask/Wallet Connect (Web3 wallet) and specific network chain from the API requested earlier, then do the transaction.
- The user wallet will receive the "liquidity tokens" that was added when it has been sent to DeX protocols.
What is the liquidity tokens?
Liquidity tokens are merely an accounting or bookkeeping tool to keep track of how much the liquidity providers are owed. If others subsequently add/withdraw coins, new liquidity tokens are minted/burned such that everyone's relative percentage share of the liquidity pool remains the same. These are not speculative tokens to be traded.
Swap
What is Swap?
Swap is a straightforward method of exchanging token assets for other assets. Swaps on decentralised exchanges (DeX) differ from trades on traditional platforms in that they use an automated market maker mechanism to provide real-time feedback on rates and slippage rather than an order book to represent liquidity or determine prices.
Swapping is simple for end users; a user selects an input token and an output token. They enter an amount, and the protocol determines how much of the output token they will receive. They then perform the swap with a single click and immediately receive the output token in their wallet. You can learn more about the swapping at https://docs.uniswap.org/contracts/v2/concepts/core-concepts/swaps.
How does Swap work?
- Create token swap request via https://thirdfi.readme.io/reference/create-swap-session.
- Redirect user to webview URL provided from API.
- User is able to swap the token by connecting user wallet with Metamask/Wallet Connect (Web3 wallet) and specific network chain from the API requested earlier, then do swapping.
- The user wallet will receive the token that was swapped when it has been sent to DeX protocols.
List of chains we supported
This is useful in Get Estimated Swap Output Amount and Create Session.
Blockchain Network | Mainnet | Testnet |
---|---|---|
Ethereum | ethereum | goerli |
Arbitrum | arbitrum | arbitrumTestnet |
BNB chain | bsc | bscTestnet |
Polygon | polygon | mumbai |
Avalanche | avalanche | fuji |
Optimism | optimism | optimismTestnet |
OKExchain | okc | okcTestnet |
Cronos | cronos | cronosTestnet |
KuCoin chain | kcc | kccTestnet |
Conflux (eSpace) | conflux | confluxTestnet |
Nautilus chain | - | nautilusTestnet |
List of liquidity pools we supported (Mainnet)
Blockchain Network | Pools |
---|---|
ethereum | USDC-ETH |
ethereum | DAI-USDC |
ethereum | ETH-USDT |
ethereum | UNI-ETH |
ethereum | WBTC-ETH |
avalanche | AVAX-USDC |
avalanche | WETH.e-AVAX |
avalanche | USDt-AVAX |
avalanche | BTC.b-AVAX |
avalanche | USDC.e-AVAX |
avalanche | AVAX-USDT.e |
polygon | MATIC-SAND |
polygon | USDC-WETH |
polygon | MATIC-USDC |
polygon | USDC-USDT |
polygon | MATIC-WETH |
arbitrum | ETH-USDC |
arbitrum | ETH-MIM |
arbitrum | WBTC-ETH |
arbitrum | ETH-USDT |
arbitrum | SPELL-ETH |
bsc | USDT-BNB |
bsc | BNB-BUSD |
bsc | USDT-BUSD |
bsc | CAKE-BNB |
bsc | BTCB-BNB |
optimism | OP-USDC |
optimism | ETH-USDC |
optimism | VELO-USDC |
optimism | USDC-DAI |
okc | USDT-ETHK |
okc | USDT-BTCK |
okc | USDT-USDC |
okc | USDT-OKB |
okc | USDT-OKT |
cronos | WCRO-USDC |
cronos | VVS-WCRO |
cronos | USDT-USDC |
cronos | WETH-WCRO |
cronos | VVS-USDC |
kcc | WKCS-KUS |
kcc | USDT-USDC |
kcc | USDT-WKCS |
kcc | WKCS-USDC |
kcc | WKCS-BTCK |
conflux | CFX-ETH |
conflux | CFX-WBTC |
conflux | CFX-PPI (Swappi) |
conflux | CFX-USDT |
conflux | CFX-USDC |
conflux | USDC-USDT |
List of liquidity pools we supported (Testnet)
See https://thirdfi.readme.io/reference/get-dexswap-pools for more information.
Testnet Faucet
Check https://www.faucet.thirdfi.org/ for getting testing ERC20 tokens for testnet testing.