Hi there,
In this webpage, we discuss the main results of the following paper:
Mohak Goyal, Geoffrey Ramseyer, Ashish Goel, and David Mazières. "Finding the right curve: Optimal design of constant function market makers." In Proceedings of the 24th ACM Conference on Economics and Computation, pp. 783-812. 2023.
https://dl.acm.org/doi/abs/10.1145/3580507.3597688
Constant Function Market Makers (CFMMs) are prominent in the decentralized finance ecosystem as a tool for creating exchange markets.
In this paper, we show that for any set of beliefs about future asset prices, an optimal CFMM trading function exists that maximizes the fraction of trades a CFMM can settle.
We formulate a convex program to compute this optimal trading function.
You may check out some examples of belief functions and their corresponding optimal CFMMs in the following Jupyter notebook in Google Colab:
https://colab.research.google.com/drive/14s8nPDr6ej9Lh51nZ5RUN4SbjAW1s6-Q#scrollTo=kJHToVnvp3bw
This program, therefore, gives a tractable framework for market-makers to compile their belief function on the future prices of the underlying assets into the trading function of a maximally capital-efficient CFMM. Our convex optimization framework further extends to capture the tradeoffs between fee revenue, arbitrage loss, and opportunity costs of liquidity providers. Analyzing the program shows how considering profit and loss leads to a qualitatively different optimal trading function (Theorem 6.6, page 19).
Our model additionally explains the diversity of CFMM designs that appear in practice. We show that careful analysis of our convex program enables inference of a market-maker’s beliefs about future asset prices, and show that these beliefs mirror the folklore intuition for several widely used CFMMs. Developing the program requires a new notion of the liquidity of a CFMM, and the core technical challenge is in the analysis of the KKT conditions of an optimization over an infinite-dimensional Banach space.
One natural question we often get asked about this paper is where we can get a belief function from. For this, we give a formulation to compile any price dynamics process into a belief function (linearity of expectation again to the rescue!) In the following Jupyter notebook, one can specify the parameters of the Black Scholes model and the period for which the liquidity provider wants to use the CFMM; the program will find the 'optimal' liquidity allocation and the trading curve.
https://colab.research.google.com/drive/1ZBfsMv7ROkdy8nuJPM90G5tORsPcXPmj#scrollTo=kJHToVnvp3bw
For any questions, please feel free to reach out at mohakg@stanford.edu.