Remove Liquidity
Removes liquidity from a pair by burning LP tokens and receiving the underlying tokens.A 1% withdrawal fee is applied to liquidity removals. This fee remains in the pool reserves, benefiting remaining LPs.
Withdrawal Fee
When removing liquidity, a 1% fee (LIQUIDITY_WITHDRAWAL_FEE_BPS = 100) is deducted from both token amounts:
- Discourages short-term liquidity provision
- Compensates remaining LPs for the impact of withdrawals
- Reduces potential manipulation via rapid add/remove cycles
Future Enhancement: Optionality to wait for a time period and withdraw for free, or withdraw instantly with the 1% fee.
Accounts
The pair account.
User’s LP token account. LP tokens will be burned from here.
User’s token0 account. Will receive token0.
User’s token1 account. Will receive token1.
The user removing liquidity. Must be a signer.
Arguments
Amount of LP tokens to burn. Must be greater than 0.
Minimum amount of token0 to receive. Used for slippage protection.
Minimum amount of token1 to receive. Used for slippage protection.