Mean Field Games Liquidity Spiral & Fire Sale Engine
A research-grade Mean Field Games (MFG) inference engine and coupled PDE solver for modeling systemic liquidity fire sales, crowded unwinds, and bank runs under the Lasry-Lions (2007) and Huang-Caines-MalhamΓ© (2006) forward-backward framework.
Developed by At1uri as part of the Institutional Quantitative AI Suite.
1. Coupled Forward-Backward PDE Architecture
The model describes an infinite continuum of atomistic market participants holding inventory $X_t \in \mathbb{R}$ and liquidating at speed $v_t = \dot{X}_t$:
Backward Dynamic Programming (HJB)
The representative institution minimizes execution friction, inventory holding risk, and permanent/temporary market impact:
The value function $u(t, x)$ satisfies the backward parabolic Hamilton-Jacobi-Bellman PDE:
The optimal feedback execution speed is:
Forward Population Dynamics (FPK)
The continuum population distribution of inventories $m(t, x)$ evolves forward according to the Fokker-Planck-Kolmogorov equation:
Closed-Form Matrix Riccati Solution
For Linear-Quadratic Mean Field Games, $u(t, x) = \frac{1}{2}\eta(t) x^2$, where $\eta(t)$ satisfies:
Analytical solution with $\omega = \sqrt{\phi / \gamma}$:
The aggregate liquidation speed $\bar{V}_t$ and mean inventory $\bar{X}_t$ satisfy:
2. Empirical Benchmarks
Evaluated across 4 institutional liquidity crisis scenarios:
| Crisis Regime | Friction $\gamma$ | Herd Coupling $\theta$ | Nash Price Drop | Myopic Panic Drop | Coordination Savings | Liquidity Half-Life |
|---|---|---|---|---|---|---|
| Archegos Fire Sale Cascade | 0.05 | 0.35 | -11.91% | -17.13% | +5.21% | 0.083 hrs |
| Silicon Valley Bank Run | 0.02 | 0.45 | -16.17% | -23.65% | +7.48% | 0.042 hrs |
| Flash Crash Microstructure | 0.12 | 0.20 | -10.63% | -14.88% | +4.25% | 0.250 hrs |
| Orderly Institutional Unwind | 0.06 | 0.05 | -10.52% | -14.33% | +3.81% | 0.333 hrs |
(The Nash equilibrium coordinates liquidation across participants, preventing predatory front-running and saving between +3.8% and +7.5% in market price depression).
3. Quickstart & Usage
from mfg_solver import MFGLiquiditySolver
# 1. Initialize solver for Archegos-style fire sale cascade
solver = MFGLiquiditySolver(gamma=0.05, theta=0.35, phi=0.10, alpha=3.0)
# 2. Compute closed-form Nash equilibrium
eq = solver.solve_equilibrium(initial_mean_x=1.25)
print(f"Equilibrium Price Impact: {eq['equilibrium_price_drop_pct']:.2f}%")
print(f"Myopic Panic Price Drop: {eq['myopic_panic_drop_pct']:.2f}%")
print(f"Nash Coordination Savings: +{eq['coordination_savings_pct']:.2f}%")
print(f"Liquidity Half-Life: {eq['liquidity_half_life_hrs']:.3f} hrs")
4. Repository Assets
mfg_solver.py: Standalone Python MFG PDE and Riccati solver.mfg_equilibrium_weights.json: Pre-computed Nash equilibrium value functions and density fields.benchmarks.json: Detailed empirical price depression and coordination metrics.- Interactive Web App: Explore real-time 3D value surfaces and forward density heatmaps in the Mean Field Games Liquidity Spiral Studio.