What is Impermanent Loss?

Impermanent losses (Impermanent Loss, IL) are temporary losses that happen when you hold a position on a decentralized exchange that uses the automatic market maker (AMM) mechanism. They show the difference between the value of assets in a wallet and the value of assets in a...

What is Impermanent Loss?

Impermanent losses (Impermanent Loss, IL) are temporary losses that happen when you hold a position on a decentralized exchange that uses the automatic market maker (AMM) mechanism. They show the difference between the value of assets in a wallet and the value of assets in a liquidity pool.

How do Impermanent Losses happen?

Most impermanent losses happen in c, where the liquidity provider (LP) must supply both assets in equal amounts and one asset is more volatile than the other.

Impermanent losses in the DAI/ETH liquidity pool of the Uniswap exchange, where both tokens are represented in a 50:50 ratio:

We put one ETH and one thousand DAI into the pool.

A week from now, 1 ETH will be worth 2000 DAI.

If we kept 1 ETH and 1000 DAI, the profit would be 50%. (the value of 1000 DAI would not change, but the price of 1 ETH would increase to 2000 DAI).

When you stake tokens in an AMM pool on Uniswap, you make less than 50% as much as when you just hold assets.

Losses are called “non-permanent” or “unrealized” because they are not fixed until the liquidity tokens are taken out of the pool. In the example above, there are no intermittent losses if the price of ETH goes back to the original 1000 DAI and funds are taken out after that.

Uniswap, SushiSwap, and other AMMs like them work in a simple way:

x ∗ y = k

x is the number of tokens for asset A, and y is the number of tokens for asset B. k is the so-called constant product of the pool, and this value does not change.

An example of how the liquidity pool for DAI/ETH on the Uniswap exchange works. The Chain Bulletin is the source.

The contract held tokens worth about $153.5 million, which was made up of 29,116.6 WETH and 76.7 million DAI.

Using the above formula, we can figure out the current value of k for this pool:

29 116.63 ∗ 76 737 921.22 ≈ 2.23 ∗ 10^12

k only changes when users add or take out money, or when a fee is charged for a transaction, like 0.3% in the case of Uniswap. These funds are added to the pool’s total amount of cash.

Explanation of how to interact with the AMM pool:

  • Putting 1 ETH and 100 DAI into a pool for Uniswap.
  • After that, there will be a total of 10 ETH and 1000 DAI in the pool, which is 10% of the liquidity provider’s share.
  • During the week, a total of 100 ETH is traded in the pool (50% in ETH and 50% in DAI), but the price of ETH does not change in relation to DAI.
  • During the week, neither money is added to nor taken out of the pool.
  • The total amount of money in the pool is now 10.15 ETH and 1015 DAI, plus fees of 0.3 ETH.
  • The liquidity provider still has a 10% stake in the pool, but that stake has grown because of the commission fee.
  • If you withdraw money after a week, you won’t lose money every now and then because the price ratio between ETH and DAI hasn’t changed.

Losses in Classic Pools

The Uniswap DAI/ETH liquidity pool looks like this:

  • We put up 1 ETH and 100 DAI. The liquidity provider gets 10% of what we put up.
  • In the pool, there are 10 ETH and 1000 DAI.
  • After a week, 1 ETH is worth 200 DAI.
  • In the pool, there are no commission fees.
  • We calculate non-permanent losses.

First, we figure out k:

k = 10 ∗ 1000 = 10,000

In comparison to DAI, the price of ETH has doubled around the world. The arbitrageurs saw a chance to get him cheaply out of the pool. Since there aren’t as many ETH as there are people who want them, the price of 1 ETH has gone up to 200 DAI.

At the start of the week, when one ETH was worth 100 DAI, the pool had 10 ETH and 1000 DAI. Let’s figure out how the assets in the pool will be divided now that the price of ETH has gone up. To do this, you have to set a number of variables, starting with the ratio of asset prices.

rt = cost from a to b,

where a and b are two of the pool’s assets.

A is ETH and B is DAI in our example. At first, 1 ETH was traded for 100 DAI. So, the value of r at the start is 100. Use t to show how long it takes to figure out r.

By combining the above equation with the basic AMM formula, it is possible to make formulas that can figure out how much of each asset is in the pool at any given ratio r at any given time t.

How hard is it to figure out temporary losses?

Anyone who uses an AMM platform needs to know about non-permanent losses. You can use the dailydefi.org calculator to figure out your own IL (based on Uniswap formulas).

Cost-of-loss risks are always present for people who use the AMM protocol, no matter how prices change. When compared to holding, the participant’s position grows at a slower rate when asset prices go up, and he loses more when prices go down.

Trading commissions and profitable farming save the day. They help make up for random losses so that being in the AMM pool is more profitable than just holding assets.

Subscribe
Notify of
guest
0 Commentary
Inline Feedbacks
View all comments