# ★★ Impermanent loss

This text is recommended for advanced STON.fi users.

Supplying liquidity on a DEX, like any method of earning increased returns, carries its own risks that need to be considered. Let's delve into the concept of impermanent loss.

Providers of liquidity encounter impermanent loss when the token price ratios change significantly after depositing funds into a pool. However, when the price ratios return to their previous values, the losses also diminish. Hence, they are called impermanent.

**Let's consider an example. **

In a liquidity pool of token A and token B, you deposit 1 A and 100 B, equivalent to 100 USD each (1 A = 100 USD, 1 B = 1 USD). Now, the pool contains a total of 10 A and 1000 B, amounting to 200 USD in total, alongside contributions from other liquidity providers.

Suppose your share in the liquidity pool is 10%. The total pool liquidity is calculated by multiplying the number of tokens on each side, which we can express as 10000 C.

At the time of depositing funds into the liquidity pool, 1 A = 100 B. Let's say, after some time, the price of token A increases, and now 1 A = 400 B. The price of token B in USD remains unchanged.

Arbitrage traders will add B to the pool and remove A from it until the ratio reflects the current price (as the price change has resulted in an uneven ratio of B tokens). Since AMM does not have an order book, prices are determined by the ratio of assets in the pool. As long as the pool liquidity remains stable, the asset ratio within it changes.

Thanks to arbitrage traders, the token ratio in the pool becomes 5 A = 2000 B.

You decide to withdraw your funds. Since your share in the liquidity pool is 10%, you will receive 0.5 A and 200 B. At the new token price of 1 A = 400 B = 400 USD (remember, the price of token A has increased, while B remains the same), you withdraw cryptocurrency totaling 0.5 * 400 + 200 * 1 = 400 USD. It seems your asset has doubled!

But what if you chose to hold onto the tokens without providing liquidity to the pool? Due to the spike in the price of token A, your 200 USD would have turned into... 1 * 400 + 100 * 1 = 500. The difference of 100 USD is what we call impermanent loss.

You can approximate the size of impermanent loss using this guide:

Price change of 1.25x = loss of 0.6%

Price change of 1.5x = loss of 2%

Price change of 1.75x = loss of 3.8%

Price change of 2x = loss of 5.7%

Price change of 3x = loss of 13.4%

Price change of 4x = loss of 20%

Price change of 5x = loss of 25.5%

For more precise calculations, you can use any impermanent loss calculator, such as this one: https://dailydefi.org/tools/impermanent-loss-calculator/

Last updated