An automated market maker (AMM) is a smart-contract-based system that lets users trade crypto through liquidity pools instead of a traditional order book. Rather than matching buyers and sellers, an AMM uses a mathematical pricing formula to determine the exchange rate and execute trades automatically.
AMMs are the foundation of many decentralized exchanges (DEXs), including Uniswap, Curve and Balancer. They also allow users to become liquidity providers and earn a share of trading fees. However, providing liquidity carries risks, such as impermanent loss and smart-contract vulnerabilities.
Understand automated market makers in 30 seconds
| Feature | How AMMs work |
|---|---|
| Trading | Users trade against liquidity pools rather than matching with another buyer or seller |
| Pricing | A mathematical formula determines the price based on available liquidity |
| Liquidity | Users deposit crypto into pools to facilitate trades |
| Liquidity providers (LPs) | LPs can earn a share of trading fees and, in some cases, additional incentives |
| Custody | Funds interact with smart contracts rather than being held by a centralized exchange |
| Availability | AMM-based decentralized exchanges can operate 24/7 |
| Key risks | Impermanent loss, price impact, slippage, smart-contract vulnerabilities and MEV (maximal extractable value) |
How do automated market makers work?
AMMs replace the traditional order book used by centralized exchanges with liquidity pools. Instead of matching a buyer with a seller, an AMM allows traders to swap assets directly against the assets held in a pool.
For example, an AMM might have a liquidity pool containing ether (ETH) and USD coin (USDC). A trader who wants to exchange USDC for ETH can trade against that pool without another user needing to sell ETH at the same time.
The process generally works like this:
- Liquidity providers deposit assets into a pool. Users supply pairs or groups of crypto assets to a smart contract, providing the liquidity that traders can use.
- A trader submits a swap. The trader specifies which asset they want to exchange and how much they want to receive or sell.
- The AMM determines the exchange rate. A mathematical formula calculates the price based on the assets currently available in the pool.
- The pool’s asset balance changes. The trader receives one asset and adds the other, changing the ratio of assets in the pool.
- The liquidity providers earn fees. A portion of the trading fees generated by swaps may be distributed to the users who supplied liquidity.
What is a liquidity pool?
A liquidity pool is a smart contract that holds two or more crypto assets for traders to swap. For example, an ETH/USDC pool might contain both ETH and USDC. When someone wants to buy ETH with USDC, they trade directly with the pool rather than waiting for another trader to sell ETH.
The users who deposit assets into these pools are called liquidity providers (LPs). In return for supplying liquidity, LPs can earn a share of the trading fees generated by the pool.
How do AMMs determine prices?
AMMs use mathematical formulas to determine the price of one asset relative to another. The most common model is the constant product formula, used by early versions of Uniswap:
x × y = k
In this formula, x and y represent the quantities of the two assets in a liquidity pool, while k is a constant. When a trader removes one asset from the pool, they add the other, changing the ratio between the two assets and therefore the price.
For example, suppose an ETH/USDC pool contains 10 ETH and 20,000 USDC. The constant product is:
10 × 20,000 = 200,000
If a trader buys ETH with USDC, the pool contains less ETH and more USDC after the trade. To maintain the constant product, the amount of USDC required to buy additional ETH increases. This means larger trades can have a greater impact on the price, particularly in pools with limited liquidity.
What are the different types of AMMs?
Not all AMMs use the same pricing model. Different designs are intended to work better for different types of assets and trading strategies.
- Constant-product AMMs. The traditional AMM model uses the x × y = k formula. It works well for trading assets with significantly different prices and is the model that helped popularize AMMs through Uniswap.
- Stablecoin and hybrid AMMs. These models are designed for assets that tend to trade at similar prices, such as stablecoins. They can provide lower slippage than a constant-product model when the assets remain close in value. Curve is a well-known example.
- Concentrated-liquidity AMMs. Instead of spreading liquidity across the entire possible price range, concentrated-liquidity AMMs let liquidity providers choose a specific price range for their funds. This can make capital more efficient, but it also requires more active management. Uniswap V3 and V4 use concentrated liquidity.
What are the risks of AMMs?
AMMs remove the need for a traditional intermediary, but they don’t remove the risks of trading or providing liquidity.
- Impermanent loss. Liquidity providers can end up with less value than they would have had by simply holding their assets if the prices of those assets change relative to each other.
- Smart-contract risk. A vulnerability in an AMM’s smart contracts could result in lost funds.
- Slippage and price impact. Trades in pools with limited liquidity can receive worse-than-expected prices, particularly for larger transactions.
- MEV (Maximal Extractable Value). Other blockchain participants may be able to observe pending transactions and use that information to profit, potentially worsening the execution price for a trader.
- Token risk. Permissionless AMMs can allow anyone to create or trade tokens, so users may encounter scams, fraudulent tokens or assets with very little liquidity.
The risks vary depending on whether you’re trading through an AMM or providing liquidity to one. Liquidity providers face additional risks, particularly impermanent loss.
Popular AMM protocols
AMMs are used by many decentralized exchanges, but their designs and areas of focus can differ.
- Uniswap. One of the largest AMM-based DEXs, known for its broad range of token pairs and concentrated-liquidity model.
- Curve. Designed primarily for trading stablecoins and other similarly priced assets, with a focus on minimizing slippage.
- Balancer. Supports customizable liquidity pools containing multiple assets and different weightings.
- PancakeSwap. An AMM-based DEX that began on BNB Chain and has expanded to additional networks.
- Aerodrome. A major AMM-based DEX on Base, combining trading and liquidity incentives.
Bottom line
AMMs make decentralized crypto trading possible without a traditional order book by using liquidity pools and automated pricing formulas. They give traders permissionless access to swaps and allow liquidity providers to earn trading fees, but they also introduce risks such as impermanent loss, slippage and smart-contract vulnerabilities.
For traders, the key considerations are liquidity, price impact and transaction costs. For liquidity providers, the potential fees need to be weighed against the risks of providing liquidity.
Compare exchanges where you can buy and sell cryptocurrencies
Frequently asked questions
-
The best AMM ultimately depends on the assets you're trading, the network you're using and whether you're trading or providing liquidity.
That said, Uniswap is one of the strongest general-purpose choices, with broad token support, concentrated liquidity and a well-established ecosystem. For trading stablecoins and other similarly priced assets, Curve is specifically designed to facilitate swaps between assets with similar values while minimizing slippage.
-
The security of an AMM depends on factors such as the protocol's smart-contract design, audits, track record and the blockchain it operates on.
Since AMMs rely on smart contracts, a vulnerability or exploit can result in lost funds. Traders can also face risks from malicious tokens, price manipulation, slippage and MEV attacks.
Users should also verify they are interacting with the legitimate protocol and understand the risks before trading or providing liquidity.
-
An automated market maker (AMM) is a mechanism that uses liquidity pools and mathematical formulas to facilitate trades without an order book. A decentralized exchange (DEX) is the broader platform that allows users to trade crypto without a centralized intermediary.
Many DEXs use AMMs, but the terms aren't interchangeable. Uniswap, for example, is a DEX that uses AMM technology to facilitate token swaps. Other DEXs can use different trading mechanisms, such as order books or aggregators.
Disclaimer: This page is not financial advice or an endorsement of digital assets, providers or services. Digital assets are volatile and risky, and past performance is no guarantee of future results. Potential regulations or policies can affect their availability and services provided. Talk with a financial professional before making a decision. Finder or the author may own cryptocurrency discussed on this page.
Holly Jennings is the deputy crypto editor and updates writer at Finder, working with writers across all niches to deliver quality content to readers. She’s edited hundreds of financial articles ranging from credit cards to investments. With empathy at heart, she especially enjoys content that breaks down complex financial situations into easy-to-understand information. Prior to her role at Finder, she collaborated with dozens of small businesses to maximize the reach and impact of their blog posts, website copy and other content. In her spare time, she is an award-winning author for Penguin Random House, writing about virtual reality worlds, magical girls and lasers that go pew-pew. See full bio
- Cryptocurrency
- Digital assets
- Investments
- Personal Banking
More guides on Finder
-
What is a DAO? Decentralized Autonomous Organizations explained
DAOs are already replacing traditional business models and revolutionizing the world of investing. Find out how they work and how to invest.
-
Lido Staking
Lido’s liquid staking allows investors holding LUNA and less than 32 ETH to reap the rewards of DeFi staking.
-
DeFi and Web3 wallets
Find out how a Web3 wallet can allow you to access the world of DeFi, plus discover which wallets we recommend.
-
DeFi tokens: A simple guide for beginners
DeFi tokens compose a prominent sector in the cryptocurrency markets. Learn the basics of these tokens here.
-
A guide to using the Loopring Decentralized Exchange
Learn how to save on Ethereum gas fees by using the Loopring decentralized exchange, and earn money as a liquidity provider.
-
What is Compound Finance
Earn, lend and govern crypto assets with Compound — no banks, just smart contracts and community control.
-
How Liquidity Pools Work
A beginner-friendly guide to liquidity pools — covering what they are, how they operate and their potential benefits and pitfalls.
-
How to use Zapper.fi to manage DeFi liquidity
Learn how to manage DeFi investments with Zapper.fi. We present the pros, cons and risks associated with this liquidity management tool.
-
Uniswap beginner’s guide: How to trade and provide liquidity
Learn how to trade or earn money by providing liquidity on Uniswap, Ethereum’s biggest decentralized exchange.