Back to Blog
DeFi Education6 min read

How AMMs Work: The Engine Behind Decentralized Exchanges

Understand Automated Market Makers — constant product formula, concentrated liquidity, and how DEX trading really works.

From Order Books to AMMs

Traditional exchanges use order books: buyers and sellers place orders at specific prices. AMMs replace this with liquidity pools and mathematical formulas, enabling permissionless trading.

The Constant Product Formula

Uniswap v2 popularized the formula: x * y = k, where x and y are token reserves and k is a constant. When you buy token X, you add token Y to the pool, maintaining the product.

This means: larger trades move the price more (slippage), and pools with more liquidity have less slippage.

Concentrated Liquidity (Uniswap v3+)

Instead of spreading liquidity across the entire price range (0 to infinity), LPs can concentrate their liquidity in specific price ranges. This creates much deeper liquidity at commonly traded prices.

  • For LPs: Higher fee earnings per dollar deposited
  • For traders: Lower slippage on trades near the current price
  • Tradeoff: LPs must actively manage their positions

Types of AMMs

  • Constant product: Uniswap v2, SushiSwap (x * y = k)
  • Stable swap: Curve (optimized for pegged assets)
  • Concentrated: Uniswap v3, Aerodrome (range-based)
  • Proactive MM: Trader Joe (auto-rebalancing)
  • Hybrid: Balancer (weighted pools with multiple tokens)

Impermanent Loss

When prices diverge from your entry point, you experience impermanent loss. The more the price moves, the more loss compared to simply holding. This is the primary risk of being an LP.

How Alkizen Uses AMMs

Alkizen routes through multiple AMMs to find the best price for your swap. The aggregation engine splits your trade across pools for optimal execution.

AMMDEXuniswapliquidity