Proportional Exit
LP withdrawal method receiving tokens in the pool's current ratio, avoiding swap fees and price impact.
A proportional exit allows liquidity providers to withdraw from a pool by receiving all constituent tokens in the same ratio as the pool's current composition. This exit method avoids swap fees and price impact, making it the most capital-efficient withdrawal mechanism.
How Proportional Exit Works
1Pool State:2- 100 ETH (50%)3- 200,000 USDC (50%)4- Total LP tokens: 10,00056User Exit: 1,000 LP tokens (10% of supply)78Proportional Exit Receives:9- 10 ETH (10% of 100)10- 20,000 USDC (10% of 200,000)
Proportional vs Single-Asset Exit
| Aspect | Proportional | Single-Asset |
|---|---|---|
| Tokens received | All pool tokens | One chosen token |
| Swap fees | None | Incurs swap fee |
| Price impact | None | Depends on size |
| Gas cost | Lower | Higher (swap) |
| Complexity | Simple | Complex |
Implementation
1function proportionalExit(uint256 lpAmount) external {2 uint256 totalSupply = lpToken.totalSupply();34 for (uint i = 0; i < tokens.length; i++) {5 uint256 tokenBalance = tokens[i].balanceOf(address(this));6 uint256 amountOut = tokenBalance * lpAmount / totalSupply;7 tokens[i].transfer(msg.sender, amountOut);8 }910 lpToken.burn(msg.sender, lpAmount);11}
Security Considerations
Rounding direction: Must round down (favor pool) to prevent extraction.
Order of operations: LP tokens should be burned before or atomically with transfers.
Reentrancy: External token transfers can trigger callbacks.
Balance manipulation: Donated tokens shouldn't inflate exit amounts.
When to Use Proportional Exit
✅ Recommended when:
- Withdrawing full position
- Wanting to avoid swap fees
- Pool is imbalanced (single-asset would incur high slippage)
❌ Not ideal when:
- Need only one specific token
- Rebalancing to a different allocation
Proportional exits are the "safest" exit mechanism from a pricing perspective, as they don't change the pool's ratio and have no price impact.
Related Terms
Pool Exit
The process of withdrawing liquidity from an AMM pool by redeeming LP tokens for underlying assets.
LP Token
ERC-20 token representing a liquidity provider's proportional share of a pool's reserves and fees.
Impermanent Loss
The temporary loss in value experienced by liquidity providers when the price ratio of deposited assets changes compared to holding them.
Liquidity Pool
Smart contract holding reserves of two or more tokens that enable decentralized trading without order books.
Need expert guidance on Proportional Exit?
Our team at Zealynx has deep expertise in blockchain security and DeFi protocols. Whether you need an audit or consultation, we're here to help.
Get a Quote
