| --- |
| title: Limit Order Matching Microstructure |
| emoji: π |
| colorFrom: pink |
| colorTo: indigo |
| sdk: static |
| pinned: false |
| --- |
| |
| # Limit-Order-Matching-Microstructure |
| Paper: https://arxiv.org/abs/2511.20606 |
| Code: https://github.com/Republic1024/Limit-Order-Matching-Microstructure |
| ### Unifying Matching Markets and Limit Order Books through Microstructure Dynamics |
| ### Code Release for: *Limit Order Book Dynamics in Matching Markets: Microstructure, Spread, and Execution Slippage* |
|
|
|  |
| --- |
|
|
| ## π Overview |
|
|
| This repository contains the full simulation code, experiments, and visualization pipeline for the paper: |
|
|
| **βLimit Order Book Dynamics in Matching Markets: Microstructure, Spread, and Execution Slippageβ** |
| arXiv: https://arxiv.org/abs/2511.20606 |
|
|
| The project proposes a unified framework where **matching markets** (e.g., marriage, partner choice, labor matching) are modeled as **limit order books**, with: |
|
|
| - **Intrinsic value** β `ask` |
| - **Reachability constraint** β `bid-depth / liquidity drought` |
| - **ΞV gap** β structural **spread** |
| - **Compensation C** β imperfect price improvement |
| - **Slippage (regret)** β execution shortfall |
| - **Settling** β threshold-decay crossing event |
|
|
| The framework shows that **linear compensation cannot close structural preference gaps**, unless it triggers a **categorical identity shift** (`Identity Collapse Threshold`). |
|
|
| --- |
|
|
| ## π Core Concepts |
|
|
| ### **1. Unconditional vs. Reachable Maximum** |
| - `V_uncond_max`: Best perceived partner that exists in the population. |
| - `V_reach_max`: Best partner currently reachable under social liquidity constraints. |
| - `ΞV = V_uncond_max - V_reach_max`: |
| β The **structural preference gap**, analogous to a *bid-ask spread*. |
|
|
| ### **2. Theorem 1 β Compensation Clipping & Identity Collapse** |
| If compensation utility is: |
|
|
| ``` |
| |
| h(C) = min(Ξ΅C, C_max) |
| |
| ``` |
|
|
| Then: |
|
|
| - If `Ξ΅C < C_max` β **Compensation is ineffective**: ΞV persists |
| - If `Ξ΅C β₯ C_max` β **Identity Collapse**: category shift occurs |
|
|
| This mirrors slippage-bounded execution in microstructure. |
|
|
| ### **3. Threshold Dynamics (Settling)** |
| Commitment occurs when: |
|
|
| ``` |
| |
| ΞΈ = U_effective / V_uncond_max β₯ T(t) |
| |
| ``` |
|
|
| Where `T(t)` is a decaying liquidity threshold (similar to urgency-driven execution). |
|
|
| --- |
|
|
| ## π Repository Structure |
|
|
| ``` |
| |
| Limit-Order-Matching-Microstructure/ |
| β |
| βββ exp1-5.py # Main experiments (Sections 4.2β4.6) |
| βββ exp1-5-Chinese.py # Chinese commented version |
| βββ simulation_results.png # Fig 5 replication |
| βββ simulation_results2.png # Slippage + Clipping + Settling plots |
| βββ data/ # (Empty / Ignored) placeholder for datasets |
| βββ img1.jpg # Paper figure assets |
| βββ img2.jpg |
| βββ img3.jpg |
| βββ .gitignore |
| βββ README.md |
| |
| ``` |
|
|
| --- |
|
|
| ## π Experiments Included (Sections 4.2β4.6) |
|
|
| ### **Experiment 1 β Compensation Failure** |
| Shows why compensation cannot close ΞV under clipping. |
|
|
| ### **Experiment 2 β Settling Dynamics** |
| Implements the threshold-decay commitment model. |
|
|
| ### **Experiment 3 β Instant Commitment** |
| High-tier reachable candidate β immediate match. |
|
|
| ### **Experiment 4 β Regional Differences** |
| Despite different compensation norms (Jiangsu vs Guangdong), |
| **ranking is invariant** β structural gaps dominate. |
|
|
| ### **Experiment 5 β Regret Prediction** |
| Shock to `V_uncond_max` yields post-match ΞΈ decline β slippage regret. |
|
|
| --- |
|
|
| ## π¨ Visualization |
|
|
| `generate_academic_plots()` reproduces Figures: |
|
|
| - Settling curve `T(t)` vs ΞΈ |
| - Compensation utility clipping (Theorem 1) |
| - Structural slippage bars |
|
|
| Outputs: |
|
|
| ``` |
| |
| simulation_results2.png |
| |
| ``` |
|
|
| --- |
|
|
| ## βΆοΈ How to Run |
|
|
| ### **1. Install dependencies** |
| ``` |
| |
| pip install numpy pandas matplotlib |
| |
| ``` |
|
|
| ### **2. Run the experiments** |
| ``` |
| |
| python exp1-5.py |
| |
| ``` |
|
|
| ### **3. Generate visualizations** |
| (automatically triggered at the end) |
|
|
| --- |
|
|
| ## π Citation |
|
|
| If you use this framework, please cite: |
|
|
| ``` |
| |
| Wu, Y. (2025). Limit Order Book Dynamics in Matching Markets: |
| Microstructure, Spread, and Execution Slippage. |
| arXiv:2511.20606. |
| |
| ``` |
|
|
| --- |
|
|
| ## π§ Philosophy Behind the Model (Short) |
|
|
| This project formalizes a fundamental principle: |
|
|
| > **Compensation cannot close structural gaps. |
| > Only identity shifts can.** |
|
|
| This emerges naturally from the microstructure mapping between |
| ΞV β spread, |
| C β bounded price improvement, |
| and slippage β structural regret. |
|
|