What Is an Automated Market Maker (AMM)?
An automated market maker (AMM) is a smart contract-based protocol that enables decentralized exchanges (DEXs) to facilitate crypto trading using liquidity pools and mathematical pricing formulas instead of traditional order books. Liquidity providers deposit token pairs into pools, and the AMM algorithmically sets prices based on the ratio of assets in each pool — most commonly using the constant product formula (x × y = k).
- How it works: When a trader swaps one token for another, the smart contract adjusts the pool's token balances and recalculates the price according to the formula — no counterparty or order matching is needed.
- Key benefit: AMMs enable permissionless, 24/7 trading without intermediaries, significantly lowering the liquidity requirements and entry barriers compared to traditional order book exchanges.
- Key risk: Liquidity providers face impermanent loss — a reduction in value that occurs when the price ratio of deposited tokens changes relative to when they were deposited.
Key Takeaways
- The most common AMM pricing model is the constant product formula (x × y = k), but variants like StableSwap and concentrated liquidity are optimized for different trading scenarios.
- Major AMM protocols include Uniswap, Curve, Balancer, PancakeSwap, and Aerodrome — each serving different chains and use cases.
- Besides impermanent loss, AMM users should be aware of slippage on large trades, front-running/MEV attacks, smart contract vulnerabilities, and evolving regulatory requirements.
- AMMs are evolving toward programmable pools (Uniswap V4 hooks), cross-chain swaps, and intent-based trading models.

How Do Automated Market Makers Work?
An automated market maker (AMM) is a protocol used by decentralized exchanges (DEXs) to enable the trading of digital assets without relying on a traditional order book. An order book is the system used by centralized exchanges where market makers post buy and sell orders at various prices, and trades only execute when a buyer's price matches a seller's — requiring a counterparty for every transaction. AMMs replace this entirely with liquidity pools, which are reserves of tokens locked in smart contracts, and mathematical formulas that determine asset prices and execute trades automatically. Anyone can become a liquidity provider by depositing tokens into a pool and earning a share of trading fees, making AMMs a foundational building block of decentralized finance (DeFi).
Today, AMMs underpin the majority of on-chain trading activity across Ethereum, BNB Chain, Solana, Arbitrum, Base, and other major blockchains — enabling permissionless, 24/7 trading without intermediaries, KYC requirements, or custodial risk. The system operates through three core components: liquidity pools, a pricing algorithm, and liquidity providers.
📋 What is an order book? An order book is a list of open buy and sell orders for an asset, organized by price. Centralized exchanges like Coinbase and Binance use order books to match buyers with sellers — a trade only executes when someone's bid price meets someone's ask price. This requires active market makers to post orders and sufficient volume on both sides. AMMs eliminate this requirement entirely by replacing the order book with a liquidity pool and a pricing algorithm.
Liquidity Pools
A liquidity pool is a smart contract that holds reserves of two (or more) tokens in the form of a trading pair — for example, ETH/USDC. These pools are the source of liquidity that traders swap against.
When a user wants to swap ETH for USDC, they interact with the ETH/USDC liquidity pool. The smart contract takes their ETH, adds it to the pool, and sends back the corresponding amount of USDC based on the current price ratio. No counterparty is needed — the pool itself is the other side of the trade.
Liquidity pools are funded by liquidity providers (LPs) — crypto users who deposit equal values of both tokens into the pool. In return, LPs receive LP tokens that represent their proportional share of the pool. When traders execute swaps, they pay a small fee (typically 0.3% on protocols like Uniswap), and these fees are distributed proportionally to all LPs based on their share of the pool.
The Constant Product Formula (x × y = k)
Most AMMs use a mathematical formula to determine how token prices adjust as trades occur. The most widely used formula is the constant product formula, popularized by Uniswap:
x × y = k
Where:
- x = the quantity of Token A in the pool
- y = the quantity of Token B in the pool
- k = a fixed constant (the product of x and y, which must remain the same after every trade)
This formula ensures that the total liquidity in the pool remains balanced. When a trader buys Token A from the pool (removing some of Token A and adding Token B), the supply of Token A decreases and its price increases, while the supply of Token B increases and its price decreases — all governed automatically by the formula.
📋 Why does x × y = k matter? This formula is what makes AMMs self-sustaining without human intervention. It guarantees that a pool can never be fully drained of either token — as one token's supply decreases, its price rises exponentially, making it progressively more expensive to buy. This means any token pair can have a functioning market 24/7, even with no active market makers or order flow.
Example: Suppose a pool contains 100 ETH and 300,000 USDC. The constant k = 100 × 300,000 = 30,000,000. The implied price of ETH is 300,000 / 100 = $3,000. If a trader buys 1 ETH, the pool must rebalance so that x × y still equals 30,000,000. The pool now has 99 ETH, so it needs 30,000,000 / 99 ≈ 303,030 USDC. The trader pays ~3,030 USDC for 1 ETH (slightly above the $3,000 spot price due to price impact). The new implied ETH price is 303,030 / 99 ≈ $3,061.
Some protocols use different formulas optimized for specific use cases. For example, Curve uses a StableSwap invariant that combines elements of the constant product and constant sum formulas to minimize slippage on trades between similarly-priced assets like stablecoins.
How to Swap Tokens on an AMM (Step by Step)
- Set up a Web3 wallet. Download a self-custody wallet like MetaMask, Rabby, or Coinbase Wallet. Fund it with the native token of the blockchain you want to trade on (e.g., ETH for Ethereum, BNB for BNB Chain) to cover gas fees.
- Navigate to a DEX. Go to a DEX that uses an AMM — such as Uniswap, Curve, or PancakeSwap. Make sure you are on the official website (bookmark it to avoid phishing sites).
- Connect your wallet. Click "Connect Wallet" on the DEX interface and approve the connection. Ensure you are on the correct blockchain network.
- Select your tokens and amount. Choose the token you want to sell (input) and the token you want to receive (output). The DEX will display the estimated output amount, price impact, and fees.
- Set slippage tolerance. Most DEXs let you set a maximum slippage tolerance (e.g., 0.5% or 1%). This protects you from receiving significantly less than expected if the price moves during your transaction.
- Review and confirm. Double-check the trade details — output amount, price impact, gas fee — and click "Swap." Confirm the transaction in your wallet.
- The smart contract executes the swap: it pulls the input token from your wallet, adds it to the pool, removes the corresponding output token, and sends it to you. The pool rebalances, the price ratio shifts according to the formula, and the trading fee is retained in the pool for LPs.
The entire process happens on-chain, without intermediaries, and typically settles in seconds.
Want to earn fees instead of paying them? Most DEXs have a "Pool" or "Liquidity" tab where you can deposit token pairs into a pool and start earning a share of trading fees as a liquidity provider. Be aware of impermanent loss risk before providing liquidity — especially for volatile token pairs.
Types of Automated Market Makers
Not all AMMs use the same pricing formula. Over time, several variants have emerged, each optimized for different trading scenarios.
Constant Product Market Maker (CPMM)
The CPMM uses the formula x × y = k and is the most common AMM model. It was introduced by Bancor in 2017 and popularized by Uniswap in 2018. CPMMs work well for trading pairs of volatile, uncorrelated assets (e.g., ETH/USDC, WBTC/ETH).
Strengths: Simple, robust, works for any token pair.
Weakness: Higher slippage on large trades relative to pool size.
Used by: Uniswap (V1 and V2), SushiSwap, PancakeSwap.
Hybrid / StableSwap AMMs
Hybrid AMMs use a modified pricing curve that minimizes slippage when assets are near parity but still prevents the pool from being drained by arbitrageurs when prices diverge.
This model was pioneered by Curve Finance and is optimized for trading between assets that should maintain similar prices — such as stablecoin pairs (USDC/USDT/USDS) or wrapped token pairs (WBTC/renBTC, WETH/ETH).
Strengths: Extremely low slippage for like-asset trades. Reduced impermanent loss risk.
Weakness: Not suitable for volatile, uncorrelated pairs.
Used by: Curve Finance, Ellipsis Finance.
Concentrated Liquidity AMMs
Concentrated liquidity is an evolution of the CPMM model, introduced by Uniswap V3 in 2021. Instead of spreading liquidity evenly across all possible prices (from 0 to infinity), LPs can choose a specific price range in which to provide liquidity. This dramatically improves capital efficiency — LPs can earn higher fees with less capital deployed.
For example, an LP providing liquidity to an ETH/USDC pool might choose to concentrate their capital in the $2,500–$3,500 range, where most trading activity occurs. If the price stays within that range, they earn significantly more fees than they would in a standard CPMM pool.
Strengths: Much higher capital efficiency. Higher fee earnings for active LPs.
Weakness: Requires active management. If the price moves outside the LP's chosen range, they earn zero fees and face impermanent loss.
Used by: Uniswap V3 and V4, PancakeSwap V3, Aerodrome (Base).
Benefits of Automated Market Makers
Permissionless, 24/7 Trading
AMMs operate entirely on-chain through smart contracts. There are no opening hours, no downtime, and no gatekeepers. Anyone with a Web3 wallet and an internet connection can trade at any time.
Lower Liquidity Requirements
The AMM model can support smooth trading with far less liquidity than a traditional order book system. This is critical for the crypto market, where many tokens have limited liquidity. You can track real-time liquidity and trading data across AMM pools using GeckoTerminal.
Decentralization and Self-Custody
AMMs eliminate the need for intermediaries and third-party custodians. Users retain full control of their assets until the moment a trade is executed. There is no counterparty risk from exchange insolvency — a key concern after several high-profile CEX failures.
Low Entry Barrier for Liquidity Providers
On centralized exchanges, market making is typically limited to institutional firms with significant capital. AMMs allow anyone — regardless of capital size — to become a liquidity provider and earn a share of trading fees. This opened up a new category of passive income strategies in crypto, including yield farming.
Transparent, On-Chain Pricing
All trades, pool balances, and fee distributions are recorded on-chain and publicly verifiable. There is no hidden order flow and no opaque pricing. Anyone can audit pool state in real time through a blockchain explorer or tools like GeckoTerminal.
Risks and Limitations of AMMs
Impermanent Loss
📋 Impermanent loss in brief: When you deposit tokens into an AMM pool and the price of one token changes relative to the other, your position ends up worth less than if you had simply held both tokens in your wallet. The loss is "impermanent" because it reverses if prices return to their original ratio — but it becomes permanent if you withdraw while prices are divergent.
Impermanent loss is the most significant risk facing liquidity providers. It occurs when the price ratio of the tokens in a pool changes after an LP has deposited. The greater the price divergence, the larger the impermanent loss.
For example, if an LP deposits equal values of ETH and USDC into a pool, and the price of ETH doubles, the LP's position will be worth less than if they had simply held the two tokens in their wallet. This is because the AMM algorithm automatically rebalances the pool — selling ETH as its price rises and buying ETH as its price falls — resulting in the LP holding less of the appreciating asset.
The loss is called "impermanent" because it can be recovered if the token prices return to their original ratio. However, if the LP withdraws while the prices are divergent, the loss becomes permanent.
You can estimate impermanent loss using the CoinGecko Impermanent Loss Calculator.
Slippage
Slippage is the difference between the expected price of a trade and the actual execution price. In AMMs, slippage occurs because every trade changes the ratio of tokens in the pool, which shifts the price.
Large trades relative to pool size cause higher slippage. For example, swapping $1,000 in a pool with $10 million of total liquidity will cause negligible slippage, but swapping $500,000 in the same pool will move the price significantly.
Slippage can be mitigated by trading on pools with deeper liquidity, using DEX aggregators that split orders across multiple pools, or by trading on specialized AMMs like Curve (for stablecoin swaps).
Smart Contract Risk
AMMs are powered by smart contracts, which are code deployed on a blockchain. If a smart contract contains a bug or vulnerability, it can be exploited by attackers to drain funds from liquidity pools. While leading protocols like Uniswap and Curve have undergone extensive audits and have been battle-tested over years, smart contract risk can never be fully eliminated. Users should consider using protocols with strong audit histories, active bug bounty programs, and significant track records.
Front-Running and MEV
Front-running occurs when a bot detects a pending trade in the mempool (the queue of unconfirmed transactions) and submits its own transaction ahead of it to profit from the price movement the original trade will cause. This is a subset of Maximal Extractable Value (MEV) — the profit that block producers or searchers can extract by reordering, inserting, or censoring transactions within a block.
In AMMs, the most common form of MEV is the "sandwich attack": a bot places a buy order just before a user's large swap (pushing the price up), then sells immediately after the user's trade executes at the inflated price. The bot profits from the spread, and the user receives worse execution than expected.
Several mitigation strategies are emerging: private transaction pools (like Flashbots Protect) that hide pending transactions from the public mempool, MEV-aware DEX routers that minimize extractable value, and Uniswap V4's hooks system which can embed MEV-resistant logic directly into pool contracts.
Regulatory Uncertainty
The regulatory landscape for DeFi and AMMs varies by jurisdiction and continues to evolve. Some regulators are exploring whether AMM liquidity providers could be classified as financial intermediaries, and whether DEXs should implement compliance measures such as KYC. Users should stay informed about the regulatory environment in their jurisdiction, as future regulation could affect how AMMs operate or who can access them.
Popular AMM Protocols
The AMM landscape has matured significantly. Here are the leading protocols by usage and total value locked (TVL). You can compare all decentralized exchanges by volume on CoinGecko.
Uniswap
Uniswap is the largest decentralized exchange by trading volume and the protocol that popularized the AMM model. Launched on Ethereum in 2018, Uniswap has processed over 900 million swaps and surpassed $1 trillion in annual trading volume. It is deployed across Ethereum, Arbitrum, Optimism, Polygon, Base, and BNB Chain.
Uniswap V3 (2021) introduced concentrated liquidity, allowing LPs to allocate capital within specific price ranges for greater efficiency. Uniswap V4 introduced "hooks" — programmable smart contract extensions that let developers customize pool behavior with dynamic fees, on-chain limit orders, and other advanced trading logic.
Curve Finance
Curve is an AMM optimized for trading between assets that maintain similar prices — primarily stablecoins (USDC, USDT, USDS) and wrapped tokens (WBTC, stETH). Its StableSwap invariant enables extremely low slippage on these trades, making it a backbone of DeFi liquidity infrastructure. Curve also launched crvUSD, its own overcollateralized stablecoin, and uses a veCRV governance model that incentivizes long-term participation.
Balancer
Balancer extends the AMM model with support for multi-asset pools containing up to eight different tokens in custom weightings (e.g., 80/20 instead of the standard 50/50). This allows pools to function as self-rebalancing index funds. Balancer also supports dynamic trading fees set by pool creators, encouraging competition between pools.
PancakeSwap
PancakeSwap is the largest AMM on BNB Chain and one of the most popular DEXs by user count. It offers standard AMM swaps, concentrated liquidity (V3), yield farming, lottery, and NFT features. Its lower gas fees (compared to Ethereum mainnet) make it accessible to users with smaller capital.
Aerodrome
Aerodrome is the dominant DEX on Base (Coinbase's Layer 2 network). Built as a fork of Velodrome on Optimism, Aerodrome uses a ve(3,3) tokenomics model that incentivizes deep liquidity through its AERO governance token. It supports both volatile and stable trading pairs with concentrated liquidity positions.
AMMs vs. Order Book Exchanges
The key architectural difference between AMMs and order book exchanges is how they source liquidity and discover prices. An order book lists individual buy and sell orders posted by traders and market makers, matching them when prices align. An AMM replaces this with a liquidity pool and an algorithm. Here is how the two models compare across major dimensions:
| Feature | Automated Market Maker (AMM) | Order Book Exchange |
|---|---|---|
| Price discovery | Algorithmic — set by pool ratio and formula | Market-driven — set by buy/sell orders |
| Liquidity source | Liquidity pools funded by LPs | Market makers and individual traders |
| Counterparty | Smart contract (the pool) | Another trader |
| Custody | Non-custodial — user retains control | Custodial (CEX) or non-custodial (on-chain order book) |
| Accessibility | Permissionless — anyone can trade or provide liquidity | May require KYC/account on centralized platforms |
| Trading hours | 24/7, no downtime | 24/7 for crypto; limited hours for traditional markets |
| Slippage on large trades | Higher (depends on pool depth) | Lower (if order book has deep liquidity) |
| Best suited for | Long-tail tokens, DeFi-native trading, smaller trade sizes | High-frequency trading, large institutional orders |
The Future of Automated Market Makers
AMMs continue to evolve rapidly. Several trends are shaping the next generation of AMM design:
Concentrated liquidity and active LP management. Following the introduction of concentrated liquidity in Uniswap V3, the trend is toward more capital-efficient LP positions. Protocols and third-party vaults are developing automated position management tools that rebalance LP ranges dynamically, reducing the need for manual intervention.
Programmable pools (hooks and plugins). Uniswap V4's hooks system allows developers to attach custom logic to liquidity pools — enabling features like dynamic fee structures that adjust based on volatility, on-chain limit orders, and MEV-resistant trade execution. This transforms AMMs from static infrastructure into programmable financial building blocks.
Cross-chain AMMs. Protocols like THORChain already enable native cross-chain swaps without wrapped tokens or bridges. As multichain DeFi matures, cross-chain AMM liquidity is expected to deepen, allowing users to swap assets across blockchains seamlessly.
Intent-based trading and AMM hybrids. A newer trend involves combining AMM liquidity with off-chain intent systems and request-for-quote (RFQ) models. In these systems, a user expresses a trading "intent" (e.g., "I want to swap 10 ETH for USDC at the best price"), and solvers compete to fill the order — often routing through AMM pools, private market makers, or a combination. This hybrid approach aims to reduce slippage and MEV extraction while still leveraging on-chain AMM liquidity as a backstop.
Institutional adoption. As regulatory frameworks for DeFi become clearer, institutional participants are increasingly using AMMs — both as traders and as liquidity providers. Permissioned pools (with KYC-gated access) and compliant DeFi wrappers are emerging to accommodate this demand.
Frequently Asked Questions
What is the difference between an AMM and a DEX?
A DEX (decentralized exchange) is a platform for trading digital assets without an intermediary. An AMM is the pricing and liquidity mechanism that many DEXs use under the hood. Not all DEXs use AMMs — some use on-chain order books (e.g., dYdX) or request-for-quote systems — but AMMs are the most common DEX model.
Can you lose money using an AMM?
Yes. Liquidity providers can experience impermanent loss if the price of deposited tokens diverges. Traders can lose value through slippage on large trades. And all users face smart contract risk — the possibility that a bug in the protocol's code could be exploited.
What is impermanent loss?
Impermanent loss is the reduction in value that liquidity providers experience when the price ratio of their deposited tokens changes. It is called "impermanent" because the loss is only realized when the LP withdraws from the pool. If the prices return to their original ratio, the loss disappears. You can estimate impermanent loss using the CoinGecko Impermanent Loss Calculator.
Which is the most popular AMM?
Uniswap is the largest AMM by trading volume and is deployed across multiple blockchains including Ethereum, Arbitrum, Base, and Polygon. Other major AMMs include Curve (optimized for stablecoin swaps), PancakeSwap (dominant on BNB Chain), and Aerodrome (leading DEX on Base).
Are AMMs safe?
AMMs built on well-audited, battle-tested protocols like Uniswap and Curve have strong security track records. However, no smart contract is completely risk-free. Users should trade on established protocols, check audit reports, and never invest more than they can afford to lose.
Do AMMs only work on Ethereum?
No. AMMs operate on virtually every major blockchain, including BNB Chain, Solana, Polygon, Arbitrum, Optimism, Base, and Avalanche. Many leading AMM protocols are deployed across multiple chains simultaneously.
Subscribe to the CoinGecko Daily Newsletter!
Ethereum Mainnet
Base Mainnet
BNB Smart Chain
Arbitrum
Avalanche
Fantom
Flare
Gnosis
Linea
Optimism
Polygon
Polygon zkEVM
Scroll
Stellar
Story
Syscoin
Telos
X Layer
Xai