Back to Blog

What Is an Automated Market Maker (AMM)? A Simple Guide for Uniswap Users

🤝Join the Beta

Help Us Build PoolShark

Get unlimited free access in exchange for feedback. We're figuring this out together and would love your help.

Join Beta

What Is an Automated Market Maker (AMM)? A Simple Guide for Uniswap Users

Automated Market Makers (AMMs) are the technology that powers Uniswap and most decentralized exchanges. But if you're new to DeFi, the concept can seem abstract—how can a mathematical formula replace human market makers? And why does this matter for your trading and liquidity provision?

This guide explains exactly what AMMs are, how they work mathematically, and why they've revolutionized decentralized finance. You'll understand pricing curves, liquidity pools, fee mechanics, and how liquidity providers earn money—all explained in simple terms with real examples.

By the end, you'll understand the foundation that makes Uniswap work and why AMMs enable permissionless trading for anyone, anywhere.

What Is an Automated Market Maker?

An Automated Market Maker (AMM) is a smart contract that uses a mathematical formula to determine token prices and execute trades automatically—no human market makers or order books required.

Traditional exchange (order book):

  • Buyers place "bid" orders (I'll buy ETH at $2,400)
  • Sellers place "ask" orders (I'll sell ETH at $2,500)
  • Exchange matches orders when prices overlap
  • Requires active market makers providing liquidity

AMM (liquidity pool):

  • Smart contract holds a pool of tokens (e.g., 1,000 ETH and 2,500,000 USDC)
  • Mathematical formula determines prices based on pool ratios
  • Anyone can trade against the pool instantly
  • Liquidity providers earn fees automatically

Key difference: AMMs don't need someone to take the other side of your trade. You trade directly against a pool of assets, with prices determined by a formula.

How AMMs Work: The Core Mechanism

The Constant Product Formula: x × y = k

Uniswap V2 uses a simple but powerful formula:

x × y = k

Where:

  • x = amount of token A in the pool
  • y = amount of token B in the pool
  • k = constant product (must stay the same)

How it determines price:

  • Price = y / x (how much token B per token A)
  • When you buy token A, you add token B and remove token A
  • This changes the ratio, which changes the price
  • The formula ensures the pool always has liquidity (can't run out)

Real Example: ETH/USDC Pool

Initial pool state:

  • 1,000 ETH (x)
  • 2,500,000 USDC (y)
  • k = 1,000 × 2,500,000 = 2,500,000,000

Current price: 2,500,000 / 1,000 = 2,500 USDC per ETH

You want to buy 1 ETH:

Step 1: Calculate what happens to the pool

  • You remove 1 ETH, so new x = 999 ETH
  • k must stay 2,500,000,000
  • New y = 2,500,000,000 / 999 = 2,502,503 USDC
  • You must add: 2,502,503 - 2,500,000 = 2,503 USDC

Result: You paid 2,503 USDC for 1 ETH (slightly above market price due to slippage)

New pool state:

  • 999 ETH
  • 2,502,503 USDC
  • New price: 2,502,503 / 999 = 2,505 USDC per ETH

Key insight: The larger your trade relative to pool size, the more slippage you experience. This is why liquidity depth matters—larger pools mean better prices.

Why AMMs Matter: The Revolution

Problem AMMs Solved

Before AMMs:

  • Exchanges needed order books with sufficient depth
  • Market makers had to actively provide liquidity
  • New tokens couldn't get listed easily
  • Low-liquidity pairs had huge spreads
  • Centralized control over listings

AMMs enabled:

  • Permissionless trading: Any token pair can have a pool
  • Automatic pricing: Formula determines prices, no matching needed
  • 24/7 liquidity: Pools always available
  • Global access: Anyone can trade or provide liquidity
  • No intermediaries: Smart contracts handle everything

The Uniswap Innovation

Uniswap didn't invent AMMs (Bancor did), but Uniswap made them:

  • Simple: Easy to understand and use
  • Efficient: Low gas costs (relatively)
  • Composable: Other protocols can build on top
  • Open source: Anyone can fork and improve

Result: Uniswap became the standard, and AMMs became the foundation of DeFi.

Understanding Liquidity Pools

What Is a Liquidity Pool?

A liquidity pool is a smart contract holding two tokens that traders can swap between. Liquidity providers deposit tokens, and traders swap against the pool.

Example: ETH/USDC Pool

Pool composition:

  • 1,000 ETH
  • 2,500,000 USDC
  • Total value: $5,000,000

How it works:

  • Trader wants to buy ETH → Adds USDC, removes ETH
  • Trader wants to sell ETH → Adds ETH, removes USDC
  • Each swap changes the ratio, which changes the price
  • Formula ensures pool always has both tokens

How Liquidity Providers Earn Fees

When you provide liquidity:

  1. You deposit equal value of both tokens (e.g., $5,000 ETH + $5,000 USDC)
  2. You receive LP tokens representing your share
  3. Traders pay fees when swapping (0.01% to 1% depending on fee tier)
  4. Fees accumulate in the pool
  5. You earn fees proportional to your share

Example:

  • Pool has $1 million TVL
  • You provide $10,000 (1% of pool)
  • Pool generates $10,000 in fees per day
  • You earn: $10,000 × 0.01 = $100/day
  • Annualized: ~365% APR (before impermanent loss)

Important: Fees are just one part of returns. You also face impermanent loss when prices diverge. Track your positions with PoolShark to see your real returns after accounting for all factors.

Pricing Curves: How AMMs Determine Prices

The Constant Product Curve

The x × y = k formula creates a hyperbolic pricing curve:

Characteristics:

  • Price increases as you buy more (slippage)
  • Price decreases as you sell more
  • Curve is smooth and continuous
  • Never runs out of liquidity (approaches but never reaches zero)

Visual representation:

Price
  |
  |     /
  |    /
  |   /
  |  /
  | /
  |/_____________ Quantity

Key properties:

  • Infinite liquidity: Pool can always execute trades (at some price)
  • Price impact: Larger trades move price more
  • Slippage: Difference between expected and actual price

Slippage Explained

Slippage is the difference between the expected price and the actual execution price.

Example:

  • You want to buy 10 ETH
  • Current price: 2,500 USDC per ETH
  • Expected cost: 25,000 USDC
  • Actual cost: 25,500 USDC (due to price impact)
  • Slippage: 500 USDC (2%)

Why slippage happens:

  • Your trade changes the pool ratio
  • Formula adjusts price to maintain k
  • Larger trades = more slippage

How to minimize slippage:

  • Use larger pools (more liquidity)
  • Split large trades into smaller ones
  • Use limit orders (Uniswap V3)
  • Check price impact before trading

Fee Mechanics: How AMMs Generate Revenue

Fee Structure

Uniswap V2:

  • Single fee: 0.3% per swap
  • All fees go to liquidity providers
  • Simple and predictable

Uniswap V3:

  • Multiple fee tiers: 0.01%, 0.05%, 0.30%, 1.00%
  • Different tiers for different asset types
  • LPs choose which tier to provide liquidity to

How Fees Are Distributed

Process:

  1. Trader initiates swap
  2. Fee is deducted (e.g., 0.05% of swap amount)
  3. Fee stays in the pool (increases pool value)
  4. LPs earn fees proportional to their share
  5. Fees compound as pool value grows

Example:

  • Pool: ETH/USDC (0.05% tier)
  • Trader swaps: 10 ETH for 25,000 USDC
  • Fee: 25,000 × 0.0005 = 12.5 USDC
  • Fee stays in pool
  • All LPs benefit proportionally

Important: Fees accumulate in the pool. When you withdraw, you get your share of accumulated fees plus your original capital.

AMM Variations: Beyond Constant Product

Constant Product (Uniswap V2)

Formula: x × y = k

Characteristics:

  • Simple and proven
  • Works for all token pairs
  • Predictable slippage
  • Used by most DEXs

Concentrated Liquidity (Uniswap V3)

Innovation: LPs choose price ranges instead of full range

Benefits:

  • 2-4x better capital efficiency
  • Same fees with less capital
  • More control for LPs

Tradeoff: Requires active range management

Other AMM Types

StableSwap (Curve):

  • Optimized for stablecoins
  • Lower slippage for similar assets
  • Different formula (x + y = k for stable pairs)

Weighted Pools (Balancer):

  • Multiple tokens in one pool
  • Custom weightings
  • More complex but flexible

Hybrid Models:

  • Combine multiple formulas
  • Optimize for specific use cases
  • More sophisticated but harder to understand

For most users: Constant product (Uniswap V2/V3) is sufficient and most widely used.

Advantages of AMMs

1. Permissionless Trading

Anyone can:

  • Create a pool for any token pair
  • Trade any pair instantly
  • Provide liquidity to any pool
  • No approval process needed

Impact: Enabled thousands of tokens to access liquidity immediately.

2. 24/7 Availability

AMMs:

  • Never close
  • No maintenance windows
  • Always available globally
  • No downtime

Impact: True global, always-on trading.

3. Composability

AMMs integrate with:

  • Lending protocols (use pools as collateral)
  • Yield aggregators (route through pools)
  • Other DeFi protocols (build on top)
  • Complex strategies (combine multiple protocols)

Impact: Entire DeFi ecosystem built on AMMs.

4. Transparent Pricing

AMMs:

  • Formula is public
  • Prices determined algorithmically
  • No hidden spreads
  • Predictable slippage

Impact: Fair, transparent pricing for everyone.

5. Lower Barriers to Entry

Traditional market making:

  • Requires capital
  • Needs expertise
  • Active management
  • High barriers

AMM liquidity provision:

  • Anyone can participate
  • Passive approach possible
  • Lower capital requirements
  • Easier to understand

Impact: Democratized market making.

Disadvantages and Limitations

1. Impermanent Loss

What it is: Loss from providing liquidity when prices diverge from entry point.

Example:

  • You deposit: 2 ETH + 5,000 USDC (worth $10,000)
  • ETH price doubles
  • If you held: Would be worth $15,000
  • In pool: Worth ~$14,500
  • Impermanent loss: $500

Impact: Can reduce or eliminate returns, especially for uncorrelated pairs.

2. Slippage on Large Trades

Problem: Large trades experience significant slippage.

Example:

  • Buying $1 million of tokens
  • Might pay 5-10% above market price
  • Slippage can be expensive

Impact: Large traders may prefer order book exchanges.

3. Capital Inefficiency (V2)

Problem: V2 spreads liquidity across entire price range.

Example:

  • Much liquidity sits at extreme prices (never used)
  • Only ~50% capital efficiency
  • Need 2x capital for same fees vs V3

Impact: V3 solved this with concentrated liquidity.

4. Gas Costs

Problem: Each swap costs gas (especially on Ethereum).

Example:

  • Simple swap: $10-50 gas
  • Complex swap: $20-100+ gas
  • Can eat into profits for small trades

Impact: Layer 2 networks (Arbitrum, Optimism) solve this.

5. Price Oracle Limitations

Problem: AMM prices can deviate from external markets.

Example:

  • Large trade moves pool price significantly
  • Arbitrageurs correct it, but temporary deviation exists
  • Can affect protocols using AMM as price oracle

Impact: V2 introduced TWAP (time-weighted average price) to mitigate this.

How AMMs Enable Liquidity Provision

The LP Lifecycle

1. Deposit Liquidity:

  • Provide equal value of both tokens
  • Receive LP tokens (receipt for your share)
  • Start earning fees immediately

2. Fees Accumulate:

  • Every swap generates fees
  • Fees stay in pool (increase pool value)
  • Your LP tokens become more valuable

3. Withdraw:

  • Burn LP tokens
  • Receive tokens back (plus accumulated fees)
  • Claim your share of pool value

Real Example: Providing ETH/USDC Liquidity

Initial deposit:

  • 2 ETH (worth $5,000)
  • 5,000 USDC
  • Total: $10,000
  • Receive LP tokens representing 0.1% of pool

After 30 days:

  • Pool generated $30,000 in fees
  • Your share: $30,000 × 0.001 = $30
  • Pool value increased (fees accumulated)
  • Your LP tokens worth more

Withdraw:

  • Burn LP tokens
  • Receive: 2 ETH + 5,030 USDC (includes your fee share)
  • Earned: $30 in fees

But: If ETH price moved, you also face impermanent loss. Net return = fees - IL.

This is why tracking real returns matters—you need to see fees minus impermanent loss. Start tracking with PoolShark to see your actual LP performance.

AMMs vs Order Books: Key Differences

Order Book Exchanges

How they work:

  • Buyers and sellers place orders
  • Exchange matches orders
  • Requires active market makers
  • Centralized matching engine

Advantages:

  • Better prices for large trades
  • No impermanent loss
  • More familiar to traditional traders

Disadvantages:

  • Need sufficient order book depth
  • Can't trade low-liquidity pairs
  • Centralized control
  • KYC/account requirements

AMM Exchanges

How they work:

  • Trade against liquidity pools
  • Formula determines prices
  • No order matching needed
  • Fully decentralized

Advantages:

  • Works for any token pair
  • 24/7 availability
  • Permissionless
  • No account needed

Disadvantages:

  • Slippage on large trades
  • Impermanent loss for LPs
  • Gas costs
  • Less efficient for very large trades

Reality: Both have their place. AMMs dominate DeFi, but order books still excel for large institutional trades.

The Future of AMMs

Current Innovations

Uniswap V3:

  • Concentrated liquidity
  • Multiple fee tiers
  • Better capital efficiency

Uniswap V4 (upcoming):

  • Hooks (customizable pool logic)
  • Singleton contract (lower gas)
  • Flash accounting (more efficient)

Emerging Trends

1. Hybrid Models:

  • Combine AMMs with order books
  • Best of both worlds
  • Better prices + always-on liquidity

2. Advanced Routing:

  • Multi-hop optimization
  • Cross-protocol routing
  • Better price discovery

3. Capital Efficiency:

  • Continued improvements
  • More fees with less capital
  • Better returns for LPs

4. Layer 2 Expansion:

  • Lower gas costs
  • More accessible
  • Faster transactions

Common AMM Misconceptions

Misconception 1: "AMMs Always Have the Best Prices"

Reality: AMMs provide good prices for most trades, but order books can be better for very large trades. The advantage is accessibility and 24/7 availability, not always price.

Misconception 2: "LPs Always Make Money"

Reality: LPs face impermanent loss, which can exceed fees earned. Many LPs lose money, especially in volatile markets. Success requires strategy and monitoring.

Misconception 3: "AMMs Are Too Complex"

Reality: Basic AMM usage (swapping) is simple. Advanced features (LP optimization) are more complex, but anyone can start trading easily.

Misconception 4: "Gas Fees Make AMMs Unusable"

Reality: On Ethereum Mainnet, gas can be expensive. But AMMs are available on Layer 2 networks where gas costs pennies. The ecosystem has solved this.

Misconception 5: "AMMs Are Just for Trading"

Reality: AMMs enable entire DeFi ecosystems—lending, borrowing, yield farming, and complex strategies all depend on AMM liquidity.

How to Use AMMs Effectively

For Traders:

  1. Understand slippage: Larger trades = more slippage
  2. Check liquidity depth: Larger pools = better prices
  3. Use Layer 2: Lower gas costs
  4. Set slippage tolerance: Appropriate for token volatility
  5. Verify you're on real site: Avoid phishing

For Liquidity Providers:

  1. Choose pools wisely: High Volume-to-TVL ratios
  2. Understand impermanent loss: Use correlated pairs
  3. Monitor positions: Especially V3 ranges
  4. Track real returns: Fees minus IL minus gas
  5. Optimize continuously: Based on data

This requires tracking tools—manually calculating returns across multiple positions is nearly impossible. Start tracking with PoolShark to automatically monitor all your LP positions and see real returns.

Conclusion: AMMs Are the Foundation of DeFi

Automated Market Makers revolutionized decentralized finance by enabling permissionless, 24/7 trading for any token pair. Understanding how AMMs work—the constant product formula, liquidity pools, fee mechanics—helps you trade and provide liquidity more effectively.

Key takeaways:

  • AMMs use mathematical formulas (x × y = k) to determine prices
  • Liquidity pools enable trading without order books
  • LPs earn fees but face impermanent loss
  • AMMs enable permissionless, global trading
  • Understanding AMMs helps optimize your DeFi strategy

The revolution continues: V3 improved capital efficiency, V4 will reduce gas costs further, and AMMs continue evolving to serve traders and LPs better.

Whether you're trading tokens or providing liquidity, understanding AMMs helps you make better decisions. And once you start providing liquidity, tracking your positions becomes essential for optimizing returns.

Ready to optimize your AMM experience? Start tracking your LP positions with PoolShark to see exactly how your positions are performing, calculate real returns, and identify optimization opportunities—free for 7 days, no credit card required.


Want to learn more? Check out our guides on how Uniswap works, liquidity pool returns, or fee tier optimization. Get started with PoolShark to track your positions automatically.

🤝Join the Beta

Help Us Build PoolShark

Get unlimited free access in exchange for feedback. We're figuring this out together and would love your help.

Join Beta