Telegram (AI) YouTube Facebook X
Ру

What are liquidity pools and how do they work?

What are liquidity pools and how do they work?
Intermediate
What are liquidity pools and how do they work?
Intermediate

What is liquidity?

Liquidity is a foundational concept in both traditional and crypto markets. It describes the ability to sell assets quickly and smoothly at a price close to the market rate.

Liquidity is usually provided by a large number of buyers and sellers. If a financial instrument is little traded and thus illiquid, converting it to cash may take time.

A trade may also involve significant slippage. This is the difference between the price at which a market participant intended to sell an asset and the price at which the trade was actually executed.

What is a liquidity pool?

Liquidity pools are a key element of decentralised finance (DeFi). They are sets of cryptoassets locked in a smart contract.

Liquidity pools are used across the “money Lego” stack, spanning crypto lending, DEX, decentralised insurance, synthetic assets, and more.

An important component is the automated market maker (AMM). This algorithm features in most DeFi protocols. It manages liquidity and prices of cryptoassets on decentralised platforms, enabling automated trading.

How does a liquidity pool work?

Anyone in the DeFi ecosystem can create a liquidity pool. To do so, an investor locks a pair of cryptoassets in a smart contract in equal value parts, setting initial prices.

Users of AMM platforms who supply funds to pools are called liquidity providers (LPs). Prices are set by supply and demand (a coin’s market value rises when many users buy it, and vice versa) and by the formula embedded in each platform’s algorithm.

For supplying assets, liquidity providers earn a share of trading fees. The size of this reward depends on the amount of liquidity contributed, represented by special cryptoassets—LP tokens. These can be used across the “money Lego” ecosystem.

lp-lp-tokens

The practice of earning passively by depositing cryptoassets on DeFi platforms is known as ‘yield farming’ or “liquidity mining”.

Any market participant can trade the assets in a pool. There is no need for counterparties (buyers and sellers as on traditional platforms) or an order book—the AMM executes trades directly against the pool.

Most DEXs operate under the Constant Product Market Maker (CPMM) model. First introduced by Bancor, it rose to prominence with Uniswap.

Under CPMM, the product of the values of two assets in a pool is a constant:

Token A * Token B = K

where:

Token A: value of Token A

Token B: value of Token B

K: constant

The ratio between tokens in the pool dictates prices. For example, if someone buys ETH in a DAI/ETH pair, the supply of ETH in the pool falls while DAI rises. As a result, the price of ether increases and the stablecoin’s price falls. The impact on market prices depends on the trade size relative to the pool. If the pool’s TVL is large and the trade is only a few dollars, the price impact will be small.

LPs can exit a liquidity pool at any time by redeeming their LP tokens. The participant immediately receives the originally deposited coins and the percentage income accrued from trading activity.

Which DeFi platforms are built on liquidity pools?

Most DEXs rely on AMMs using the CPMM model. This type of exchange accounts for nearly 90% of the segment.

DEX-Mech-Volume-Share
Data: CoinGecko, The Block.

The corresponding share for “hybrid” DEXs is ~9.5%, and for order-book-based decentralised exchanges ~1%.

Uniswap is the segment’s perennial leader by TVL and trading volume. At the time of writing (20 October 2023) the exchange supports eight networks, including Ethereum, Arbitrum, Optimism, Polygon, Base, BNB Chain, Avalanche and Celo.

Dexes-TVL-Ratings
DEX ranking by TVL. Data from DeFi Llama as of 20.10.2023.

In July, Uniswap Labs unveiled UniswapX—an open-source protocol that aggregates liquidity from decentralised exchanges. In the same month, the developers set a launch window for Uniswap v4: within four months of Ethereum’s Dencun hard fork.

Curve is also popular among crypto traders. It is designed for efficient trading between stablecoins and other like-valued tokens with minimal slippage and fees.

Balancer commands a sizeable market share too. The platform allows pools with three or more tokens.

The table below shows types of liquidity pools and examples of platforms:

tipy-razlichnyh-pulov-likvidnosti

What are the advantages of liquidity pools?

As a cornerstone of a fast-evolving DeFi ecosystem, liquidity pools let any market participant earn passive income on cryptoassets.

Their most important attribute is being permissionless. This means any user can create a liquidity pool and, in effect, a new market. There are no review or approval processes—everything happens in a decentralised, intermediary-free manner.

Both large and small investors can take part—the barrier to entry is minimal. Such openness fosters a more inclusive and equitable financial system, where anyone can add liquidity and help stimulate trading activity.

DEXs run on open-source smart contracts, ensuring transparency and allowing external audits.

What are the drawbacks of liquidity pools?

The DeFi ecosystem is still far from mature. Alongside clear advantages, its key building blocks have several drawbacks:

  • liquidity pools and protocols can be controlled by a narrow group of participants, which runs counter to the ideal of decentralisation;
  • hack risks due to vulnerabilities and coding errors;
  • the possibility of a rug pull;
  • significant slippage, especially in low-liquidity markets (typical of new and obscure coins and platforms with small TVL).

Participants in DeFi are also exposed to impermanent loss (IL). This occurs when the prices of assets in a liquidity pool differ markedly from those at the time of deposit. During sharp market moves it can sometimes be more profitable simply to hold coins in a wallet than to lock them in smart contracts for passive income.

Consider a simplified example.

Suppose a user creates a new DEX pool WBTC/USDT by depositing 1 WBTC and 20,000 USDT.

The price of bitcoin jumps; within a short time the digital gold rises to 25,000 USDT. Noticing the new exchange, arbitrageurs spot an opportunity to profit from price discrepancies. They begin actively buying “wrapped” bitcoin

from the pool until the price reaches parity with the broader market.

The pool now holds mostly USDT, with its WBTC almost depleted.

Initial deposit: 20,000 USDT + 1 WBTC. Given that funds are added to a DEX in equal-value parts, the total value of assets in the pool is equivalent to 40,000 USDT.

After bitcoin’s rally to 25,000 USDT, the pool’s liquidity would be worth 45,000 USDT. But with WBTC exhausted, the pool holds 40,000 USDT and 0 BTC. The opportunity cost is 5,000 USDT.

This difference is impermanent loss. It is called “impermanent” because prices in the pool may still return to parity with the broader market. The loss becomes permanent only if liquidity providers leave the pool while IL is present.

There are impermanent-loss calculators, for example from dilydefi.org and CoinGecko.

Trades via liquidity pools can also involve significant slippage, especially with new, little-known and (possibly still) illiquid coins.

Slippage is the difference between the expected price and the actual execution price. The reason is that asset prices in a pool are not static; they change trade by trade as a new equilibrium is found each time.

AMM trades are not instantaneous—between a user’s initiation and confirmation, other, larger transactions may be processed. These can materially affect prices, particularly when pool liquidity is thin.

Follow ForkLog on social media

Telegram Instagram
Found a mistake in the text? Highlight it and press CTRL+ENTER.

Рассылки ForkLog: держите руку на пульсе биткоин-индустрии!

We use cookies to improve the quality of our service.

By using this website, you agree to the Privacy policy.

OK