What is a liquidity pool?

A liquidity pool is a sum of funds locked in a smart contract by liquidity providers (LPs), where anyone can deposit specific assets and obtain rewards for delivering liquidity to that platform.

A single liquidity pool usually integrates two tokens and each pool creates a market for that specific pair of token (e.g. EGLD/MEX, EGLD/USDC).

It is used to permit decentralized trading, borrowing or lending and it usually represents the backbone of a decentralized exchange (DEX). A liquidity pool is the most important component of any DeFi platform and it substitutes the traditional order book model, used by a centralized exchange.

A liquidity pool can also represent the intersection of orders which decides whether an asset will move uptrend or downtrend. The liquidity pool is a very important aspect of automated market makers (AMM), yield farming, borrow-lend protocols, on-chain insurance, synthetic assets, blockchain-based games etc.

What are the existing types of liquidity pools?

There are two types of platforms using liquidity pools:

  • Lending platforms – a single asset liquidity pool. The lender will deposit a type of token and will get cTokens, which are derivatives that derive their value from the assets deposited by the lender. Best known such platforms are Compound, AAVE and Maker.
  • Decentralized exchanges (DEX) – dual asset liquidity pool. The most popular DEXs are Uniswap, Bancor, Sushiswap and Curve Finance.

What is a liquidity provider (LP)?

Liquidity providers (LPs) contribute with an equal value of two tokens and this way create a market. In exchange for this, they gain trading fees corresponding to the trades that take place in the pool, proportional with their contribution in the total liquidity.

The interaction is this case is between a trader and the liquidity pool, without any other counterparty. When a LP provides liquidity to a pool, they get LP tokens, proportional to the liquidity they provided. When a trade facilitated by the pool happens, the corresponding fee is proportionally distributed to all the LP tokens holders.

What's the mechanism of a liquidity pool?

Specific for a liquidity pool is the constant product equation: x * y = k

If a pool consists of units in token x and units in token y, any trades would take place in the pool, the quantities in x and y obtained after the trade, if multiplied, remain unchanged and it's equal to the constant k.

The price of the assets in the pool is established by the ratio between them in the pool. A liquidity pool uses a constant product market maker algorithm, making it possible that the product of the amounts of the two given tokens always remains constant. Thanks to the algorithm, a pool can provide liquidity, no matter how big a trade is.

How about the incentives in a liquidity pool?

Rewards can be different, depending on the platform: on a DEX, they could be a share in the trading fee, but on a lending platform they could represent a share of the interest received from the borrowers.

Yield farming or liquidity mining refers to the fact that liquidity pools are used to generate yield. Some decentralized exchanges started to incentivize LPs with extra tokens for providing liquidity to specific pools, a process which is called "liquidity mining".

What is impermanent loss in a liquidity pool?

Impermanent loss takes place when the price of the tokens provided in the liquidity pool changes, compared with the moment they were deposited in that pool. The greater the change is, the greater the impermanent loss. The loss means less value at withdrawal time than at deposit time. Impermanent loss can be minimized by the trading fees in many situations.

What are the advantages and disadvantages of liquidity pools?

Main advantages:

  • Anyone can become a liquidity provider if they hold the appropriate asset(s)
  • There are no intermediary entities, users can trade directly from their wallets
  • Earning transaction fees can be very profitable
  • The opportunity to gain yield farming reward tokens
  • A liquidity pool doesn't need a buyer and a seller of a certain asset, but the leverage of a pre-funded liquidity pool
  • In a liquidity pool, trades take place with limited slippage for the pairs involved, as long as there is a large liquidity pool

Main disadvantages/Risks:

  • Smart contract bugs
  • Admin keys
  • Impermanent loss
  • Hacks
  • Systemic risks
  • Slippage due to high orders
  • The pricing algorithm may fail

How can anyone join a liquidity pool?

The method to join to a liquidity pool differs, according to the chosen platform. You usually must create an account on the platform, connect your wallet and deposit the tokens into the liquidity pool.