An automated market maker, or AMM, is a smart contract that holds two tokens in a pool and prices swaps between them by formula: the product of the two reserves stays constant, so each trade moves the price along a curve. There is no order book, no counterparty, and no operator setting quotes — traders swap against the pool's reserves, and liquidity providers, the depositors who own those reserves, earn the fees. The model went from a 2018 experiment to the default venue for on-chain trading, with the largest pools churning billions of dollars in volume daily.
Bitcoin Trader publishes information, not investment advice. Providing liquidity carries market and smart-contract risks, including losses; this is a mechanics explainer.
How does the constant-product formula price trades?
The classic rule is x times y equals k: multiply the two reserves, and keep the product constant as amounts shift. A trader adding token X removes token Y in the quantity that restores the product after fees — a mechanism that makes price rise continuously with purchase size and fall continuously with sale size. The bigger the trade relative to the pool, the worse the effective price: that gap is slippage, and pool depth is what dampens it.
Arbitrage is the missing half that makes a formula into a market. When a pool's price drifts from the wider market, arbitrageurs trade against the drift for profit, pulling the pool back in line. Pool prices track external markets not because the formula knows anything, but because someone is always paid to fix the error — and the cost of that fixing is borne by the pool's owners, a fact formalized as impermanent loss.
What do liquidity providers earn and lose?
Providers deposit both tokens and receive pool tokens representing their share. Every swap pays a fee — commonly 0.01 to 1 percent depending on the pool's design and risk tier — and those fees accrue to the pool pro rata. Income is therefore driven by volume relative to depth, not by price direction.
The loss side is impermanent loss: the gap between holding the deposit versus simply holding the two tokens. Because the formula continuously rebalances the pool toward the cheaper asset, a provider's position ends up with more of whichever token fell. The arithmetic is fixed by the curve: a 25 percent price move between the pair creates roughly 0.6 percent loss versus holding; a doubling creates about 5.7 percent; a quadrupling, about 20 percent. The loss is called impermanent because it shrinks back if prices re-converge — and permanent whenever the provider withdraws while prices differ.
The provider's whole trade-off is therefore fee income versus rebalancing loss. Stablecoin pairs — two assets meant not to diverge — earn modest fees with almost no impermanent loss; correlated but volatile pairs and uncorrelated pairs carry progressively more of it. Pools price this crudely through fee tiers; markets price it continuously through provider inflows and outflows.
What is concentrated liquidity?
The 2021 innovation that superseded uniform distribution. Instead of spreading capital across the entire price curve from zero to infinity, providers in the leading designs allocate it to specific price ranges — effectively minting a custom curve per position. Capital inside an active range works far harder, earning multiples of the fees a full-range position would; ranges that price exits stop earning entirely, and their positions end up entirely in the depreciated asset.
Concentration transformed pool economics and professionalized providing. Active management — re-centering ranges as price moves — is now a strategy in itself, with dedicated operators and analytics; passive full-range positions survive mostly as the simple default. The spectrum is a clean risk dial: the narrower the range, the more the position behaves like a directional bet with fee income, and the wider, the more like the classic diversified pool share.
What are the risks beyond impermanent loss?
Smart-contract risk first: the pool is code holding real assets, and its history includes exploits at the pair-contract, router, and governance layers. Malicious pools second — the rug pull pattern in which a deployer retains the power to drain the pool or mints a token with hidden minting authority; regulator-published fraud lists, including the SEC's investor materials, flag exactly this pattern, and the credible defenses are the boring ones: established pools, audited code, verified contracts, no deployer keys. Decimal-level checks third: fee tiers, quote conventions, and multi-hop routing change realized prices, and a pool's headline fee is not the all-in cost of a route through it.
Oracle integration adds a systemic footnote: many lending protocols price collateral from AMM spot values — the spot that flash-loan capital can move within one block. Pools that serve as price references inherit the adversarial assumption that flash loans created: any on-chain price is a price someone may be attacking.
How do AMMs compare with order-book exchanges?
They trade different efficiencies. Order books need makers and matching engines and concentrate liquidity where participants place it; AMMs need no counterparties at all and concentrate liquidity along a curve. Books execute large trades better in deep markets; pools execute small trades continuously, including for assets no market maker would bother quoting. On-chain, where every operation is a public transaction, the AMM's properties — permissionless listing, composability with lending and staking, always-available liquidity — decided the contest for the default venue, and order-book venues on-chain now mostly serve high-frequency designs built on the same rails.
The unifying summary for a reader: a pool is a vending machine governed by a formula, owned by its depositors, corrected by arbitrageurs, and attacked by anyone who finds the difference between the formula's assumptions and reality. Each role earns what it bears.
How did the design generations of AMMs evolve?
The technology iterated in three recognizable generations. The first — the constant-product pool — spread liquidity uniformly across every price from zero to infinity: simple, always-on, and wasteful of capital, since most of it sat at prices the market would never visit. The second introduced concentrated liquidity: providers chose price ranges, capital efficiency multiplied within those ranges, and providing became an active management problem — ranges to re-center, fees to compound, positions that stop earning when price exits the band.
The third generation is programmability: the pool itself became customizable, with hooks — contract logic that can run at defined points in a swap's lifecycle, implementing dynamic fees, limit-order-like behavior, or custom accounting without deploying a bespoke exchange for each idea. The direction is the familiar one from traditional markets: from instrument to platform. Each generation compounded the last rather than replacing it — full-range positions still exist, ranges still concentrate, hooks now customize — and the practical consequence for providers is a wider menu with sharper edges: every efficiency gain came paired with a new way to be wrong about where price will sit.
For more context, read How Memecoins Launch and Why They Collapse.
For more context, read how defi lending works.
For more context, read smart contract audit explained.




