Uniswap V3 rebalance calculator
Your Uniswap V3 or PancakeSwap V3 position is out of range and earning nothing. Find out when to rebalance a liquidity position: compare what a rebalance costs with the fees you give up while you wait for the price to come back.
How the rebalance math works
Rebalancing an out of range position means removing the liquidity, swapping about half of it into the other token and adding it back around the current price. The cost is cost = gas + (position × 0.5 × swap cost %), because only half the position goes through the swap, and the swap cost covers the pool fee plus slippage.
While in range the position earns daily fees = position × APR / 365. The break-even is break-even days = cost / daily fees: how many days back in range it takes to earn the rebalance cost back. If you wait instead, you give up daily fees × days out of range, so rebalancing wins whenever those missed fees exceed the cost.
This is a simplification: it ignores the impermanent loss already locked in when the position left the range (you take it either way) and assumes the new range earns the same APR as the old one, so treat the result as a guide, not a guarantee.
Worked example: a $10,000 position earning 40% APR goes out of range. It earns about $10.96 a day in range. Rebalancing costs $20 ($5 of gas plus 0.3% on the $5,000 you swap), so it pays back in 1.8 days. If you expect the price to stay out for 7 days, waiting costs about $76.71 in missed fees, so the verdict is rebalance.
How to decide when to rebalance a Uniswap V3 position
- Enter the current value of your out of range position.
- Enter the fee APR it earned while in range.
- Add the gas for removing, swapping and adding liquidity, and the swap cost as pool fee plus slippage.
- Estimate how many days the price would stay out of range, then follow the verdict: rebalance if the missed fees beat the cost, wait if not.
Frequently asked questions
When should I rebalance a Uniswap V3 position?
Rebalance when the fees you would miss while waiting for the price to return are larger than the cost of rebalancing. That cost is the gas for removing, swapping and adding liquidity plus the swap cost on about half the position.
What happens when a Uniswap V3 position goes out of range?
The position turns into a single token and stops earning trading fees until the price moves back inside your range. Your liquidity stays in the pool, but it does nothing until then.
How much does it cost to rebalance a liquidity position?
You pay gas for three steps (remove liquidity, swap, add liquidity) plus the pool fee and slippage on the half of the position you swap. On a $10,000 position with $5 of gas and a 0.3% swap cost, that is about $20.
Is it better to wait for the price to come back into range?
Waiting is cheaper when you expect the price to return soon and the rebalance cost is high compared with your daily fees. If the price is likely to stay out for longer than the break-even days, rebalancing usually earns more.
