The x times y equals k formula
Automated Market Makers (AMMs) use a simple mathematical formula to price assets without a central order book. The most common formula is x * y = k, where x and y are the quantities of two assets in a liquidity pool and k is a constant. If a pool has 100 ETH and 10,000 USDC, then k equals 1,000,000. When you swap 1 ETH for USDC, the pool must maintain the constant: the new ETH amount (101) times the new USDC amount must equal k.
Solving 101 * y = 1,000,000, you get y = 9,901 USDC. Since the pool started with 10,000 USDC, you receive 99 USDC (not 100). The 1 USDC difference is slippage: the price you received is worse than the spot price because your trade moved the pool's ratio. Larger trades incur more slippage because they move the pool further along the curve.
Why the hyperbolic curve increases slippage
The curve x * y = k is a hyperbola, which gets steeper at the extremes. Small trades (e.g., swapping 0.1 ETH) have minimal impact and low slippage. Large trades (e.g., swapping 10 ETH out of a 100 ETH pool) move the pool significantly and slippage is severe. This design creates an incentive structure: it discourages large single trades from pushing prices far and encourages liquidity providers to add capital (increasing x and y, thus k) to reduce slippage. More liquidity means tighter prices and lower fees.