decreaseLiquidity

Decrease specific liquidity from specific pool.

Signature

decreaseLiquidity(options: DecreaseLiquidityOptions): Promise<Transaction>

Params

interface DecreaseLiquidityOptions {
  // pool object ID
  pool: string;
  // liquidity NFT ID
  nft: string;
  // Operator address
  address: string;
  // liquidity delta
  decreaseLiquidity: string | number;
  // Amount of coin A
  amountA: string | number; 
  // Amount of coin B
  amountB: string | number;
  // Acceptable wasted amount percentage. Range: [0, 100)
  slippage: string | number;
  // Expires timeout(ms), defaults 180_000
  deadline?: number;
  // Custom transaction handler
  txb?: Transaction;
}

Examples

const tx = await pool.decreaseLiquidity({
  pool: '0x2c6fc12bf0d093b5391e7c0fed7e044d52bc14eb29f6352a3fb358e33e80729e',
  nft: '0x...',
  address: '0xc851a734b97870c41435b06c8254f1ef4cef0d53cfe1bcb0ba21a175b528311e',
  decreaseLiquidity: 10,
  amountA: 20,
  amountB: 30,
  slippage: 0.5,
});

Last updated