stablecoins

What Is an Automated Market Maker (AMM)? How AMMs Work

Published: ·Editorial Desk·Updated: ·7 min readPublic

Last updated: October 12, 2026

TL;DR

An automated market maker (AMM) is a smart contract that lets people trade tokens against a shared pool of liquidity, with prices set by a mathematical formula instead of an order book. Liquidity providers deposit pairs of tokens and earn trading fees; arbitrage traders keep pool prices in line with the wider market. Uniswap, Curve and Balancer are the best-known AMMs, and stablecoin pools are among the most heavily used.

AMMs: definition and positioning

A traditional exchange matches buyers and sellers through an order book, with market makers posting bids and offers. An AMM replaces both the order book and the human market maker with a pool of tokens and a pricing rule.

Order book exchange Automated market maker
How prices are set Matching bids and asks A formula based on the pool's token balances
Who provides liquidity Professional market makers Anyone who deposits into the pool
Counterparty Another trader The pool itself
Availability Depends on market makers being present Always on while the pool has liquidity
Typical cost Spread plus fees Pool fee plus price impact

The distinction that matters: an AMM never "knows" the market price. It only knows its own balances. Arbitrage is what connects it to everything else.

How an AMM works

The classic design, popularized by Uniswap, uses the constant product formula: x × y = k. The pool holds two tokens, x and y, and every trade must keep their product, k, constant (before fees).

A worked example makes it concrete. Suppose a pool holds 100 ETH and 300,000 USDC, so k = 30,000,000 and the implied price is 3,000 USDC per ETH.

  1. A trader buys 1 ETH. The pool now holds 99 ETH.
  2. To keep k constant, USDC in the pool must rise to 30,000,000 ÷ 99 = 303,030.30.
  3. The trader therefore pays about 3,030.30 USDC, plus the pool fee.
  4. The new implied price is 303,030.30 ÷ 99, about 3,061 USDC per ETH.

The trader paid slightly more than 3,000 because their own purchase moved the price. That difference is price impact, and it grows with trade size relative to the pool. Deeper pools mean less impact.

Liquidity providers (LPs) supply both tokens and receive LP tokens representing their share of the pool. They earn a cut of every trade's fee and can withdraw their share at any time.

Types of AMM

Model How it works Best for Example
Constant product x × y = k across all prices Volatile token pairs Uniswap v2
Stable swap Flat curve near a target price, steeper away from it Stablecoins and pegged assets Curve
Concentrated liquidity LPs choose a price range for their capital Capital-efficient trading of major pairs Uniswap v3 and v4
Weighted pools More than two tokens in custom proportions Index-like portfolios Balancer
Batch-auction AMMs Trades settled in batches to reduce extraction Users seeking MEV protection CoW AMM

Why stablecoin pools work differently

A constant product curve is wasteful for two assets that should both be worth $1: it spreads liquidity across prices like $0.50 and $2 that should never trade. Stable swap designs, introduced by Curve, flatten the curve around the peg so a large stablecoin swap moves the price very little, then steepen it if the pool drifts far from balance.

That design has a useful side effect. Because a stablecoin pool rebalances toward whichever token holders are selling, pool composition is an early warning signal. When one stablecoin grows to a large share of a pool, holders are dumping it, often before the price visibly breaks. Our stablecoin depeg guide covers how to read that signal.

Arbitrage: how AMMs stay in line with the market

An AMM's price only changes when someone trades. When ETH rises to 3,100 on centralized exchanges, the pool still says 3,000 until an arbitrageur buys ETH from the pool cheaply and sells it elsewhere. Each arbitrage trade nudges the pool price toward the market until the profit disappears.

The framing I keep coming back to: arbitrage is not a side effect of AMMs, it is their price feed. Without arbitrageurs, pools would drift away from reality. The cost of that service is paid by liquidity providers, as the next section shows. Arbitrage between pools and exchanges is also one of the largest categories of MEV, the value captured by ordering transactions.

Impermanent loss and LP economics

When prices move, arbitrageurs buy the token that has become cheap in the pool and sell the one that has become expensive. LPs end up holding more of the asset that fell and less of the one that rose. Compared with simply holding both tokens, this shortfall is called impermanent loss. It reverses only if prices return to where they started.

Researchers have since framed the cost more precisely as loss-versus-rebalancing: LPs systematically trade at stale prices against better-informed arbitrageurs. Fees are the LP's compensation. A pool is profitable for LPs only if fee income exceeds that loss, which is why stablecoin pools, where prices barely move, are among the more reliable places to provide liquidity.

Trade-offs and limitations

AMMs offer permissionless, always-on markets and let anyone earn as a liquidity provider. Their limits are price impact on large trades, impermanent loss for LPs, exposure to sandwich attacks and other MEV, smart contract risk, and fragmentation of liquidity across many pools and chains. For large or sensitive trades, aggregators and request-for-quote systems often route around AMMs to get better execution.

FAQs

What is an AMM in crypto?

An AMM, or automated market maker, is a smart contract that lets users trade tokens against a pool of liquidity instead of matching with another trader. A formula sets the price based on the pool's balances. Uniswap and Curve are the best-known examples, and most decentralized exchanges run on AMMs.

How does an automated market maker work?

Liquidity providers deposit pairs of tokens into a pool. Traders swap one token for the other, and a formula, such as x × y = k, adjusts the price after each trade based on the new balances. Arbitrage traders keep the pool price in line with other markets, and liquidity providers earn trading fees.

What is impermanent loss?

Impermanent loss is the shortfall a liquidity provider experiences compared with simply holding the two tokens, caused by price changes. As prices move, arbitrage leaves the pool holding more of the falling asset. The loss becomes permanent if the provider withdraws before prices return to their starting level.

Are AMMs profitable for liquidity providers?

They can be, if trading fees earned exceed impermanent loss. Pools with high volume and stable prices, such as stablecoin pools, tend to work best for providers. Pools of volatile tokens with low volume often lose money for providers once price movements are accounted for.

What is the difference between an AMM and an order book?

An order book matches buy and sell orders between traders, with prices set by the best bids and offers. An AMM has no order book: traders trade against a pool, and a formula sets the price. AMMs are always available on-chain, while order books depend on market makers posting quotes.

Why do stablecoin AMMs use a different formula?

Stablecoins should all trade near $1, so a standard constant product formula spreads liquidity across prices that should never occur. Stable swap formulas concentrate liquidity around the peg, letting large stablecoin swaps execute with very little price impact while still adjusting if one token loses its peg.

The takeaway

AMMs turned market making into a public utility: a formula, a pool and arbitrage traders together replace the order book. The open question is whether newer designs such as concentrated liquidity, hooks and batch auctions can shift more of the value captured by arbitrage back to liquidity providers and traders.

related