Tutorial at EC'24

In recent years, automated market makers (AMMs) have emerged as an alternative to the most common market structure used for electronic trading, the limit order book (LOB). AMMs are currently the dominant market structure for the on-chain exchange of digital assets. One advantage of AMMs over LOBs is computational efficiency: AMMs generally have minimal storage needs and require only lightweight computations, as opposed to the relatively complex data structures and matching logic typically used by large-scale LOBs. Second, LOBs are not well-suited to "long-tail" assets (i.e., those with thin trading markets), as they generally require the participation of active market makers. In contrast, AMMs rely largely on passive liquidity providers (LPs). There is a well-developed theory for the design and analysis of LOBs; what would an analogous theory look like for AMMs?

The focus of the tutorial will be on the adverse selection costs incurred by liquidity providers in automated market makers, and in particular the concept of "loss-versus-rebalancing" (LVR) introduced recently by Milionis, Moallemi, Roughgarden, and Zhang (2022). We will discuss multiple ways to interpret LVR, and then develop the necessary math to give a closed-form expression for LVR in AMMs (e.g., σ²/8 for the ubiquitous “x*y=k” AMM made famous by Uniswap, where σ denotes the volatility of the price process).

The primary goals of this tutorial are to learn about the market structure of AMMs, the reasons why LVR is an important quantity in decentralized finance, how LVR applies to data, and the mathematics that are best suited for reasoning about and predicting LVR.

Jason Milionis, Ciamac C. Moallemi, and Tim Roughgarden

- Part I: Slides, Video
- Part II: Slides, Video
- Part III: Slides, Video
- Link to Tutorial Zoom Links (password on EC24 registration):

This part of the tutorial will focus on a conceptual understanding of the market structure posed by AMMs, as well as the multiple structural results. No knowledge of AMMs will be assumed.

- Introduction to AMMs: market that always accepts orders to buy/sell at a quoted price
- High-level, conceptual market structure: arbitrage, adverse selection, relation to loss in prediction markets
- Discrete notion of adverse selection in AMMs: sum defined for a trade sequence with respect to an AMM and an external price trajectory
- Mathematically equivalent ways to characterize LVR:
- Cost of informational asymmetry: the AMM does not have access to accurate market prices
- Hedging interpretation: the market mechanism has inventory of a risky asset which changes value; factoring out the changes in value of the underlying ("eliminating market risk") leads to discrete delta-hedging, e.g., every 5 minutes, adjust a short position on asset in an external venue
- Profit of arbitrageurs trading against AMMs

- Example empirical analysis in an actual market (ETH-USDC in Uniswap v2)

The second part of the tutorial will delve into the mathematical details underlying the structural characterizations and conceptual understanding of AMMs.

- Convex optimization framework for AMMs: dual representation, portfolio value function
- Notion of marginal liquidity in an AMM
- Exchanges as demand curves and relation to Myerson's lemma
- Equivalent notions around the different representations of AMMs: demand curves, convex bonding curve, and portfolio value function are equivalent

The final part of the tutorial will introduce just enough mathematics to derive a characterization of LVR in the most basic model studied in continuous-time finance.

- Geometric Brownian motion: what it is and how to think about it
- A glimpse of stochastic calculus and how it differs from the calculus you know (and love?)
- Characterization of LVR for arbitrary AMMs
- Derivation of σ²/8 for the special case of "x*y=k" AMMs