AMMs replace order book matching with a mathematical formula. Here is how the math works, what concentrated liquidity changed, and why every AMM is secretly a price importer.
How AMMs Price Assets Without an Order Book
If you come from traditional markets, an order book makes intuitive sense. Buyers post bids. Sellers post asks. A trade happens when they match. Price is whatever two people agreed to trade at, moment to moment.
An automated market maker works differently. There are no bids and no asks. There is a pool holding two assets and a formula that says: for any trade size, here is the price. The pool always quotes. The formula does the matching.
This article walks through how that formula works, what it buys and what it costs, and why concentrated liquidity changed the economics for everyone building on AMMs today.
The Formula
The most common AMM uses the constant product formula.
x * y = k
x is the amount of token A in the pool. y is the amount of token B. k is a constant that stays the same before and after every trade.
If a pool has 100 ETH and 200,000 USDC, then:
100 * 200,000 = 20,000,000
The spot price of ETH in this pool is the ratio of the reserves: USDC divided by ETH, or 200,000 / 100 = 2,000 USDC. When you buy ETH, you add USDC to the pool and remove ETH. The ratio shifts. The next buyer faces a different price.
The price after a trade is not arbitrary. It is determined entirely by how much you moved the ratio. A trade that adds 10,000 USDC to the pool raises the USDC side to 210,000. To keep k at 20,000,000, the ETH side must drop to 20,000,000 / 210,000 = 95.238 ETH. You receive 100 - 95.238 = 4.762 ETH for your 10,000 USDC, at an average price of 2,100 USDC per ETH.
This is a different model from an order book. In an order book, price is the result of discrete orders at specific levels. In an AMM, price is a continuous function of the reserve ratio. Every trade moves the price. Every price is available, just at different quantities.
What This Actually Buys
The AMM design solved a specific problem: you can create a two-sided market with only one person providing capital.
An order book needs market makers on both sides to function. If no one has posted an ask, you cannot buy. If no one has posted a bid, you cannot sell. For a new token with no trading history, this is a death sentence. No market makers, no book, no trades.
An AMM with one liquidity provider creates a market immediately. Deposit 1 ETH and 2,000 USDC, and suddenly anyone can buy or sell up to the pool depth. The entire pool capital is available on both sides at all times. The cold start problem disappears.
This is why every new blockchain, every new token, and every new DeFi protocol starts with AMMs. The bootstrapping question was the real bottleneck, not the fee model or the impermanent loss math.
What It Costs
Full-range constant product AMMs (Uniswap V2 style) spread LP capital across every price from zero to infinity. Most of that capital sits at prices that never trade.
A liquidity provider who deposits $10,000 into a WETH/USDC pool has capital deployed at ETH prices from $1 to $100,000. In reality, ETH trades in a much narrower band. The capital sitting outside that band earns nothing. It still suffers impermanent loss when the price moves, but it generates no fees.
The data backs this up. Across major Uniswap V2 pools, full-range LPs earned an average of 4-6% APR in 2025 before IL, with realized returns closer to 0-2% after accounting for divergence loss. Many pools returned negative net yields over 6-month windows.
This is the hidden cost of the “always available” design. The capital efficiency is 1x by construction. Every dollar in the pool is deployed, but most of it is deployed inefficiently.
Concentrated Liquidity Fixed This
Uniswap V3 introduced concentrated liquidity, which lets LPs choose a price range and deploy capital only within it. Raydium’s CPMM on Solana uses the same principle.
A concentrated LP with $10,000 who believes ETH trades between 1,900 and 2,100 can deploy all $10,000 in that band. The effective capital at those prices is roughly 10x higher than a full-range position of the same size.
The fee capture is correspondingly higher. A concentrated position in an active range can earn 10-50x the fees of a full-range position of equal value, depending on pool volume and range width.
Watch the animation below. The V3-range brackets on the x-axis widen and narrow, showing how concentrated liquidity selects a segment of the same xy=k curve.
V2 (dashed) deploys capital across the entire xy=k curve. V3 (solid) concentrates it on a segment. The bracketed range narrows and widens — tighter range means higher capital efficiency and fee potential, but requires active rebalancing if the price moves.
But concentrated liquidity introduces active management risk. If the price leaves the LP’s range, their position becomes 100% one asset and stops earning fees. They need to rebalance back to the current range. This turns passive LPs into active market makers who must monitor and adjust positions.
The tradeoff is clear: capital efficiency for active management burden. Most LPs on Uniswap V3 now use automated position managers to handle rebalancing.
The Arb Dependency
Here is the part that matters most for the original question: AMMs do not discover price. They import it.
An AMM formula will quote any price the math produces. If someone trades 500 ETH out of a pool, the formula will happily quote ETH at 100 USDC. Nothing in the formula checks whether that price makes sense relative to other markets.
What keeps AMM prices sane is arbitrage. When the AMM price diverges from the price on Binance, arbitrageurs trade against the pool until they converge. The pool is a price taker. The centralized order books (Binance, Coinbase, Kraken) are the price reference.
Consider a 20 ETH trade on a 100 ETH pool. If the reference price is 2,000 USDC, the AMM might quote 2,100 on the buy side. An arb sees this, buys 20 ETH on Binance at 2,000, sells them into the pool at 2,100, and collects the spread. This brings the pool back toward the reference price.
Without arbs, every AMM pool would drift to a random price determined by the last large trade. The pool would function mechanically but the prices would lose all economic meaning.
This dependence matters for design. AMMs work best where there is a liquid external reference market. They work worst where there is none, which is why new token pools have the widest spreads, the deepest slippage, and the cheapest sandwich attacks.
What This Means for Builders
If you are building on AMMs today, three things matter.
First, concentrated liquidity is not optional for capital efficiency. Full-range positions bleed value for any pool with active trading volume. If your protocol uses AMM-style pools, you should default to concentrated or tick-based designs.
Second, the arb dependency is a feature, not a bug. Design your pools to converge to external reference prices efficiently. Tight fee bands, dynamic fee adjustment based on volatility, and MEV-resistant sequencing all reduce the spread between AMM price and reference price.
Third, the bootstrapping advantage of AMMs is still unmatched. For launching a new token or entering a new chain, there is no faster way to create a two-sided market. Order books remain more capital efficient at scale, but they cannot bootstrap from zero.
Newer designs are experimenting with hybrid models. Hyperliquid runs a perp engine that looks like an order book but settles on an L1. CowSwap uses intent-based matching to find better prices than AMM quotes. These are improvements on specific dimensions, but they do not replace the core AMM property: one person can create a market.
Related
This article builds on earlier work on DEX mechanics and market microstructure.
- Why Large Trades Fail on DEX — How AMM slippage behaves at scale and where the liquidity ceiling is
- How to Build a Bonding Curve on Solana — Building a curve-based market maker from scratch in Anchor
- DEX Market Maker Strategy for Uniswap V3 — How professional LMs optimize concentrated positions
- DEX Liquidity Shock Mean Reversion — Exploiting temporary AMM price dislocations