DeFi & Web3Guide

How Do Automated Market Makers (AMMs) Work?

This breakdown works through the x × y = k formula on a real Uniswap pool read on-chain on 16 November 2026: what a swap costs at 1, 10 and 100 ETH, and why stablecoin pools barely move.

How Do Automated Market Makers (AMMs) Work?
Illustration: CoinPaprika

Introduction

Selling 100 wrapped ether (WETH) into the Uniswap V2 WETH/USDC pool costs 2.33% below the market price, while selling one WETH costs 0.32%. No order book sets either number. An automated market maker (AMM), a smart contract that holds two tokens and prices trades with a formula, sets both, and the same idea runs under decentralized exchanges (DEXs) that handled $213.3 billion of spot volume in the 30 days to 15 November 2026 (DefiLlama, 2026). This guide works the constant-product formula through a real pool read on-chain on 16 November 2026, with every figure traced to the pool's own reserves, then compares stableswap and weighted curves, where a stablecoin pool loses 0.132% on a $10 million swap, and closes with who earns the fees and what can go wrong.

Key Takeaways

  • An AMM prices every trade from its reserves: the Uniswap V2 WETH/USDC pool, holding 8.62 million USDC and 4,796 WETH, quotes $1,798 per WETH.
  • Cost grows faster than size: selling 10 WETH lands 0.51% below spot, 100 WETH lands 2.33% below, and 400 WETH lands 7.95% below (pool read on 16 November 2026).
  • Fees follow volume, not rate: a 0.05% V3 pool earned about 0.057% of its liquidity in one day, against 0.012% for a 0.30% V2 pool.
  • Curve's stableswap 3pool loses 0.132% on a $10 million USDT to USDC swap, where an equally deep constant-product pool would lose 27.3% (illustrative).
  • Uniswap V3 and V4 handle $62.5 billion of the $213.3 billion in spot DEX volume in the 30 days to 15 November 2026, about 29%.

What Is an Automated Market Maker and How Does It Replace the Order Book?

An automated market maker (AMM) is a smart contract that holds two tokens and quotes every trade from a formula, so no buyer or seller needs to sit on the other side. Anyone can swap against the pool at any hour. Anyone can also deposit tokens into it and earn a share of the trading fees.

Pools Replace Buyers and Sellers

An exchange with an order book keeps a ladder of bids and asks, and a trade happens only when a buyer and a seller agree on a price. A pool works differently. It holds a reserve of each token, and the contract sets the price from the ratio between the two reserves. A trader sends one token in and receives the other out within a single transaction. Depositors, called liquidity providers (LPs), supply the reserves, and Uniswap V2 hands each of them fungible pool tokens that represent a share of both reserves. Professional market makers are not required, and a pool for a brand-new token exists the minute someone funds it.

From Bancor to Uniswap

Bancor activated its BNT smart token on 22 June 2017, a token priced continuously from an ether reserve instead of an order book (Bancor, 2017). Hayden Adams then built Uniswap on the market-maker idea Vitalik Buterin had described, and deployed it on Ethereum mainnet on 2 November 2018 at Devcon 4 (Uniswap blog, 2019). Uniswap V2 launched in May 2020. Curve, Balancer and dozens of forks reused the concept with different curves, which later sections compare. Each design answers the same problem: quoting a price when nobody posts one.

FeatureOrder book exchangeAMM pool
Who quotes the priceTraders and market makersThe pool contract
How the price formsOrders match at agreed levelsA formula applied to two reserves
Where liquidity comes fromResting orders from tradersAnyone who deposits both tokens
Cost of a large tradeWalks through posted ordersSlides along the curve
Main weaknessThin books for small tokensPrice impact on shallow pools

Data current as of November 2026.

The simplest curve in that family, constant product, is also the one that explains all the others.

How Does the Constant-Product Formula Turn Pool Reserves Into a Price?

The constant-product rule keeps the product of the two reserves fixed: x × y = k. Price is the ratio of the reserves, and every trade must leave k unchanged or higher. The Uniswap V2 WETH/USDC pool holds about 8.62 million USDC and 4,796 wrapped ether (WETH), which prices one WETH near $1,798 (Ethereum RPC, DexPaprika API, 2026-11-16).

Reserves Set the Spot Price

Spot price is the reserve of one token divided by the reserve of the other. On that pool, 8,622,495 USDC divided by 4,795.96 WETH gives $1,797.86 per WETH (Ethereum RPC, 2026-11-16), within a dollar of the $1,798 DexPaprika reports for the same pool. No order sits anywhere; the ratio is the quote. The pool has no view of the outside market, so its price tracks other venues only because traders correct it whenever it drifts. Uniswap's documentation describes the same structure: two token reserves, with prices updated from pool state after every swap (Uniswap docs, 2026).

Each Trade Slides Along the Curve

A swap adds one token to the pool and removes the other until the product returns to k. With k near 41.35 billion, a trader who sells 100 WETH lifts the WETH reserve to about 4,896 and leaves 8.45 million USDC in the pool, so the pool pays out roughly 175,600 USDC after its 0.30% fee (own calculation, 2026-11-16). Plotted, the reserves trace a hyperbola: price falls as the WETH reserve grows, and every finite trade leaves both reserves positive. A constant-product pool therefore keeps some of each token however large the order. Each additional unit of the scarce token costs more than the last.

Line chart of the USDC reserve falling from $16.5 million to $7.5 million as the WETH reserve rises from 2,500 to 5,500

Because the curve bends, the cost of a trade grows faster than the trade itself.

What Is the Difference Between Price Impact and Slippage on a Real Pool?

Price impact is the price movement a trade causes by its own size. Slippage is the gap between the quote at signing and the price at execution. On the Uniswap V2 WETH/USDC pool, selling 10 WETH lands 0.51% below spot including the fee, and selling 100 WETH lands 2.33% below (own calculation, Ethereum RPC, 2026-11-16).

The Math on a Real Uniswap V2 Pool

Each row of the table applies the V2 rule to the reserves read on-chain on 16 November 2026, with the 0.30% fee taken from the input. One WETH loses 0.32% to spot, almost all of it fee. Price impact on the average price equals the trade divided by the reserve after the trade, so 100 WETH against 4,796 costs 2.04% before the fee. The 400 WETH sale, more than 8% of the pool's WETH, nets $1,655 per WETH, 7.95% under spot. A pool holding $17.3 million of liquidity absorbs small orders cheaply and punishes large ones. Splitting the sale into smaller orders changes nothing in a single pool ↗, because each order moves the price along the same curve (Conrad et al., 2023).

Arbitrage Keeps Pool Prices Honest

Slippage is the part no formula predicts: other transactions land first and change the reserves before a swap executes. A wallet's slippage tolerance, such as 0.5%, instructs the contract to revert if the output falls below that bound. Arbitrageurs close the gap between pool and market. A pool that prices WETH below another venue gets bought out: arbitrageurs take WETH from the pool and sell it elsewhere until the ratio realigns, which is how an isolated formula follows a global price. A live look at DEX pool prices for LINK ↗ tracks the same correction on real pools.

Sell sizeShare of pool's WETHUSDC receivedAverage price per WETHTotal shortfall vs spot
1 WETH0.02%$1,792.10$1,792.100.32%
10 WETH0.21%$17,887.52$1,788.750.51%
100 WETH2.09%$175,596.74$1,755.972.33%
400 WETH8.34%$661,945.47$1,654.867.95%

Data current as of November 2026.

Bar chart of selling cost in the V2 WETH pool: 1 WETH 0.32%, 10 WETH 0.51%, 100 WETH 2.33%, 400 WETH 7.95%

Those arbitrage trades are also why liquidity providers get paid: the pool earns a fee on every correction.

How Do Liquidity Providers Earn Swap Fees From an AMM Pool?

Swap fees stay inside the pool, so every trade raises the value behind each LP share. The Uniswap V2 fee is 0.30% of the input, of which LPs have kept 0.25% since the protocol fee was switched on in December 2025, and LP shares are redeemable for a pro-rata slice of both reserves (Uniswap docs, 2026). The pool's own fee income, not a promised rate, is what an LP earns, whether it holds a V2 LP token or a pair token that wraps a full-range position ↗.

Fees Stay in the Pool and Grow the Reserves

The pool applies the formula to 99.7% of the input and keeps the other 0.3% in the reserves, which is why k rises with every trade. An LP holding 1% of a pool's shares owns 1% of both reserves at any moment, accumulated fees included, and claims them by burning the LP token. The mechanism has a cost. As the price moves, the pool rebalances the mix of tokens an LP owns, and that effect, impermanent loss, can outweigh the fees. A companion guide on impermanent loss ↗ works through the math. Fee rates also vary by pool and version. Uniswap governance switched on protocol fees on Ethereum on 29 December 2025: the protocol takes 0.05 percentage points of every V2 swap and a quarter of the fee in 0.05% V3 pools such as WETH/USDC (Uniswap docs, 2026).

One Day of Fees on Two Real Pools

The same pair trades in two Uniswap pools with different fee designs, and one day of data separates them sharply. The V2 pool, charging 0.30%, held $17.3 million and handled $0.70 million of volume in 24 hours, which pays about $2,110 in fees, 0.012% of its liquidity (DexPaprika API, 2026-11-16). The V3 pool, charging 0.05%, held $76.2 million and handled $86.4 million, which pays about $43,200, 0.057% of its liquidity. After the protocol's cut, LPs keep about 0.010% and 0.043%. Volume, not fee rate, decided the outcome. One day is a snapshot, not an annual yield.

Volume flows to the pool with the cheapest effective price, which makes curve design matter more than the fee tier for some pairs.

How Do Stableswap and Weighted Pools Bend the Curve?

Constant product spreads depth across every possible price, including prices far outside a stablecoin pair's usual range. Stableswap pools flatten the curve around parity, and weighted pools change the split of value between assets. Both keep the idea of a formula-set price (Curve docs, 2026; Balancer docs, 2026).

Stableswap Flattens the Curve Near Parity

Curve's stableswap invariant blends constant sum, which prices at exactly 1:1, with constant product, which keeps the pool solvent, and an amplification coefficient (A) sets the blend (Curve docs, 2026). The 3pool holds 27.5 million DAI, 26.7 million USDC and 104.5 million USDT, runs A = 4,000 and charges 0.015% (Ethereum RPC, 2026-11-16). A $10 million swap from USDT to USDC returns $9.9868 million, a 0.132% shortfall with the fee included. Most of that gap is the pool's imbalance rather than the curve: USDT makes up about two-thirds of the 3pool, so it trades slightly below USDC even on small swaps. A constant-product pool of equal depth would lose 27.3% on that trade (illustrative). Pools like this one sit behind much of the activity in stablecoin lending and liquidity pools ↗.

Weighted Pools Set the Asset Split

Balancer's weighted math generalizes constant product to any number of tokens and any weights, so an 80/20 pool keeps 80% of its value in one asset (Balancer docs, 2026). Spot price divides each balance by its weight before taking the ratio. In an illustrative $20 million pool, a $200,000 swap loses 1.96% in a 50/50 split and about 3.0% in an 80/20 split, because the 80/20 pool holds less of the asset being bought. The trade-off is shallower depth between the pair in exchange for a pool that holds most of its value in the asset its LPs want.

DesignRule in one lineBest forLive exampleTrade-off
Constant productReserves multiply to a fixed kVolatile and long-tail pairsUniswap V2 WETH/USDCCost grows fast with trade size
StableswapFlat near parity, constant product at the edgesPegged assetsCurve 3poolBends sharply once a coin leaves its peg
WeightedWeighted product of n balancesUneven splits and index poolsBalancer 80/20 poolsShallower depth between the pair

Data current as of November 2026.

Swap size (USDT to USDC)Curve 3pool shortfallConstant-product pool of equal depth (illustrative)
$100,0000.086%0.39%
$1 million0.089%3.63%
$10 million0.132%27.3%
$20 million0.311%42.8%

Flat curves suit assets that hold their peg, and volatile pairs use other designs.

Which AMM Designs Handle the Most Trading Volume Today?

Uniswap's concentrated-liquidity versions ↗ lead AMM volume as of November 2026. DefiLlama's spot DEX category records $213.3 billion of trading in the 30 full UTC days to 15 November 2026, of which Uniswap V3 handled $33.4 billion and V4 $29.0 billion, while V2 handled $0.66 billion and Curve $5.5 billion (DefiLlama, 2026).

Concentrated Liquidity Took the Volume

V3 lets each LP confine capital to a price range, so the same dollars quote deeper prices near the market. An LP in a narrow range supplies that depth with a fraction of the tokens a full-range position needs. The V3 WETH/USDC pool from the fee comparison holds $76.2 million and traded $86.4 million in a day, 123 times the volume of the V2 pool (DexPaprika API, 2026-11-16). Uniswap V4 keeps that model and adds hooks and a singleton contract (Uniswap docs, 2026). Together V3 and V4 account for $62.5 billion, about 29% of the spot DEX total. Outside these two versions, the split of DEX volume by blockchain ↗ lists where the rest trades.

Where Older Curves Still Win

Older curves persist where their math fits the asset. Curve holds $1.01 billion of total value locked (TVL) and recorded $5.5 billion of 30-day volume, with fees as low as 3pool's 0.015% (DefiLlama, 2026). Uniswap V2 still holds $0.71 billion of TVL on $0.66 billion of volume. On Ethereum alone, 24-hour volume to 16 November was $327 million on V4, $305 million on V3, $112 million on Curve and $9 million on V2 (DexPaprika API, 2026-11-16). Balancer's V2 and V3 contracts hold $14 million and $9 million. Tokenized-asset markets reuse the same pool mechanics, as the guide to liquidity pools for real-world assets ↗ explains.

Bar chart of 30-day spot volume: Uniswap V3 $33.42B, V4 $29.05B, Curve $5.54B, Uniswap V2 $0.66B, Balancer $0.06B

Volume and safety do not move together, and the next section covers what can go wrong.

What Can Go Wrong When Trading Against or Funding an AMM?

Thin pools, fake tokens and contract bugs cost AMM users real money ↗. Traders face price impact and sandwiching, and LPs face impermanent loss and the chance that the contract itself fails. Balancer's Composable Stable Pools lost an estimated $94.8 million of user funds to a rounding bug on 3 November 2025 (Balancer post-mortem, 2025).

Risks for Traders

Pool depth decides what a swap costs, so a trade against a shallow pool pays heavily: the 400 WETH sale above lost 7.95% to a $17.3 million pool. Anyone can create a pool for any token, so a pool's existence proves nothing about the token behind it, and pools with fake or freshly minted tokens can be drained of the real asset. Bots can also insert trades before and after a swap to capture the price movement, a practice called sandwiching and tied to maximal extractable value (MEV). A tight slippage tolerance and a pool-liquidity check limit both. The step-by-step swap process on Uniswap ↗ covers where each setting sits.

Risks for Liquidity Providers

An LP holds a changing mix of tokens: when a price rises, the pool sells the appreciating token and buys the falling one. Impermanent loss measures the gap between that mix and holding the original tokens. Contract risk is separate. On 3 November 2025 a rounding error in the swap math of Balancer's Composable Stable Pools, which use Curve-style stableswap math, let an attacker pull funds out across several chains; Balancer reported that its weighted pools and V3 were unaffected (Balancer post-mortem, 2025). A pool's fee income, such as the 0.057% one-day snapshot earlier, has to cover both risks.

Conclusion

An automated market maker, one of decentralized finance's core building blocks ↗, replaces the order book with a rule: the reserves of two tokens set the price, every trade slides along a curve, and the fees stay in the pool for the people who funded it. The same idea branches into flatter curves for pegged assets and weighted curves for uneven pools, and trading volume has moved toward designs that concentrate capital where the trades happen.

The formula is rarely the problem. The good case is a deep pool, a trade that is a small share of its reserves, and fee income large enough to pay for the risks that liquidity providers carry. The bad case looks identical until size, a price move or a contract flaw exposes it: a large sale that costs 7.95%, impermanent loss that outruns fees, or a rounding error that drains a pool. Each stays invisible in small trades and appears only at size or at the moment of failure.

Before you swap, compare the trade with the pool's reserves, since price impact roughly equals that share, and set a tight slippage tolerance. Before you deposit, compare the fee tier with recent volume, and check whether the contract has been audited and whether its math has ever failed. Depth decides whether a formula's price is fair.

Quick Stats

  • 2.33% — cost of selling 100 WETH into the Uniswap V2 pool on 16 November 2026, below spot
  • $213.3B — spot DEX volume in the 30 days to 15 November 2026
  • 0.132% — Curve 3pool shortfall on a $10 million USDT to USDC swap
  • 123x — daily volume of the V3 pool versus the V2 pool on the same pair
  • 0.015% — Curve 3pool swap fee, against the 0.30% Uniswap V2 fee

Data current as of November 2026.

FAQ

?Is an automated market maker the same thing as a DEX or a liquidity pool?

No. The AMM is the pricing mechanism, the liquidity pool is the pot of tokens it prices, and a DEX is the protocol or app built around pools. Uniswap is a DEX that runs on AMM pools. Some DEXs skip the AMM entirely: Hyperliquid runs fully on-chain order books for perpetual futures and spot trading (Hyperliquid, 2026).

?What slippage tolerance should I set when I swap on an AMM?

Tolerance applies to the quote shown at signing, which already includes price impact and the pool fee. A tight setting such as 0.5% protects a deep pair from price moves and sandwich bots. A thin token may need more room to execute, and each extra percent is room a bot can take, so raise it only as far as the swap needs.

?Are AMM swaps and liquidity provision taxable?

In many jurisdictions a swap counts as a disposal of one asset and an acquisition of another, and depositing into or withdrawing from a pool can count as a separate event. Rules vary by country and change, so check local guidance. Every transaction sits on-chain, which makes records straightforward to reconstruct from a wallet address.

?Can a constant-product pool ever run out of one of its tokens?

No. As one reserve shrinks, the price of that token rises without limit, so trading alone cannot empty the pool. The 400 WETH sale in the example removed more than 8% of the pool's WETH and cost 7.95% in price. Only a contract flaw, such as the November 2025 Balancer exploit, drains a pool completely.

?Do AMMs only exist on Ethereum?

No. Raydium and Orca on Solana ↗ recorded $4.4 billion and $6.5 billion of 30-day volume to 15 November 2026, and Aero, formed when Aerodrome merged with Velodrome on 21 October 2026, recorded $21.7 billion, mostly on Base (DefiLlama, 2026). The mechanics differ by chain and design, but each prices swaps from pool reserves.

?Can I create a pool for any token I want?

Yes. Pool creation is permissionless: anyone can create a pool for any token pair and deposit the first liquidity, and the first deposit sets the starting price. That openness is also why fake-token pools exist, so a pool's presence says nothing about the token behind it. Initial depth decides how cheap early trades are.

?How can I check how deep a pool is before I swap?

Read the pool's reserves or reported liquidity and compare them with the trade. Price impact on the average price equals the trade divided by the reserve after the trade, so selling 1% of a pool's reserve of that token costs about 1% before fees. DexPaprika and DefiLlama both publish pool liquidity.

?Why does my wallet quote a different price from the one on a price chart?

A chart plots the last traded or market-wide price. A wallet quote is the average price this exact trade would get from the pool, with price impact and the pool fee included. On the Uniswap V2 pool, a 10 WETH sale quotes $1,788.75 per WETH against a $1,797.86 spot price.

References / Sources

Platform & Company Data

On-chain and market data behind the figures in this guide.

  • DefiLlama: Spot DEX Volume and Protocol Locked Value (defillama.com, Nov 2026)
  • DexPaprika: Pool Liquidity and Volume Data (dexpaprika.com, Nov 2026)
  • PublicNode: Ethereum Pool Reserves and Curve 3pool State (publicnode.com, Nov 2026)
  • Balancer: Nov 3 Exploit Post-Mortem (medium.com, Nov 2025)
  • Bancor: BNT, the First Smart Token (blog.bancor.network, Jun 2017)
  • Uniswap: A Short History of Uniswap (blog.uniswap.org, Feb 2019)
Academic & Technical

Protocol documentation and research on AMM mathematics.

  • Uniswap: How Uniswap Works (docs.uniswap.org, 2026)
  • Curve: Stableswap Exchange Overview (docs.curve.fi, 2026)
  • Balancer: Weighted Math (docs.balancer.fi, 2026)
  • Conrad, Vinciguerra, Méroué: About Constant-Product AMMs (arxiv.org, Jan 2023)
  • Check Point Research: Balancer Rounding-Error Exploit (research.checkpoint.com, Nov 2025)
  • Hyperliquid: Documentation (hyperliquid.gitbook.io, 2026)
Share this guide
Written by Bartek Hagan

Original CoinPaprika guide.

Report a correction
All guides

Cryptocurrencies are highly volatile and involve significant risk. You may lose part or all of your investment.

All information on Coinpaprika is provided for informational purposes only and does not constitute financial or investment advice. Always conduct your own research (DYOR) and consult a qualified financial advisor before making investment decisions.

Coinpaprika is not liable for any losses resulting from the use of this information.