MCDEX
Search…
Adding Liquidity
This guide shows how to add liquidity into pool by using the ILiquidityPoolFull interface.

Add Liquidity

Function

function addLiquidity(int256 cashToAdd)
parameters
type
description
cashToAdd
int256
amount of cash to add. The amount always use decimals 18.
Notice
  • Add liquidity to the liquidity pool. Liquidity provider deposits collaterals then gets share tokens back.
  • The ratio of added cash to share token is determined by current liquidity.
  • Can only called when the pool is running.

Example

1
ILiquidityPoolFull liquidityPool = ILiquidityPoolFull(liquidityPoolAddress)
2
liquidityPool.addLiquidity(amount)
Copied!

Sample Code

Github
Last modified 14d ago