AMM Design in 2026: The Invariant That Prices Every Trade
Every automated market maker is one equation refusing to change. Here is the math behind the curve that sets your price, your slippage, and your loss.
On 21 November 2026, anyone who sold Ether into a decentralized pool got a worse price than the day before, and not only because the market was falling. ETH had slipped under $1,571 in a week that dragged Uniswap’s UNI to $4.30 and Curve’s CRV to $0.17. The deeper reason is that no trader quoted that sale. A short piece of arithmetic did. Every automated market maker is, at bottom, a single equation that refuses to change, and every price it ever gives you is that equation solving for the number it needs to stay true.
That equation has a name: the invariant. It is the whole machine. A centralized venue like the ones compared in our 2026 exchange drawdown review matches a buyer against a seller through an order book, and the price is wherever the two agree. An AMM has no book and no counterparty waiting on the other side. It has a pool of two assets and a rule about how those two balances are allowed to relate. You trade against the rule. This piece is a tour of that rule, the family of curves built from it, and the reason the math, not the marketing, decides who makes money.
Most explainers describe AMMs from the outside. This one works from the equation outward, because once the invariant is clear, impermanent loss, slippage, oracle risk, and the entire 2026 design war stop looking like separate problems and start looking like what they are: consequences of one line of algebra.
The constant product: x times y equals k
The canonical invariant is the constant product. A pool holds a reserve of token X and a reserve of token Y, and it enforces one condition: the product of the two reserves must never fall. Call that product k. Whatever a trade does to the pool, it must leave x multiplied by y equal to k. Vitalik Buterin formalized the rule in a March 2018 ethresear.ch post on making x times y equals k markets more resistant to front-running, crediting the formulation to the Gnosis team; Hayden Adams turned it into Uniswap later that year, and the idea has priced trillions of dollars of volume since.
Plot the condition and you get a hyperbola: a curve that falls steeply, flattens through the middle, and sweeps back up, never touching either axis. The reserves live somewhere on that curve. A buy moves the point one way, a sell moves it the other, but it can never leave the line, because leaving the line would change k. One property matters above all others: because the curve approaches but never reaches zero on either axis, the pool can never be fully emptied of either token. The last unit costs an infinite amount. A constant-product pool is, by construction, always open for business at some price, however bad.
That single property is why the constant product was a breakthrough rather than a curiosity. An order book needs a willing seller sitting across from every buyer, and in a thin market there may be none, so trading stalls exactly when it is needed most. The curve removes the counterparty entirely. The pool is always the counterparty, quoting continuously from whatever reserves it holds, with no one to find and no quote to refresh. Liquidity stops being a crowd of market makers and becomes a balance sheet and a rule. That is the bargain DeFi struck: it gave up the tight spreads of a deep order book in exchange for a market that never closes and never needs permission to quote.
Spot price is the slope of the curve
Where does the price come from? It is not stored anywhere. It is the steepness of the curve at the point where the reserves currently sit. Write the invariant as y equals k divided by x, and the marginal price of X measured in Y is the slope of that line, which works out to y divided by x. The price of a token is simply the ratio of the two reserves. Nothing else.
Take a pool with 100 ETH and 250,000 USDC. The product k is 25,000,000, and the spot price is 250,000 divided by 100, or 2,500 USDC per ETH. If someone adds USDC and removes ETH, the ETH reserve shrinks, the USDC reserve grows, and the ratio, the price, climbs. The curve has done the price discovery without consulting any outside feed. This is elegant and dangerous in equal measure, and both halves of that sentence come back later: elegant because the pool is self-contained, dangerous because that same reserve ratio is readable by any other contract as an oracle, which is a story for a later section.
The depth of the pool decides how much a trade disturbs the price. A pool with 1,000 ETH and 2,500,000 USDC quotes the same 2,500 spot price, but the curve is flatter near the current point, so the same order barely nudges the ratio. Liquidity, in AMM terms, is just a bigger k, and a bigger k means a flatter, more forgiving curve.
Slippage is the curve bending under your trade
The spot price is only the price of an infinitely small trade. The moment you buy a real quantity, you walk along the curve, and every step up the curve is steeper than the last. That gap between the price you saw and the average price you actually pay is slippage, and it is not a fee or a failure. It is the geometry of the invariant.
Return to the 100 ETH and 250,000 USDC pool. To buy 10 ETH you cannot just pay 10 times 2,500. Removing 10 ETH leaves 90 ETH in the pool, and k must hold, so the USDC reserve has to rise to 25,000,000 divided by 90, which is 277,777.78. You therefore pay 27,777.78 USDC for 10 ETH, an average of 2,777.78 each, roughly 11 percent above the spot you started from. After the trade the new marginal price is 277,777.78 divided by 90, about 3,086, because you have left the pool thinner in ETH and the next buyer starts from a worse point. The table below walks the same pool through larger and larger orders.
| ETH bought | USDC paid | Average price | Price impact vs 2,500 spot |
|---|---|---|---|
| 1 | 2,525.25 | 2,525.25 | +1.0% |
| 5 | 13,157.89 | 2,631.58 | +5.3% |
| 10 | 27,777.78 | 2,777.78 | +11.1% |
| 25 | 83,333.33 | 3,333.33 | +33.3% |
| 50 | 250,000.00 | 5,000.00 | +100.0% |
Buying half the ETH in the pool doubles the price you pay on average. This convexity is why a large order never executes against a single pool if the trader can help it; routers split it across venues and price curves to stay near the flat part of each one. It is also why liquidity depth, not the headline fee, is the number that decides execution quality. A 0.05 percent fee on a shallow pool is worse than a 0.30 percent fee on a deep one.
Fees quietly grow the invariant
Where do liquidity providers earn their keep? Not from a spread, because there is no spread; there is only the curve. The fee is bolted on around it. On each swap the pool skims a cut, classically 0.30 percent, with 0.05 percent and 1.00 percent tiers added in later versions, and leaves that cut inside the reserves. The practical effect is that k does not actually stay constant. It ratchets upward a fraction with every trade, and each provider’s share of the pool grows in step. The invariant is constant between trades and quietly larger after each one.
In 2026 that quiet growth is shared with the protocol. Uniswap’s fee switch, approved overwhelmingly in a December 2025 governance vote and rolling out chain by chain since, diverts a slice of swap fees to buy and burn UNI. For a classic 0.30 percent pool, providers now keep closer to 0.25 percent while 0.05 percent is routed to the protocol. The curve did not change. The split of what it earns did, and that split is one of the forces squeezing provider returns in a thin-volume month.
The fee is also the one lever a provider picks before anything else, which is why later designs offer several tiers rather than one. A volatile pair needs a fat fee to cover the losses the curve will inflict; a pair of near-identical stablecoins can thrive on a sliver, because the curve barely moves against it. Set the fee too high and the pool bleeds flow to a cheaper venue; set it too low and the fees never cover the loss, and liquidity drifts away. The number looks like a detail and behaves like the whole business model, which is exactly why the dynamic-fee machinery that arrived with programmable pools matters so much later in this story.
Constant sum and the drainable pool
If the goal is cheap trading, why not flatten the curve completely? The constant-sum invariant does exactly that: x plus y equals k, a straight line. Along it the price is always one to one and slippage is zero, which sounds perfect for two assets that should trade at par. It is also a trap. A straight line has no bend to defend the reserves, so the instant the outside market moves off par, an arbitrageur buys the cheap side at the fixed price until the pool holds none of it. A pure constant-sum pool can be drained to zero on one side with a single well-sized trade. Zero slippage and zero protection are the same property seen from two directions.
No serious venue runs a bare constant-sum curve for this reason. But the idea is not wasted. It is one ingredient in the most important stable-asset design in DeFi.
StableSwap: blending the two curves
Michael Egorov’s 2019 StableSwap paper asked a sharper question: what if a pool behaved like a flat constant-sum line while prices sat near par, and like a safe constant-product hyperbola once they wandered? The answer is a hybrid invariant that blends the two. For a two-asset pool it reads A times n to the n times the sum of the balances, plus D, equals A times D times n to the n, plus D to the power n plus one, over n to the n times the product of the balances, where n is the number of assets, D is the pool’s total value at balance, and A is the amplification coefficient. Set A to zero and the whole thing collapses back to constant product. Push A toward infinity and it straightens into constant sum.
A is the dial, and Curve deploys it somewhere between roughly 50 and 2,000 depending on how tightly the assets should track. High A gives a curve that is almost flat across a wide band around the peg, so swapping 100,000 USDC for USDT in a million-a-side pool moves the price a tiny fraction of the roughly eleven percent a constant-product pool would charge. The catch is that A is a risk dial, not a performance dial. A flat curve keeps the pool near a 50/50 split and resists rebalancing, which is what you want right up until one of the assets genuinely breaks its peg, at which point the pool has been holding the failing token all the way down. Curve’s own literature frames the result as a constant-product pool with leverage applied near the peg, and that leverage cuts both ways. The same math underwrites pools of assets that are correlated rather than identical, such as a liquid-staking token against the asset it represents, a pairing at the center of the Lido, Rocket Pool and Frax contest.
The design has a social side effect worth naming. Because high-A pools share base assets, Curve stacks them: a smaller stablecoin pairs against a large base pool rather than against each dollar separately, which concentrates depth but also wires the pools together. When one asset in a shared base breaks, the flat curve routes the selling straight into the pool holding it, and the stress spreads along the plumbing that made the liquidity efficient in the first place. The same amplification that delivers near-zero slippage in calm markets is the channel through which a depeg travels in a crisis. Efficiency and fragility, once again, are the same parameter read in two directions.
Weighted pools: the constant-mean invariant
Constant product assumes a 50/50 pool. Balancer’s 2019 whitepaper generalized it to any split and any number of assets through the constant-mean invariant: the product of each reserve raised to its own weight stays constant, with the weights summing to one. A 50/50 pool is just the special case where both exponents are one half, which reduces to plain x times y. An 80/20 pool, by contrast, lets a provider hold mostly one asset while still quoting both, and the spot price between any two tokens becomes the ratio of each balance divided by its weight. That flexibility made Balancer the Swiss-army invariant of DeFi, able to run index-style baskets and skewed pools a constant-product venue could not express.
Flexibility has a price, and in 2026 the bill came due. The protocol that pushed the weighted-pool idea furthest is winding down: Balancer governance approved an orderly shutdown, moved its pools to withdrawals-only, and set its V3 vault to pause on 30 November 2026. The most general invariant engine turned out to be the hardest to defend and the thinnest on sustainable volume, a theme the math keeps returning to.
Concentrated liquidity: the same curve, a smaller window
The biggest leap in AMM design did not replace the constant-product curve. It cropped it. In a plain pool, a provider’s capital is spread along the entire hyperbola from zero to infinity, most of it parked at prices the asset will never reach. Uniswap’s own documentation notes that a V2 DAI to USDC pool used only about 0.50 percent of its capital to serve trades in the 0.99 to 1.01 band where almost all the action happens. The rest sits idle.
Uniswap V3, launched in May 2021, let providers choose a price range and concentrate their liquidity inside it. Within that band the position behaves like an ordinary constant-product pool, but with much larger virtual reserves than the capital alone would supply. The formula that governs it is x plus L over the square root of the upper price bound, times y plus L times the square root of the lower price bound, equals L squared, where L is the liquidity depth of the position. The real token balances fall out of L and the current price: x equals L times one over the square root of the price minus one over the square root of the upper bound, and y equals L times the square root of the price minus the square root of the lower bound. The launch announcement put the headline figure at up to 4,000 times the capital efficiency of V2 for a tight range.
Nothing comes free. Concentrating liquidity into a band means that once the price leaves the band, the position converts entirely into the losing asset and stops earning fees, exactly like an unfilled limit order. Providers who pick a range are making an active bet on where price will sit, and the discretized price steps that make this possible, the ticks, are where that bet is recorded. Uniswap V4, live since January 2025, keeps this math intact and wraps it in hooks, a singleton contract and flash accounting, which change what a pool can do around the curve without changing the curve itself.
Two consequences follow from cropping the curve. First, liquidity is no longer uniform along the price axis; it piles up wherever providers expect trading and thins out elsewhere, so the depth a trade actually meets depends on where the price currently sits. Second, the most profitable providers are the most active, rebalancing their ranges as price drifts, which pushed passive providers toward automated vault managers that do the rebalancing for them. The extreme version is just-in-time liquidity, where a sophisticated actor adds an enormous tightly-ranged position in the same block as a large swap, collects most of the fee, and withdraws immediately, capturing the reward while bearing almost none of the inventory risk. Concentrated liquidity made capital efficient and turned market-making into a full-time job.
The invariant zoo
Five shapes cover almost every pool trading on-chain today. They differ only in the equation they defend.
| Invariant | Equation | Price behavior | Best suited to | Example |
|---|---|---|---|---|
| Constant sum | x + y = k | Fixed 1:1, zero slippage, drainable | Nothing on its own | Used only as an ingredient |
| Constant product | x times y = k | Price = y / x, always liquid | Any volatile pair | Uniswap V2 |
| Constant mean (weighted) | product of (x_i to the w_i) = k | Weighted ratio of reserves | Index baskets, skewed pools | Balancer |
| StableSwap (hybrid) | A n^n sum(x) + D = A D n^n + … | Flat near peg, steep in the tails | Pegged or correlated assets | Curve |
| Concentrated liquidity | (x + L/sqrt(p_b)) (y + L sqrt(p_a)) = L^2 | Constant product inside a chosen band | Capital efficiency | Uniswap V3 and V4 |
Impermanent loss is baked into the convexity
Impermanent loss is the most misunderstood number in DeFi, usually because it is described as a risk rather than a certainty. It is the mathematical shadow of the curve. When the price of one asset rises, the invariant forces the pool to sell that asset and buy the other to keep the product constant, so a provider always ends a price move holding more of the loser and less of the winner than someone who simply held the two tokens in a wallet. The gap between the pool and the wallet is the loss, and it depends only on how far the price moved, not on the path it took.
For a constant-product pool the formula is exact: the loss equals two times the square root of the price ratio, divided by one plus the price ratio, minus one. It is symmetric, so a doubling and a halving of price both cost the same 5.7 percent, and it grows with the size of the move. The figures below come from the standard derivation, published by Binance Academy.
| Price change (either direction) | Impermanent loss vs holding |
|---|---|
| 1.25x | 0.6% |
| 1.5x | 2.0% |
| 2x | 5.7% |
| 3x | 13.4% |
| 4x | 20.0% |
| 5x | 25.5% |
The number is called impermanent because it reverses if the price returns to where it started; it becomes permanent the moment a provider withdraws while prices are dislocated. Fees are the only thing standing against it. A pool is profitable for its providers only if the fees it earns over a period beat the impermanent loss the price move inflicts, which is why fee income, not token incentives, is the real yield that keeps liquidity in place, a distinction the market is relearning as emissions dry up across real-yield venues and tokenized-asset pools.
Loss-versus-rebalancing: the sharper ruler
Impermanent loss measures a provider against holding. It flatters the AMM, because holding is a passive benchmark. A more honest ruler, introduced in 2022 by researchers at Columbia University and a16z crypto, is loss-versus-rebalancing, or LVR. It isolates what a provider loses specifically to the arbitrageurs who keep the pool’s price in line with the outside market, the traders who buy the pool’s stale price just before it updates. For a constant-product pool the instantaneous LVR rate works out to volatility squared divided by eight, times the value of the pool. At 5 percent daily volatility that is about 3.125 basis points a day, or on the order of 11 percent a year bled quietly to arbitrage.
The two rulers differ because they ask different questions. Impermanent loss asks what a provider gave up versus doing nothing, and doing nothing is a cheap benchmark, so the number looks small. LVR asks what the provider lost to the one trader who is always on the other side of a stale quote, the arbitrageur, and that trader never overpays. In a rising market, impermanent loss can be offset by fees and incentives and feel like a cost of doing business; LVR strips out the comfort and shows the structural leak, because the pool is, by construction, always selling into strength and buying into weakness a half-step behind the market. It is the clearest statement of what a passive liquidity provider actually is: a counterparty who has agreed to be adversely selected, and who has to be paid for the privilege.
The verdict from the LVR paper is blunt. As the a16z research team put it, “An AMM can be successful only if it has happy LPs, which means that fee revenues need to scale with LVR.” Volatility is the enemy and fees are the only defense, so a design that cannot raise fees when volatility spikes is structurally underpaying the people who fund it. That is precisely the bind of November 2026: volatility is high, as the fall to $1,571 Ether shows, while thin volume starves the fee side of the equation. For providers weighing a weakening tape against the yield they could earn risk-free, the opportunity cost is front of mind, as it is across the market’s December countdown.
The invariant is also an oracle
Recall that the price is nothing but the reserve ratio. That makes every pool a price feed, readable by any other contract on-chain, and it is the second job the invariant never asked for. The trouble is that a raw reserve ratio is trivially manipulable: a trader with a flash loan can shove the reserves hard in one block, read the distorted price from a lending market that trusts the pool, borrow against it, and let the price snap back. A long run of exploits has used exactly this play, which is why telling a genuine break apart from a staged one matters when a protocol loses funds, the question at the heart of our look at exit scams dressed as exploits.
The defenses are all attempts to put time between the attacker and the price. Uniswap V2 introduced a time-weighted average price, accumulating the price over many blocks so that moving it meaningfully costs sustained capital rather than one flash loan. Concentrated liquidity complicates this, because a pool thin at the edges is a worse oracle, and the shift to proof-of-stake weakened time-weighting further by letting a validator with consecutive blocks nudge a pool and nudge it back. The arithmetic that prices your trade and the arithmetic that can be gamed to rob a lending market are the same arithmetic, and Uniswap’s oracle notes read as a running attempt to make one job safe without breaking the other.
What the math can and cannot fix
Here is the line that separates 2026’s design war from the marketing. The invariant is fixed. You cannot wish away slippage, impermanent loss, or LVR, because they are properties of the curve. What you can change is who captures the value the curve leaks. Dynamic-fee hooks raise the fee when volatility spikes, aiming the fee side straight at LVR. Auction-managed pools sell the right to set a pool’s fee to whoever will run it best. CoW AMM clears trades in batches at a uniform price and hands the arbitrage profit back to providers instead of to searchers. None of these touch x times y equals k. They re-route the money the equation, left alone, gives away.
The venues that matter in late 2026 each sit on one of the five invariants, wrapped in different machinery.
| Venue | Core invariant | Where it stands in late 2026 |
|---|---|---|
| Uniswap V4 | Concentrated liquidity + hooks | Uniswap’s flagship version; Uniswap leads all DEXs |
| Uniswap V3 | Concentrated liquidity | Still deep, volume migrating into V4 |
| Curve | StableSwap hybrid | Stablecoin and pegged-asset depth |
| Balancer | Constant mean (weighted) | Winding down; V3 vault pauses 30 Nov 2026 |
| Aerodrome / Aero | Concentrated + vote-escrow incentives | Largest venue on Base |
| CoW AMM | Batch-cleared constant function | Niche, built to internalize LVR |
Uniswap still clears close to a third of all spot DEX volume even after the autumn drawdown, carrying roughly $91 billion over one recent 30-day window on DefiLlama’s reading before November’s slide thinned the tape further. On the rules that govern all of this, the United States has mostly stepped back: the SEC closed its investigation into Uniswap Labs in February 2025 without an enforcement action, and an AMM’s invariant is not a registrable entity in any case. The compliance surface is the front-end and the issuer, not the curve.
So the honest summary is that the curve is permanent and the contest is over its edges. Hayden Adams, who turned Buterin’s one-line rule into an industry, still argues that “AMMs are only just getting started.” The math under him has not moved since 2018. On a day when ETH trades near $1,571 and a provider is weighing fees against LVR against the yield on a Treasury bill, the single equation that refuses to change is doing its one job: it is still quoting a price, and it is still making whoever funds it think hard about whether that price pays.
Frequently Asked Questions
What is an AMM invariant?
An invariant is the fixed equation an automated market maker pool keeps true at all times, such as x times y equals k. Every trade must leave the equation satisfied, so the invariant alone determines the price, the slippage, and how the reserves change. It replaces the order book and the human market maker with a single rule.
How does the x times y equals k formula set a price?
The price of a token is simply the ratio of the two reserves, y divided by x, which is the slope of the constant-product curve at the pool’s current point. A buy shrinks one reserve and grows the other, so the ratio, and therefore the price, moves on its own. No external feed is consulted; the curve itself does the price discovery.
Why do larger trades get worse prices on an AMM?
Because the invariant is convex, every additional unit you buy sits further up a steepening curve, so the average price you pay rises with order size. Buying ten percent of a pool’s reserve can move the price several percent, and buying half of it can double the average cost. This price impact, called slippage, is geometry, not a fee, which is why large orders are split across several pools.
What is the difference between impermanent loss and loss-versus-rebalancing?
Impermanent loss measures a liquidity provider against simply holding the two tokens, and it depends only on how far the price moved. Loss-versus-rebalancing measures the provider against a strategy that continuously trades at the true market price, isolating the value lost specifically to arbitrageurs. LVR is the stricter benchmark, and it is the one that tells a pool how high its fees must be to keep providers whole.
Does StableSwap remove impermanent loss?
No. StableSwap flattens the curve near the peg so that swaps between pegged assets suffer far less slippage, but a provider still takes a loss if one asset depegs. The amplification coefficient that makes the curve flat is a risk dial, because a flatter curve leaves the pool holding more of a failing asset during a real break. It reduces everyday slippage, not the tail risk.
Yuki Tanaka covers DeFi infrastructure and on-chain market structure for HOGE Wire.