Skip to content
Technical Concepts

AMM

Automated Market Maker

Decentralized exchange using mathematical formulas for pricing instead of order books

Definition

An automated market maker prices trades with a formula applied to pooled reserves instead of matching buyers with sellers. Uniswap v2's constant product x*y=k is the base case: it will quote any size at any price from zero to infinity, which makes it robust and capital-inefficient at the same time. Curve's stableswap flattens the curve near the peg so that correlated assets trade with almost no price impact until reserves get lopsided. Uniswap v3's concentrated liquidity lets each provider pick a price range and concentrates capital there. Balancer generalises to weighted baskets of several assets, and Maverick moves a liquidity range automatically as the price travels. In every design the liquidity provider is a passive counterparty who is systematically selling whichever asset is going up, and arbitrageurs, not fees, set the pool's price.

An AMM is a pool of two or more assets with a formula that quotes a price from the current balances. You trade against the formula instead of against another person.

Example

A pool with 100 ETH and 300,000 USDC has k = 30,000,000 and a spot price of $3,000. Buy 5 ETH: reserves become 95 ETH and 30,000,000 / 95 = 315,789 USDC, so you pay 15,789 USDC, an average of $3,158 per ETH, roughly 5.2% worse than spot. The same notional swapped between stETH and ETH on Curve costs a small fraction of that, because stableswap keeps the curve almost flat while the two assets stay near parity. That is the entire argument for using the right curve for the pair: identical capital, wildly different execution.

1

How it works

Reserves plus a curve define the price. Your trade shifts the reserves and therefore the price, which is your price impact. When the pool's price drifts from the market, arbitrageurs correct it and keep the difference.

2

Why it matters

It is the settlement layer for almost all on-chain trading, and its mechanics explain both why long-tail tokens can have markets at all and why passive liquidity providers so often underperform simply holding.

3

What to check

Match the curve to the pair, compare pool depth with your trade size, and for liquidity provision compare realised fees with divergence between the two assets rather than looking at APR alone.

Risks to Consider

  • Impermanent loss and loss-versus-rebalancing: LPs are structurally on the wrong side of every informed trade and are paid in fees for the privilege
  • Predictable pricing makes AMM trades sandwichable, so retail orders are routinely front-run and back-run in the same block
  • During a depeg, an AMM pool mechanically absorbs the failing asset and hands LPs a bag of it
  • Concentrated liquidity positions stop earning entirely once price leaves the chosen range, and end up fully converted into the weaker asset

Common Questions

How can an AMM price an asset with no order book?

It does not discover the price, it derives it from reserves. The formula defines a ratio at every point on the curve, and the pool's quoted price is simply the current ratio. When the outside market moves, the pool is temporarily mispriced, and arbitrageurs trade against it until the curve's price matches the market again. That arbitrage is the price discovery mechanism, and the LPs pay for it.

Why do liquidity providers lose to arbitrageurs?

Because the pool always quotes a stale price. When ETH rises on a centralised exchange, the pool is still selling ETH at yesterday's price until someone arbitrages it, and that someone captures the difference from the pool. The academic name is loss-versus-rebalancing, and unlike impermanent loss it does not reverse if the price comes back. Fees have to out-earn it for liquidity provision to be profitable at all.

Which curve should a pair use?

Constant product for uncorrelated pairs such as ETH/USDC, where the price can go anywhere and you want the pool to keep quoting. Stableswap for assets meant to trade at a fixed ratio, such as stablecoin pairs or an LST against its underlying. Concentrated liquidity when the provider is willing to actively manage a range in exchange for far higher fee capture per dollar. Using constant product for a pegged pair wastes most of the capital on prices that will never trade.