Home/Concepts/Blockchain/DeFi Liquidity Pools

DeFi Liquidity Pools

Provide liquidity and understand impermanent loss interactively

⏱️ 30 min20 interactions

What Are Liquidity Pools?

Liquidity pools are smart contracts that hold reserves of two or more tokens, enabling decentralized trading without traditional order books. Users can trade, earn fees, and provide liquidity 24/7.

💡 The Simple Explanation

Think of a liquidity pool like a community pot. Instead of waiting for a buyer and seller to match, you trade directly with the pool. Contributors earn fees from every trade. The pool automatically adjusts prices using a mathematical formula.

Anatomy of a Liquidity Pool

🏊 What Makes Up a Liquidity Pool?

A liquidity pool is a smart contract holding reserves of two tokens (like ETH and USDC). Unlike traditional exchanges with order books matching buyers and sellers, liquidity pools enable instant trading against the pool's reserves using an automated market maker (AMM) algorithm.

The Revolution: Anyone can become a market maker. Traditional finance requires $10M+ and regulatory approval to provide liquidity on centralized exchanges. DeFi liquidity pools democratize this—anyone with $100 or $10,000 can earn trading fees by providing liquidity.

📊 Pool Components

Token Reserves

The pool holds reserves of both tokens (e.g., 100 ETH + 300,000 USDC). These reserves determine the current price and enable instant swaps.

Total Value Locked (TVL)

Combined value of all assets in the pool. Higher TVL = more liquidity = less slippage on trades. Top pools have $100M-$1B+ TVL.

Trading Fee

Fee charged on every swap (typically 0.05%-1%). Fees are distributed proportionally to all liquidity providers. High-volume pools generate substantial fee income.

LP Tokens

Receipt tokens representing your share of the pool. If you own 5% of LP tokens, you can claim 5% of both reserves plus accumulated fees.

🎯 Popular Pool Types

💰
Stablecoin Pairs (DAI/USDC)

Low volatility, low impermanent loss risk. APY: 2-10%. Safe for conservative investors. Massive volume ($10M-100M daily).

🌊
Major Pairs (ETH/USDC, BTC/ETH)

High volume, moderate IL risk. APY: 10-30%. Most popular for balanced risk/reward. $1M-50M daily volume.

🚀
Volatile Pairs (ALT/ETH)

High APY (50-200%), high IL risk. Prices diverge dramatically. Best for short-term speculation or strong conviction in both tokens.

💡 Why Liquidity Pools Matter

• 24/7 Trading: No need to wait for matching orders. Instant swaps anytime, anywhere.
• Passive Income: Earn trading fees on every transaction. Top LPs earn $100K+ annually.
• Permissionless: No KYC, no minimum balance, no middleman. Pure decentralization.
• Composability: LP tokens can be staked elsewhere for additional rewards (yield farming).

1. Explore Liquidity Pools

🏊 Interactive: Select a Pool

Pool Details: ETH/USDC

ETH Reserve100
USDC Reserve300,000
Current Price
3000.00
USDC per ETH

Becoming a Liquidity Provider

💰 How to Add Liquidity to a Pool

Providing liquidity means depositing equal values of both tokens into a pool. Unlike simply buying and holding, you're actively facilitating trades and earning a cut of every transaction. The process is permissionless—no application, no approval, just connect wallet and deposit.

The Balanced Deposit Requirement: You cannot deposit just one token. Pools require deposits in the current price ratio. If ETH/USDC is 1:3000, depositing 10 ETH requires exactly 30,000 USDC. This maintains pool balance and prevents price manipulation.

🔄 The 4-Step Process

1
Select Pool

Choose token pair (ETH/USDC, DAI/USDC, etc.). Review TVL, APY, trading volume. Higher TVL = safer but lower APY.

2
Enter Amount

Input one token amount, the other auto-calculates to maintain ratio. Example: 10 ETH → automatically requires 30,000 USDC at 1:3000 price.

3
Approve & Deposit

Sign two transactions: (1) Token approval for smart contract access, (2) Deposit transaction. Gas cost: $5-50 on Ethereum L1, $0.01-0.50 on Polygon.

4
Receive LP Tokens

Pool mints LP tokens representing your share. These tokens prove ownership and can be redeemed anytime for your portion of reserves + accumulated fees.

💵 Understanding Your Returns

Trading Fee Income

Most pools charge 0.3% per swap. If you own 5% of the pool and daily volume is $1M, you earn: $1M × 0.3% × 5% = $15/day ($5,475/year).

Fee collection is automatic—no claiming needed until withdrawal
Additional Rewards

Many protocols offer liquidity mining incentives—bonus tokens for staking LP tokens. Can boost APY from 10% to 50-200%+ during campaigns.

Example: Uniswap distributes UNI tokens, Sushiswap gives SUSHI

⚠️ Pool Share Matters

Your percentage of the pool determines both earnings and exposure. Larger share = more fees but also more capital at risk from impermanent loss.

Small Player
0.01-0.5%
$100-$5K deposit
Medium Player
0.5-5%
$5K-$500K deposit
Whale
5-20%
$500K-$10M+ deposit

✨ Pro Tips for New LPs

• Start with stablecoins: DAI/USDC pools have minimal IL risk, perfect for learning.
• Check historical APY: Don't chase unsustainable 1000%+ rates—likely temporary.
• Monitor gas costs: Small deposits on Ethereum L1 may be unprofitable due to $20-100 gas fees.
• Diversify pools: Don't put all liquidity in one pool—spread risk across multiple pairs.

2. Provide Liquidity

💰 Interactive: Add Liquidity

Your Deposit
10 ETH
30,000 USDC
Total Value
$60,000
Pool Share
9.09%

⚖️ Balanced deposits: You must provide both tokens in the current pool ratio. This ensures the price stays consistent.

The Math Behind AMMs

📐 Understanding x × y = k

The constant product formula is the elegant algorithm powering most decentralized exchanges. It's deceptively simple: x × y = k, where x and y are the token reserves, and k is a constant that never changes (except when liquidity is added/removed).

The Key Insight: When someone buys token X, they add token Y to the pool. Reserve X decreases, reserve Y increases, but their product always equals k. This automatically adjusts prices—more demand for X makes it more expensive in terms of Y.

🧮 How Price Discovery Works

Initial State: Balanced Pool

Pool starts: 100 ETH × 300,000 USDC = 30,000,000 (k)

Current price: 300,000 / 100 = $3,000 per ETH

The ratio of reserves determines the spot price at any moment.

Someone Buys 10 ETH

Trader adds USDC to pool, removes ETH. To maintain k = 30,000,000:

New reserves: 90 ETH × 333,333 USDC = 30,000,000

New price: 333,333 / 90 = $3,704 per ETH

Price increased 23% because buying reduced ETH supply!

Arbitrage Restores Balance

If Binance shows ETH at $3,000 but pool shows $3,704, arbitrage opportunity exists.

Arbitrageur buys ETH on Binance ($3,000), sells to pool ($3,704), pockets $704 profit.

This pushes pool price back toward $3,000, keeping DEX prices aligned with broader market.

📊 The Bonding Curve

The constant product formula creates a hyperbolic curve. As reserves of one token decrease, its price increases exponentially. This is why large trades cause dramatic price impact.

Small Trade (1% of pool)

Minimal price impact (~1%). You get close to the spot price. Slippage is acceptable.

✅ Recommended trade size
Large Trade (25% of pool)

Massive price impact (~33%). Final units cost much more than first units. Severe slippage.

⚠️ Split into smaller trades

🔬 The Calculation Step-by-Step

// Given: Pool has 100 ETH and 300,000 USDC (k = 30M)
// You want to swap 5 ETH for USDC
amountIn = 5 ETH
amountInWithFee = 5 × 0.997 = 4.985 ETH (0.3% fee)
newReserveX = 100 + 4.985 = 104.985 ETH
newReserveY = 30,000,000 / 104.985 = 285,714 USDC
amountOut = 300,000 - 285,714 = 14,286 USDC
Effective price: 14,286 / 5 = $2,857 per ETH (vs $3,000 spot)

💡 Why This Formula Matters

• No Order Book Needed: Price emerges from reserves, not bids/asks. Trades execute instantly.
• Always Liquid: Pool never "runs out" of tokens—prices just get exponentially worse.
• Self-Balancing: Arbitrageurs keep pool prices aligned with external markets automatically.
• Predictable Slippage: You can calculate exact output before trading using the formula.

3. Automated Market Maker (AMM)

📐 Interactive: Constant Product Formula

The AMM Formula
x × y = k
Reserve A × Reserve B = Constant
100 × 200000 = 20,000,000

Swap Calculation

You give:1 Token A
You receive:1974.32 Token B
New price:1960.65

Executing Token Swaps

🔄 How DEX Swaps Work

Swapping tokens on a decentralized exchange is fundamentally different from centralized exchanges. No order matching, no waiting—you trade directly against the pool's reserves. The smart contract calculates output using the constant product formula and executes instantly.

The User Experience: Select input token and amount → see exact output (including slippage and fees) → approve transaction → swap completes in ~15 seconds. The entire process is permissionless and censorship-resistant—no account signup, no KYC, no middleman.

⚙️ What Happens During a Swap

1
Input Token Transfer

Your wallet sends tokens to the pool's smart contract. For ETH/USDC swap, you send 5 ETH to the pool address.

2
Fee Deduction

0.3% fee deducted from input (5 ETH × 0.3% = 0.015 ETH). Remaining 4.985 ETH goes into calculation. Fee stays in pool for LPs.

3
Output Calculation

Smart contract uses x × y = k to compute output. New ETH reserve increases, USDC reserve must decrease proportionally to maintain k.

4
Output Token Transfer

Pool sends calculated USDC amount to your wallet. Reserves update, new price set. Transaction complete.

💸 Cost Breakdown

Trading Fee (0.3%)

Goes to liquidity providers. On a $10,000 swap: $30 fee. Higher on some pools (0.5%-1%).

Distributed proportionally to all LPs
Network Gas Fee

Ethereum L1: $5-50
Polygon/Arbitrum: $0.01-0.50

Goes to validators, not LPs
Slippage Cost

Hidden cost from price impact. Large trades: 1-10% worse than spot price.

Set slippage tolerance to prevent surprises

🎯 Slippage Tolerance Explained

Slippage tolerance is your maximum acceptable price change. If you set 1% tolerance and price moves 1.5% before your transaction executes, the swap automatically fails (you get refunded minus gas fee).

0.1-0.5%
Stablecoin swaps
Ultra-low slippage expected
0.5-2%
Major token pairs
Standard setting
3-10%
Volatile/low-liquidity
High risk of bad execution

✨ Swap Best Practices

• Check multiple DEXs: Prices vary—use aggregators like 1inch to find best rate.
• Avoid low-liquidity pools: <$100K TVL = high slippage. Stick to $10M+ pools.
• Set reasonable slippage: Too tight = transaction fails. Too loose = sandwich attack risk.
• Swap during low gas: Trade overnight UTC on Ethereum to save 50-70% on fees.

4. Execute a Swap

🔄 Interactive: Token Swap

You Pay
5 ETH
You Receive
14955.00 USDC
After 0.3% fee

The Impermanent Loss Problem

📉 Understanding the Biggest LP Risk

Impermanent loss (IL) is the hidden cost of providing liquidity when token prices diverge from your entry point. If you had simply held the tokens instead of depositing them, you'd end up with more value. The loss is "impermanent" because it only becomes permanent when you withdraw—prices could revert.

The Core Mechanism: Liquidity pools automatically rebalance through arbitrage. When one token appreciates, arbitrageurs buy it from your pool until its price matches external markets. This means you're force-selling your winners and force-buying your losers.

📊 Real Example: ETH Price Doubles

Scenario: HODL Strategy

Initial: 10 ETH @ $3,000 + 30,000 USDC = $60,000 total

After ETH → $6,000: 10 ETH @ $6,000 + 30,000 USDC = $90,000 total

Profit: +$30,000 (50% gain)

Scenario: Liquidity Provider

Initial: 10 ETH + 30,000 USDC in pool = $60,000 total

After rebalancing: 7.07 ETH @ $6,000 + 42,426 USDC = $84,852 total

Profit: +$24,852 (41.4% gain)

Impermanent Loss: -$5,148 (5.7% loss vs HODL)

What happened: As ETH rose, arbitrageurs bought ETH from your pool (selling USDC), reducing your ETH exposure from 10 → 7.07 ETH. You sold 2.93 ETH at average prices between $3K-$6K, missing full upside. Your position rebalanced to 50/50 value.

📈 IL by Price Change Magnitude

1.25x
Price Change
-0.6% IL
Minimal impact
1.5x
Price Change
-2.0% IL
Acceptable
2x
Price Change
-5.7% IL
Noticeable loss
5x
Price Change
-25.5% IL
Severe loss

Note: IL is symmetric—price going up 2x or down 2x both result in same ~5.7% loss vs holding.

💰 Can Trading Fees Offset IL?

✅ Scenario: Fees Win

• Stablecoin pool (DAI/USDC)

• Price divergence: minimal (~0.1%)

• IL: ~0.01%

• Daily volume: $10M, 0.05% fee

• Your 1% share earns: $5K/day, ~180% APY

Fees massively exceed IL ✅

❌ Scenario: IL Dominates

• Volatile pool (SHIB/ETH)

• Price divergence: 5x in 3 months

• IL: -25.5%

• Daily volume: $500K, 0.3% fee

• Your 1% share earns: $15/day, ~5.5% APY

IL crushes fee income ❌

🛡️ Strategies to Minimize IL

Stablecoin pairs: DAI/USDC have minimal price divergence. IL typically <0.1%.

Correlated assets: ETH/stETH or WBTC/renBTC move together, reducing IL to 1-3%.

High-volume pools: Fee income can outpace IL. ETH/USDC on Uniswap does $100M+ daily.

Short timeframes: IL grows over time. Consider LPing for weeks, not years, in volatile pairs.

Concentrated liquidity: Uniswap v3 lets you provide liquidity in narrow price ranges for 2-10x higher fee earnings.

🎯 Key Takeaway

Impermanent loss is the price you pay for earning trading fees. It's not a bug, it's a feature—the automatic rebalancing is what enables 24/7 liquidity. Only provide liquidity if you believe fee income will exceed IL, or if you have no strong directional conviction on either token.

5. Impermanent Loss

📉 Interactive: Calculate IL

Price Change
33.3%
Impermanent Loss
-1.03%
vs. HODL
😐 Slightly worse

⚠️ Understanding IL: When token prices diverge from your entry point, you'd have been better off just holding. However, trading fees can offset this loss over time.

Earning Trading Fees as an LP

💵 The Passive Income Opportunity

Every swap on a liquidity pool charges a trading fee (typically 0.05%-1%), and 100% of that fee goes to liquidity providers. Your share of fees is proportional to your share of the pool. This creates a genuine passive income stream—fees accumulate automatically 24/7 with no action required.

The Scalability: Unlike staking where your rewards are fixed, LP fee income scales with trading volume. A $100M daily volume pool at 0.3% fee generates $300,000 daily fees to be distributed. Even a 0.1% pool share earns $300/day ($109K/year).

🔢 Fee Revenue Math

Formula: Your Daily Fees
dailyFees = (dailyVolume × feePercent) × yourPoolShare
Example: ($10M × 0.3%) × 5% = $1,500/day
Yearly: $1,500 × 365 = $547,500/year
If you deposited $500K: $547,500 / $500K = 109% APY
Your Deposit
$500,000
5% of $10M pool
Pool Volume
$10M/day
$3.65B/year
Fee Tier
0.3%
Standard for most pools

📊 Fee Tiers Explained

0.05% Fee TierStablecoins

For highly correlated pairs (DAI/USDC, USDC/USDT). Lower fee compensated by massive volume. $100M+ daily volume common.

Example: $100M volume × 0.05% = $50K daily fees to distribute
0.3% Fee TierMost Common

Standard for major pairs (ETH/USDC, BTC/ETH, UNI/ETH). Balances volume with fee capture. $10M-50M daily volume typical.

Example: $20M volume × 0.3% = $60K daily fees to distribute
1% Fee TierExotic/Volatile

For risky or low-liquidity pairs. High IL risk compensated by high fees. Lower volume ($100K-1M daily) but premium fee capture.

Example: $500K volume × 1% = $5K daily fees to distribute

💰 Real-World APY Examples

🔵 ETH/USDC (Uniswap v3)

• TVL: $400M

• Daily Volume: $50M

• Fee: 0.3%

• Daily Fees: $150K

APY: ~13.7%

💠 DAI/USDC (Curve)

• TVL: $200M

• Daily Volume: $80M

• Fee: 0.04%

• Daily Fees: $32K

APY: ~5.8%

🔮 UNI/ETH (Uniswap v2)

• TVL: $50M

• Daily Volume: $3M

• Fee: 0.3%

• Daily Fees: $9K

APY: ~6.6%

⚡ SHIB/ETH (SushiSwap)

• TVL: $10M

• Daily Volume: $2M

• Fee: 0.3%

• Daily Fees: $6K

APY: ~21.9%

⚠️ High IL risk

🎯 Maximizing Fee Income

• Target high-volume pools: $10M+ daily volume ensures consistent fee flow.
• Monitor volume trends: New token pairs often have explosive early volume.
• Concentrated liquidity: Uniswap v3 lets you earn 2-10x more fees in narrow ranges.
• Stack yield farming: Many protocols offer bonus tokens on top of trading fees.

6. Earning Trading Fees

💵 Interactive: Fee Revenue Calculator

Daily Fees
$150.00
Monthly Fees
$4500.00
Yearly Revenue
$54750.00

Slippage & Price Impact

📊 Why Large Trades Get Worse Prices

Slippage is the difference between the expected price and the actual execution price. On AMMs, slippage is directly proportional to your trade size relative to pool liquidity. The larger your trade as a % of the pool, the worse your price—exponentially.

The Math: The constant product formula means buying 1% of the pool's token moves price ~1%, but buying 10% moves it ~11%, and buying 50% moves it ~100% (doubles the price). This protects the pool from being drained but punishes large traders.

🔍 Real Example: Trade Size Impact

Scenario: ETH/USDC Pool (100 ETH, 300K USDC)
Small Trade: Buy 0.5 ETH (0.5% of pool)Price Impact: ~0.5%
Pay: $1,507 | Fair price: $1,500 | Slippage: $7 ✅
Medium Trade: Buy 5 ETH (5% of pool)Price Impact: ~5.3%
Pay: $15,795 | Fair price: $15,000 | Slippage: $795 ⚠️
Large Trade: Buy 20 ETH (20% of pool)Price Impact: ~25%
Pay: $75,000 | Fair price: $60,000 | Slippage: $15,000 🚫

📉 Slippage Guidelines by Trade Size

<1%
of Pool TVL
Minimal Slippage
0.5-1% price impact
✅ Recommended
1-5%
of Pool TVL
Moderate Slippage
1-5% price impact
⚠️ Acceptable
5-10%
of Pool TVL
High Slippage
5-11% price impact
⚠️ Split trade
> 10%
of Pool TVL
Severe Slippage
> 11% price impact
🚫 Don't trade

🛡️ Protection Strategies

1️⃣
Use Slippage Tolerance Settings

Set max acceptable slippage (e.g., 2%). Transaction reverts if actual slippage exceeds this, protecting you from sandwich attacks and extreme price movements.

2️⃣
Split Large Trades

Instead of buying 20 ETH at once (20% of pool, 25% slippage), buy 5 ETH four times (5% each, ~5.3% slippage per trade). Total slippage: ~21% vs 25%.

3️⃣
Use Aggregators

Tools like 1inch, Matcha, Paraswap route trades across multiple pools and DEXs to minimize slippage. A $100K swap might use 5 different pools simultaneously.

4️⃣
Target Deep Liquidity Pools

$100M+ TVL pools absorb large trades better. $50K trade in $1M pool = 5% size. Same trade in $100M pool = 0.05% size, minimal slippage.

⚠️ Beware: Sandwich Attacks

Bots monitor the mempool for large pending trades. They front-run (buy before you, driving price up) and back-run (sell after you, profiting from your purchase). You pay inflated prices while bot profits.

Example Attack:

1. Your trade pending: Buy 10 ETH with 5% slippage tolerance

2. Bot front-runs: Buys 8 ETH, price jumps 3%

3. Your trade executes: You buy at 3% premium

4. Bot back-runs: Sells 8 ETH, pockets 3% profit

You lost ~$900 to MEV bot. Bot earned ~$720.

💡 Key Takeaway

Slippage is the tax for immediate liquidity. Trade size matters exponentially—keep trades under 1-2% of pool size for minimal slippage. For large trades, use aggregators, split orders, or consider OTC desks.

7. Price Impact & Slippage

📊 Interactive: Slippage Simulator

Trade % of Pool
1.00%
Price Impact
2.00%
Slippage Status
⚠️ Medium

⚡ Pro tip: Large trades relative to pool size cause significant slippage. Consider splitting into smaller trades or using pools with deeper liquidity.

LP Tokens: Your Liquidity Receipt

🎫 How LP Tokens Work

When you deposit tokens into a liquidity pool, you receive LP (Liquidity Provider) tokens as a receipt. These tokens represent your proportional share of the pool and your claim on the underlying assets plus accumulated fees. Think of them as a warehouse receipt—you can redeem them anytime for your portion of the vault.

The Power of Composability: LP tokens are ERC-20 tokens themselves, so they can be transferred, sold, or used as collateral in other DeFi protocols. This creates yield-stacking opportunities—earn trading fees AND stake LP tokens for bonus rewards.

🔢 LP Token Math

When You Deposit (Minting LP Tokens)
// First depositor sets the rate
lpTokens = sqrt(amountA × amountB)
// Later depositors get proportional share
lpTokens = (yourDeposit / totalPoolValue) × totalLpSupply
Example: Pool has $10M TVL, 1M LP tokens. You deposit $100K.
You receive: ($100K / $10M) × 1M = 10,000 LP tokens
Your share: 10,000 / 1,010,000 = 0.99%
When You Withdraw (Burning LP Tokens)
yourShare = lpTokens / totalLpSupply
ethReturned = yourShare × poolEthReserve
usdcReturned = yourShare × poolUsdcReserve
Example: You own 10,000 LP tokens (0.99%). Pool now has 105 ETH, 325K USDC.
You receive: 0.99% × 105 ETH = 1.04 ETH
You receive: 0.99% × 325K USDC = 3,218 USDC
Note: Extra 5 ETH + 25K USDC came from trading fees accumulated

💎 LP Token Use Cases

🎁
Yield Farming (Staking)

Stake your LP tokens in liquidity mining programs to earn bonus governance tokens. Example: Stake UNI-V2 ETH/USDC LP tokens on SushiSwap to earn SUSHI tokens (20-100% APY).

🏦
Collateral for Loans

Use LP tokens as collateral on lending platforms like Aave or Rari. Borrow stablecoins against your LP position at 50-70% LTV. Earn fees while borrowing.

💱
Trading/Transferring

LP tokens are transferable ERC-20 tokens. Sell your position OTC without withdrawing liquidity. Transfer to another wallet instantly. No withdrawal fees.

🔐
Vaults & Auto-Compounding

Deposit LP tokens in yield aggregators (Yearn, Beefy) that automatically claim and reinvest fees. Compound earnings without manual intervention.

⚠️ LP Token Risks

Smart Contract Risk

LP tokens are tied to pool smart contracts. If the contract has a bug or exploit, your entire position could be drained. Stick to audited, battle-tested protocols (Uniswap, Curve, Balancer).

Mitigati on: Use established DEXs with $1B+ TVL
Rug Pulls (New Tokens)

Scam projects create pools with fake tokens, attract liquidity, then drain the legitimate token (ETH/USDC). Always verify token contracts and team credibility before providing liquidity.

Mitigation: Only LP in top 100 tokens

💡 LP Token Strategy

LP tokens unlock multi-layered yield: trading fees (base layer) + liquidity mining rewards (second layer) + auto-compounding vaults (third layer). Advanced users stack all three for 100-300% APY in bull markets.

Layer 1: Fees
5-20% APY
Layer 2: Mining
+20-80% APY
Layer 3: Vaults
+10-50% APY

8. LP Token Value

🎫 Interactive: LP Token Calculator

Your Share
1.000%
ETH Claimable
1.0000
USDC Claimable
2000.00

Visualizing AMM Price Curves

📈 The Hyperbolic Curve of Liquidity

The constant product formula x × y = k creates a hyperbolic curve when graphed. This curve represents all possible states of the pool—as you move along the curve (trading), you're always maintaining the constant k, but the ratio of tokens (the price) changes dramatically.

Why Hyperbolic? As one token reserve approaches zero, its price approaches infinity. The pool never fully drains—it just makes the price prohibitively expensive. This mathematical property ensures perpetual liquidity, even for extreme trades.

📊 Reading the Curve

The Axes

X-axis (horizontal): Reserve of Token A (e.g., ETH)

Y-axis (vertical): Reserve of Token B (e.g., USDC)

Any point on curve: Valid pool state where x × y = k

Slope at any point: The current price (rate of exchange)

Movement Along the Curve

Buy Token A (ETH): Move left and up—ETH reserve decreases, USDC reserve increases

Buy Token B (USDC): Move right and down—USDC reserve decreases, ETH reserve increases

Small trades: Small movements along curve = minimal price change

Large trades: Large movements = you're "climbing" the steep part of curve = exponential price increase

🔬 Mathematical Properties

Asymptotic Behavior

As you buy more of one token, its reserve approaches (but never reaches) zero. Price approaches infinity. The curve has vertical and horizontal asymptotes.

Result: Pool never fully drains, always has some liquidity
Convexity

The curve is convex—it bends away from origin. This means price impact accelerates with trade size. Second half of your trade is more expensive than first half.

Result: Large trades face exponential slippage

🆚 Comparing AMM Models

🔷
Uniswap v2: Constant Product (x × y = k)

Hyperbolic curve. Liquidity spread across all prices (0 to ∞). Simple, capital inefficient. Good for volatile pairs.

🔶
Uniswap v3: Concentrated Liquidity

LPs choose price range (e.g., $2,900-$3,100 for ETH). Liquidity concentrated in range. 2-10x capital efficiency, but requires active management.

🔸
Curve: StableSwap (optimized for stablecoins)

Flat curve around 1:1 price, hyperbolic at extremes. Low slippage for similar-priced assets. Perfect for DAI/USDC, stETH/ETH.

🔺
Balancer: Weighted Pools (multi-token)

Custom weights (e.g., 80% WBTC, 20% ETH). Curve adjusts based on weights. Allows 2-8 tokens per pool.

💡 Practical Implication

Understanding the curve helps you predict slippage. The steeper the curve at your trade point, the higher the slippage. Large trades push you up the steep part—split them to stay on the flatter section.

9. Understanding Price Curves

📈 Interactive: AMM Price Curve

Understanding APY & Yield

💎 Projecting Your Liquidity Pool Returns

APY (Annual Percentage Yield) shows your projected returns if current conditions persist for a year. In DeFi liquidity pools, APY comes from multiple sources: trading fees, liquidity mining rewards, and sometimes additional protocol incentives. Understanding how to calculate and interpret APY is crucial for comparing opportunities.

The Catch: Advertised APYs are snapshots, not guarantees. They fluctuate daily based on trading volume (fees), token prices (IL), and reward emissions. A 100% APY today could be 20% next week if volume drops or token rewards decline.

🧮 APY Calculation Breakdown

Component 1: Trading Fee APY
// Calculate annualized fee income
dailyFees = (dailyVolume × feePercent) × yourShare
yearlyFees = dailyFees × 365
feeAPY = (yearlyFees / yourDeposit) × 100
Example: $10M daily volume, 0.3% fee, 1% pool share, $100K deposit
Daily: ($10M × 0.3%) × 1% = $300
Yearly: $300 × 365 = $109,500
APY: ($109,500 / $100,000) × 100 = 109.5%
Component 2: Liquidity Mining APY
// Calculate reward token APY
dailyRewards = (totalDailyEmissions / totalStaked) × yourStake
yearlyValue = dailyRewards × tokenPrice × 365
miningAPY = (yearlyValue / yourDeposit) × 100
Example: 1,000 UNI/day pool rewards, 10M total staked, you stake 100K
Daily: (1,000 / 10M) × 100K = 10 UNI
Yearly: 10 × $5 × 365 = $18,250
APY: ($18,250 / $100,000) × 100 = 18.25%
Total APY (Compounded)

If you compound earnings (reinvest fees + rewards back into pool), APY is higher than simple addition:

totalAPY = (1 + feeAPY/365)^365 × (1 + miningAPY/365)^365 - 1
Simple: 109.5% + 18.25% = 127.75%
Compounded: ~183.2% APY

📊 APY Reality Check

🟢 Sustainable (5-30% APY)

Driven by real trading fees from established pools. Volume is consistent. Returns predictable.

Examples: ETH/USDC, DAI/USDC on Uniswap/Curve
🟡 Medium Risk (30-100% APY)

Mix of fees and farming rewards. Token rewards may decline. IL risk higher in volatile pairs.

Examples: UNI/ETH, MATIC/ETH with staking
🔴 High Risk (> 100% APY)

Mostly from unsustainable token emissions. Rewards dump, APY crashes. High IL risk. Often new/unproven projects.

Examples: New DEX launches, meme coin pairs

⚠️ APY Pitfalls to Avoid

Ignoring Impermanent Loss: A 50% APY is worthless if you suffer 60% IL. Always factor in IL when volatile pairs.
Chasing High APY: 500% APY on unknown tokens usually means emissions will dump price 90%. Better to earn 20% safely.
Not Accounting for Gas: On Ethereum L1, $50 to enter + $50 to exit = $100 overhead. Need $10K+ position to make sense.
Assuming APY is Fixed: Trading volume fluctuates. Token rewards decrease over time. 100% APY today might be 40% next month.

🎯 Realistic Yield Expectations

Stablecoins
3-10% APY
Low risk, stable returns
Blue Chips
10-30% APY
ETH/BTC pairs, medium risk
Mid-caps
30-80% APY
Higher IL risk
Speculative
80-300% APY
Very high risk

💡 Pro Strategy: Risk-Adjusted Returns

Smart LPs don't chase maximum APY—they chase maximum risk-adjusted APY. A safe 15% on stablecoins beats a risky 80% that comes with 50% IL potential. Calculate: Expected APY - Expected IL - Gas Costs = True Return.

10. APY Calculator

💎 Interactive: Yield Projections

Initial Deposit
$10,000
Profit
+$2839.16
Final Value
$12839.16

🎯 Key Takeaways

🏊

Automated Market Makers

Liquidity pools use mathematical formulas (x × y = k) to enable trading without order books. Prices adjust automatically based on supply and demand.

💰

Earn Passive Income

Liquidity providers earn a share of all trading fees proportional to their pool ownership. High-volume pools generate substantial revenue.

📉

Impermanent Loss Risk

When token prices diverge, LPs experience impermanent loss compared to holding. This loss can be offset by trading fees over time.

⚖️

Balanced Deposits

You must provide both tokens in the current ratio. Pools automatically rebalance through arbitrage trading to maintain fair prices.

📊

Slippage & Impact

Large trades cause price impact. The trade size relative to pool liquidity determines slippage. Deeper pools = less slippage.

🎫

LP Tokens

When you provide liquidity, you receive LP tokens representing your share. These can be staked for additional rewards or used as collateral.