Keyboard shortcuts

BTC79,450-1.68%ETH2,258.36-2.16%SOL90.81-4.29%BNB671.66-1.34%XRP1.43-1.79%ADA0.2640-3.52%DOGE0.1131-0.64%AVAX9.68-3.95%LINK10.20-4.14%DOT1.32-5.85%BTC79,450-1.68%ETH2,258.36-2.16%SOL90.81-4.29%BNB671.66-1.34%XRP1.43-1.79%ADA0.2640-3.52%DOGE0.1131-0.64%AVAX9.68-3.95%LINK10.20-4.14%DOT1.32-5.85%
IntermediateCrypto 101

What is an AMM?

An automated market maker is a smart contract that quotes prices from a formula against a pool of tokens, replacing the traditional order book.

Last updated Nov 1, 2025, 12:00 PM UTC

An automated market maker is a smart contract that quotes a price for a trade by plugging the pool's current balances into a mathematical formula. Instead of matching buyers and sellers on an order book, an AMM lets anyone trade at the price implied by the pool's current state. The design is simple enough to fit on a single screen of Solidity and powerful enough to have replaced most on-chain order books entirely.

Constant-product: the original

The breakthrough design, pioneered by Uniswap v1 in 2018 and refined in v2, is the constant-product formula: x times y equals k. A pool holds two tokens in amounts x and y, and the product of those amounts must stay constant across trades (ignoring fees). If someone buys token X from the pool, x decreases and y has to increase to keep the product constant — which means the trader has to deposit more Y than a linear pricing rule would suggest, especially as the trade grows.

The result is a smooth curve. Small trades near the current price pay nearly the spot rate. Large trades move the pool's price as they execute, paying progressively worse rates. This is built-in slippage — a feature, not a bug. It is what lets the pool quote a price without any outside oracle, and what keeps deep pools hard to manipulate.

The fee — 0.3 percent on classic Uniswap v2 pools — is added on top. The pool skims a small amount from each trade and pays it pro rata to the liquidity providers who deposited the tokens. That yield is the compensation for bearing impermanent loss, which the dedicated explainer covers.

Concentrated liquidity

Uniswap v3 (2021) added concentrated liquidity. Instead of spreading their capital across the entire price curve from zero to infinity, LPs can choose a price range to provide in. Inside the range, they earn fees as if they had much more capital. Outside the range, their capital sits idle.

The result is dramatically better capital efficiency for stable and correlated pairs (USDC/USDT, stETH/ETH) where most trading happens in a tight band. A v3 position providing ETH/USDC liquidity between 3,000 and 4,000 dollars earns fees at the rate of a much larger v2 position — so long as ETH stays in that range. If it leaves, the position becomes 100 percent of one side of the pair.

The tradeoff is complexity. v3 LPs have to actively manage ranges or delegate management to vaults like Gamma, Arrakis, or Merkl. "Just providing liquidity" is no longer a passive strategy.

StableSwap and other curves

Curve Finance introduced a different curve, tuned for assets that are supposed to trade at parity — USDC/USDT/DAI, stETH/ETH, WBTC/BTC. The Curve formula blends a constant-sum curve (efficient near parity) with a constant-product curve (robust at extremes), giving extremely tight pricing when the peg holds and graceful failure when it does not.

Balancer generalized the pattern to pools of multiple tokens with arbitrary weights (for example, a 60/30/10 pool of ETH, BTC, USDC). Maverick and Trader Joe added dynamic liquidity shapes. Each variation trades capital efficiency against complexity and against how gracefully the pool handles large moves.

The oracle problem and manipulation

AMM prices are derived from pool balances, which means the price is whatever the pool's current state says it is. For a deep, actively traded pool, that is a reasonable reflection of the market. For a thin pool, an attacker can temporarily push the price far from fair by executing a large trade, trigger a dependent contract (a liquidation, a lending borrow), and unwind the position in the same block.

This is the flash-loan-oracle-manipulation pattern that has drained hundreds of millions across several DeFi exploits. The mitigation is to use time-weighted average prices (TWAPs) rather than spot prices for critical decisions, or to rely on external oracles (Chainlink, Pyth) that aggregate from many venues. See the flash-loan explainer.

The LP side of the trade

Being a liquidity provider in an AMM is not a free yield. Every trade is the pool selling you whichever token is becoming relatively cheap. Over time, if the two tokens in the pool diverge in price, the LP ends up with more of the losing asset and less of the winner — a phenomenon called impermanent loss (see that explainer). Fees compensate for this risk, and often do. But LP returns are path-dependent, and the right mental model is not "staking yield" but "selling volatility."

Why it matters

AMMs are one of the cleanest demonstrations of what smart contracts enable: markets that run without operators, settle without custodians, and price-discover without matching engines. Uniswap alone has settled trillions of dollars of trading volume with no central counterparty. The design is not strictly better than an order book — it trades off execution quality for permissionlessness and composability — but it made on-chain markets practical, and every major DeFi category has been built on top of it.

Related terms

More explainers