What is Liquidity Mining and Impermanent Loss?

Eric | Eternal Finance
Eternal Finance
Published in
5 min readFeb 7, 2023

Decentralized Finance (DeFi) is one of the most beloved and popular blockchain applications. Before the rise of DeFi, crypto assets were traded on centralized exchanges and over-the-counter (OTC) markets as they serve as market makers by providing liquidity for a tradable asset while earning a profit from the spreads of bid and offer prices.

Unlike centralized exchanges and OTC markets, the DeFi Automated Market Maker (AMM) concept enables users to trade their crypto assets on decentralized exchanges (DEXs) with the usage of AMMs and liquidity pools.

What is an Automated Market Maker (AMM)?

An automated market maker (AMM) is a part of the DeFi ecosystem adopted by DEXs to provide liquidity for trading pairs. The mechanism allows digital assets to be traded in an automatic way by using liquidity pools to initiate trades directly from non-custodial wallets within the liquidity pools instead of trading between buyers and sellers (traditional market).

The smart contracts are designed to hold the liquidity reserves within a pool, smart contracts govern what happens in the liquidity pool, where each asset swap facilitated by the smart contract results in a price adjustment.

A liquidity pool is similar to a shared pot of tokens, where users can deposit tokens represented in the pool, and the price of the tokens in the pool is determined by a mathematical formula. For example, if you want to trade ETH for USDT, you would need to look for ETH/USDT liquidity pool to trade. Or if you want to become a liquidity provider for ETH/USDT pool, you would need to deposit a 50/50 split of ETH and USDT into that liquidity pool. It serves a similar purpose as order books and is used to dodge volatility when swapping tokens.

How is the price determined and what is the constant product formula?

AMMs implement preset mathematical constant product formula to determine the prices of tokens to ensure the ratio of assets in liquidity pools remains as balanced as possible and to eliminate price discrepancies.

For example, Uniswap uses a simple x*y=k equation to set the mathematical relationship between the particular assets held in the liquidity pool.

X = Represents the number of A tokens

Y = Denotes the number of B tokens

K = Always a constant

Assuming the pool has 3 ETH and 12,000 USDC (1 ETH = 4,000 USDC), 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 deposited into the pool, the price of the ETH in this pool will become 36,000/(2+3) = 7,200 USDT.

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

Liquidity provision is the process when liquidity is added to a pool, and the person who provides liquidity is known as the liquidity provider. Once the liquidity is provided, unique liquidity pool tokens that represent the particular share of the provider in the pool are minted and sent to the liquidity provider’s wallet 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.

Benefits of Liquidity Mining

Low entry barrier: Anyone can participate in liquidity mining as most DeFi platforms allow small amounts of deposit, and do not require KYC or a complicated registration procedure.

Distribution of governance tokens: Liquidity Provision Rewards (LP Rewards) are fairly distributed to Liquidity Providers that contribute to the pool whenever a trade occurs as most platforms charge trading fees.

Passive income: Earning passive income is made easy for liquidity providers.

Risks of Liquidity Mining

Impermanent Loss: This happens when the price of your deposited assets changes compared to when you deposited them. The greater the price difference, the more you are exposed to impermanent loss. In this case, the loss means less dollar value at the time of withdrawal than at the time of deposit.

Rug pulls Fraud: The lack of centralized regulation exposes investors to frauds such as rug pulls, the protocol team can vanish with all the investors’ funds as DeFi offers anonymity.

Smart Contract Vulnerabilities: Source code bugs can be exploited by malicious entities, draining all the funds from the smart contract and leaving without a trace.

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 ETH/USDT (50:50 ratio) liquidity pool.

To understand how impermanent loss may look like, let’s go through an analytical approach example:

Let’s assume that you are the only liquidity provider in a liquidity pool made of 50% ETH and 50% USDC, where you supply 10 ETH and 1,000 USDT to the liquidity pool.

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

A few days later, the price of ETH increases to 00 USDT, and arbitrage traders rush to add USDC to the liquidity pool and remove ETH from it until the ratio reflects the current price. While liquidity remains constant in the pool — (Constant 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 USDT thanks to 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 USDT then your 10 ETH would be worth 2,000 USDC whilst your 1,000 USDT maintains the same value.

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

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

  • $3000 — $2828.42 = $171.58
  • $171.58 / $3000 = 5.717%

Impermanent Loss Calculators

There are a handful of online calculators available to help investors tackle the complexities of impermanent losses and manage their risks of depositing assets into a liquidity pool.

Daily DeFi

The calculator allows users to enter current token prices and future token prices, applied with Uniswap’s AMM formula to calculate any future impermanent losses.

Coingecko

The calculator allows users to enter the dollar value of the digital asset, the amount of each token, asset weightage for both tokens, formula type, and the percentage change in price to calculate a detailed impermanence loss.

About Eternal Finance

Eternal Finance is revolutionising the DeFi space with a one-of-a-kind portal that links VAMPIRES seeking safe and attractive APY with SORCERERS looking to maximize their returns with leverage and alpha.

Vampire playgrounds 🛝

🧛🏻‍♂️ Eternal Finance | 🧛🏻‍♂️ Twitter | 🧛🏻‍♂️ Discord | 🧛🏻‍♂️ Blog | 🧛🏻‍♂️ Docs

--

--

Eric | Eternal Finance
Eternal Finance

Eternal Finance is the First Automated and Leveraged Yield Farming Protocol built for PancakeSwap.