← All Projects

DeFi Research · Stochastic Control

Automated Market
Maker Prototype

A research-driven dashboard that formalises AMM invariant curvature as a stochastic control variable — simulating impermanent loss, fee-compensation equilibrium, and utility-maximising liquidity provision via the HJB framework.

Python Plotly NumPy SciPy HJB Framework Stochastic Control
Full Report ↗

HJB

Control Framework

IL

Impermanent Loss

AMM

Invariant Design

LP

Utility Optimisation

01 / Problem

AMM design lacks a rigorous framework for curvature optimisation

Automated Market Makers like Uniswap use fixed invariant curves (x·y=k) that don't adapt to market conditions. Liquidity providers suffer impermanent loss when prices diverge from the pool's implied rate — a cost that existing AMM designs accept as fixed rather than treating it as a control variable to be minimised.

02 / Approach

Stochastic curvature control via Hamilton-Jacobi-Bellman

The project formalises AMM invariant curvature as a stochastic control variable in continuous time. The liquidity provider's problem is formulated as a utility maximisation problem: choose the invariant curvature path that maximises expected utility subject to the price dynamics of the risky asset.

The Hamilton-Jacobi-Bellman equation characterises the value function of this control problem. Numerical solutions are computed and visualised — showing how the optimal curvature responds to price volatility, fee rates, and LP risk aversion. Fee-compensation equilibrium conditions are derived analytically and verified numerically.

03 / Result

A tractable framework for next-gen AMM design

The prototype demonstrates that treating curvature as a dynamic control variable — rather than a fixed constant — can meaningfully reduce impermanent loss for risk-averse LPs under certain fee and volatility regimes. The full mathematical derivation and interactive simulations are documented in the companion report.

Key Features
  • AMM curvature formalised as a stochastic control variable
  • HJB equation derivation and numerical solution
  • Impermanent loss simulation under dynamic curvature
  • Fee-compensation equilibrium analysis
  • Interactive Plotly dashboard for parameter exploration