DeFi Fraud Prevention | What is impermanent loss? Uniswap, Curve, Balancer

share
DeFi Fraud Prevention | What is impermanent loss? Uniswap, Curve, Balancer

The emergence of new offerings like sushi, kimchi, noodles, pearls, stir-fry, alongside previous options like shrimp, butter, and sweet potatoes, with the continuous innovation in liquidity mining, makes events from a few months ago seem like a thing of the past. Lately, the phenomenon of major exchanges rushing into the world of various cryptocurrencies is a clear indication that the decentralized trading market is staging a bull market drama in conjunction with centralized exchanges.

The "DeFi Anti-Fraud Series" aims to help readers understand the operational principles and types of DeFi liquidity pools, view the essence and reasons behind these "special" coins rationally, and be cautious of investment risks.

In the previous article, through a video from Finematics, we compiled and introduced "What is a liquidity pool?" and the principles behind the emergence of Uniswap's hundredfold coins. This article focuses on explaining what temporary loss (impermanent loss, also known as impermanent loss) is for farmers participating in liquidity mining as Liquidity Providers (LP), and the purpose of liquidity mining. It is recommended that readers use the translated content in conjunction with the original video for accuracy.

Advertisement - Scroll down for more content

What is Impermanent Loss?

In simple terms, it is a situation where assets are temporarily lost when providing liquidity.

Next, let's discuss the difference between "holding an asset" and "providing an asset in a liquidity pool."

Impermanent loss often occurs in regular liquidity pools, where liquidity providers (LPs) must provide two assets in a fixed value ratio to the liquidity pool. The price relationship between one asset and another will fluctuate. For example, in the DAI-ETH 50/50 liquidity pool on Uniswap (meaning LPs need to provide equal value of DAI and ETH), if the price of ETH rises, the pool must rely on arbitrage to ensure that the prices in the pool are consistent with the external market prices, maintaining the prices of the two assets in the pool.

However, due to arbitrage actions that occur when one asset appreciates, LPs incur value losses. If an LP decides to withdraw their liquidity at this point, temporary loss will turn into "permanent loss."

Explaining Impermanent Loss with an Example

Let's use an example to quickly understand "impermanent loss."

Imagine a person becomes an LP in the DAI-ETH 50/50 liquidity pool on Uniswap, where the LP must provide equal value of two assets to the pool. In this scenario, the LP provides 10,000 units of the stablecoin DAI worth 1 USD each, along with 20 units of ETH worth 500 USD each, both totaling 10,000 USD. This ensures that the values of the two assets provided are equal.

LP needs to provide equal value of two assets

Next, suppose the price of ETH on Coinbase increases to 550 USD. Arbitrageurs will participate at this point, noticing the price difference between ETH on Coinbase and Uniswap, and seek to profit from this price discrepancy.

Uniswap uses the constant product market maker algorithm to maintain the token ratio in the liquidity pool. As more ETH is bought from the pool, the algorithm adjusts the price of ETH higher. Arbitrageurs continue to buy the cheaper ETH from the pool until the algorithm adjusts the price to match the market price.

In this example, let's see how much ETH the arbitrageurs need to buy to make the above scenario happen. Anchoring to the external market price and using the constant product market maker algorithm: x * y = k calculation, the quantity of DAI in the pool needs to become 10,488.09 and the quantity of ETH needs to become 19.07 for the price of one ETH to adjust to 550 USD.

This result shows that the arbitrageurs use 488.09 DAI to buy 0.93 ETH for arbitrage, equivalent to buying 1 ETH for only 524.83 DAI. The 0.93 cheaper ETH bought by the arbitrageurs on Uniswap can be sold on other external trading platforms, yielding a profit of about 23.41 DAI (excluding transaction fees).

Arbitrageurs can buy ETH at a cheaper price

How does Impermanent Loss Affect Liquidity Providers (LPs)?

Initially, an LP holds 10,000 DAI and 20 ETH worth 500 USD each in the pool, totaling 20,000 USD in tokens.

After being arbitrated, the pool becomes 10,488.09 DAI and 19.07 ETH priced at 550 USD, resulting in a total token value of 20,976.59 USD. If these LPs had just held these tokens without providing liquidity, the value of their tokens would have been 21,000 USD, 23.41 USD more than not providing liquidity. This 23.41 USD is the LP's impermanent loss.

Why is it temporary? As long as the LP does not withdraw liquidity at this time, they only have a book loss. Once the ETH price returns to 500 USD, the impermanent loss will disappear. However, if the LP chooses to withdraw liquidity immediately, this impermanent loss will become permanent.

Temporary loss due to arbitrage

How Does Impermanent Loss Erode LP's Profits?

Next, let's see how an increase in the price of one asset relative to another damages LP's profits.

If one asset in the pool rises by 500%, the LP will experience a 25% impermanent loss. Since impermanent loss can be substantial for LPs, what motivates them to provide liquidity?

A 500% increase in one asset leads to a 25% impermanent loss for LP. source:medium

【Note: For more information, refer to this article or for updates on Uniswap V2, check this article

Motivation for LPs to Provide Liquidity

Let's see how LPs earn money with their capital.

In an ideal scenario without impermanent loss, LPs profit by extracting transaction fees. For example, for every trade made in a Uniswap pool, LPs receive a 0.3% fee proportionally distributed to the pool. Even if impermanent loss occurs, if the received fees exceed the impermanent loss, LPs will still make money.

Based on this situation, many liquidity pools offer LPs a new incentive: liquidity mining. In essence, LPs receive another token for providing liquidity to a pool or using a protocol as a reward.

Some tokens from liquidity mining may have the potential to offset impermanent loss, making providing liquidity more profitable.

Will Pools Outside Uniswap Experience Impermanent Loss?

Take Curve as an example, where pools only hold assets of similar or identical value, such as different stablecoins like USDC or DAI, or variations of the same token like SBTC, RENBTC, and WBTC. In such pools, impermanent loss is minimized because the assets within the pool have minimal volatility among them. This is why Curve is more popular and stable assets' pools usually attract more assets compared to pools with volatile assets.

Another example is Balancer, which offers pools with hedge-weighted ratios instead of the standard 50/50 weight model. This means that if an LP wants to maintain the risk of a particular asset, they can participate in a pool with disparate weight ratios, such as 80/20 or even 98/2. Such pools can also reduce impermanent loss, the higher the weight ratio of an asset in the pool, the lower the difference in holding or providing liquidity.

The last case to counter impermanent loss is Bancor's recent introduction. Bancor V2 pools can automatically adjust weights using external price data through oracles to reduce impermanent loss even in pools with highly volatile assets.

Have you experienced impermanent loss? How did you handle it?