When you trade cryptocurrency on a centralised exchange, your trade is matched against another trader’s order in an order book. There is a buyer, a seller, and a matching engine connecting them. This model works well when there are many active participants placing orders, but it breaks down for less liquid assets or in the absence of professional market makers willing to quote prices continuously.
An automated market maker, or AMM, solves this problem differently. Instead of matching buyers with sellers through an order book, an AMM uses a mathematical formula and a pool of tokens deposited by liquidity providers to price and execute trades automatically, without any counterpart trader needing to be present on the other side. AMMs are the foundational trading mechanism of decentralised finance, powering the decentralised exchanges that have processed trillions of dollars in trading volume since their emergence in 2018.
Understanding what AMMs are, how the pricing formula works, what liquidity providers do and earn, and what the specific risks of AMM participation look like is essential knowledge for anyone active in DeFi or seeking to understand how on-chain trading works.
To appreciate the AMM model, it helps to understand what problem it was designed to solve.
Traditional order book exchanges require active market makers: participants who continuously quote buy and sell prices to provide liquidity to other traders. Professional market makers in traditional finance and on centralised exchanges manage complex inventory and risk systems to maintain tight spreads and deep liquidity. This is a technically sophisticated and capital-intensive activity.
On a decentralised exchange built on a blockchain, running a traditional order book market maker is impractical: every order placement, cancellation, and modification would require a blockchain transaction, incurring gas fees and confirmation delays that make the economics of traditional market making unworkable on-chain.
The AMM model replaces the active market maker with a passive liquidity pool and a deterministic pricing formula. Liquidity providers deposit tokens into the pool once, earning fees passively as trades occur against their deposited liquidity. The pricing formula handles all price discovery automatically without any active management. This makes continuous, permissionless liquidity provision accessible to any token holder, not just professional market making firms.
The most widely used AMM pricing formula is the constant product formula, introduced by Uniswap in 2018 and used in its original form or with variations by the majority of AMMs across DeFi.
The formula is: x × y = k
In this formula, x is the quantity of Token A in the liquidity pool, y is the quantity of Token B in the pool, and k is a constant that must remain unchanged by any trade. Every trade that occurs against the pool changes the quantities of Token A and Token B, but the product of the two quantities must always equal k.
A practical example illustrates how this works. Imagine a pool containing 100 Ethereum (ETH) and 300,000 USDC. The product k is 100 × 300,000 = 30,000,000. The implied price of ETH is 300,000 ÷ 100 = $3,000 USDC per ETH.
A trader wants to buy 1 ETH from the pool by depositing USDC. After the trade, the pool will have 99 ETH. For k to remain 30,000,000 with 99 ETH, the USDC quantity must be 30,000,000 ÷ 99 = 303,030.30 USDC. The trader must deposit 303,030.30 – 300,000 = 3,030.30 USDC to buy 1 ETH. The effective price paid is $3,030.30 per ETH, not the $3,000 the pool implied before the trade.
This difference between the pre-trade implied price and the actual execution price is the price impact of the trade, which is also the slippage experienced by the trader. The price impact is larger when the trade is larger relative to the pool size, which is why slippage is significantly greater on shallow AMM pools than on deep ones.
After this trade, the pool contains 99 ETH and 303,030.30 USDC. The new implied price of ETH is 303,030.30 ÷ 99 = $3,061.92 USDC per ETH. The trade has moved the price in the direction of the trade: buying ETH made ETH more expensive in the pool. Subsequent traders buying ETH will face a higher implied price.
The tokens in an AMM pool are deposited by liquidity providers, sometimes shortened to LPs. Any holder of the relevant tokens can become a liquidity provider by depositing both tokens in the pool’s required ratio, receiving liquidity provider tokens in return that represent their proportional share of the pool.
When a liquidity provider deposits into a Uniswap ETH/USDC pool, they receive LP tokens representing their share of the pool’s total liquidity. These LP tokens can be redeemed at any time to withdraw their proportional share of the pool’s current token balances, including any trading fees that have accumulated since their deposit.
Trading fees are the primary revenue source for liquidity providers. Every trade executed against the pool pays a fee, typically between 0.05% and 1% depending on the AMM and the specific pool’s fee tier, which is distributed proportionally to all liquidity providers in that pool. A liquidity provider holding 1% of a pool’s liquidity receives 1% of all fees generated by trades in that pool.
The economics of liquidity provision depend on the fee revenue generated by trading volume relative to the impermanent loss risk described below. High-volume pools with significant trading activity generate substantial fee revenue. Low-volume pools generate little fee revenue regardless of how much liquidity has been deposited.
Impermanent loss is the most important risk concept specific to AMM liquidity provision, and it is one that any DeFi participant considering providing liquidity to an AMM pool must understand clearly.
Impermanent loss occurs when the price ratio between the two tokens in a pool changes after a liquidity provider deposits. The AMM’s rebalancing mechanism, through which arbitrageurs trade against the pool to correct its price toward external market prices, results in the liquidity provider holding proportionally more of the token that has declined in relative value and less of the token that has appreciated.
A concrete example makes this clear. A liquidity provider deposits $10,000 AUD worth of value into an ETH/USDC pool when ETH is priced at $3,000 USDC. They deposit 1.667 ETH and 5,000 USDC (50/50 split of their $10,000 position).
Later, ETH’s price rises to $4,500 USDC on external markets. Arbitrageurs buy ETH from the pool to profit from the price discrepancy, depositing USDC and withdrawing ETH until the pool’s implied price equals the external market price. The liquidity provider’s position in the pool is now approximately 1.36 ETH and 6,124 USDC, worth approximately $12,247 AUD at the new ETH price.
If instead the liquidity provider had simply held 1.667 ETH and 5,000 USDC without providing liquidity, they would have 1.667 ETH worth $7,500 at the new price plus $5,000 USDC, totalling $12,500 AUD. The liquidity provider earned $12,247 from the pool versus $12,500 from holding: a difference of $253, which is the impermanent loss from ETH’s price appreciation.
The loss is called “impermanent” because if the price ratio returns to its original level, the impermanent loss disappears entirely. The loss only becomes permanent when the liquidity provider withdraws while the price ratio differs from their entry ratio. If fee revenue during the liquidity provision period exceeds the impermanent loss, the liquidity provider is net positive compared to simply holding the tokens.
Impermanent loss is proportional to the magnitude of price change in either direction: a doubling in the price of one token relative to the other results in an impermanent loss of approximately 5.7%. A 5x price change results in approximately 25% impermanent loss. The asymmetric impact is greatest for volatile token pairs and least for stable asset pairs like USDC/USDT where the price ratio changes very little.
This is why AMM pools consisting of two similarly priced stablecoins, as used by Curve Finance, generate minimal impermanent loss: the price ratio between the assets barely moves, so the rebalancing mechanism rarely adjusts the pool’s composition significantly.
The constant product formula is the foundation of AMM design, but significant variations have been developed to address its limitations for specific use cases.
Concentrated liquidity AMMs. Uniswap v3 introduced concentrated liquidity, allowing liquidity providers to deploy their capital within a specific price range rather than across all possible prices from zero to infinity. Concentrating liquidity in the range where trading actually occurs makes capital significantly more efficient: a liquidity provider can earn the same fees with less capital by concentrating it in the active trading range. The tradeoff is that if the price moves outside the specified range, the liquidity provider’s position is entirely converted to one token and earns no fees until the price returns to the range.
Stable swap AMMs. Curve Finance developed an AMM formula specifically optimised for stablecoin and similarly-priced asset pairs. The Curve formula allows very large trades with minimal slippage near the target price ratio of 1:1, making it far more capital efficient than the constant product formula for stable asset swaps. This is why Curve became the dominant venue for large stablecoin swaps in DeFi.
Multi-asset pools. Balancer extended the AMM concept to pools containing more than two tokens in arbitrary weight ratios. A Balancer pool might contain five tokens at varying percentage weights, functioning simultaneously as a trading venue and a self-rebalancing portfolio index.
Dynamic fee AMMs. Some AMMs adjust their trading fees dynamically based on market volatility, charging higher fees during volatile periods to compensate liquidity providers for increased impermanent loss risk and lower fees during stable periods to attract volume.
As covered in our popular DeFi protocols explained resource, each major DeFi protocol uses AMM mechanics tailored to its specific use case.
Arbitrage is the mechanism that keeps AMM prices aligned with external market prices, and it is an essential part of how AMMs function in practice.
Because AMM prices are determined by pool composition rather than by market participant orders, they can diverge from prices on centralised exchanges whenever trading activity on one venue moves prices faster than the other. When an AMM pool’s implied price for ETH differs from the price on Binance or Kraken, arbitrageurs profit by buying the cheaper source and selling into the more expensive one, in the process correcting the AMM pool’s price toward the external market price.
This continuous arbitrage activity ensures AMM prices remain reasonably aligned with broader market prices. It also means that price movements on centralised exchanges are quickly reflected in AMM pool compositions, with the rebalancing coming at the expense of liquidity providers in the form of impermanent loss.
AMMs are the foundational infrastructure of DeFi. Their permissionless, non-custodial nature means any token can be listed and traded without requiring approval from any central authority. This is how new tokens first achieve liquidity: a project deploys its token and seeds an AMM pool with the token paired against ETH or a stablecoin, providing immediate trading capability without needing to be listed on a centralised exchange.
AMMs also power yield farming and liquidity mining programs: protocols incentivise liquidity providers to deposit into specific pools by distributing governance tokens as additional rewards on top of trading fees. This mechanism has been used by nearly every major DeFi protocol to bootstrap liquidity.
Cross-chain bridges and Layer 2 networks each have their own AMM deployments: the same Uniswap interface can route trades across Ethereum mainnet, Arbitrum, Optimism, and other EVM networks, with each deployment having its own liquidity pools. This multi-chain AMM landscape is part of the broader DeFi infrastructure covered in our staking vs farming and risks of DeFi investing resources.
Beyond impermanent loss for liquidity providers, several additional risks apply to AMM interactions.
Smart contract risk. AMMs are smart contracts: the pool logic and fund management are encoded in code deployed on the blockchain. A vulnerability in the smart contract code can be exploited to drain the pool’s funds. As covered in our risks of DeFi investing resource, smart contract exploits are one of the most common causes of significant DeFi losses.
Sandwich attacks and MEV. As covered in our slippage in crypto trading resource, AMM trades with high slippage tolerance are vulnerable to sandwich attacks where bots front-run and back-run transactions to extract value. Setting appropriate slippage tolerances and using MEV-protection tools reduces this risk.
Token risk. Providing liquidity to a pool containing a scam token or a token subject to a rug pull can result in the paired asset being drained from the pool as the rug pull is executed. As covered in our how to spot a rug pull resource, evaluating both tokens in any liquidity pair is part of the due diligence for liquidity provision.
Gas fee costs. Every AMM interaction, whether swapping tokens or adding and removing liquidity, requires an Ethereum transaction that incurs gas fees. During periods of high network congestion, gas fees can make small AMM trades uneconomical. Layer 2 deployments of AMMs address this by providing the same functionality at a fraction of the gas cost.
An automated market maker is a smart contract-based trading protocol that uses a mathematical formula and pooled liquidity to price and execute trades without an order book or counterpart traders. The constant product formula x × y = k determines trade prices based on pool composition, with larger trades causing greater price impact. Liquidity providers deposit token pairs into pools and earn trading fees proportional to their pool share. Impermanent loss is the primary risk of liquidity provision, occurring when the price ratio between pooled tokens changes from the entry ratio.
AMMs are the foundational infrastructure of DeFi, enabling permissionless trading of any token and powering yield farming and liquidity mining programs. Risks include smart contract vulnerabilities, sandwich attacks, token-specific risks, and gas fee costs. Variations including concentrated liquidity AMMs and stable swap AMMs extend the model for specific use cases.
For everyday investors who want to understand how DeFi trading works and how to interact with AMMs safely and profitably, our Runite Tier Membership provides the education and frameworks to develop that capability properly. For serious investors who want personalised guidance on liquidity provision strategy, impermanent loss management, and positioning DeFi activity within a professionally structured portfolio, our Black Emerald and Obsidian Tier Members receive direct specialist support. Find out more at shepleycapital.com/membership.
WRITTEN & REVIEWED BY Chris Shepley
UPDATED: MARCH 2026