What Is an Automated Market Maker? How AMMs Power DeFi Trading
Before 2018, if you wanted to trade crypto without a centralized exchange, your options were grim. Peer-to-peer forums, sketchy escrow services, or early DEX experiments where an order could sit for hours without filling. Then Uniswap showed up with an idea so simple it sounded stupid: instead of matching buyers with sellers, just let people trade against a pool of tokens. A smart contract holds the tokens. A math formula sets the price. No order book, no matching engine, no company in the middle. When I first heard about it I thought it was a toy. Then the toy processed $1 trillion in annual trading volume by 2021 and rewrote how decentralized markets work.
Automated market makers are now the backbone of decentralized finance. Every time you swap tokens on Uniswap, Curve, PancakeSwap, or Balancer, you're interacting with an AMM. Every time someone earns yield as a liquidity provider, they're participating in an AMM pool. The concept sounds technical but the core idea is something I can explain at a dinner table, and I've done it enough times that the explanation has gotten pretty tight.
How an automated market maker actually works
Forget everything you know about order books. An AMM throws that model out entirely.
On a centralized exchange like Binance, you place a buy order at $2,000 for 1 ETH. Somebody else places a sell order at $2,000. The exchange matches the two orders. Done. The exchange runs an order book that lists every open bid and ask. Market makers (usually firms or bots) post both buy and sell orders to keep the book liquid.
An AMM replaces all of that with a pool and a formula.
Here's the setup. Two tokens go into a smart contract. Let's say 10 ETH and 20,000 USDC. That's the liquidity pool. Anyone can deposit tokens into it (these people are called liquidity providers, or LPs) and anyone can trade against it.
The price isn't set by a human. It's set by math. The constant product formula x * y = k is how most AMMs work. In our pool, x is 10 ETH, y is 20,000 USDC, and k equals 200,000. That constant k never changes (within a single swap). When you buy 1 ETH from the pool, you're removing ETH and adding USDC. The pool needs to maintain k = 200,000, so the new ratio becomes 9 ETH and 22,222 USDC. You paid 2,222 USDC for that 1 ETH, not the "implied" price of 2,000. That extra $222 is slippage, the cost of your trade shifting the pool's balance.
The bigger the pool relative to your trade, the less price impact and slippage you get. A $1,000 swap in a $100 million pool barely moves the needle. The same swap in a $50,000 pool hits you with several percent. This is why deep liquidity matters and why protocols fight so hard to attract LPs.
After every trade, arbitrageurs check whether the pool's price still matches the broader market. If ETH is $2,000 on Binance but the AMM shows $2,100, someone buys cheap ETH on Binance and sells into the pool until prices converge. This happens within seconds, 24/7, run by MEV bots and arbitrage firms competing for fractions of a cent in profit.
The AMM itself has no idea what the "real" price of ETH is. It doesn't query Coinbase. It doesn't read a price feed (unless the protocol specifically integrates one like Chainlink). It relies entirely on profit-seeking bots to drag its price in line with reality. That sounds fragile and in some ways it is. During flash crashes or extreme volatility, AMM prices can lag the market by meaningful amounts, and LPs eat the loss when arbitrageurs exploit that gap. This specific inefficiency is called LVR (loss versus rebalancing), and it's become a major area of academic and practical research in DeFi over the past two years.

The different types of AMMs and their formulas
Not every AMM uses x * y = k. Different formulas serve different purposes, and understanding the differences matters if you're going to provide liquidity or trade in size.
Constant product market maker (CPMM). x * y = k. This is Uniswap's model and still the most widely used. It works for any pair of tokens and always has liquidity available at some price. The downside: it spreads liquidity across the entire price curve from zero to infinity, which is capital inefficient. Most of that liquidity sits in price ranges that will never be touched.
Constant sum market maker (CSMM). x + y = k. A straight line instead of a curve. Zero slippage, which sounds great until you realize a single large trade can drain one side of the pool entirely. In practice, CSMMs break because arbitrageurs will empty one token completely. Almost nobody uses this in production.
StableSwap (Curve's hybrid). Combines constant product and constant sum. Near the equilibrium price (where both tokens are close to their peg), it behaves like a constant sum with minimal slippage. Away from equilibrium, it switches to constant product behavior to avoid draining. This makes it perfect for stablecoin pairs like USDC/USDT or USDC/DAI where both tokens should trade near $1. Curve Finance built an empire on this formula. At its peak the protocol held over $20 billion in TVL and processed billions in stablecoin trades with near-zero slippage. Even now, Curve remains the default for anyone swapping between stablecoins in size.
Weighted pools (Balancer). Instead of a 50/50 token split, Balancer lets you create pools with up to eight tokens in any ratio. 80% ETH / 20% USDC, or 33/33/34 across three different tokens. The generalized formula uses geometric means. This allows index-fund-like products where the pool itself acts as a self-rebalancing portfolio. Traders who swap tokens in the pool are actually rebalancing it, and the pool charges them fees for the privilege. Balancer's pitch: "Instead of paying fund managers to rebalance your portfolio, you collect fees from traders who rebalance it for you."
Concentrated liquidity (Uniswap v3/v4). This is where the AMM model got genuinely clever. Technically still CPMM but with a twist that changed the economics. Instead of spreading your liquidity across every possible price from zero to infinity, LPs pick a specific range. If ETH is at $2,000, you might concentrate between $1,800 and $2,200. Within that band, your capital works 4,000x harder than it would in a v2 pool (Uniswap's own claim). Outside the range, your position goes dormant and earns nothing.
The tradeoff is active management. If price drifts outside your range, you're earning zero fees while still exposed to impermanent loss. Professional LPs use scripts and bots to adjust ranges. Casual LPs tend to set and forget, which defeats the purpose.
Uniswap v3 launched in 2021 and v4 followed in January 2025. V4 added "hooks," which are plugins that let developers customize pool behavior. Dynamic fees that adjust with volatility. On-chain limit orders. Custom oracle integrations. The idea is to make each pool programmable rather than one-size-fits-all.
| AMM type | Formula | Best for | Used by |
|---|---|---|---|
| Constant product (CPMM) | x * y = k | General token pairs | Uniswap v2, SushiSwap |
| Constant sum (CSMM) | x + y = k | Theory only | Almost nobody (breaks easily) |
| StableSwap (hybrid) | CPMM + CSMM | Stablecoin pairs | Curve Finance |
| Weighted pools | Geometric mean | Multi-asset baskets | Balancer |
| Concentrated liquidity | Range-bound CPMM | High-volume pairs | Uniswap v3/v4 |
Why AMMs matter: the problem they solved
Before AMMs, decentralized exchanges tried to copy the order book model from centralized exchanges and run it on chain. It was painfully slow. Every order placement and cancellation was a blockchain transaction that cost gas and took seconds to confirm. Market makers couldn't update quotes fast enough. The user experience was terrible compared to Binance or Coinbase.
AMMs bypassed the whole problem by eliminating the order book. No orders to post, cancel, or match. Just liquidity pools sitting there, always available, always priced by math. Greater capital efficiency came later with concentrated liquidity. A swap on Uniswap takes one transaction. You send tokens to the pool contract and get tokens back. The trade is atomic: it either fully executes or doesn't happen at all.
This opened crypto trading to a completely different set of participants. Before AMMs, providing liquidity meant running sophisticated market making bots. After AMMs, providing liquidity meant depositing two tokens into a smart contract. A college student with $500 in ETH and USDC could become a liquidity provider alongside hedge funds managing hundreds of millions. Same pool, same fee share, same rules. No application form, no minimum balance, no accredited investor check. That kind of open access simply didn't exist in finance before AMMs. The DeFi user base grew from 189 wallets in 2017 to over 6.6 million by 2023. Annual DeFi trading hit $1 trillion in 2021. AMMs were the plumbing that made all of this possible.
The numbers today back this up. Uniswap holds roughly $5 billion in TVL and handles 35% of all DEX volume. It has processed over $3.45 trillion in cumulative trades. DEX spot volume hit 24% of total crypto spot trading in June 2025. Five years earlier it was 1%. PancakeSwap dominates on BNB Chain. Curve still owns stablecoin swaps. Balancer has its niche in weighted pools and index products. Newer entrants like Aerodrome on Base and Orca on Solana are growing fast by optimizing for their specific chains.
AMMs haven't killed centralized exchanges. They probably never will. CEXs still handle 76% of spot volume because they offer fiat ramps, margin trading, and customer support that AMMs can't match. But AMMs carved out a permanent and growing share of the market by solving a problem that centralized exchanges can't: fully permissionless, non-custodial, always-on trading without anyone's permission.

Impermanent loss: the risk every LP should understand
If you deposit tokens into an AMM pool, you will eventually hear the phrase "impermanent loss" and you need to understand it before you lose money to it.
Here's the simplest version. You deposit 1 ETH ($2,000) and 2,000 USDC into a pool. ETH doubles to $4,000. If you'd just held your tokens in a wallet, you'd have $6,000 (1 ETH at $4,000 + 2,000 USDC). But the AMM rebalanced your position as the price moved. When you withdraw, the pool gives you back 0.707 ETH and 2,828 USDC, worth about $5,656. You're $344 short compared to just holding. That $344 is impermanent loss.
It's called "impermanent" because if ETH drops back to $2,000, the loss goes away. But in crypto, "temporary" price moves often become permanent, and the loss goes from impermanent to very permanent.
Research from Topaz Blue and Bancor found that 49.5% of Uniswap v3 LPs had negative returns after accounting for impermanent loss. A BIS working paper found that 65-85% of DEX liquidity comes from professional participants who use hedging strategies to manage this risk. The casual LP who deposits and walks away for three months is often the one subsidizing the professionals.
Does this mean you shouldn't be an LP? Not necessarily. Stablecoin pairs have minimal impermanent loss because both tokens hover near $1. High-volume pools generate enough fees to offset the loss for many LPs. Uniswap v4 pools averaged 56% APY across tracked pools in 2025, though that number is skewed by a few outlier pairs.
The point is: do the math for your specific pool, your specific pair, and your expected holding period before depositing. Back-test using tools like Revert Finance or DefiLab. Check if the pool's historical fee yield covers the impermanent loss for that pair's volatility. "Just depositing" without doing this homework is the single most reliable way to lose money in DeFi and then blame the protocol for it.