Remove from Specific Bins

Selectively withdraw liquidity from individual bins while maintaining positions in others. Perfect for rebalancing, profit-taking, or adjusting your range.

Prerequisites

  • Position ID with active liquidity

  • List of bin IDs to remove from

  • Understanding of current bin distribution

  • Gas for transaction execution

Basic Usage

const pair = await sdk.Pair.getPair(pairAddress);

// Remove from specific bins only
const tx = await sdk.Pair.removeLiquidity(pair, {
  positionId: "0x123...abc",
  binIds: [8388606, 8388607, 8388609]  // Selected bins
});

await sdk.fullClient.signAndExecuteTransaction({
  transaction: tx,
  signer: keypair
});

Method Parameters

Common Strategies

Remove Out-of-Range Bins

Harvest High-Fee Bins

Rebalance Toward Active Price

What Happens

  1. Liquidity Burned: Your shares in selected bins are burned

  2. Tokens Returned: Receive proportional reserves + fees

  3. Position Updated: Remaining bins stay untouched

  4. Fees Collected: Accumulated fees automatically included

Calculate Before Removing

Gas Optimization

Important Notes

  • Cannot remove from bins without liquidity

  • Fees are included automatically

  • Position NFT remains active

  • Can add back to same bins later

Last updated