How Automated Market Makers (AMMs) Work: Liquidity Pools, Pricing & Risks
- Koeksal Chaker
- 6 days ago
- 6 min read
Updated: 1 day ago
Every market needs liquidity.
In traditional finance, liquidity comes from professional market makers—banks, trading firms, or brokers—who continuously quote buy and sell prices so trades can happen without delay. Whether you’re trading stocks, FX, or commodities, there’s always someone standing on the other side of your order.
Decentralized finance took a different path.
When you swap tokens on Uniswap or PancakeSwap, there is no broker, no order book, and no human counterparty. Instead, you trade directly against a pool of assets governed entirely by smart contracts. Pricing, execution, and settlement are all handled by code.
This system is called an Automated Market Maker (AMM)—and it has quietly become one of the most important financial primitives in crypto.
This article explains how AMMs work, why they exist, what problems they solved, the risks they introduce, and how they’re evolving as DeFi matures.

Key Takeaways
Automated Market Makers replace order books with liquidity pools governed by smart contracts
Prices are determined algorithmically based on token ratios, not bids and asks
Liquidity is provided by users who earn trading fees, while arbitrage keeps prices aligned with global markets
AMMs power most decentralized exchanges (DEXs) and enable permissionless token trading
Risks such as impermanent loss, MEV, and smart contract exploits must be carefully managed
What Is an Automated Market Maker?
At its core, an AMM is a decentralized pricing system.
Instead of matching buyers and sellers, an AMM allows users to trade directly against a pool of tokens. That pool holds two or more assets, and a smart contract determines the exchange rate based on how much of each asset remains in the pool.
There is no waiting for a counterparty. There is no centralized operator. There is no manual price setting.
The market “makes itself.”
This distinction is critical:
A DEX is the platform users interact with
An AMM is the mechanism that powers pricing and liquidity beneath it
Why AMMs Were Necessary
Early crypto trading relied almost entirely on centralized exchanges. These platforms worked well—but they came with trade-offs:
Custodial risk
Regulatory exposure
Permissioned access
Centralized liquidity control
Decentralized exchanges aimed to remove these constraints, but they faced a major technical problem: blockchains are terrible at running order books.
Maintaining thousands of live bids and asks on-chain is expensive, slow, and inefficient. AMMs solved this by replacing continuous order updates with deterministic math.
Instead of asking “Who wants to buy?” AMMs ask:
“What price should this trade execute at, given the current pool balance?”
That single shift unlocked on-chain trading at scale.
Liquidity Pools: The Foundation of AMMs
Every AMM revolves around liquidity pools.
A liquidity pool holds a pair of tokens—such as ETH/USDC or SOL/USDT—and enables swaps between them. Since every trade involves exchanging one asset for another, all AMM markets are pair-based.

How Liquidity Is Supplied
Liquidity doesn’t come from institutions—it comes from users.
Anyone can deposit equal-value amounts of both tokens into a pool. In return, they receive LP (liquidity provider) tokens, which represent their share of the pool.
When trades occur:
A small fee is charged
Fees are distributed proportionally to LPs
This incentive model transforms passive token holders into market makers.
How AMMs Set Prices
Traditional markets discover prices through bids and asks. AMMs do it through math.
Most AMMs use a pricing formula that adjusts prices automatically as the pool balance changes. The most famous version is the constant product formula, introduced by Uniswap:
x × y = k
Where:
x = amount of token A in the pool
y = amount of token B
k = constant
Every trade must preserve k. When one token is added to the pool, the other must decrease—changing the implied price.
Why Slippage Happens
Because trades alter the pool balance, they also move the price. This creates slippage, the difference between the expected price and the execution price.
Small trades in deep pools → minimal slippage
Large trades in shallow pools → significant slippage
Slippage isn’t a flaw—it’s how AMMs enforce balance.
A Simple AMM Pricing Example
Assume a pool starts with:
10 ETH
1 BTC
So: 10 × 1 = 10
A trader adds 1 ETH to the pool:
New ETH balance = 11
BTC must adjust so k remains 10
11 × BTC = 10 → BTC ≈ 0.909
The trader receives 0.091 BTC, paying a worse price than before due to slippage.
The larger the trade relative to pool size, the greater the price impact.
Arbitrage: The Invisible Force That Keeps Prices Honest
AMMs don’t know what assets are “worth” globally. They only know what’s inside their pool.
That means prices can temporarily diverge from centralized exchanges or other DEXs. This is where arbitrage comes in.
If ETH trades at:
$3,100 on a CEX
$3,120 in an AMM pool
Arbitrageurs will:
1. Buy ETH cheaply on the CEX
2. Sell it into the AMM pool
3. Profit from the price difference
Their trades rebalance the pool and pull prices back toward the market average.
This process:
Is automated
Is competitive
Happens constantly
Arbitrage traders are not parasites—they are essential to AMM price efficiency.
Why AMMs Matter to DeFi
AMMs introduced capabilities that traditional markets never had:
1. Always-On Markets
As long as the blockchain runs, liquidity exists. No trading hours. No downtime.
2. Permissionless Market Creation
Anyone can create a pool for any token pair—no listing approval required.
3. Democratized Market Making
Users earn fees for supplying liquidity, creating entirely new yield strategies.
4. Token Bootstrapping
New projects can launch with instant liquidity and organic price discovery.
5. Composability
AMMs plug into aggregators, lending platforms, derivatives, and yield optimizers—forming DeFi’s “money Lego” stack.
Major AMM Designs and Protocols
While hundreds of AMMs exist, most trace their lineage back to a few foundational designs:
Uniswap – General-purpose AMM and industry benchmark
Curve – Optimized for stablecoin and correlated asset swaps
Raydium – Solana-native AMM with order book integration
Balancer – Multi-asset pools with customizable weights
PancakeSwap – BNB Chain’s primary AMM and retail hub
Each optimizes for different assets, chains, and user behavior.
The Evolution of AMM Design
Uniswap V2: Simplicity at Scale
Constant product formula
Highly composable
Capital inefficient
Liquidity was spread evenly across all price ranges—much of it unused.
Uniswap V3: Concentrated Liquidity
LPs choose price ranges where their capital is active.Result:
Higher capital efficiency
Lower slippage
More complex LP management
AMMs began to resemble professional market making.
Uniswap V4: Modular Liquidity
Introduces hooks, allowing:
Dynamic fees
Custom pool logic
Oracle-aware behavior
Combined with a singleton architecture, V4 reduces gas costs and enables bespoke AMM designs.
Risks and Trade-Offs of AMMs
AMMs are powerful—but not risk-free.
Impermanent Loss
LPs may underperform simply holding tokens when prices diverge significantly.
MEV and Sandwich Attacks
Transaction ordering manipulation can harm both traders and LPs.
Loss vs. Rebalancing (LVR)
Arbitrage profits often come at the expense of LP returns.
Smart Contract Risk
Bugs and exploits remain a systemic risk in DeFi.
AMMs shift risk from intermediaries to users—transparency replaces protection.
The Future of AMMs
AMMs are no longer standalone exchanges. They’re becoming liquidity infrastructure.
Key trends include:
Cross-chain routing and chain abstraction
Hybrid order book + AMM models
Oracle-driven pricing systems
L2-native AMMs with near-CEX performance
As scaling improves, the line between centralized and decentralized liquidity continues to blur.
Final Thoughts
Automated Market Makers changed how markets work on the internet.
They removed gatekeepers, replaced human discretion with code, and turned liquidity into a permissionless public good. From simple token swaps to complex cross-chain routing, AMMs now sit at the heart of DeFi’s financial stack.
Understanding AMMs isn’t just about trading—it’s about understanding how value moves on-chain.
And as crypto markets mature, the protocols that best balance efficiency, security, and capital productivity will define the next generation of decentralized finance.
FAQ:
Q1: What is the difference between an AMM and an order book?
An AMM uses liquidity pools and algorithms to price trades, while an order book matches buyers and sellers through bids and asks.
Order books depend on active participants placing orders. AMMs allow users to trade directly against pooled assets governed by smart contracts.
In short: order books discover price through matching orders; AMMs determine price mathematically (e.g., constant product formula).
Q2: How do liquidity providers make money in AMMs?
Liquidity providers (LPs) deposit token pairs into pools and earn a share of trading fees generated from swaps.
Returns depend on trading volume, fee tiers, and volatility. However, profits can be reduced by impermanent loss when token prices diverge significantly.
Professional liquidity strategies often combine fee optimization and risk management to improve capital efficiency.
Q3: What causes impermanent loss?
Impermanent loss occurs when the price ratio between pooled tokens changes after deposit.
As traders rebalance the pool, LPs effectively sell appreciating assets and buy depreciating ones. The greater the price divergence, the larger the loss.
It becomes permanent only when liquidity is withdrawn at a lower value than simply holding the tokens.
Q4: Are AMMs safer than centralized exchanges?
AMMs remove custodial risk since users keep control of funds until execution.
However, they introduce other risks such as smart contract bugs, MEV attacks, and liquidity volatility.
Centralized exchanges carry counterparty risk, while AMMs shift risk toward protocol security and market mechanics.
Disclaimer
This content is provided for informational and reference purposes only and does not constitute any commercial, investment, financial, legal, or tax advice. Some materials may be sourced or reproduced from third parties. CiaoAI makes no representations or warranties regarding the timeliness, accuracy, or completeness of such content and shall not be liable for any actions or decisions taken based on it.
If you believe that any content infringes upon the rights of a third party, please contact service: anson@ciaoaibot.com. We will review and take appropriate action promptly.
Comments