Coffer Docs
For Liquidity Providers

Removing Liquidity

Redeem LP tokens for a share of the current reserve basket

Burning LP tokens returns your proportional share of the pool's current basket, which may differ from what you deposited. To finish with one token, you must also swap the withdrawn assets, with additional fees, price impact, and liquidity requirements.

A simple example

A pool holding 120 A and 180 B with 1,000 LP tokens returns approximately 12 A and 18 B for 100 LP tokens. Supply determines your share, not pricing weights. Retained LP fees are already in the reserves; no separate claim is needed.

When you can withdraw

Normal removal requires pool_enabled = true. Pausing swaps or disabling a token as swap input does not block proportional withdrawals. A full pool pause does. See Pool Controls.

Supply minimum_token_amounts, one per pool token. If any received output, after token transfer fees, falls below its minimum, the whole transaction fails. These limits protect token amounts at execution, not their USD value. A zero-reserve token returns zero.

Withdrawal calculation

Withdrawals use LP-supply and balance ratios, without calculating an invariant. Let A_i be LP-owned actual balance, V_i virtual balance, S LP token supply, and b the effective LP tokens burned. With Q = 10^18, for positive-reserve tokens:

r = floor(b × Q / S)
gross_out_i = floor(A_i × r / Q)
received_i = gross_out_i − tokenTransferFee(gross_out_i)
new_actual_i = A_i − gross_out_i
new_virtual_i = max(1, floor(V_i × new_actual_i / A_i))

Integer fixed-point rounding can differ from a floating-point estimate. actual_balance already excludes protocol_fees_owed; do not deduct protocol fees again. Both balances shrink proportionally, approximately preserving concentration factors. For an empty reserve slot, payout is zero and virtual balance follows remaining LP supply: max(1, floor(V_i × (S − b) / S)).

The minimum remaining supply

The pool retains 1,000 raw LP token units, so a request near the full supply can burn less than requested:

effective_burn = min(requested_burn, total_lp_tokens − 1_000)

Unburned LP tokens stay in your account. This is a floor for the whole pool, not a minimum position for each user. At the floor, no further normal withdrawal is available.

Minimum outputs must be based on this effective burn. Integrators should read confirmed outputs and use the matching liquidity instruction interface.

On this page