LEARN

Understanding and Mastering Liquidity Pools and the Impact of Impermanent Loss

Liquidity pool

What is a liquidity pool?

A liquidity pool primarily serves to facilitate cryptocurrency exchanges on a DEX (Decentralized Exchange), eliminating the need for a direct buyer or seller for each transaction.

Let’s define this in a few points:

Liquidity pools allow users to trade cryptocurrencies instantly, using the funds available in the pool, rather than waiting for a corresponding buyer or seller to be found. By having a large volume of funds, liquidity pools can help mitigate significant price fluctuations that might occur during large transactions on less liquid markets.

How liquidity pools work

Suppose we have a liquidity pool for trading between $ETH and another cryptocurrency, say the token $DFC. Those who wish to facilitate exchanges between $ETH and $DFC place an equal value of both cryptocurrencies in the pool. For example, if 1 ETH is worth 100 $DFC, someone might put 1 ETH and 100 $DFC into the pool.

When someone else wants to exchange their ETH for $DFC, they use this pool. They can deposit their ETH, and the system automatically calculates how many $DFC they should receive in return, based on the amount available in the pool and the current demand. The process works the same way if someone wants to exchange $DFC for $ETH.

But all this is not without risk

Beyond the risk associated with the platform on which you deposit your funds, the main risk of a liquidity pool is impermanent loss. Let’s revisit our example:

Initial scenario:

  • Your deposit: 1 ETH + 100 $DFC
  • Ratio in the pool: 1 ETH = 100 $DFC
  • Total value of your deposit with 1 ETH at $4K: $8,000 USDT (since 1 ETH = 100 $DFC = $4K)
  • Therefore, 1 $DFC is worth $40

Illustration of impermanent loss:

Imagine that the price of $ETH increases relative to $DFC after you have deposited your assets in the pool. Let’s say now that the price of $ETH doubles relative to $DFC, so 1 $ETH is now worth 200 $DFC on the external market.

Fluctuation Scenario:

  • New market ratio: 1 ETH = $8k = 200 $DFC
  • 1 $DFC is still equal to $40
  • Your share in the pool must remain balanced: it will be adjusted to maintain the value balance between $ETH and $DFC

If you decided to withdraw your assets from the pool at this time, the amount you would recover would not exactly be 1 $ETH and 100 $DFC. Due to the conservation formula used by most pools, your share in both assets will be adjusted to maintain this constant product. In practice, this means that the amount of ETH you hold in the pool will decrease, while your amount of $DFC will increase to compensate for the increase in value of $ETH.

Suppose, after adjustment, that you end up with about 0.7 ETH in the pool (the exact number would depend on the specific mechanics of the pool and other trades that have taken place). With the new price of ETH at $8k, your 0.7 ETH would now be worth $5,600. In addition, you have more $DFC in the pool now to compensate for the rise in $ETH. You thus have 140 $DFC worth $5,600. Your withdrawal value is therefore $11,200, which is higher than your initially deposited $8k.

Now consider if you had simply kept your 1 ETH and 100 $DFC without putting them in the pool. Outside the pool, with the new price of ETH, you would have:

  • 1 ETH = $8k
  • 100 $DFC = $4k
  • Total value outside the pool: $12,000

The difference between the total value you would have had by keeping your assets outside the pool ($12,000) and the value of your assets in the pool after adjustment ($11,200) represents the impermanent loss, which in this example amounts to $800. This loss is called “impermanent” because it only materializes if you withdraw your funds from the pool. If the asset prices return to their initial state before you withdraw your funds, the impermanent loss disappears.

Conclusion

Although liquidity pools offer a convenient and efficient method for exchanging cryptocurrencies, they come with specific risks such as impermanent loss. Investors must weigh these risks against the potential benefits and use strategies to minimize potential losses. By staying vigilant and informed, you can effectively navigate the complex world of DeFi and its innovative mechanisms like liquidity pools.