Automated Market Makers (AMMs) are the engine of decentralised trading. Instead of matching buyers with sellers via an order book, AMMs use a mathematical formula and liquidity pools to enable 24/7 trading of any token pair. Understanding AMMs explains how Polymarket prices YES/NO contracts and why prediction market spreads exist.
In a traditional exchange order book, someone must be willing to sell for you to buy. AMMs solve this by using liquidity pools: reserves of two tokens held in a smart contract. When you trade, you swap one token from the pool for another. The price adjusts automatically based on the ratio of tokens in the pool.
x = amount of token A in pool; y = amount of token B in pool; k = constant. When you add token A, you receive token B, but the product must remain k. This mathematically ensures the pool never runs out of either token (at increasingly unfavorable prices for large trades).
Example: ETH/USDC pool with 100 ETH and $200,000 USDC. k = 20,000,000. Price = 200,000/100 = $2,000/ETH. If you buy 10 ETH: new ETH = 90, new USDC = 20,000,000/90 = $222,222. Price paid = 22,222/10 = $2,222 average. The price "slipped" from $2,000 to $2,222 due to pool impact.
If you provide liquidity to a pool and the price of one token changes significantly, you end up with less of the appreciating token than if you'd just held. This "impermanent loss" is only crystallised when you withdraw — hence "impermanent." But if the price doesn't revert, the loss becomes permanent.
Rule of thumb: providing liquidity to correlated asset pairs (e.g., ETH/stETH) minimises impermanent loss. Providing to volatile/uncorrelated pairs (e.g., ETH/SHIB) maximises it. LP fees must compensate for impermanent loss to make providing liquidity profitable.
Polymarket uses an AMM-style pricing mechanism for its YES/NO contracts. The price you see (e.g., YES at 65¢) is determined by the current liquidity pool composition. Large trades move the price more than small ones — this "market impact" creates spread, which is why a sharp trader with a small edge should trade small positions rather than size up and destroy their own edge through price impact.