1. Home
  2. Glossary
  3. Liquidity pool

Liquidity pool

Also known as AMM pool · Stableswap pool

Definition

A liquidity pool is a smart contract holding two or more tokens that traders swap against, with prices set by a formula instead of an order book. Liquidity providers supply the tokens and earn a share of trading fees, taking on price and smart contract risk in return.

An exchange usually needs someone on the other side of every trade. Liquidity pools remove that need. Instead of matching buyers and sellers, a pool holds a reserve of tokens and quotes prices from a formula, so anyone can trade against it at any time. This automated market maker (AMM) design is how most onchain swaps happen.

How a pool sets prices

The classic formula keeps the product of the two token balances constant. Say a pool holds 1,000 ETH and 3 million dollar tokens. A trader who buys ETH adds dollar tokens and removes ETH, and the formula raises the price of ETH as its balance shrinks. Bigger trades move the price more, an effect called slippage. Whenever the pool's price drifts from prices elsewhere, other traders step in and bring it back in line.

Stableswap pools

For tokens that should trade near the same value, such as two dollar tokens, the classic formula spreads liquidity over prices that should rarely occur. Curve's stableswap formula concentrates liquidity around equal prices, so large swaps between dollar tokens cost little. As the balances become very uneven, the formula behaves more like the classic one and prices move faster. A heavily unbalanced stableswap pool is often an early sign that the market doubts one of its tokens, a possible depeg.

A simple example

A stableswap pool holds 5 million each of two dollar tokens. A trader swaps 100,000 of one for the other and receives close to 100,000 back, minus a small fee. Now suppose holders lose confidence in one token and sell 3 million of it into the pool. The pool ends up holding mostly the doubted token, that token's price in the pool slides below one dollar, and liquidity providers are left with more of the asset everyone else was trying to leave.

How liquidity providers earn

Providers supply tokens and receive LP tokens that represent their share of the pool. They earn a share of every swap fee, and some pools add reward tokens on top. The return is a variable yield that depends on trading volume. LP tokens can themselves be used elsewhere, for example as collateral, which makes pools a basic building block of composability.

Risks and limits

  • Impermanent loss. When the prices of the pooled tokens move apart, the pool rebalances toward the one that fell, leaving providers worse off than if they had simply held both tokens. The loss becomes permanent if they withdraw at that point. Stableswap pools reduce it for assets that stay close in value.
  • Depeg exposure. In a pool of dollar tokens, providers absorb the token that loses value.
  • Smart contract and oracle risk, especially for pools that other protocols read prices from.
  • Thin liquidity. A small pool can be pushed far from fair value by one trade, which attackers use to manipulate prices.

How Tori Finance uses this

Tori Finance's integrations include Curve, whose stableswap pools are designed for assets that trade near the same value, alongside Morpho and Pendle.

Frequently asked questions

What is a liquidity pool?

A smart contract holding two or more tokens that anyone can swap against. Prices come from a formula based on the pool's balances, and the tokens are supplied by liquidity providers who earn trading fees.

What is impermanent loss?

The shortfall a liquidity provider faces, compared with simply holding the tokens, when their prices move apart. The pool rebalances toward the token that fell, and the loss becomes realized if the provider withdraws before prices move back.

What is a stableswap pool?

A pool, popularized by Curve, whose formula concentrates liquidity around equal prices. It suits assets that should trade near the same value, such as dollar tokens, and keeps swaps between them cheap.

Sources

Written by the Tori Finance team. Not investment advice. Yields vary; capital is at risk.