What Is a Liquidity Pool? How AMMs Replace Order Books
Learn how liquidity pools work, what automated market makers are, how the x*y=k formula sets prices, and what impermanent loss means for liquidity providers.

Key Takeaways |
1. A liquidity pool is a smart contract holding two tokens that anyone can trade against, replacing the need for a buyer and seller to be matched at the same time. |
2. Automated market makers (AMMs) use a mathematical formula, most commonly x * y = k, to set prices automatically based on the ratio of tokens in the pool. |
3. Liquidity providers earn trading fees in exchange for depositing tokens, but they take on a risk called impermanent loss when token prices shift significantly. |
Introduction
If you have ever used a decentralized exchange (DEX) to swap one token for another, you have interacted with a liquidity pool without necessarily realizing it. Understanding how liquidity pools work is one of the most important building blocks in DeFi education. It explains how tokens get priced, where trading fees come from, and how people earn passive income by providing capital to decentralized protocols.
This article explains what liquidity pools are, how automated market makers (AMMs) replaced the traditional order book model, how prices are calculated, and what risks exist for participants.
The Traditional Order Book Model
Centralized exchanges such as Coinbase or Binance operate using an order book. In this model, buyers place bids and sellers place asks. A trade only executes when a buyer and a seller agree on the same price.
This system works reasonably well on high-volume platforms, but it has limitations in a decentralized environment:
It requires two parties to be present and willing to trade at the same price at the same time.
It depends on market makers, typically large professional firms, to continuously quote buy and sell prices to maintain liquidity.
In blockchain environments, every order placement and cancellation costs gas fees, making frequent order updates extremely expensive.
Decentralized finance needed a different solution. That solution is the liquidity pool, powered by an automated market maker.
What Is a Liquidity Pool?
A liquidity pool is a smart contract that holds two (or sometimes more) tokens in reserve. Anyone can trade against these reserves at any time, without needing another person on the other side of the trade.
Here is an everyday analogy: imagine a vending machine stocked with two types of drinks. You do not need a shopkeeper to hand you one drink in exchange for another. The machine handles the transaction automatically according to its own pricing rules. A liquidity pool works similarly, except the pricing is governed by a mathematical formula rather than a human operator.
Liquidity providers (LPs) are the people who fill the pool. They deposit an equal value of both tokens into the smart contract. In return, they receive LP tokens that represent their proportional share of the pool. When they want to exit, they return the LP tokens and withdraw their underlying assets plus any fees earned.
How Automated Market Makers Work
An automated market maker is the algorithm inside a liquidity pool that determines the price of a swap. Instead of matching buyers with sellers, it uses a formula based on the current reserves of both tokens.
The Constant Product Formula: x * y = k
The most widely used AMM model was introduced by Uniswap v2. It relies on a simple equation:
x * y = k
x = the quantity of Token A in the pool
y = the quantity of Token B in the pool
k = a constant value that must always remain the same
When a trader buys Token A from the pool, they remove some of x and add an equivalent amount of Token B (y). Because k must stay constant, the price of Token A automatically rises as its supply in the pool falls. This is how price discovery works without any human intervention.
A Simple Numerical Example
Suppose a pool holds 10 ETH and 20,000 USDC, so k = 10 * 20,000 = 200,000.
A trader wants to buy 1 ETH from the pool.
After the trade, only 9 ETH remains: 9 * y = 200,000, so y must become approximately 22,222 USDC.
The trader paid 22,222 minus the original 20,000 = 2,222 USDC for 1 ETH.
The effective price was 2,222 USDC per ETH, slightly above the starting price of 2,000 USDC because removing ETH from the pool made it more scarce.
This price slippage increases with the size of the trade relative to the pool. Larger pools produce less slippage for the same trade size.
Types of AMM Formulas
Not all AMMs use the same formula. Different protocols optimize for different trading scenarios.
AMM Type | Formula Logic | Best For | Example Protocol |
|---|---|---|---|
Constant Product | x * y = k | General token pairs | Uniswap v2 |
StableSwap | Hybrid curve (flat center) | Stablecoin pairs (low slippage) | Curve Finance |
Concentrated Liquidity | LPs set custom price ranges | Capital efficiency, active LPs | Uniswap v3 / v4 |
Weighted Pool | Multi-token, variable ratios | Index-style portfolios | Balancer |
What Are LP Tokens?
When you deposit into a liquidity pool, you receive LP tokens. These are proof-of-deposit receipts on the blockchain. They track your proportional share of the total pool.
LP tokens serve several purposes:
They entitle the holder to withdraw their share of the pool at any time.
They automatically accumulate the trading fees earned by the pool, proportional to your share.
They can often be staked in other protocols to earn additional yield, a practice sometimes called liquidity mining.
When you redeem LP tokens, you receive back the current balance of the two tokens in the pool, which may differ from what you originally deposited.
Understanding Impermanent Loss
Impermanent loss is the most important risk for liquidity providers to understand. It occurs when the price ratio of the two pooled tokens changes after you deposit.
Definition: Impermanent loss is the difference between the value of your assets inside the pool versus what they would be worth if you had simply held them in your wallet.
Why Does It Happen?
As the AMM adjusts token prices in response to trades, it rebalances the pool. If one token rises in value significantly, the pool formula automatically sells some of the rising token and buys more of the other. The LP ends up holding less of the token that appreciated and more of the one that did not.
This is called impermanent because if prices return to their original ratio, the loss disappears. It only becomes permanent if the LP withdraws while the price ratio is still diverged.
Impermanent Loss: Impact by Price Change
Price Change of One Token | Approximate Impermanent Loss vs. Holding |
|---|---|
25% increase | ~0.6% |
50% increase | ~2.0% |
100% increase (2x) | ~5.7% |
200% increase (3x) | ~13.4% |
400% increase (5x) | ~25.5% |
These are approximate figures for a standard constant product pool. The actual impact depends on the specific pool and trading fees earned. For high-volume pools, trading fees can offset impermanent loss. For low-volume or highly volatile pairs, impermanent loss can exceed fee income.
Who Is Most Exposed?
LPs in volatile token pairs face the highest impermanent loss risk.
LPs in stablecoin pairs (such as USDC/DAI) face minimal impermanent loss because both assets maintain similar values.
Concentrated liquidity positions carry amplified impermanent loss risk within their chosen price range.
Risks and Considerations for Liquidity Providers
Risk | Description | Mitigation |
|---|---|---|
Impermanent Loss | Value erosion when token prices diverge | Choose stable pairs or high-volume pools |
Smart Contract Risk | Bugs or exploits in pool code | Use audited, established protocols |
Low Trading Volume | Fees may not offset losses or opportunity cost | Research pool TVL and volume before depositing |
Token Depeg / Rug Pull | One token loses value suddenly | Avoid unaudited or low-quality token pairs |
Slippage | Large swaps move price unfavorably | Use pools with deep liquidity for large trades |
How to Provide Liquidity: The Basic Process
The exact steps vary by protocol, but the general process is consistent across most AMM-based DEXs:
Connect a non-custodial wallet (such as MetaMask or Coinbase Wallet) to the DEX.
Select a liquidity pool that contains the token pair you want to deposit.
Approve and deposit equal values of both tokens (the interface calculates the required amounts).
Receive LP tokens representing your share of the pool.
Withdraw at any time by returning LP tokens to reclaim your proportional share, including accrued fees.
Before depositing, it is worth checking the pool's total value locked (TVL) and its 24-hour trading volume to estimate fee income relative to capital deployed.
Quick Reference Glossary
Term | Plain-English Meaning |
|---|---|
Liquidity Pool | A smart contract holding two tokens that traders can swap against |
AMM (Automated Market Maker) | The algorithm that determines swap prices using a mathematical formula |
Liquidity Provider (LP) | A person who deposits tokens into a pool to earn trading fees |
LP Token | A receipt token showing your share of a liquidity pool |
x * y = k | The constant product formula that keeps pool value balanced as trades occur |
Impermanent Loss | The value difference between holding tokens vs. depositing them in a pool |
Slippage | The difference between the expected and actual price of a swap |
TVL (Total Value Locked) | The total dollar value of assets deposited in a protocol or pool |
DEX (Decentralized Exchange) | A trading platform that operates through smart contracts without a central operator |
Summary
Liquidity pools replaced the order book model in DeFi by letting anyone deposit tokens into a shared reserve that traders can access at any time. The automated market maker formula, most commonly x * y = k, sets prices based purely on the ratio of tokens in the pool, with no need for professional market makers or a counterparty.
For depositors, the trade-off is clear: earn trading fees passively, but accept the risk of impermanent loss if token prices diverge. The type of pool, the volatility of the assets, and the volume of trading all determine whether the fees outweigh the risk.
Understanding this mechanism is foundational to navigating DeFi. Almost every yield strategy, lending protocol, and decentralized exchange in the ecosystem builds on the liquidity pool model in some form.
Frequently Asked Questions
What is a liquidity pool in simple terms?
A liquidity pool is a bucket of two tokens held in a smart contract. Traders swap one token for the other directly from the bucket. The smart contract automatically adjusts the price based on how much of each token remains.
What is the difference between an AMM and a DEX?
A DEX (decentralized exchange) is the platform. An AMM is the pricing mechanism inside the DEX. Most DEXs use an AMM to handle trades, though some use hybrid models that combine AMMs with other price-discovery methods.
Is impermanent loss always a loss?
Not necessarily. Impermanent loss describes a value difference compared to simply holding the tokens. If trading fees are high enough, the net return from providing liquidity can still be positive even when impermanent loss is present. Whether it is actually a loss depends on the specific pool, time period, and fee income.
Can I lose all my money providing liquidity?
In standard AMM pools with established tokens, a total loss is unlikely unless one of the tokens loses all its value. However, depositing into pools with unaudited or low-quality tokens carries significant risk, including the possibility of one token becoming worthless. Smart contract bugs or exploits are also a real, though less common, risk.
What are LP tokens used for?
LP tokens represent your share of the pool. You use them to withdraw your position. They can also be staked in other protocols to earn additional rewards, a practice called liquidity mining or yield farming.
What is concentrated liquidity?
Concentrated liquidity, introduced by Uniswap v3, allows LPs to deposit within a specific price range rather than across the entire price curve. This makes capital more efficient but requires active management, as the position only earns fees when the market price stays within the chosen range.
What is slippage in a liquidity pool?
Slippage is the difference between the price you expected to pay for a swap and the price you actually paid. It occurs because large trades shift the token ratio in the pool, which moves the price. Deeper pools with more liquidity produce less slippage.
Disclaimer: This content is for educational and informational purposes only and is not financial advice. Nothing here is a recommendation to buy or sell any asset or use any platform. Do your own research and manage your risk.
Read More
Social Engineering in Crypto: How Hackers Build Trust Before They Strike
Best Crypto Cards in 2025: Top 10 Reviewed, Compared, and Explained
How to Verify a Smart Contract on Etherscan: A Beginner's Walkthrough
AI + Crypto Convergence in 2026: What It Means for Web3 Developers and Users
Need deeper training?
Join our structured modules with live examples and expert checklists for effective implementation.
JOIN THE ACADEMY
Ad
Get a $100K funded account
See current qualification terms and payout conditions.
Sponsored
Share Transmission
Broadcast this signal to your network




