An AMM is a limit order you cannot cancel
A constant-product pool is a continuum of resting limit orders, and the liquidity provider's defining disadvantage is that none of them can be pulled when the price moves.
A market maker on an order book does one thing constantly: cancels. Quotes are posted, the price moves elsewhere, the quotes are pulled before anyone can hit them, and new ones are posted at the new price. The cancel is the whole job. An automated market maker cannot do it. A constant-product pool posts, in effect, a resting limit order at every price, and when the price moves on another venue, every one of those orders is still there, waiting for the first person who notices. That inability is the entire economics of being a liquidity provider, and the losses people argue about, impermanent loss, loss-versus-rebalancing, all follow from it.
A curve is a ladder of orders
Take the constant-product rule, x times y equals k, that Uniswap's second version and countless pools since have used. The pool holds x of one asset and y of the other, and it will trade along the curve so that the product stays constant. A trader who buys a small amount of y pays a price near y over x; a trader who buys a lot walks up the curve and pays more. Read that from the other side and it is a ladder: the pool is offering to sell y at every price above the current one and to buy y at every price below it, in amounts fixed by the curve. It is an order book with an order at every tick, placed by nobody, cancelled by nobody.
On a central limit order book, the maker whose quotes are stale loses money to whoever trades against them first, which is why makers cancel the instant they see the price move. The pool cannot see anything. It has no feed, no clock and no opinion; it only knows its own reserves. When the price on a large exchange moves, the pool's ladder is wrong, and it stays wrong until an arbitrageur trades it back to the right price, taking the difference as profit. That profit is paid by the liquidity providers, and it is paid every time the price moves, in either direction.
The uncancellable quote test
Here is the test I apply to any market-making design, on chain or off. Ask what happens the instant the quoter learns that the price has moved. If the answer is "nothing, until someone trades against it", the design pays a cost for being unable to cancel, and everything else about its economics is a way of pricing that cost. If the answer is "the quotes move", the design is a market maker in the ordinary sense and the question is only whether it can move them fast enough.
A constant-product pool fails the test by construction. A concentrated-liquidity pool fails it too; the ladder is narrower and the orders are larger within the range, but they are just as uncancellable. In fact concentration makes the failure sharper rather than softer: the liquidity provider has chosen to post bigger orders closer to the current price, which is exactly where a stale quote is most expensive, and the reward for that choice is a larger share of the fees in exchange for a larger share of the arbitrageurs' profit. Concentration is a lever on the size of the bet, not on its direction.
The test is also useful for reading the newer designs, because most of them are attempts to pass it partially. Pools that quote from an external price feed are trying to cancel by proxy, with the oracle doing the cancelling; they pass to the extent the oracle updates before the arbitrageurs arrive and fail in every block where it does not. Pools that auction the right to trade first are not cancelling at all; they are selling the stale orders to the highest bidder and returning the proceeds to the LP, which is a way of getting some of the rent back rather than avoiding it. An order-book maker with a fast feed passes it. A pool whose quotes are set by an oracle rather than by its own reserves passes it partly, to the extent the oracle is faster than the arbitrageurs, which is the design question that most of the newer AMMs are really about.
Loss-versus-rebalancing is the price of the missing cancel
Milionis, Moallemi, Roughgarden and Zhang gave the cost a name and a formula in Automated Market Making and Loss-Versus-Rebalancing. Loss-versus-rebalancing compares the liquidity provider's position against a benchmark that holds the same assets but rebalances at the true market price instead of being picked off at stale ones. The difference is exactly the arbitrageurs' profit, and for a constant-product pool it has a closed form: the LVR accrues at a rate proportional to the square of the asset's volatility, sigma squared over eight, as a fraction of the pool's value, per unit time. Higher volatility means the price moves more, the ladder is wrong more often and by more, and the cost of not cancelling rises with the square.
Read the chart as a rent. At 70 percent annualised volatility, which is not unusual for a large crypto asset, the pool loses about six percent of its value a year to the people who correct its prices, before a single fee is counted. Fees are what the pool charges in return for the service of always being there, and the position is profitable only when fee income exceeds the rent. That is the whole calculation, and it is why fee tiers exist: a volatile pair needs a higher fee to cover a higher LVR, and a stable pair can charge almost nothing because its ladder is almost never wrong.
Where impermanent loss fits
Impermanent loss is the older and more confusing name for a related quantity, and the ladder view sorts out the confusion. Impermanent loss compares the LP's position with simply holding the two assets; it depends on where the price ends up and is zero if the price returns to where it started. LVR compares the LP with a rebalancing benchmark and depends on the path, on how much the price moved along the way, not on where it ended. Both are the cost of the missing cancel, measured against different benchmarks. LVR is the better measure of what the LP actually pays, because arbitrageurs are paid on every move and do not give the money back when the price comes home.
What it means for the other side
I spend more of my time on the other side of this trade than on it. Shayanomaly watches five venues for the moments when a pool's ladder and an exchange's book disagree, and the disagreement is exactly the LVR the pool is about to pay. From that side, the ladder view is also the clearest explanation of what the arbitrage is: not a free lunch, but a service the pool has agreed in advance to pay for, at a rate set by volatility, to whoever gets there first. The competition to get there first is what keeps the pool's price honest and keeps the LP's rent from being any higher than it has to be.
For anyone providing liquidity, the test reduces to one question that is easier to answer than the literature makes it look. What does this design do the instant it learns the price has moved? If the answer is nothing, then the fee tier is the only thing standing between you and the square of the volatility, and it needs to be large enough to cover it.
Get new posts by email
Occasional essays on engineering, AI, and building for the people technology leaves behind.
Subscribe with RSS