# ZeroSwap: Data-driven Optimal Market Making in DeFi

arXiv: https://arxiv.org/abs/2310.09413 · HTML: https://mlsanity.com/paper/2310.09413/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 11 of its 43 references that are in the map.
- First posted on arXiv 13 Oct 2023.

## Builds on (most cited first, 11 of 11)

- [Playing Atari with Deep Reinforcement Learning](https://mlsanity.com/paper/1312.5602/) (2013)
- [SoK: Decentralized Exchanges (DEX) with Automated Market Maker (AMM) Protocols](https://mlsanity.com/paper/2103.12732/) (2021)
- [Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges](https://mlsanity.com/paper/1904.05234/) (2019)
- [Automated Market Making and Loss-Versus-Rebalancing](https://mlsanity.com/paper/2208.06046/) (2022)
- [A Myersonian Framework for Optimal Liquidity Provision in Automated Market Makers](https://mlsanity.com/paper/2303.00208/) (2023)
- [Constant Function Market Makers: Multi-Asset Trades via Convex Optimization](https://mlsanity.com/paper/2107.12484/) (2021)
- [An Axiomatic Characterization of CFMMs and Equivalence to Prediction Markets](https://mlsanity.com/paper/2302.00196/) (2023)
- [Automated Market Making and Arbitrage Profits in the Presence of Fees](https://mlsanity.com/paper/2305.14604/) (2023)
- [QLAMMP: A Q-Learning Agent for Optimizing Fees on Automated Market Making Protocols](https://mlsanity.com/paper/2211.14977/) (2022)
- [Finding the Right Curve: Optimal Design of Constant Function Market Makers](https://mlsanity.com/paper/2212.03340/) (2022)
- [Augmenting Batch Exchanges with Constant Function Market Makers](https://mlsanity.com/paper/2210.04929/) (2022)

## Abstract (arXiv)

Automated Market Makers (AMMs) are major centers of matching liquidity supply and demand in Decentralized Finance. Their functioning relies primarily on the presence of liquidity providers (LPs) incentivized to invest their assets into a liquidity pool. However, the prices at which a pooled asset is traded is often more stale than the prices on centralized and more liquid exchanges. This leads to the LPs suffering losses to arbitrage. This problem is addressed by adapting market prices to trader behavior, captured via the classical market microstructure model of Glosten and Milgrom. In this paper, we propose the first optimal Bayesian and the first model-free data-driven algorithm to optimally track the external price of the asset. The notion of optimality that we use enforces a zero-profit condition on the prices of the market maker, hence the name ZeroSwap. This ensures that the market maker balances losses to informed traders with profits from noise traders. The key property of our approach is the ability to estimate the external market price without the need for price oracles or loss oracles. Our theoretical guarantees on the performance of both these algorithms, ensuring the stability and convergence of their price recommendations, are of independent interest in the theory of reinforcement learning. We empirically demonstrate the robustness of our algorithms to changing market conditions.
