Crypto-assets are high-risk and volatile. You could lose all the money you put in. Education only — not financial advice. Risk disclosure

Liquidity pools and AMMs explained

How liquidity pools and automated market makers work, the x·y=k formula with worked numbers, and why impermanent loss can leave you worse off.

In this article
  • USD Coin (USDC)
A large outdoor pool of clear blue water
Photo: “Libya Ghadames Old Town Spring Water Pool” by Kurt Dundy, CC BY-SA 3.0, via commons.wikimedia.org.

Key Takeaways

Quick answer

A liquidity pool is a smart contract holding two tokens that traders swap against. An automated market maker (AMM) prices trades with a formula — in Uniswap v2, x·y=k. Depositors earn a share of fees but risk “impermanent loss”: ending up worth less than simply holding.

  • A liquidity pool is a smart contract holding two tokens that traders swap against, priced by a formula.
  • Uniswap v2's formula, x times y equals k, keeps the product of the two token balances constant on every trade.
  • Liquidity providers deposit both tokens and receive a share of trading fees, but their mix of tokens changes as prices move.
  • Impermanent loss is the shortfall against simply holding: about 5.7% when one token's price doubles, before fees.
  • ESMA cites research finding most Uniswap v3 liquidity providers studied in 2021 would have done better just holding.

What is a liquidity pool?

A liquidity pool is a pot of two (or sometimes more) crypto tokens locked in a smart contract. Traders on a decentralised exchange swap against that pot instead of against another person’s order.

The tokens come from liquidity providers (LPs). The European Securities and Markets Authority (ESMA) describes it this way: “Liquidity providers contribute (i.e. deposit) two crypto-assets (or more) (crypto-asset A and B) in the liquidity pool and receive a share in the liquidity pool in return.” That share is recorded with pool tokens (often called LP tokens), which you hand back to withdraw.

What is an automated market maker (AMM)?

On a traditional exchange, a market maker is a firm that constantly quotes prices to buy and sell. An automated market maker replaces that firm with a formula. The Bank for International Settlements (BIS) explains that DEXs match counterparties “through so-called automated market-maker (AMM) protocols.”

Uniswap’s documentation describes its version 2 as “an automated liquidity protocol powered by a constant product formula”. Different DEXs and later versions use different formulas, but the constant product rule is the classic one and the easiest to follow.

How does the x·y=k formula set prices?

Uniswap’s documentation: “This formula, most simply expressed as x * y = k, states that trades must not change the product (k) of a pair's reserve balances (x and y).” Because k stays fixed during a trade, it is called the invariant. The pool’s price is simply the ratio of the two balances.

Illustrative example (hypothetical numbers, fees ignored): a pool holds x = 100 ETH and y = 200,000 USDC. So k = 100 × 200,000 = 20,000,000, and the price is 200,000 ÷ 100 = 2,000 USDC per ETH.

Trade (USDC in)Pool afterETH outAverage price
1,00099.502 ETH / 201,000 USDC0.498≈ 2,010
10,00095.238 ETH / 210,000 USDC4.762≈ 2,100
50,00080.000 ETH / 250,000 USDC20.0002,500
The constant-product curve x · y = kA curve showing every combination of ETH and USDC where ETH times USDC equals 20,000,000. Before the trade the pool holds 100 ETH and 200,000 USDC. A trade adds 50,000 USDC and removes 20 ETH, moving along the curve to 80 ETH and 250,000 USDC. The average price paid is 2,500 USDC per ETH, up from 2,000.USDC in pool (y)Illustrative, fees ignored100k300k500k40100160ETH in pool (x)x · y = 20,000,000Before: 100 ETH200,000 USDCAfter: 80 ETH250,000 USDCTrade: 50,000 USDC in → 20 ETH outAverage price 2,500, up from 2,000
Illustrative pool from the example above, fees ignored. Every trade must stay on the curve, so the more you take from the pool, the worse the average price (price impact).

Each row uses the same formula: new ETH balance = 20,000,000 ÷ new USDC balance; ETH out = 100 − new ETH balance. The bigger the trade relative to the pool, the worse the average price — this is the price impact traders see as slippage. Uniswap’s documentation adds that the pool price changes only through trading, so gaps with outside prices “create arbitrage opportunities” that traders close.

What do liquidity providers earn?

Uniswap’s documentation says: “Anyone can become a liquidity provider (LP) for a pool by depositing an equivalent value of each underlying token in return for pool tokens.” LPs are paid from trading fees: “In practice, Uniswap applies a 0.30% fee to trades, which is added to reserves.” That 0.30% is specific to Uniswap v2; other DEXs and versions may charge different fees.

How much an LP actually collects depends on trading volume, the size of the pool and their share of it — none of which is fixed. Fee income also has to be weighed against the loss described next.

What is impermanent loss?

ESMA defines it: “Impermanent loss, also known as ‘divergence loss’, corresponds to the loss in value of the reserves in the pool compared to holding the reserves outside of the pool.” When one token’s price moves, arbitrage traders rebalance the pool, so an LP ends up holding more of the token that fell and less of the token that rose.

Illustrative example (same pool, fees ignored): the outside price of ETH doubles from 2,000 to 4,000 USDC. Arbitrage moves the pool until its price is also 4,000, keeping k = 20,000,000. The new balances are x = √(20,000,000 ÷ 4,000) ≈ 70.71 ETH and y = √(20,000,000 × 4,000) ≈ 282,842.71 USDC. The pool is now worth 70.71 × 4,000 + 282,842.71 ≈ 565,685 USDC. If the tokens had simply been held, they would be worth 100 × 4,000 + 200,000 = 600,000 USDC. The pool is about 5.7% behind — matching Uniswap’s own figure: “a 2x price change results in a 5.7% loss relative to HODL”.

The general rule for a two-token constant-product pool is: value compared with holding = 2√r ÷ (1 + r) − 1, where r is how much the price ratio changed.

Price change (r)Pool vs holding
×1.25−0.6%
×1.5−2.0%
×2 or ×0.5−5.7%
×3−13.4%
×4−20.0%

It is called “impermanent” because, as Uniswap explains, the gap disappears if prices return to where they were when you deposited. If you withdraw while they have diverged, the loss becomes real.

Do trading fees make up for impermanent loss?

Sometimes, but not reliably. Uniswap’s own documentation says it is difficult to know the trade-off between fee revenue and losses from price moves without knowing how much trading happens in between.

ESMA cites a 2021 study by Loesch and others: “Examining liquidity pools representing 43% of Uniswap V3's TVL in 2021, Loesch et al (2021) found that a majority of liquidity providers would have been better off holding their crypto-assets in their wallet.” ESMA adds: “In certain pools, the percentage of users who lost more from impermanent loss than they gained in trading fees was as high as 70-75%.”

What is a rug pull in a liquidity pool?

Whoever holds a pool’s LP tokens can take the liquidity out. In a January 2025 case, the US Securities and Exchange Commission (SEC) alleged: “The SEC alleges that, absent safeguards, the holders of LP tokens can, without warning, withdraw liquidity from a liquidity pool, sell significant amounts of crypto assets into the pool and cause losses to investors.” It added: “Such trading behavior is commonly known in the crypto asset industry as a ‘rug pull.’”

In that case the SEC alleges the defendant kept his LP tokens unlocked despite telling investors the liquidity was “locked”, and misappropriated crypto assets worth about $553,000. These are allegations in an SEC complaint, not court findings. A claim that liquidity is locked is only as good as the evidence behind it — see our crypto scam red flags.

What are the risks of providing liquidity?

  • Impermanent loss, which grows with the size of the price move and can exceed fee income (ESMA).
  • Smart-contract risk. ESMA: “Indeed, if a protocol becomes large enough, any flaw in its smart contract code is very likely to be found and exploited.” Your deposit sits in that contract.
  • Price risk on both tokens. If both tokens fall, fees do little to cushion the loss. The UK Financial Conduct Authority (FCA) says anyone buying crypto should be prepared to lose all the money they put in.
  • Rug pulls and scam tokens in pools created by anonymous teams (SEC, ESMA).
  • Oracle and manipulation attacks. ESMA describes attackers using flash loans to shift prices in less liquid markets and “manipulate oracles to their advantage”.
  • No recourse. ESMA notes “the absence of a recourse mechanism if things go wrong.”

Many of these risks apply to DeFi in general; see what DeFi is for the bigger picture.

Blockhorizon is an education site. Nothing here is a recommendation to use any DeFi app, token or staking service.

Frequently asked questions

Is impermanent loss the same as losing money?

Not exactly. It measures how far your pool position falls behind simply holding the same tokens. You can still lose money overall if both tokens fall in price.

Does impermanent loss happen when prices fall as well as rise?

Yes. The formula depends on how far the price ratio moves in either direction: a halving produces the same 5.7% shortfall as a doubling in a constant-product pool, before fees.

Are stablecoin-to-stablecoin pools free of impermanent loss?

The loss is small only while both coins hold their peg. If one stablecoin loses its peg, the pool fills up with the weaker coin.

What are LP tokens?

Tokens a pool gives you to record your share of it. You return them to withdraw your share of both tokens. Whoever holds them can withdraw, which is why the SEC links unlocked LP tokens to rug pulls.

Next lessonCrypto staking explained →

Article Sources

6 sources

Blockhorizon checks every figure, date and quotation against primary sources: regulators, statistics bodies and original technical documents. Read our editorial policy.

  1. Uniswap v2 docs — How Uniswap works — docs.uniswap.org (accessed 2026-10-02)
  2. Uniswap v2 docs — Understanding returns — docs.uniswap.org (accessed 2026-10-02)
  3. ESMA, Decentralised Finance in the EU: Developments and risks (11 Oct 2023) — esma.europa.eu (accessed 2026-10-02)
  4. BIS Quarterly Review, DeFi risks and the decentralisation illusion (6 Dec 2021) — bis.org (accessed 2026-10-02)
  5. SEC Litigation Release No. 26223, SEC v. Eric Zhu (16 Jan 2025) — sec.gov (accessed 2026-10-02)
  6. UK Financial Conduct Authority, Crypto: the basics (updated Jan 2026) — fca.org.uk (accessed 2026-10-02)

One plain-English lesson a week

Short, sourced and risk-first. No hype, no “signals”, no sales pitches.

↑↓ to moveEnter to open