Jump to content
Chain Times

Markets, protocols, policy and people

What Is a Liquidity Pool, and How Does It Work?

A liquidity pool in DeFi is a smart contract holding tokens for swaps. Learn how its price formula works and what LP tokens represent.

The Chain Times Desk3 min read

What Is a Liquidity Pool, and How Does It Work?

A liquidity pool makes a DeFi swap easier to understand: it shows where the tokens come from and how the trade price is set. It is a smart contract holding two tokens that traders swap directly against.

Fraxswap is a decentralized exchange and automated market maker (AMM), a system that sets swap prices by formula. Its pair holds two tokens, and its embedded time-weighted market maker adds a way to execute large trades over time. That is one example of how a pool can be part of a broader trading system; Fraxswap adds that time-based trading mechanism.

How is a liquidity pool different from an order book?

A liquidity pool quotes a price from its reserves, while an order book matches buyers with sellers. On an order-book exchange, a buyer’s order needs a seller willing to trade at that price. In a pool, a trader swaps against the tokens already held by the contract.

Say a Fraxswap pair holds Token A and Token B. To buy Token A, a trader puts Token B into the pool and takes Token A out. That leaves fewer units of Token A and more units of Token B in the reserves, so the pool’s formula raises Token A’s price for the next swap.

Uniswap and Curve are other names readers may see when learning about pool-based trading. Their pool designs can use different pricing rules, so the constant-product formula below describes one common model, not every pool.

How does a pool set its price, and what do LP tokens mean?

In a constant-product pool, the two token reserves are written as x*y=k. Here, x and y are the amounts of each token, and k is their product. A trade changes the amounts in the pool while the formula constrains how much can be swapped at the current price. The Uniswap v2 Core whitepaper describes this constant-product model and the tokens used to track a provider’s share.

The reserve ratio helps determine the quoted price. When a trade removes some of one token and adds the other, the ratio shifts. A larger trade moves the reserves further, so later units of the token being bought cost more under the formula.

Anyone can deposit both tokens in the pool’s current ratio and receive LP tokens. An LP token is a receipt for a share of the pool: it records the depositor’s proportional claim on the reserves. The ethereum.org DeFi page describes pools as a way to make funds available for DeFi activity.

That receipt does not promise the exact coins deposited will come back unchanged. Trades can alter the pool’s mix while the LP tokens represent a share of the whole. When a depositor withdraws, they redeem that share of whatever the pool holds then. If the pool’s proportions have shifted, the withdrawal contains different amounts of each token than the original deposit.

To explain a pool, remember three things: it holds tokens for direct swaps, a formula quotes prices from the reserves, and LP tokens represent a share of those reserves at withdrawal.

More stories

  1. 01US gets authority to seize $1.2B in Binance crypto
  2. 02US moves to seize or restrain $1.2bn in Binance theft
  3. 03DOJ gets court authority over $1.2B in Binance theft
  4. 04How to follow a Monad bridge transfer from start to finish