Remove All Liquidity
Withdraw all liquidity from a position in a single transaction while keeping the position NFT active. Useful for complete exits without burning the NFT.
Prerequisites
Position ID with active liquidity
Understanding this keeps NFT alive
Gas for transaction execution
Consider
removeAndClosePositionif burning NFT
Basic Usage
// Get all bins for the position
const bins = await sdk.Position.getPositionBins(pair, positionId);
const allBinIds = bins.map(bin => bin.id);
// Remove from all bins at once
const tx = await sdk.Pair.removeLiquidity(pair, {
positionId: "0x123...abc",
binIds: allBinIds
});
await sdk.fullClient.signAndExecuteTransaction({
transaction: tx,
signer: keypair
});Complete Withdrawal Pattern
Preview Total Returns
Remove All vs Close Position
Remove All Liquidity
Remove AND Close
Common Use Cases
Temporary Exit
Fee Collection
What You Receive
All tokens from all bins
Accumulated trading fees
Based on current bin reserves
Single transfer to your wallet
Error Handling
Related Topics
Close Position - Remove + burn NFT
Calculate Output Amounts - Preview returns
Remove from Specific Bins - Partial removal
Add to Existing Position - Re-add later
Last updated