removeLiquidity

Remove a specific liquidity that includes follow steps:

  1. decrease liquidity

  2. collect fees

  3. collect rewards

  4. final burn

Signature

removeLiquidity(options: RemoveLiquidityOptions): Promise<Transaction>

Params

interface RemoveLiquidityOptions extends DecreaseLiquidityOptions {
  collectAmountA: string | number;
  collectAmountB: string | number;
  rewardAmounts: (string | number)[];
}

DecreaseLiquidityOptions can be found at page decreaseLiquidity

Examples

const tx = await sdk.pool.removeLiquidity({
  pool: '0x2c6fc12bf0d093b5391e7c0fed7e044d52bc14eb29f6352a3fb358e33e80729e',
  nft: '0x...',
  address: '0xc851a734b97870c41435b06c8254f1ef4cef0d53cfe1bcb0ba21a175b528311e',
  decreaseLiquidity: 10,
  amountA: 20,
  amountB: 30,
  slippage: 0.5,
  collectAmountA: 100,
  collectAmountB: 120,
  rewardAmounts: [20, 30, 50]
});

Last updated