Thursday, March 14, 2024

Moallemi's Auction-Managed AMM

A recent paper by Columbia professor Ciamac Moallemi and three Uniswap affiliates (Adams, Reynolds, and Robinson) presents a mechanism for recapturing the convexity costs. It builds upon Moallemi's previous work on automated market makers (AMMs) and arbitrage profit, published a year ago, which Moallemi presented at a16z crypto last summer. In that talk, he mentioned auctions as a way to reduce adverse selection costs for liquidity providers (LP).

AMMs' big problem is that LPs generally lose money in their popular capital-efficient (v3) pools. An LP's net profitability consists of revenue in the form of fee income and convexity.

LP profits = volume*fee – convexity costs

The LPs present traders with an option, and like all options, these are costly for the sellers. LP convexity costs have three mathematically equivalent formulations, and I posted three equivalent ways on Monday. Many only consider LP fee revenue as if convexity costs are just an academic hypothetical relative to an ideal. However, unlike the hedge fund sniping expense, option expenses are real, as reflected in standard option premiums above intrinsic value.

More relevant to this post, the convexity cost in an AMM is determined by two variables: the variance of the asset, which is exogenous to the AMM, and the liquidity in the AMM pool, which is endogenous. Both have a direct, linear impact on convexity costs.

AMM convexity costs = liquidity * sqrt(p0) * variance / 4

The expected value of this formula is unaffected by the granularity of the data used to generate the variance, highlighting that this cost has nothing to do with the frequency of blocks, trading, or hedging. The convexity cost is the inverse of the gross arbitrage profit (noted in my Monday post), which is the profit to the arbitrageur collective pre-fees

The largest AMM on blockchains is the ETH-USDC 5 basis point v3 pool, which processes hundreds of millions of USDC daily. This year, the 5 bp pool is actually making money because its liquidity is down about 60%, which has a first-order effect on convexity costs. For example, last year, their liquidity was usually around 30MM, which implies a $100k trade would generate slippage of only 0.01%; currently, liquidity is around 10MM, so the slippage would be 0.04%. I don't think traders mind, as this is still far better liquidity than anywhere else. This LP profitability could be temporary, but this pool has not had this low level of liquidity for three months since 2021, suggesting LPs have wizened up. With only $150MM in capital in the pool, this annualizes to an excellent 10% annualized return. 

Average Daily Stats for ETH-USDC 5bp Uniswap v3 Pool

Unfortunately, this year's ETH-USDC 5bp pool performance is not typical, and regardless, addressing LP convexity costs is important. The larger capital efficient restricted range (v3) pool LPs lose money. Since January 1, 2023, the ETH-USDC 5bp pool has lost an average of $6k a day net, including $142k in fee revenue and $148k in convexity costs. If one could reduce these costs by a mere 10%, the pool LPs would be profitable.

The auction mechanism is presented formally per Moallemi's previous work, but the gist is straightforward. Arbitrageurs bid for the right to be the 'pool manager' who gets all fee revenue and sets the pool fee in a future period (e.g., a day). As they get all the fees paid, the pool manager will effectively trade for free because the fees come back to him as revenue, while other arbitrageurs would pay the X bp fee. This gives the pool manager a competitive advantage in arbitraging the pool, as those paying the fee will find any mispricing less than the fee unprofitable, while the pool manager could capture it. If the pool manager pays the expected fees and just half of the arbitrage revenue, virtually all v3 pool LPs would be profitable. This is because gross arbitrage revenue—i.e., excluding fees—is the flip side of their convexity costs.

Chicago professor Eric Brudish has been promoting frequent batch auctions as an alternative to CLOBs for the past decade (see here and here), highlighting the tax generated by hedge fund sniping, where speedy high-frequency traders scoop up resting limit orders before the hapless market makers can remove them. Milionis, Moamelli, Roughgarden, and Zhang's Loss vs. Rebalancing paper alludes to hedge fund sniping in the context of AMMs, but that's far-fetched. AMMs do not have race conditions analogous to traders picking off stale limit orders. Even within the snail's pace of blockchains, you do not see LPs trying to do the inverse of just-in-time liquidity to get out of the way of trades (removing liquidity before a big trade and then adding it back in after the trade). The sniping form of adverse selection is sexy, focusing on unsympathetic high-frequency traders portrayed by best-selling author and SBF fanboy Michael Lewis. Still, it's, at best, a curiosity. A generous estimation of its effect is 0.4 basis points on average CLOB stock market spread of 3.5 basis points—a trivial effect—and irrelevant in AMMs. The bottom line is that arbitrage profits generate standard adverse selection costs for all market makers. With AMMs, this cost has an explicit formula.

Nonetheless, the sniping-motivated auction literature explains why Professor Moamelli had an auction solution ready. Academics like auctions because, in theory, they do not have any deadweight losses and are efficient given simplifying assumptions. In practice, however, auction complexity generates problems, which is why most asset markets use CLOBs, which have reduced stock trading costs by 90% from 1990 through 2010.

Uncertainties in the Bidder's Expected Arbitrage Profit

Expected arbitrage profits are a linear function of variance, the square of volatility. The average daily variance using minute-downsampled data is 15 basis points, but the distribution is flat with a long tail, so we should expect bidders to assume something well below the mean.

Expected arbitrage profit is also a linear function of liquidity, which is also variable, especially in the popular v3 pools [they acknowledge their mathematical model only applies to v2 pools, but clearly, the application would be to v3 pools]. An intriguing example occurred on March 6, where the ETH-USDC 30 basis point pool liquidity was a whopping 30 times higher than its standard value over a 5% price interval, from $3,612 to $3,812. This was due to a massive LP position above the current price, where the LP probably thought it would be an excellent place to sell their ETH without any hassle. Interestingly, in this case, the LP lost $2.6MM in convexity costs and captured $2.2MM in fees, for a net loss of about 40 basis points on the $100MM in ETH they effectively sold. This was not a good deal, but not horrible given the size. The bottom line is that the expected variance of arb profit in the face of these liquidity spikes increases the expected arb profit volatility even more, making it more difficult because the LPs can withdraw it at any time.

Huge LP Position Taken Out Last Week



New Gaming Strategies

There is also the issue of the unknown unknowns in this setup. For example, i
n March 2020, a bidder rigged an auction to buy $8.32 million in ETH for zero DAI.  While that attack has been exposed, who knows what strategies this approach generates? For example, one could handicap an arbitrageur by withdrawing all of your liquidity when an adversary wins the pool manager's right. This could be a part of a long game where the punisher is willing to incur a cost to inflict a cost on others, getting them to stop bidding. As withdrawals are standard in v3 pools, it is difficult to see how to lock in liquidity and avoid this.

While the pool manager would have an advantage in arbitrage trading, they would not prevent noise traders from inadvertently taking some of their profit, as people will randomly buy when the AMM price is low. To prevent that, a pool manager might target traders using high latency front ends like Uniswap, and front-run these trades. Conversely, traders could see the current mispricing and anticipate an arbitrage trade, sandwich attacking the arbitrageur. While chains without the slow ETH mainchain could avoid explicit MEV tactics, one can expect motivated traders to see these transactions and get in front of them regardless, as latency for a decentralized blockchain is orders of magnitude greater than anything on centralized exchanges (100s of milliseconds vs 100s of microseconds). Unlike co-location on centralized exchanges, there would be back-room deals for access to the sequencers or RPC nodes, creating a deadweight loss to users.

Even without front-running, there is the question of how much of the total arbitrage profit a zero-cost ab could capture. These uncertainties would incentivize the Bidder to price arbitrage profit well below its expected value.

The paper also acknowledges the potential for an increase in sandwich attacks because the zero fee would make these more attractive. This would be like the front-running attack on lucky noise traders, but instead, it would target any large trade. The authors mention that off-chain auctions or private relays could address this, but this complicates the mechanism even further (how are private relays incented?). A strategy space grows exponentially in the number of moves players can make. Simplicity is the key to security.

Lastly, there is the issue of to what extent arbitrageurs are hedging off the blockchain. Given the mispricing distribution, we can see that the AMM price is generally within the fee for the 5 bp pool. As centralized exchanges charge at least 2.5bps, and there is always slippage (i.e., price impact, spread), the total cost of a hedge is at least 5 bps at the size they would trade (chunks of $50k). The arbs cannot hedge each AMM arbitrage trade with a CEX trade and lock in a profit. They probably hedge every hour or day or when their on-chain position reaches some absolute level. 

This practical nature of hedging implies the arbs will have the opposite risk profile as the LPs, becoming short during price declines and long on the opposite. As this arb would have tens of millions at work, it creates an endogenous risk amplification mechanism because a price decline would make the arb profit and also increase his short position, so he would have the means and motive to push it down further to hit stop-loss orders on centralized exchanges.


If average convexity costs for a pool were 100, the uncertainty about future liquidity and variance and how much of the arb could be captured would lower the didder's price well below that, say, half. The arb would have to pay hedging costs and gas fees, reducing this further. Then there is the loss of the fees the current arbs pay. It's possible that LPs would make less money, just as ObamaCare, in theory, was supposed to reduce medical costs but, in practice, increased them. 

Nevertheless, this is a step in the right direction, addressing a major problem in the status quo. Given that the difference between revenues and costs on these pools is 3%, the bidder could pay a mere 10% of the expected total arbitrage profits and bring LPs back to profitability. The biggest downside is that there are many complexities generated by this approach, implying a lot of work for a temporary solution, as the best-case scenario would capture a small fraction of the arbitrage profits, leaving significant room for improvement. 


No comments: