AMM (Automated Market Maker)
A type of decentralized exchange that uses a mathematical formula and a liquidity pool to set asset prices, instead of an order book. Uniswap’s constant-product formula (x·y=k) is the canonical example.
How a constant-product AMM works
The most common AMM design, popularized by Uniswap, uses the formula x · y = k. The pool holds two assets — say ETH and USDC. Multiply their quantities together, you get a constant k that the pool maintains across every trade.
Suppose a pool holds 100 ETH and 200,000 USDC, so k = 20,000,000. A trader wants to buy 1 ETH. After the trade, the pool will have 99 ETH and X USDC, where 99 · X = 20,000,000, so X = 202,020. The trader paid 2,020 USDC for 1 ETH — implying a price of 2,020 USDC/ETH. The price wasn't picked by the AMM; it fell out of the math.
The deeper the liquidity pool, the less each trade moves the price. Trade enough size relative to the pool and price impact becomes significant, which is the source of slippage.
Why AMMs matter
Before AMMs, on-chain trading required matching orders on an order book — which is hard to scale on a slow, expensive blockchain like early Ethereum. AMMs sidestepped the problem entirely: anyone could deposit liquidity, anyone could trade against it, and prices set themselves through arithmetic. The first viable AMMs (Bancor in 2017, Uniswap V1 in 2018) opened the door to permissionless token listings — anyone could create a pool for any token pair without asking a centralized exchange to list it.
Today, AMMs handle the bulk of DEX volume across every major chain.
Variations
Different AMM designs target different use cases:
- Constant-product (Uniswap V2) — works for any pair, but spreads liquidity across an infinite price range, leaving most of it idle.
- Concentrated liquidity (Uniswap V3, V4) — LPs choose specific price ranges to provide liquidity in. Capital-efficient but adds complexity and exposure to impermanent loss.
- Stable-asset AMMs (Curve) — designed for assets that should trade near 1:1 (USDC/USDT, stETH/ETH). Use a curve that's flat near the peg and only steepens at extremes.
- Weighted pools (Balancer) — multi-token pools with custom weights, useful for index-fund-like exposure.
Costs and risks for liquidity providers
Providing liquidity to an AMM earns fees — typically 0.05% to 1% of trading volume, paid by the trader and split among LPs in proportion to their share of the pool. The cost is impermanent loss: if the relative prices of the pooled assets diverge significantly, the LP ends up with more of the underperforming asset and less of the outperforming one than if they had simply held both. Over long horizons in volatile pairs, impermanent loss often eats more than fees.
MEV and AMMs
Public AMMs are unusually exposed to MEV. Bots watch the mempool for swaps, place buy orders ahead of large trades, and sell into them after — a sandwich attack. Mitigations include slippage protection in the user's own transaction, private order flow (Flashbots Protect), and intent-based architectures where solvers compete to fill the swap optimally.