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:

min⁑vE[∫0T(Ξ³2vt2+Ο•2Xt2+ΞΈXtVΛ‰t)dt+Ξ±2XT2]\min_{v} \mathbb{E} \left[ \int_0^T \left( \frac{\gamma}{2} v_t^2 + \frac{\phi}{2} X_t^2 + \theta X_t \bar{V}_t \right) dt + \frac{\alpha}{2} X_T^2 \right]

The value function $u(t, x)$ satisfies the backward parabolic Hamilton-Jacobi-Bellman PDE:

βˆ‚tu+12Οƒ2βˆ‚xxuβˆ’12Ξ³(βˆ‚xu)2+Ο•2x2+ΞΈxVΛ‰t=0,u(T,x)=Ξ±2x2\partial_t u + \frac{1}{2}\sigma^2 \partial_{xx} u - \frac{1}{2\gamma} (\partial_x u)^2 + \frac{\phi}{2} x^2 + \theta x \bar{V}_t = 0, \quad u(T, x) = \frac{\alpha}{2} x^2

The optimal feedback execution speed is:

vβˆ—(t,x)=βˆ’1Ξ³βˆ‚xu(t,x)v^*(t, x) = -\frac{1}{\gamma} \partial_x u(t, x)

Forward Population Dynamics (FPK)

The continuum population distribution of inventories $m(t, x)$ evolves forward according to the Fokker-Planck-Kolmogorov equation:

βˆ‚tmβˆ’12Οƒ2βˆ‚xxm+βˆ‚x(m vβˆ—(t,x))=0,m(0,x)=m0(x)\partial_t m - \frac{1}{2}\sigma^2 \partial_{xx} m + \partial_x \left( m \, v^*(t, x) \right) = 0, \quad m(0, x) = m_0(x)

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:

Ξ·Λ™(t)=1Ξ³Ξ·(t)2βˆ’Ο•,Ξ·(T)=Ξ±\dot{\eta}(t) = \frac{1}{\gamma}\eta(t)^2 - \phi, \quad \eta(T) = \alpha

Analytical solution with $\omega = \sqrt{\phi / \gamma}$:

Ξ·(t)=ϕγ⋅αcosh⁑(Ο‰(Tβˆ’t))+ϕγsinh⁑(Ο‰(Tβˆ’t))ϕγcosh⁑(Ο‰(Tβˆ’t))+Ξ±sinh⁑(Ο‰(Tβˆ’t))\eta(t) = \sqrt{\phi \gamma} \cdot \frac{\alpha \cosh(\omega(T - t)) + \sqrt{\phi \gamma} \sinh(\omega(T - t))}{\sqrt{\phi \gamma} \cosh(\omega(T - t)) + \alpha \sinh(\omega(T - t))}

The aggregate liquidation speed $\bar{V}_t$ and mean inventory $\bar{X}_t$ satisfy:

XΛ‰Λ™t=VΛ‰t=βˆ’Ξ·(t)+ΞΈΞ³XΛ‰t\dot{\bar{X}}_t = \bar{V}_t = -\frac{\eta(t) + \theta}{\gamma} \bar{X}_t


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.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including At1uri/mean-field-games-liquidity-engine