Order Flow, Liquidation Risk, and Margin
The current paper is Order Flow, Liquidation Risk, and Margin (V20). The code below accompanies an earlier version, Public Inference and Funding Fragility. It is retained as a historical archive, not as a replication package for V20.
Run locally with:
pip install -r requirements.txt
python code/run_all.py
wedge_equilibrium.py: wedge equilibrium identities and tradeoff checks.iso_dispersion_path.py: iso-dispersion primitive path.constructed_equilibrium.py: binding equilibrium, table values, and threshold.welfare.py: constrained-efficient margin sensitivity calculations.