When I first encountered mean field games, I was struck by their elegance: a tool to study strategic behavior among many agents without modeling each one individually.
At the time, I was also working on quantitative strategies inside liquidity pools. It didn’t take long to connect the dots. What if we could apply mean field theory to model the strategic flow of liquidity in AMMs like Uniswap?
Most existing models treat traders or LPs as passive or use simulations with hardcoded rules. But if you assume traders are optimizing their decisions based on the state of the pool, you get a different story. A game-theoretic one.
This post shares the core ideas behind my first research paper in this direction: modeling AMMs using MFGs, proving equilibrium existence, and sketching how this could shape more robust and realistic protocol design.
Most research on AMMs takes one of three paths:
Analytical models, using calculus or convex optimization to describe pricing curves and slippage.
Agent-based simulations, where rules for different actors are hardcoded and played out in silico.
Empirical studies, measuring risk and returns using historical data from protocols like Uniswap.
These methods are valuable. But they rarely capture the strategic behavior of many agents interacting dynamically in the same system. Especially not in a way that leads to equilibrium insights.
And while game theory has been applied to DEXs before (particularly to concentrated liquidity and fee competition) mean field games remain virtually untouched in this domain.
Yet the fit is natural: AMMs involve a large number of small participants (traders, LPs), each making decisions based on prices that they themselves help shape.
That’s exactly what MFGs are designed for.
What’s a Mean Field Game (and why it fits)
Imagine you have thousands of agents: traders, LPs, bots, all acting simultaneously in a DeFi protocol. Modeling each one individually would be chaos. The system would be intractable.
Mean Field Games solve this by focusing on what each agent does on average, given the aggregate behavior of the rest.
Instead of a giant multiplayer game, you study the limit case: one “representative agent” optimizing their behavior in response to the average actions of the population, the mean field.
This is what makes MFGs so powerful:
You keep the essence of game theory (strategic interaction).
But you get a model that scales mathematically and can often be solved.
In the context of AMMs, here’s the idea:
Each trader decides how much to buy or sell.
These decisions move the price via the AMM formula (e.g. constant product).
That price movement affects everyone’s incentives.
So everyone’s behavior feeds back into the system.
It’s not just “supply and demand.” It’s a strategic loop.
And that’s exactly what a Mean Field Game captures.
This paper is the first in a series where we model traders as a continuum of agents interacting through a constant-product AMM without transaction costs.
In this initial work, we focus on the core strategic behavior. Just a clean model of trading flows shaped by mutual price impact.
How the model works
Let’s break it down.
In general, in MFG one analyzes the game for the finite case and then takes the step to the limit to present the problem to be optimized. We model a system with a large population of agents trading in an ETH/USDC liquidity pool governed by a constant-product AMM. Each agent i holds their own reserves of ETH and USDC, denoted by X^i_t and Y^i_t respectively, and decides at each moment how much ETH to buy (if positive) or sell (if negative), which we denote as the control α^i_t.
The inventory of ETH and USDC evolves as follows:
The ETH control directly changes the ETH inventory, while the USDC account is impacted by the traded volume at the current pool price P_t, plus a transaction cost term c_p(\alpha_t^i) that we will assume as zero.
Here’s the twist: the pool’s ETH reserve is a function of the aggregate ETH flow from all agents. In the finite-agent case, this becomes:
where X_0 is the number of tokens provided by the liquidity provider at an initial time. Note that the aggregate impact is represented as the average historical traded volume.
Therefore, the price itself P_t is itself impacted by the action of traders. The formula is given by:
where W_t^0 is a Wiener process that models the inherent risks of the liquidity pool (slippage, illiquidity, oracle failures, exploits, etc.), and \sigma^0 is an associated volatility.
This captures how collective trading behavior (via the sum of α^i_t) shapes the pool's reserves and thus the price introducing feedback into each agent’s optimization.
This setup naturally fits into the Extended Mean Field Game framework, where the interaction between agents occurs also through the law of the controls (rather than just their states).
📐 The math behind it
The formal (limit) problem structure is defined by the following extended MFG:
with the utility function reflecting the AMM mechanics is:
where the costs h and l are measurable, and for existence purposes we need them to be bounded by
for a certain constant c_1 > 0 .
The core idea: Each agent chooses their optimal strategy assuming some distribution of behaviors across the rest of the market.
The equilibrium is reached when those assumed distributions over strategies and states are exactly the ones that emerge from everyone acting optimally.
In other words: you guess how others behave, optimize accordingly… and in equilibrium, your guess was right.
What we proved (and why it matters)
To give the model some solid ground, we proved that an equilibrium actually exists.
More precisely:
We showed that under certain assumptions, there exists a fixed point where the distribution of agents' optimal controls and states matches the ones they react to.
In the language of Mean Field Games, that means the pair (μ_t,q_t) describing the state and control distributions is self-consistent it satisfies both the individual optimality condition and the aggregate consistency.
This result builds on classical existence theorems from the MFG literature, but adapted to the structure of a trading game inside an AMM, where agents interact through the pool price, and the pool price evolves based on their combined actions.
Why does this matter?
Because once you prove the game has a solution, you can:
Study its properties (e.g., how trading pressure or volatility affects behavior).
Explore numerical approximations to simulate real-world scenarios.
Eventually extend the framework to include transaction costs, liquidity providers, or even MEV.
What comes next
This is just the beginning.
In follow-up papers, we go beyond the frictionless world of this first model and add more realistic ingredients to the game:
Transaction costs: Trades come with costs, either proportional or nonlinear, which changes agents’ incentives and reduces excessive flow. The price dynamics adjust accordingly.
Liquidity providers (LPs): We introduce a second class of agents who provide liquidity to the AMM, not just trade against it. LPs face their own optimization problems, balancing yield with impermanent loss.
Arbitrage: We incorporate arbitrageurs who exploit price discrepancies between the AMM and external references. These agents stabilize the system but also extract value making their role crucial in the equilibrium.
Numerical resolution and simulation: We apply numerical methods to solve the MFG system and visualize equilibrium trajectories. This includes plotting inventory paths, price evolution, and aggregate behavior under various conditions.
The ultimate goal is to build a principled, mathematically grounded understanding of agent dynamics inside DeFi protocols, not just to describe what happens, but to predict and design for what should.
✍️ A Final Word
DeFi is full of heuristics, vibes, and backtests. But systems driven by economic incentives deserve better, they deserve real models.
Mean Field Games offer a powerful lens to think rigorously about strategic interactions at scale.
They don’t just simulate what might happen, they explain why agents act the way they do, and how their actions feed back into the protocol.
This first paper is just a seed. But it points to something deeper:
Crypto doesn’t just need new primitives, it needs better thinking.