Impermanent loss occurs when the price of two tokens grouped for liquidity fluctuates after providing liquidity to the pool. The larger this price change, the greater the impermanent loss.

If you are providing liquidity by supplying LP in Osmosis, the number of coins will change depending on the coin price. In addition, the ratio of the total amount of the two coins remains the same at all times. Automated market makers (AMMs) such as Osmos DEX determine the exchange rate of coins based on the following formula:

$$ X*Y=k \,(X,Y=number\,of\,coins,\,k= \, constant) $$

Additionally, if you know the ratio of the changed coin price, you can calculate the number of coins by substituting them into the above equation, as the number of coins is the reciprocal of the price ratio.

Let us better understand the concept of impermanent loss through the following example.

Case 1. After providing liquidity, the values of both coins rose. Isn’t that a benefit?

Correct, this is a benefit. This is because the value of both coins has increased, and the value of LP has increased as well. However, an impermanent loss may or may not have occurred. Don’t understand? Let us consider this further in the next example.

비영구적 손실 3.png

<aside> 💡 John supplied a total of $200 worth of liquidity when MED was $0.1 and OSMO was $10. LP should be tied half and half based on the value of the coins. Then, 1,000 MEDs worth $100 and 10 OSMOs worth $100 are grouped into LP. Let us now determine the k value of John’s LP using the equation above. Multiplying 1,000 by 10, we find that k becomes 10,000.

Let us say that over time, the price of MED rises to $0.2 and OSMO to $80 (i.e., MED has doubled, and OSMO has increased eight-fold). Then, MED is now 2,000 and OSMO is 5 according to the X*Y=10,000 equation. Thus, John made a profit of about $600! However, what if John did not provide liquidity and had a single coin? He then would have earned $800 in revenue. As with John’s $200, which could have been gained without this liquidity supply, it is an impermanent loss of unfulfilled profits. It is easy to view this as an opportunity cost. Note that impermanent losses increase as the range of price changes increases.

Let us now consider that the price has risen to $0.2 for MED and $20 for OSMO (both MED and OSMO have doubled). Because their rates of increase are the same, the quantity of MED and OSMO is maintained. John earned $200, but there was no impermanent loss, as the price of the coins increased at the same rate.

</aside>

Case 2. After providing liquidity, the price of the coin fell. Does this mean I an losing more money?

비영구적 손실 4.png

<aside> 💡 Marshall supplied a total of $200 worth of liquidity when MED was $0.2 and OSMO was $20. As such, 500 MEDs and 5 OSMOs are tied up as LP. Here, Marshall’s k value is 2,500.

Let us say that over time, the price decreases to $0.15 for MED and $5.00 for OSMO (MED has decreased by 25%, while OSMO has decreased by 75%). Then, according to the X*Y = 2,500 equation, MED changes to 288, while OSMO changes to 8.68. As a result, Marshall’s $200 becomes $86.6. However, what if Marshall had a single coin? He instead would have had $100. As such, it was more damaging to provide LPs than when he had them as a single coin.

Regarding the damages, the larger the ratio difference, the greater the impermanent loss. Let us consider the next example.

Let us say that the price has changed to 0.4 dollars for MED and 2 dollars for OSMO (MED has increased by 100%, while OSMO has decreased by 90%) Then, according to the X*Y = 2,500 equation, MED changes to 111, while OSMO changes to 22. As a result, Marshall’s $200 becomes $88. Having them as a single coin would have yielded $210, and he would have made a profit.

This is the most significant risk associated with impermanent losses. Namely, MED rose by 100%, but OSMO fell by 90%, thereby maximizing the difference in the price ratio and in turn resulting in large impermanent losses. Therefore, you should always determine whether there are any rapid price fluctuations of either coin in the LP pair.

</aside>

Oh my god! Then, if I supply LP, most of them lose money, right?

If you tie LP, it appears that you earn less, and if you lose, you lose more. That is, it seems to be a business that is losing money. Then why do people provide LP? The reason lies in the various incentives provided by decentralized exchanges. The AMM decentralized exchange operates based on users’ LP. Smooth transactions are possible only when there are users who provide liquidity. Therefore, we provide various incentives to maintain LP. People are willing to provide LP because these incentives offered in the form of interest can offset impermanent losses.

If you consider the above explanation, you will find that the lower the rate of the price change between the two coins, the lower the permanent loss. As such, the stable-stable coin liquidity supply is stable, but most of the annual interest is low. On the contrary, coins with high price fluctuations shortly after being listed offer high annual interest while at high risk. Therefore, rather than unconditionally judging based on the annual interest rate, it is better to participate in the decentralized exchange with various factors and be mindful of the risk associated with impermanent losses.

Everything good?