An automated market maker does not take bids and offers from buyers and sellers. It prices a trade against a pool of two tokens using a formula — most commonly the constant product formula, x*y=k, per Uniswap’s developer documentation. The pool’s reserve ratio sets the price before the trade, but because the trade itself changes that ratio, the price actually paid is worse than the price first quoted whenever the trade is not tiny relative to the pool.
A liquidity pool is a smart contract holding reserves of two tokens — for example ETH and USDC — that anyone can trade against directly, according to the Uniswap Blog. Liquidity providers deposit both tokens in equal value to seed the pool and set the initial value of a constant, k, which is the product of the two reserve quantities, per the Uniswap Blog. From that point, every swap has to leave x times y equal to that same k. Uniswap’s developer documentation describes k as an invariant that must stay constant, or increase, after each trade. Because the two reserve balances have to keep multiplying out to the same number, pulling one token out of the pool means the other has to go up to compensate, and that shift in the ratio is what moves the price.
The Uniswap Blog sets out a worked example. Start with a pool of 10 ETH and 20,000 USDC. The constant is 10 times 20,000, or 200,000. At this starting point, the pool implies a spot price of 1 ETH for 2,000 USDC.
Now a trader buys 1 ETH. The pool’s ETH reserve falls to 9. To keep the constant at 200,000, the USDC reserve has to rise to 200,000 divided by 9, which is approximately 22,222.22 USDC, per the Uniswap Blog’s own calculation. The trader has therefore put in 22,222.22 minus 20,000, or 2,222.22 USDC, to get that 1 ETH. Their effective price for the ETH they bought is 2,222.22 USDC — not the 2,000 USDC the pool was quoting before they traded.
That gap, 2,222.22 USDC against a 2,000 USDC starting quote, is called slippage. It is not a fee and it is not a malfunction; it is the formula doing exactly what it is supposed to do, repricing the pool as reserves shift. The Uniswap Blog notes that larger trades relative to the size of the pool cause more slippage, while a deeper pool absorbs the same trade with a smaller price move. The same point is made in Uniswap’s developer documentation, which describes this effect as price impact: larger trades relative to pool depth move the price more, and smaller trades execute closer to the current spot price.
The Uniswap Blog also gives a simpler retail framing of the same mechanism: a user swapping $100 worth of USDC for ETH sees a rate calculated in real time by the constant product formula, and the smart contract pulls in the USDC and returns ETH in one transaction, rebalancing the pool as it goes.
The x*y=k arithmetic above describes a Uniswap v2-style pool, where liquidity is spread across the entire possible price range. Uniswap’s developer documentation says that in v3 and v4, the formula applies only within each liquidity provider’s chosen price range — a design called concentrated liquidity. In v3, a provider’s position in that range is represented as an ERC-721 non-fungible token through a contract called the NonfungiblePositionManager; in v4, positions are tracked through a PositionManager using ERC-6909 for internal accounting, per the same documentation. The practical consequence is that two pools trading the same pair, on different Uniswap versions or with different liquidity ranges chosen by their providers, will not move price by the same amount for an identical trade, even though both are described as running the constant product formula.
Uniswap and Balancer both belong to a broader family that a 2020 paper by Guillermo Angeris and Tarun Chitra calls constant function market makers, or CFMMs — automated market makers whose pricing rule is some fixed function of pool reserves, of which x*y=k is one example. The same paper points out that not every asset pair should be priced with that particular curve. Stablecoins, which are pegged to roughly $1 but fluctuate in a narrow band around it, are priced more efficiently with a flatter curve near the peg so that trading fees stay low when the pair is close to $1 and rise as it drifts away — an approach the paper attributes to Curve’s StableSwap design. The underlying idea is the same as Uniswap’s — reserves and an invariant set price — but the shape of the curve, and therefore the arithmetic a trader would work through, is different.
Angeris and Chitra’s paper, dated March 2020, put some numbers on the DeFi landscape it was describing at the time. It stated that DEXs then held roughly $100 million of digital assets locked, with daily trading volumes at times surpassing $10 million a day. A figure in the paper, sourced to DeFi Pulse data and dated 12 February 2020, showed CFMM contracts holding $129.7 million against $0.721 million held by LMSR-based prediction-market makers such as Augur and Gnosis. The same paper noted that Uniswap was built with a $100,000 grant from the Ethereum Foundation, compared with $24 million raised by 0x and $153 million raised by Bancor in initial coin offerings, and stated that Uniswap held roughly five to ten times the combined liquidity of those two competitors as of the paper’s writing. These figures describe a market from five years before this page was written and are useful only as a historical illustration of how quickly a simply-designed AMM outgrew more heavily funded, more complex alternatives — they say nothing about the current size of any of these protocols.
This page explains the constant product formula as documented for Uniswap v2-style pools, using the one worked numerical example available in the evidence. It does not work through the concentrated-liquidity math of Uniswap v3 or v4, or the StableSwap curve used by Curve, because none of the sources consulted here supplies a numbered example for those cases — only a description of how they differ.
The 10 ETH / 20,000 USDC example above is fee-free. Uniswap’s developer documentation says swap fees are configured by pool and protocol version and that protocol fees may apply when enabled through governance, but no source used here states an actual fee percentage for any specific pool, so the 2,222.22 USDC execution price calculated above would be somewhat higher on a real, fee-charging pool.
The Uniswap Blog warns, without giving numbers, that a trader’s final execution price can shift slightly from the initial quote shown on screen, especially when liquidity is thin or activity spikes. None of the sources used here explains how techniques such as sandwich trading interact with that gap on a live transaction, beyond that general warning.
Finally, the 2020 figures on total value locked and ICO fundraising are a snapshot of one point in the market’s history, dated to 12 February 2020 for the TVL comparison and to the paper’s March 2020 publication for the fundraising comparison. They should not be read as current figures for Uniswap, 0x, Bancor, or the wider DeFi market.
Every fact above is attributed to one of these reports. Where they disagree, the article says so.
We measure how many people read this site. That is all it is used for — there is no ad network, no advertising cookie, and nothing sold to anyone. Decline and the site works exactly the same. What we collect