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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Limit Order Matching Microstructure
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: static
|
| 7 |
+
pinned: false
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Limit-Order-Matching-Microstructure
|
| 11 |
+
Paper: https://arxiv.org/abs/2511.20606
|
| 12 |
+
Code: https://github.com/Republic1024/Limit-Order-Matching-Microstructure
|
| 13 |
+
### Unifying Matching Markets and Limit Order Books through Microstructure Dynamics
|
| 14 |
+
### Code Release for: *Limit Order Book Dynamics in Matching Markets: Microstructure, Spread, and Execution Slippage*
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
---
|
| 18 |
|
| 19 |
+
## π Overview
|
| 20 |
|
| 21 |
+
This repository contains the full simulation code, experiments, and visualization pipeline for the paper:
|
| 22 |
+
|
| 23 |
+
**βLimit Order Book Dynamics in Matching Markets: Microstructure, Spread, and Execution Slippageβ**
|
| 24 |
arXiv: https://arxiv.org/abs/2511.20606
|
| 25 |
|
| 26 |
+
The project proposes a unified framework where **matching markets** (e.g., marriage, partner choice, labor matching) are modeled as **limit order books**, with:
|
| 27 |
+
|
| 28 |
+
- **Intrinsic value** β `ask`
|
| 29 |
+
- **Reachability constraint** β `bid-depth / liquidity drought`
|
| 30 |
+
- **ΞV gap** β structural **spread**
|
| 31 |
+
- **Compensation C** β imperfect price improvement
|
| 32 |
+
- **Slippage (regret)** β execution shortfall
|
| 33 |
+
- **Settling** β threshold-decay crossing event
|
| 34 |
+
|
| 35 |
+
The framework shows that **linear compensation cannot close structural preference gaps**, unless it triggers a **categorical identity shift** (`Identity Collapse Threshold`).
|
| 36 |
+
|
| 37 |
---
|
| 38 |
|
| 39 |
+
## π Core Concepts
|
| 40 |
+
|
| 41 |
+
### **1. Unconditional vs. Reachable Maximum**
|
| 42 |
+
- `V_uncond_max`: Best perceived partner that exists in the population.
|
| 43 |
+
- `V_reach_max`: Best partner currently reachable under social liquidity constraints.
|
| 44 |
+
- `ΞV = V_uncond_max - V_reach_max`:
|
| 45 |
+
β The **structural preference gap**, analogous to a *bid-ask spread*.
|
| 46 |
+
|
| 47 |
+
### **2. Theorem 1 β Compensation Clipping & Identity Collapse**
|
| 48 |
+
If compensation utility is:
|
| 49 |
+
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
h(C) = min(Ξ΅C, C_max)
|
| 53 |
+
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Then:
|
| 57 |
+
|
| 58 |
+
- If `Ξ΅C < C_max` β **Compensation is ineffective**: ΞV persists
|
| 59 |
+
- If `Ξ΅C β₯ C_max` β **Identity Collapse**: category shift occurs
|
| 60 |
+
|
| 61 |
+
This mirrors slippage-bounded execution in microstructure.
|
| 62 |
+
|
| 63 |
+
### **3. Threshold Dynamics (Settling)**
|
| 64 |
+
Commitment occurs when:
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
|
| 68 |
+
ΞΈ = U_effective / V_uncond_max β₯ T(t)
|
| 69 |
+
|
| 70 |
+
```
|
| 71 |
+
|
| 72 |
+
Where `T(t)` is a decaying liquidity threshold (similar to urgency-driven execution).
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## π Repository Structure
|
| 77 |
+
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
Limit-Order-Matching-Microstructure/
|
| 81 |
+
β
|
| 82 |
+
βββ exp1-5.py # Main experiments (Sections 4.2β4.6)
|
| 83 |
+
βββ exp1-5-Chinese.py # Chinese commented version
|
| 84 |
+
βββ simulation_results.png # Fig 5 replication
|
| 85 |
+
βββ simulation_results2.png # Slippage + Clipping + Settling plots
|
| 86 |
+
βββ data/ # (Empty / Ignored) placeholder for datasets
|
| 87 |
+
βββ img1.jpg # Paper figure assets
|
| 88 |
+
βββ img2.jpg
|
| 89 |
+
βββ img3.jpg
|
| 90 |
+
βββ .gitignore
|
| 91 |
+
βββ README.md
|
| 92 |
+
|
| 93 |
+
```
|
| 94 |
|
| 95 |
---
|
| 96 |
|
| 97 |
+
## π Experiments Included (Sections 4.2β4.6)
|
| 98 |
+
|
| 99 |
+
### **Experiment 1 β Compensation Failure**
|
| 100 |
+
Shows why compensation cannot close ΞV under clipping.
|
| 101 |
+
|
| 102 |
+
### **Experiment 2 β Settling Dynamics**
|
| 103 |
+
Implements the threshold-decay commitment model.
|
| 104 |
+
|
| 105 |
+
### **Experiment 3 β Instant Commitment**
|
| 106 |
+
High-tier reachable candidate β immediate match.
|
| 107 |
+
|
| 108 |
+
### **Experiment 4 β Regional Differences**
|
| 109 |
+
Despite different compensation norms (Jiangsu vs Guangdong),
|
| 110 |
+
**ranking is invariant** β structural gaps dominate.
|
| 111 |
+
|
| 112 |
+
### **Experiment 5 β Regret Prediction**
|
| 113 |
+
Shock to `V_uncond_max` yields post-match ΞΈ decline β slippage regret.
|
| 114 |
+
|
| 115 |
+
---
|
| 116 |
+
|
| 117 |
+
## π¨ Visualization
|
| 118 |
+
|
| 119 |
+
`generate_academic_plots()` reproduces Figures:
|
| 120 |
+
|
| 121 |
+
- Settling curve `T(t)` vs ΞΈ
|
| 122 |
+
- Compensation utility clipping (Theorem 1)
|
| 123 |
+
- Structural slippage bars
|
| 124 |
+
|
| 125 |
+
Outputs:
|
| 126 |
+
|
| 127 |
+
```
|
| 128 |
+
|
| 129 |
+
simulation_results2.png
|
| 130 |
+
|
| 131 |
+
```
|
| 132 |
+
|
| 133 |
+
---
|
| 134 |
+
|
| 135 |
+
## βΆοΈ How to Run
|
| 136 |
+
|
| 137 |
+
### **1. Install dependencies**
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
pip install numpy pandas matplotlib
|
| 141 |
+
|
| 142 |
+
```
|
| 143 |
+
|
| 144 |
+
### **2. Run the experiments**
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
python exp1-5.py
|
| 148 |
+
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
### **3. Generate visualizations**
|
| 152 |
+
(automatically triggered at the end)
|
| 153 |
+
|
| 154 |
+
---
|
| 155 |
+
|
| 156 |
+
## π Citation
|
| 157 |
+
|
| 158 |
+
If you use this framework, please cite:
|
| 159 |
+
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
Wu, Y. (2025). Limit Order Book Dynamics in Matching Markets:
|
| 163 |
+
Microstructure, Spread, and Execution Slippage.
|
| 164 |
+
arXiv:2511.20606.
|
| 165 |
+
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
---
|
| 169 |
+
|
| 170 |
+
## π§ Philosophy Behind the Model (Short)
|
| 171 |
+
|
| 172 |
+
This project formalizes a fundamental principle:
|
| 173 |
+
|
| 174 |
+
> **Compensation cannot close structural gaps.
|
| 175 |
+
> Only identity shifts can.**
|
| 176 |
+
|
| 177 |
+
This emerges naturally from the microstructure mapping between
|
| 178 |
+
ΞV β spread,
|
| 179 |
+
C β bounded price improvement,
|
| 180 |
+
and slippage β structural regret.
|