
An Automated Market Maker (AMM) is a type of decentralized exchange that uses a mathematical formula to price trades instead of an order book. The formula operates on the reserves of a liquidity pool: when you swap one token for another, the pool's reserves shift and the formula automatically computes the new price. No counterparty needs to be found—the pool always quotes.
This mechanism allows AMMs to function continuously and permissionlessly, meaning anyone can create a new trading pair by providing initial liquidity, and any user can trade against the pool without needing approval or registration. The pricing is algorithmic and transparent, embedded in a smart contract that enforces the rules and handles the token transfers automatically.
Uniswap v2 popularized the constant product formula, expressed as x * y = k, where x and y are the reserves of two tokens in the pool, and k is a constant. This formula ensures that the product of the two reserves remains unchanged after a swap, which determines the price based on supply and demand within the pool. It works well for a wide variety of token pairs but can be inefficient for assets that trade very close to each other in value, such as stablecoins or wrapped versions of the same asset.
To address this, Curve introduced a hybrid curve formula optimized for stable assets. This design reduces slippage—the difference between expected and actual trade execution price—on pairs like USDC/USDT or stETH/ETH by keeping prices within a tighter range. This specialization allows for cheaper and more efficient stablecoin swaps, which are common in decentralized finance.
Uniswap v3 further innovated by introducing concentrated liquidity, enabling liquidity providers to allocate their capital within specific price ranges rather than across the entire curve. This approach allows providers to earn higher fees on the same amount of capital by focusing liquidity where most trading occurs, improving capital efficiency and reducing slippage for traders.
AMMs are the dominant mechanism behind DEX volume today. Their simplicity and permissionless nature make them accessible to anyone with a compatible wallet, allowing 24/7 trading without intermediaries or centralized control. This openness has fueled the growth of decentralized finance by enabling seamless token swaps and liquidity provision.
However, AMMs have trade-offs. Liquidity providers face impermanent loss, a risk that occurs when the relative price of pooled tokens changes, potentially reducing returns compared to simply holding the tokens. Traders can be exposed to Miner Extractable Value (MEV), where bots reorder or front-run transactions to profit at the expense of regular users. Additionally, AMMs can struggle with pricing inefficiency on thinly traded or exotic pairs, where the formula may not reflect true market value accurately.
To mitigate these issues, decentralized finance platforms often use aggregators that route trades across multiple AMMs and order books, seeking the best execution price and lowest slippage for users. This hybrid approach leverages the strengths of both algorithmic pricing and traditional market mechanisms.
At the heart of every AMM is a liquidity pool, a smart contract holding reserves of two or more tokens. Liquidity providers deposit equal values of each token into the pool, earning a share of the trading fees generated when others swap tokens through the pool. These pools replace the need for individual buyers and sellers to be matched, creating continuous liquidity.
The pool’s reserves adjust with every trade, and the AMM formula recalculates prices accordingly. For example, if you swap token A for token B, the pool’s token A reserve increases while token B decreases, pushing the price of token B higher relative to token A. This dynamic pricing mechanism incentivizes arbitrageurs to align AMM prices with external markets, maintaining price accuracy over time.
Liquidity pools also enable other decentralized finance activities such as yield farming, where providers earn additional rewards beyond trading fees by staking their liquidity tokens in incentive programs. This creates a complex ecosystem of incentives that drive participation and liquidity depth across protocols.
A common misconception is that AMMs always provide the best prices. While they offer continuous liquidity, prices can deviate from centralized exchanges or other market venues, especially during volatile periods or for low-volume pairs. Traders should be aware of potential slippage and compare rates across platforms when executing large trades.
Another misunderstanding is that AMMs eliminate all counterparty risk. While they remove the need for a direct counterparty, users are still exposed to smart contract risk—the possibility of bugs or exploits in the underlying code. Choosing reputable AMMs with audited contracts is important for security.
Finally, while AMMs simplify trading, they do not replace all market functions. Order books and limit orders still play a crucial role in price discovery and advanced trading strategies on some decentralized and centralized exchanges. Many platforms combine AMM pools with order book models to offer hybrid solutions that balance liquidity and price efficiency.