DEV Community

Merissa Stemler
Merissa Stemler

Posted on

How to estimate impermanent loss before adding liquidity

Before depositing into a volatile token pair, compare the pool’s value after a possible price move with what the same tokens would be worth if you simply held them. That estimate shows the cost of rebalancing through the pool; trading fees and incentives can change the final result.

  • Impermanent loss measures a pool position against holding the same starting tokens.
  • For a standard full-range pool, a doubling or halving of one token’s relative price means about 5.7% less value than holding, before fees.
  • A concentrated position needs a range-specific estimate; the full-range formula does not describe it.

What are you comparing?

Impermanent loss is the difference between the value of your pool share and the value of keeping its original tokens outside the pool. It comes from an automated market maker changing the pair’s token quantities as their relative price moves. For the separate details on earnings and withdrawals, see how BaseSwap liquidity positions work. Here, the question is whether a price move could make the pool’s rebalanced mix worth less than holding.

How do you estimate the difference?

For a standard full-range constant-product pool, use the price ratio of one token against the other—not its dollar price alone. Let r be the ending relative price divided by the starting relative price. The pool’s value versus holding is 2√r ÷ (1 + r) − 1. The result is negative when the pool underperforms holding.

  1. Write down your starting mix and price. For example, suppose you deposit 1 ETH and 2,000 USDC when ETH is $2,000. Your starting deposit is worth $4,000, split evenly between the tokens.
  2. Choose a price scenario and calculate the ratio. If ETH rises to $4,000 while USDC stays at $1, the relative price doubles, so r = 2. The formula gives about −5.7%.
  3. Translate the percentage into dollars. If you had held your original tokens, they would now be worth $6,000. In a standard full-range pool, the rebalanced share would be worth about $5,657 before fees: roughly $343 less than holding.
  4. Add fees and incentives separately. Compare the pool share’s value plus any fees or rewards you actually receive with the $6,000 hold value. For this example, those earnings would need to exceed about $343 to close the gap; this is a break-even illustration, not a prediction.

When does this estimate need adjusting?

Use the formula as a screening estimate only if the pool follows the standard full-range x × y = k design. A concentrated-liquidity position can stop earning trading fees when price leaves its chosen range, and its token mix changes with the range; its outcome needs a position-specific calculation. A stablecoin depeg also changes the relative price, even if both tokens are meant to track a dollar.

Before using BaseSwap’s official app to provide liquidity, check the pair’s price risks and whether its pool design matches the estimate. For a prospective base swap position, I’d compare several plausible relative prices—not just the most likely one—then decide whether the possible fee income justifies the gap against holding.

Top comments (0)