What is liquidity pool?

A smart contract holding a pair of assets that traders buy from and sell into, funded by depositors who earn a share of the trading fees.

Not yet verifiedHow we verify

3 min read

In this entry

A smart contract holding a pair of assets that traders buy from and sell into, funded by depositors who earn a share of the trading fees.

Pools are the inventory behind an automated market maker. Depositors carry impermanent loss when the two prices diverge, and the pool is only as safe as the contract holding it.

A pool replaces the two sides of an order book with a single contract and a pricing rule, which is what lets a decentralized exchange operate without anyone posting quotes. Understanding the rule explains most of what follows, including why deposits underperform holding when prices move.

How it works

The classic design is the constant product pool described in the Uniswap v2 documentation: the pool holds two assets and requires that the product of the two reserves stay constant across a trade. Buying one asset out of the pool reduces its reserve and increases the other, and the price the trader gets is set by that ratio rather than by any quote.

Three consequences follow directly.

  1. Price impact is automatic. A larger trade moves further along the curve, so the effective price worsens with size. Pool depth is what makes that impact small.
  2. Arbitrage keeps the pool honest. When an outside market moves, the pool's ratio is stale, and arbitrageurs trade against it until the ratio matches. That trade is profitable for them and is paid out of depositor value.
  3. Depositors must supply both assets in the pool's current ratio, and they receive a token representing their share plus accumulated fees.

Each trade pays a fee that accrues to the pool, and newer designs let liquidity be concentrated in a chosen price band, which raises fee income within that band and raises exposure to divergence.

The risks are distinct from the economics. The contract can be exploited. A token in the pool can be malicious. And on chains where anyone can create a pool for any token, the existence of a pool is not evidence of anything.

Example

Illustrative arithmetic. A pool holds 100 ETH and 200,000 USDC, so the price is $2,000 and the product of reserves is 20,000,000. A trader buys 1 ETH. The ETH reserve falls to 99, so the USDC reserve must rise to 20,000,000 divided by 99, which is about 202,020. The trader pays roughly $2,020 for 1 ETH, about 1 percent above the starting price, plus the pool's fee. Repeat with a 10 ETH purchase: the USDC reserve must reach about 222,222, so 10 ETH costs about $22,222, an average of $2,222 each, over 11 percent above the starting price. Nothing changed except size.

Why it matters when you buy

Pool depth is the decentralized equivalent of order book depth, and the price impact above is what slippage tolerance settings are protecting against. On centralized venues the same question is measured directly: the liquidity view reports spreads, depth within one percent of the mid, and slippage per order size for each exchange we measure. Centralized versus decentralized exchanges covers the wider comparison.

Questions

Where does the price in a pool come from?

From the ratio of its reserves and the pricing formula, not from a quote. Arbitrage is what keeps that ratio aligned with outside markets.

Is depositing into a pool a way to earn yield?

It earns a share of trading fees and exposes you to divergence loss between the two assets. The advertised rate is fee income only and is not a net return.

Can the pool be drained?

By an exploit in the contract, or by whoever supplied the liquidity withdrawing it, unless it is locked. Both have happened often enough to be the first thing to check.