Table of Contents
Fetching ...

Adaptive Curves for Optimally Efficient Market Making

Viraj Nadkarni, Sanjeev Kulkarni, Pramod Viswanath

TL;DR

This work tackles arbitrage losses in DeFi AMMs by replacing static bonding curves with adaptive curves derived from a Glosten–Milgrom framework. It formalizes a differential equation governing the optimal curve and provides Kalman-filter-based solutions for Gaussian and Lognormal price dynamics, including an Adaptive Kalman Filter for unknown market parameters. The approach is robust to adversarial trading and is paired with an end-to-end on-chain/off-chain implementation using Uniswap v4 and a machine-learning co-processor. Empirical results show substantial reductions in per-trade arbitrage losses and demonstrate practical feasibility and resilience in dynamic market conditions, supporting real-world deployment in decentralized markets.

Abstract

Automated Market Makers (AMMs) are essential in Decentralized Finance (DeFi) as they match liquidity supply with demand. They function through liquidity providers (LPs) who deposit assets into liquidity pools. However, the asset trading prices in these pools often trail behind those in more dynamic, centralized exchanges, leading to potential arbitrage losses for LPs. This issue is tackled by adapting market maker bonding curves to trader behavior, based on the classical market microstructure model of Glosten and Milgrom. Our approach ensures a zero-profit condition for the market maker's prices. We derive the differential equation that an optimal adaptive curve should follow to minimize arbitrage losses while remaining competitive. Solutions to this optimality equation are obtained for standard Gaussian and Lognormal price models using Kalman filtering. A key feature of our method is its ability to estimate the external market price without relying on price or loss oracles. We also provide an equivalent differential equation for the implied dynamics of canonical static bonding curves and establish conditions for their optimality. Our algorithms demonstrate robustness to changing market conditions and adversarial perturbations, and we offer an on-chain implementation using Uniswap v4 alongside off-chain AI co-processors.

Adaptive Curves for Optimally Efficient Market Making

TL;DR

This work tackles arbitrage losses in DeFi AMMs by replacing static bonding curves with adaptive curves derived from a Glosten–Milgrom framework. It formalizes a differential equation governing the optimal curve and provides Kalman-filter-based solutions for Gaussian and Lognormal price dynamics, including an Adaptive Kalman Filter for unknown market parameters. The approach is robust to adversarial trading and is paired with an end-to-end on-chain/off-chain implementation using Uniswap v4 and a machine-learning co-processor. Empirical results show substantial reductions in per-trade arbitrage losses and demonstrate practical feasibility and resilience in dynamic market conditions, supporting real-world deployment in decentralized markets.

Abstract

Automated Market Makers (AMMs) are essential in Decentralized Finance (DeFi) as they match liquidity supply with demand. They function through liquidity providers (LPs) who deposit assets into liquidity pools. However, the asset trading prices in these pools often trail behind those in more dynamic, centralized exchanges, leading to potential arbitrage losses for LPs. This issue is tackled by adapting market maker bonding curves to trader behavior, based on the classical market microstructure model of Glosten and Milgrom. Our approach ensures a zero-profit condition for the market maker's prices. We derive the differential equation that an optimal adaptive curve should follow to minimize arbitrage losses while remaining competitive. Solutions to this optimality equation are obtained for standard Gaussian and Lognormal price models using Kalman filtering. A key feature of our method is its ability to estimate the external market price without relying on price or loss oracles. We also provide an equivalent differential equation for the implied dynamics of canonical static bonding curves and establish conditions for their optimality. Our algorithms demonstrate robustness to changing market conditions and adversarial perturbations, and we offer an on-chain implementation using Uniswap v4 alongside off-chain AI co-processors.
Paper Structure (17 sections, 5 theorems, 32 equations, 5 figures, 2 algorithms)

This paper contains 17 sections, 5 theorems, 32 equations, 5 figures, 2 algorithms.

Key Result

Theorem 1

Let the amounts of asset and numeraire in the reserves of a market maker be $x_0^t,y_0^t$. Then, the optimal demand curve $g_t(p)$ for a market maker obeys the following differential equation with the constraints $\lim_{\delta\rightarrow 0^-}g(p_0^t+\delta) \geq x_0^t$ and $\lim_{\delta\rightarrow 0^-}-\int^{p_0^t+\delta}_0 p dg(p) \geq y_0^t$. This equation can be solved separately for $p>p_0^t$

Figures (5)

  • Figure 1: Percentage monetary loss per trade of our market making algorithms (Kalman Filtering and Adaptive Kalman Filtering) is much less than a static Uniswap curve for a Gaussian price jump and trader noise models
  • Figure 2: Percentage monetary loss per trade of our algorithms (Kalman Filtering and Adaptive Kalman Filtering) is much less than a static Uniswap curve for a Lognormal price jump and trader noise models
  • Figure 3: If the AMM is treated as an oracle, then we can use the Robust Kalman Filtering to get a more accurate reading of the hidden external price
  • Figure 4: Percentage monetary loss per trade of our market making algorithms (Kalman Filtering and Adaptive Kalman Filtering) is much less than a static Uniswap curve for continously changing market conditions
  • Figure 5: System design for an on-chain implementation of our algorithms

Theorems & Definitions (5)

  • Theorem 1
  • Theorem 2
  • Theorem 3
  • Theorem 4
  • Theorem 5