8️⃣Adding Liquidity to a Liquidity Pool

Yeah, swapping is great but earning income from trading is a lot better! Let's learn how to do this by adding liquidity to a liquidity pool (LP). Adding liquidity to an LP allows you to earn passive income by getting a fee from each trade conducted on that trading pair.

In this example, we'll learn how to add liquidity to the CFX-ETH pool.

Prerequisites

  • 2 different kinds of assets for which you'll provide liquidity to the liquidity pool. The amount of those assets should be provided in equals parts in USD value. Swappi will auto-calculate how much funds from each asset you'll need to provide. In this example, we'll use the CFX-ETH pair.

  • Your wallet connected to Conflux eSpace and Swappi.

  • CFX to pay for gas transaction costs.

Adding Liquidity to a Liquidity Pool

  1. In Swappi, go to Liquidity.

  2. Click Add Liquidity.

  3. Select the pair of assets that you want to provide liquidity for.

  4. In Token A, enter the amount of liquidity that you want to provide.

  5. The amount of available liquidity will be completed in Token B.

  6. Click Approve ETH (or the token that you're adding to the pool) to approve the transfer of your token to the liquidity pool contract.

  7. In MetaMask, click Confirm to confirm the approval of this transaction.

  8. Now, click Supply to start adding your funds to the liquidity pool.

  9. Confirm the details of the transaction by clicking Confirm Supply.

  10. Finally, approve the transaction in MetaMask by clicking Confirm.

You have just added liquidity to the CFX-ETH liquidity pool! As a result, you received a liquidity pool token which proves that you own a position in this liquidity pool. [insert image here]

  1. Click Add PPI-LP to add the liquidity pool token to MetaMask.

  2. In MetaMask, confirm adding this token by clicking Add Token.

  3. Now, in Swappi, go to Liquidity.

You'll notice that Swappi now shows you an LP Balance, which represents the amount of LP tokens that you own from that liquidity pool. [images also go here]

You can always remove this liquidity. See: Removing Liquidity from a Liquidity Pool to learn how.

In the next section, we'll learn how to increase our earnings on Swappi.

See Also

  • Exchange section on Swappi, for a detailed guide on adding/removing LP tokens to/from a liquidity pool, as well as other useful information on liquidity pools.

  • Liquidity Pools Token Addresses to verify the contract addresses of different LP tokens.

Last updated