DexCrypto Guides AMM & Liquidity Pools
📚 DEX Guide

AMM & Liquidity Pools Explained: Complete DeFi Guide 2025

Automated Market Makers (AMMs) and liquidity pools are the foundational technology behind decentralized exchanges. Instead of matching buyers and sellers through an order book, AMMs use smart contracts and mathematical formulas to determine prices and execute trades automatically. Anyone can provide liquidity to these pools and earn a share of trading fees. This guide explains how the technology works, the math behind it, how to earn as an LP, and how AMMs have evolved.

📅 June 1, 2025 ⏱ 13 min read ✍️ DexCrypto Team

What Is an Automated Market Maker?

An Automated Market Maker (AMM) is a type of decentralized exchange protocol that uses smart contracts and mathematical formulas — instead of traditional order books — to facilitate token trading. In a traditional exchange, trades happen when a buyer's bid price matches a seller's ask price. In an AMM, prices are determined algorithmically based on the ratio of assets in a liquidity pool.

The AMM model was pioneered by Uniswap in 2018 and has since become the dominant architecture for DEX platforms. Every major DEX — PancakeSwap, Raydium, Curve, SushiSwap, Trader Joe — uses some variant of the AMM model. AMMs enable permissionless, always-on liquidity: anyone can trade at any time, and anyone can provide liquidity to earn fees.

💡 Key Insight: AMMs solved the "cold start" liquidity problem that plagued early DEXs. Order book DEXs needed active market makers to provide liquidity — a chicken-and-egg problem. AMMs allow passive liquidity provision by anyone, bootstrapping liquidity from day one.

AMM vs Traditional Order Book

FeatureAMMOrder Book
Price discoveryMathematical formulaSupply/demand matching
Market makersPassive LPs (anyone)Professional market makers
Always liquidYes (if pool exists)No (requires active orders)
Best price for large tradesVariable (slippage)Better (deep books)
Token listingPermissionlessRequires approval

The Constant Product Formula

The most widely used AMM formula is the constant product formula, introduced by Uniswap v2:

x × y = k

Where x = quantity of Token A, y = quantity of Token B, and k = a constant value that remains unchanged through all trades.

When a trader buys Token A from the pool, they add Token B (payment) to the pool and remove Token A. This changes the ratio of x to y, and since k must remain constant, the price of Token A increases (becomes scarcer) while Token B decreases in price (becomes more abundant).

Price Impact and Trade Size

The larger your trade relative to the pool size, the more the ratio changes, and the worse your execution price. This "price impact" or slippage is an inherent property of the constant product formula. A $1,000 trade in a $10M pool causes minimal slippage; the same trade in a $50,000 pool causes substantial slippage.

Example: BNB/USDT pool with 100 BNB and 30,000 USDT (k = 3,000,000, implied price: 300 USDT/BNB). A trader buys 10 BNB: they add y USDT such that (100-10) × (30,000 + y) = 3,000,000. Solving: 90 × (30,000 + y) = 3,000,000, so y = 3,333.33 USDT. They paid 3,333 USDT for 10 BNB — an effective price of $333.33/BNB, not the pool's initial $300 rate. The 11% price impact is due to the small pool size in this example.

How Liquidity Pools Work

A liquidity pool is a smart contract holding reserves of two tokens. When you add liquidity, you deposit both tokens in equal value. In return, you receive LP tokens — ERC-20 tokens (or SPL on Solana) that represent your fractional ownership of the pool.

When you later withdraw your liquidity by burning your LP tokens, you receive your proportional share of the pool — which may differ from what you deposited due to trading activity (impermanent loss) but includes your share of accumulated trading fees.

Pool Creation

On a permissionless AMM like PancakeSwap or Uniswap, anyone can create a new liquidity pool for any pair of tokens — no approval required. The pool creator sets the initial price by depositing tokens in the ratio they choose. If they deposit 1 ETH and 3,000 USDT, they're setting an initial price of $3,000 per ETH.

How Trades Flow Through Pools

Every swap on a DEX routes through one or more liquidity pools. Complex trades might use multi-hop routing — for example, swapping Token A → BNB → Token B across two separate pools. The DEX router automatically finds the path that minimizes slippage and maximizes output.

How to Become a Liquidity Provider

Providing liquidity on a DEX is a way to earn passive income on crypto you already hold. Here's how to do it on PancakeSwap (BNB Chain):

01

Connect your wallet

Go to the DEX, click Connect Wallet, and connect MetaMask or Trust Wallet with BNB Chain configured.

02

Navigate to Liquidity section

Find the Liquidity or Pool section of the DEX interface.

03

Select your token pair

Choose the two tokens you want to provide liquidity for — for example, BNB and USDT.

04

Set your price range (CLMM)

On v3 concentrated liquidity pools, select the price range where your liquidity will be active.

05

Approve tokens and deposit

Approve each token for the pool contract, then confirm the liquidity deposit transaction in your wallet.

06

Receive LP tokens and earn fees

You now hold LP tokens representing your pool position. Fees accrue to your position automatically as trading occurs.

LP Fees & Earnings

Liquidity providers earn a share of all trading fees generated by their pool, proportional to their share of total pool liquidity. Fee tiers on PancakeSwap v3:

0.25%
Fee per swap (standard pair)
100%
Of fees go to LPs
24/7
Passive fee accumulation

Calculating LP Returns

Your annual percentage return as an LP depends on: trading volume, your pool share, fee tier, and impermanent loss. A pool with $1M in liquidity generating $500K in daily volume at 0.25% fee produces $1,250/day in LP fees. An LP with 10% of that pool earns $125/day — a 4.56% annual return on their $1M position, just from fees.

Impermanent Loss Explained

Impermanent loss (IL) is the temporary reduction in value experienced by liquidity providers when the price ratio of their pooled tokens changes relative to when they deposited. It's called "impermanent" because the loss only materializes if you withdraw at the unfavorable ratio — if prices return to their original ratio, the loss disappears.

Why IL Happens

When you deposit BNB and USDT in a 50/50 pool, the AMM rebalances your position automatically as prices change. If BNB doubles in price, the pool sells BNB and accumulates USDT as external arbitrageurs bring the pool price to market. You end up holding less BNB (and more USDT) than if you'd simply held outside the pool — that's impermanent loss.

The IL formula: for a price change ratio r, IL = 2√r/(1+r) - 1. For a 2x price increase (r=2): IL = 2√2/3 - 1 = -5.7%. This means you'd be 5.7% worse off providing liquidity vs simply holding, before accounting for fees earned.

When IL Doesn't Matter

Impermanent loss is offset by trading fees. High-volume pools generate enough fee income to more than compensate for IL over time. Stablecoin pools (USDT/USDC) have near-zero IL since both tokens maintain the same price. Long-term LPs in high-volume pools consistently outperform simple holding strategies.

Yield Farming & Liquidity Mining

Yield farming is the practice of maximizing returns by deploying LP positions across multiple protocols, often involving staking LP tokens to earn additional rewards. Liquidity mining specifically refers to earning a DEX's native token as a reward for providing liquidity.

On PancakeSwap, LPs can stake their LP tokens in "Syrup Pools" to earn CAKE (PancakeSwap's token) on top of trading fees. This boosts total APY significantly — a pool with 15% fee APY might offer 25–40% total APY when liquidity mining rewards are included.

Concentrated Liquidity (CLMM)

Concentrated Liquidity Market Makers (CLMMs), introduced by Uniswap v3 and now standard across modern DEXs, allow LPs to specify a price range for their liquidity. Instead of providing liquidity across the entire price curve (0 to ∞), you concentrate your capital where trading actually happens.

This dramatically improves capital efficiency. An LP who concentrates liquidity in the BNB price range of $280–$340 earns the same fees as an LP with 10x more capital in a standard v2 pool — because within that range, they provide the same depth of liquidity. The tradeoff: if the price moves outside your range, your position stops earning fees until price returns to the range.

PancakeSwap v3 (the engine behind DexCrypto's BNB Chain DEX) and DexCrypto's Solana DEX both support CLMM, giving LPs professional-grade capital efficiency.

Frequently Asked Questions

What is impermanent loss in simple terms?
Impermanent loss is the opportunity cost of providing liquidity versus simply holding tokens. If the price ratio of your pooled tokens changes significantly, you end up with a different mix of tokens than you deposited, and this mix may be worth less than if you had just held. The loss is "impermanent" because it reverses if prices return to original ratios.
Is providing liquidity profitable?
It depends on the pool. High-volume pools with stable price ratios are generally profitable for LPs — trading fees outweigh impermanent loss. Stablecoin pools are the safest. Highly volatile pairs with low volume are the riskiest. Check APY data on DEX analytics platforms before providing liquidity.
How much can I earn as a liquidity provider?
Returns vary widely. Low-risk stablecoin pools might yield 3-10% APY. High-volume major pair pools (BNB/USDT) often yield 15-30% APY. When liquidity mining rewards are added, yields can reach 50-100%+ APY — though higher yields always come with higher risk.
What is concentrated liquidity?
Concentrated liquidity (CLMM) lets you provide liquidity within a specific price range, rather than across all prices. This makes your capital much more efficient — earning more fees from the same amount of capital — but requires active management to keep your range aligned with the current price.
How do I withdraw my liquidity?
Navigate to the Liquidity section of the DEX, find your position, and click Remove Liquidity. Burn your LP tokens in exchange for your proportional share of the pool plus any uncollected fees. The transaction completes in seconds on BNB Chain or Solana.

Launch Your Own AMM DEX

Deploy a white-label AMM DEX on BNB Chain or Solana. Your brand, your fees, your liquidity pools — live in 24 hours.

Get Your AMM DEX → Free Setup →