All about Impermanent Loss

Impermanent loss (”IL”) is a concept that exist only in decentralized exchanges with AMM model, in which a liquidity pool is formed by two…

All about Impermanent Loss
Photo by Jeremy Bezanger / Unsplash
https://whiteboardcrypto.com/impermanent-loss-calculator/
  • Impermanent loss (”IL”) is a concept that exist only in decentralized exchanges with AMM model, in which a liquidity pool is formed by two or more assets in equal value. IL is defined as the difference between the value of your assets (in fiat) if you have hold it instead of putting them inside a liquidity pool. If the value of your assets would have been higher if you have hold on to them instead of depositing them into a liquidity pool, then you have suffered from IL
  • To illustrate the concept further, it is firstly important to understand that the two assets are being priced in terms of one another, and it is very likely that the price of an asset inside a liquidity pool move differently if we were to compare it with from the price of the same asset in a centralized / decentralized exchanges with CLOB model
  • Lets take an example of a BNB-CAKE liquidity pool assuming the price of $BNB is USD 350 and the price of $CAKE is USD 15. As mentioned previously, in order to become the liquidity provider (”LP”) of this pool, you need to provide both asset in equal value (50:50). This means if you were to provide 5 $BNB, you need to provide ~117 $CAKE as well. Now let’s further assume that there are 1,000 $BNB inside the pool and a corresponding~23,333 $CAKE. This means your ownership of the pool is 5/1,000 or 0.5%
  • Note that LP are entitled to the fees that are paid based on transaction inside the pool. Assuming the transaction fees accruing to LPs is 30bps, assuming a 100 $BNB transaction was made, the fees would be 3 BNB or broken into 0.12 $BNB and 2.88 $CAKE. After the transaction, the total coins in the pool would be increased by the corresponding amounts above. The amount of fees accruing to you as LP will be adjusted based on your share of the pool. In the example here, your ownership is 0.5%, so you are entitled to 0.5% of the 3 BNB fees made by the transaction
  • So what gives rise to an impermanent loss? We have been assuming that the price of $BNB and $CAKE remain constant in the above scenario. Now let’s imagine a new hot IEO on Binance which results in the price of $BNB shooting up to USD 400 per token while $CAKE remains the same at USD 15. While the market price of $BNB in centralized exchanges rose to USD 400, its price in terms of $CAKE in our liquidity pool remains the same as when the pool was first created. Outside of the pool we can buy 1 $BNB by paying 27 $CAKE (400/15), but inside the pool we can get 1 $BNB by paying only 23 $CAKE (350/15)
  • What usually happens when the above scenario occurs is that arbitrageurs will start buying $BNB off the liquidity pool in order to make a profit off the price difference. Remember that we have 1,000 $BNB and 23,333 $CAKE inside our pool (for sake of example setting aside fees or any transactions that may happened). At current price, the appropriate ratio would be 932 $BNB and 25,022 $CAKE (Note: the mechanics of AMM is complicated and is beyond the scope of this article, but in essence most Pancakeswap pools are constant product model. We have used the calculator at https://whiteboardcrypto.com/impermanent-loss-calculator/ to obtain the appropriate balance). This means that arbitrageurs would have purchased 68 BNB for the price of 1,689 $CAKE and bring the liquidity pool back to equilibrium with prices on the centralized exchange
  • So where is your impermanent loss? Your impermanent loss is simply calculated be the amount that you would have made if you have not invested in the liquidity pool
     — If you have started with only USD 500 on each asset, you would have 1.42 $BNB and 33.33 $CAKE. NOT putting these inside the liquidity pool would have net you 1.42400 + 33.3315 = USD 1,071
     — If you have put your assets inside the liquidity pool, remember that the ratio of asset would have changed according to the AMM model. It would have changed to 1.34 $BNB and 35.63 $CAKE (the help of a calculator is also required for this). Putting your asset inside the liquidity pool has net you 1.34400 + 35.63 15= USD 1,069
     — Therefore your approximate impermanent loss in percentage terms is around 0.2%
  • A graphical representation to better understand the concept of IL is as per below. Imagine an imaginary coin, $FOO and $UST, a stablecoin in Terra network
https://twitter.com/AgilePatryk/status/1477788616826970115?s=20
  • Imagine you have USD 1,000 to invest and assume that $FOO is priced at USD 1.0. In this case you can:
     — Fully invest USD 1,000 in stablecoin $UST and your position value will remain at USD1,000, or;
     — Fully invest USD 1,000 in $FOO coin, and your position value will increase 1 to 1 with increase in $FOO price, or;
     — Hold USD 500 of $FOO and USD 500 of $UST 50:50 in your wallet without injecting these into the liquidity pool. Your position value is depicted by the dotted diagonal green line. At USD 1, your position value is the same as holding 100% stablecoin or 100% $FOO, but when $FOO increases above USD 1, your position value will underperform the 100% $FOO portfolio. Conversely when $FOO decline below USD 1, your position value will overperform the 100% $FOO portfolio, but underperforms the 100% stablecoin portfolio, or
     — Inject USD 500 of $FOO and USD 500 of $UST 50:50 into the FOO-UST liquidity pool in search of the trading fee yield. However, note that at every price points of $FOO with the exception of USD 1 (original $FOO price), you will underperform the previous strategy. However, you do gain in terms of trading yield. The difference between your position value in the thin dotted-line vs the bold dotted line is your size of your IL
  • While a few percentage of impermanent loss does not sounds like much, the effect is amplified the larger the size of your LP is. If you have had 10% of the total LP instead of just 0.5%, your IL can reach as high as mid to high single digit. Therefore, you need to be aware of this and invest with the amount that you are comfortable with
  • At this stage you might be wondering — if the portfolio value in LP is lower at every other price points compared to just holding the assets in your wallet, why would anyone become LP? The answer is the yield, which in most cases, offset the size of the IL — the yield can be divided into two: 1) transaction fees made for every transaction, and 2) yield for one of the tokens or other tokens as bonus for becoming an LP. For example, SOV-RBTC liquidity pool offers 60% APY in terms of $SOV, an in addition it provides the LP with 0.30% transaction fee for each transaction made in the pool
  • Several ways to mitigate / lessen the impact of impermanent loss are as follows:
     — Invest smaller amount
     — Invest in liquidity pool with two assets that move in the same direction with the same magnitude (positive correlation close to 1). For example, stablecoins pool e.g. USDC-DAI have very limited impermanent loss compared to pools like BANANA-WETH
     — The fees you make as LP will lessen the impact of impermanent loss, although it could be miniscule. You can choose LP that offer higher liquidity fee
     — Invest in liquidity pool that offers bonus tokens as it can offset the loss from IL
     — Invest in single asset pools
     — Use the help of Balancer, a tool that is able to optimize the assets in the pool in order to minimize the impact of IL
  • Note that IL, as per its namesake, is impermanent (if you remove your liquidity, though, the loss will be permanent / realized). Sometimes the best thing you can do when you have been faced with IL is to wait it out until the price restores close to its original equilibrium