What is Liquidity Mining and Impermanent Loss?

Share:

Prior to the rise of decentralized finance, crypto assets were traded on centralized exchanges and over-the-counter (OTC) markets. Existing platforms rely heavily on the order book mechanism, and running one on the blockchain is too expensive because of gas fees issues. As a result, decentralized exchanges (DEXs) devised the Automated Market Maker (AMM) concept to enable trading without the use of an order book.

What is an Automated Market Maker (AMM)?

An automated market maker (AMM) is a type of mechanism DEXs use to provide liquidity for trading pairs. This mechanism enables the automatic trading of digital assets. DEXs encourage user autonomy by allowing them to initiate trades directly from non-custodial wallets where they store their private key. Smart contracts are used in these protocols to specify the prices of digital assets and offer liquidity; whilst the protocol pools liquidity into smart contracts. In essence, users are not trading against counterparties, but rather against the liquidity contained inside smart contracts. As such, these smart contracts are commonly referred to as liquidity pools and as a replacement for the traditional buyer and seller markets.

Trading pairs you would normally find on a centralized exchange would exist as individual “pools of tokens” in AMM. For example, if you wanted to trade ether for tether, you would need to find an ETH/USDT liquidity pool. On the other hand, anyone can provide liquidity to these pools by depositing both assets represented in the pool. For instance, if you wanted to become a liquidity provider for an ETH/USDT pool, you’d need to deposit a 50/50 split of ETH and USDT into that liquidity pool. In sum, these pools serve a similar purpose to order books and are used to dodge volatility when swapping tokens.

How is the price determined without an order book and what is the constant product formula?

Since AMM has no order book, to make sure the ratio of assets in liquidity pools remains as balanced as possible and to eliminate discrepancies in the pricing of pooled assets, AMMs use preset mathematical equations to determine the prices of tokens in a pool. For example, Uniswap and many other DeFi exchange protocols use a simple x*y=k equation to set the mathematical relationship between the particular assets held in a liquidity pool. Here, x represents the number of tokens A, while y denotes the number of tokens B, while k is always a constant.

Thus, assuming the pool has 3 ETH and 12,000 USDT (1 ETH = 4,000 USDT), the total value locked up will be US $24,000. The constant will be 3 (the number of ETH) * 12,000 (the number of USDT) = 36,000. When there are 2 ETH newly entered into the pool, the price of ETH in this pool will become 36,000/(2+3) = 7,200 USDT.

When do you receive the Liquidity Pool Tokens (LP Token)?

When liquidity is added to a pool, the provider is known as a liquidity provider (LP), and this process is called liquidity provision. Once liquidity is provided, unique liquidity pool tokens — representing the particular share of the provider in the pool — are minted and sent to the provider’s address. If a provider is to create a new pool, the number of liquidity tokens they will receive will be equal to the square root of (x * y), where x and y reflect the quantity of each token delivered.

Advantages of Liquidity Mining

Whenever a trade occurs, a portion of the fee (e.g., Uniswap V2 offers 0.3%) is charged to the trader who initiates the trade. This fee is distributed pro-rata to all LPs in the pool upon completion of the trade. This kind of reward is known as Liquidity Provision Rewards (LP Rewards).

Moreover, liquidity providers can also choose to stake LP tokens in a farming pool. Since DEXs mint their own governance tokens because of liquidity provision, they also reward these governance tokens to those who stake the LP tokens. Generally known as liquidity mining or yield farming, it is not uncommon to see yearly returns of 100% to 300%! Most of the DEXs are easy to sign up for, and they allow users to earn a passive income without any special equipment like traditional mining.

The Dangers of Liquidity Mining

Technical Risk

Computer errors or bugs are the biggest threat to the success of DEXs. If hackers discover it before the community, everyone’s funds are at risk.

Rugpull Fraud

Although blockchain technology provides security for decentralized finance applications, the lack of centralized regulation also exposes investors to risks like rugpulls.

A rugpull is a fraud scheme where application developers or liquidity pool developers decide to close down the liquidity pool and run away with users’ money.

Impermanent Loss

An impermanent loss is a temporary loss of funds that occurs when providing liquidity. It’s very often explained as a difference between holding an asset versus providing liquidity for that asset. The greater the price difference, the higher the percentage of impermanent loss.

How does Impermanent Loss Happen?

Impermanent loss is usually observed in standard liquidity pools where the liquidity provider (LP) has to provide both assets in the correct ratio and one of the assets is volatile in relation to the other, for example, in an ETH/USDC 50/50 liquidity pool.

Mathematical Example

Assuming you are the only liquidity provider in a liquidity pool made of 50% ETH and 50% USDC, and you supply 10 ETH and 1,000 USDC to the pool.

  • The price of 1 ETH is 100 USDC.
  • The pool consists of 10 ETH and 1,000 USDC (a 50/50 ratio).
  • The total value of your holdings is US $2,000

Later, the price of ETH increases to 200 USDC, and arbitrage traders rush to add USDC to the pool and remove ETH from it until the ratio reflects the current price. While liquidity remains constant in the pool (recall the formula x * y = k, or 10*1,000 = 10,000), the ratio of the assets in it has changed to 7.071 ETH and 1,414.21 USDC thanks to the work of arbitrage traders.

  • The total value of your holdings is now US $2828.42

However, if you had just held on to the 10 ETH and 1,000 USDC, your 10 ETH would be worth 2,000 USDC whilst your 1,000 USDC maintains its value.

  • The total value of your holdings would be US $3,000

Your impermanent loss is the difference between the value of your holdings (had you simply held them) and the net value of the liquidity pool assets:

  • $3000 - $2828.43 = $171.57
  • $171.57 / $3000 = 5.719%

Impermanent Loss Calculators

In a volatile cryptocurrency marketplace, impermanent loss is almost guaranteed when staking assets within a standard liquidity pool.

To help investors deal with the complicatedness of impermanent loss, there are several calculators online that can help an investor find out the potential risks of depositing assets into liquidity pools.

Daily DeFi

This calculator uses the AMM formula from Uniswap to determine impermanent loss and allows users to input current token prices and future token prices. Any future impermanent losses can then be calculated.

DecentYields

This calculator allows users to manually set the deposit amount as well as the ratio of the pool, the pool weight, the amount of each token, and the percentage change in price.

Conclusion

Liquidity mining and liquidity pools are a vital part of the crypto world. Before the invention of AMM/DeFi, ICO tokens could only store value once they were listed on a centralized exchange. Nowadays, DeFi projects and DAOs can create liquidity pools for their trading pairs, as well as their own reward mechanisms in order to attract liquidity for their own pairs.