The Math Behind Impermanent Loss
Impermanent loss can be precisely calculated using a straightforward mathematical formula derived from the constant product market maker model. This formula allows liquidity providers to predict potential losses based on expected price movements before committing capital.
The calculation begins with the price ratio between the two assets. When you deposit liquidity, the current price ratio is your entry ratio. When you withdraw, the new market price ratio becomes your exit ratio. The ratio of these two values, known as k, forms the foundation of the impermanent loss equation.
The Core Formula
The impermanent loss percentage is calculated as two times the square root of k divided by one plus k, minus one, multiplied by one hundred to get a percentage. This elegant formula captures how the geometric mean of the price ratio affects the value of a balanced position compared to holding assets separately.
Meanwhile, the value change from simply holding the assets follows a simpler arithmetic mean approach. The HODL return is the average of one and k, minus one. This linear relationship contrasts sharply with the concave nature of the liquidity provider return, creating the characteristic loss pattern.
Understanding the Square Root
- The square root function creates the concave return curve typical of constant product pools
- It ensures that extreme price movements result in bounded maximum loss
- The geometric nature rewards price stability and penalizes volatility
- This mathematical property is fundamental to AMM design
Asymptotic Behavior
As the price ratio k approaches infinity or zero, impermanent loss approaches its theoretical maximum of about negative one hundred percent in dollar terms compared to holding. However, the actual maximum loss is approximately negative thirty-three point three percent of the peak value, because the position continuously rebalances along the curve.
FAQ
Why does the formula use square root?
The square root comes directly from solving the constant product constraint for the optimal holdings at any price ratio, which turns out to be proportional to the square root of the price.
Is the formula exact?
Yes, this formula provides the exact impermanent loss for any 50/50 constant product pool with no fees considered.
Does pool size affect the calculation?
No. Impermanent loss percentage is independent of pool size or your share; it depends only on the price ratio change.
The beauty of this formula lies in its simplicity and universal applicability across all constant product AMMs.