5D Library › Liquidation Cascades, Order-Book Depth Depletion and Cointegrated Statistical Arbitrage · 中文

Preface: An Order Book, a Chain of Liquidations, a Spread

Note

Please read this first: risk warning. This book presents mathematical models and statistical methods for teaching and research. It is not investment, trading, tax or legal advice, and it recommends no specific asset, coin, exchange, broker or trading strategy. Leverage, options, perpetual contracts and other derivatives can lose all of the money put in, and with some products and in some circumstances losses can exceed it. Highly leveraged perpetual contracts are especially dangerous: by the formula in Chapter 2, a long position at 20 times leverage is forcibly liquidated after a fall of only about 4.5 %, and at 100 times after about 0.5 %; in violent markets this can happen within minutes or seconds, and the whole margin can be lost almost at once.

All backtests, simulations and “fictional examples” in this book use data generated by programs. They do not represent the past performance of any real market, still less future returns. Model parameters are illustrative unless a source is given. The book neither uses nor endorses claims such as “guaranteed”, “can’t lose”, “risk-free profit” or “immune to ruin”; wherever the author’s framework came close to such wording, it has been rewritten as a mathematical result under stated assumptions and listed below under “Claims corrected after checking”.

On the afternoon of 6 May 2010, US stock-index futures fell sharply within minutes and then rebounded, an episode later called the “Flash Crash”. Perpetual contracts on crypto-assets have repeatedly shown a different kind of plunge: a price fall triggers the forced liquidation of a batch of highly leveraged longs, the liquidation sell orders punch through a thin bid side, the price falls further and triggers the next batch. Meanwhile another kind of trader does almost the opposite. They do not bet on direction; they look for two prices that “should move together”, buy one and sell the other when the spread between them strays, and wait for it to come back.

This book puts these two activities side by side because they share one body of mathematics: price impact and order-book depth, self-exciting point processes and the branching ratio, mean-reverting processes and the bias in their estimates, cointegration tests and their critical values, the Kalman filter and its tuning. It asks four questions. First, how “deep” is an order book, and how far does a large order push the price? Second, why do liquidations chain together, and under what conditions does the chain keep burning by itself? Third, how reliably can “mean reversion” and “cointegration” be established from a finite amount of data? Fourth, is a dynamic hedge ratio (the Kalman filter) really better than a rolling regression, and how should that question be pre-registered and tested out of sample?

What this book covers

Chapter 1 covers the order book and price impact: the derivation of λ in Kyle’s model, the evidence for the square-root impact law and its scope, and the gaps that appear when depth decays. Chapter 2 covers funding in perpetual contracts, the derivation of the isolated-margin liquidation price, and a toy model of chained liquidations driven by “leverage distribution × order-book depth”. Chapter 3 covers Hawkes self-exciting point processes, the branching ratio and the criticality criterion, Ogata thinning and maximum likelihood, the dispute over whether markets are near criticality, and the author’s derivation of an “effective branching ratio”. Chapter 4 covers the exact discretisation of the Ornstein–Uhlenbeck process, its half-life and small-sample bias. Chapter 5 covers the correct critical values for the Engle–Granger cointegration test, the evidence on pairs trading and broken relationships. Chapter 6 covers Kalman-filter dynamic hedging and its comparison with rolling least squares.

Chapter 7 reads these modern models beside the debate on price stabilisation (pingzhun) and equitable transport (junshu) in the Discourses on Salt and Iron, and the record in the History of Song of the reserves, over-issue and depreciation of the jiaozi paper notes and of the salt vouchers, and states the boundary between ancient fiscal institutions and modern financial models. Chapter 8 gives a “four-step checklist” and a pre-registered out-of-sample test of “Kalman-filter hedging versus rolling least-squares hedging”; for reproducibility the protocol names its data sources, which is not a recommendation of any exchange or data vendor.

This book sits next to several others in 5D Library. Book 19, Non-Ergodic Wealth Dynamics, the Kelly Criterion and Volatility Drag, covered ruin and growth rates under leverage; Book 20, Credit Cycles, Self-Organised Criticality and the Statistical Physics of Market Phase Transitions, covered liquidity spirals and self-organised criticality; Book 25 covered cascades on networks; Book 28 covered critical slowing down and critical transitions; Book 32 covered congestion and the price of anarchy; Book 33 is the methodological charter of the whole series. Where this book touches those subjects it recalls them briefly with a reference and does not repeat their programs.

Claims corrected after checking

Every point in the author’s framework was checked before publication. The following were corrected or qualified in line with the evidence; each chapter explains them where they arise, and all are collected in the Editorial Notes published with the book.

  1. The jiaozi figures. The framework speaks of “a first issue of 1,256,340 strings against a reserve of 360,000”. The History of Song says “each issue period was limited to 1,256,340 strings” and “in former years, for each issue period, a reserve of 360,000 strings was set aside”: both are per issue period, not figures for the first issue, and their ratio is about 28.65 %. According to the Long Draft Continuation of the Comprehensive Mirror, the Yizhou Jiaozi Office was set up on the wuwu day of the eleventh month of the first year of Tiansheng, already January 1024 in the Gregorian calendar. The later depreciation (“no reserve was kept and printing grew without limit, until one string was worth a dozen-odd coins”) refers to the qianyin, the renamed jiaozi.
  2. The “arbitrage character” of pingzhun and junshu is only an analogy. In the Discourses on Salt and Iron, price stabilisation is a monopolistic fiscal and price policy that “bought when cheap and sold when dear” so that “merchants had no profit to make”; the Literati’s criticism (“we have not seen prices made level”) is precisely that it became a means of profit for officials and rich merchants.
  3. “Markets are at criticality” is a disputed estimate. Filimonov and Sornette (2012) reported endogeneity rising from about 0.3 in 1998 to above about 0.7 after 2007; Hardiman and colleagues (2013) found, with a power-law kernel, values close to 1 and nearly constant; Filimonov and Sornette (2015) showed that outliers and non-stationarity push estimates towards 1. The program in Chapter 3 shows that data with no self-excitation, only baseline switches, can be fitted with a branching ratio of 0.92.
  4. The scope of the square-root law. It describes the average impact of metaorders executed in pieces (YY of order one, exponents about 0.4–0.7), not the impact of one market order on a static visible book; a book whose depth decays with distance gives convex impact and gaps instead.
  5. Critical values for cointegration tests. The Engle–Granger residual test must use MacKinnon’s residual critical values (two variables with a constant: about −3.34 at 5 %, about −3.36 with 250 observations); with the ordinary Dickey–Fuller −2.86, about 15 % of unrelated random walks look cointegrated.
  6. Models are not laws. “Liquidation cascades are governed by an effective branching ratio set by leverage and depth” is the author’s model derivation; “the Kalman filter beats rolling regression” is a hypothesis to be tested, and the synthetic data of Chapter 6 even show that the filter tracking β best does not trade best.
  7. The liquidation formula is generic algebra. The isolated-margin price P0(1−1/L)/(1−m)P_0(1-1/L)/(1-m) ignores fees, funding, penalties and tiered maintenance margins; venues differ, and the book addresses none in particular.

How to read the boxes

As in the other books of 5D Library, different kinds of statement are marked separately.

Evidence

Evidence boxes report published research findings, with sources.

Calculation

Calculation boxes give formulas and short Python programs. Every program runs as printed in a standard Python 3 environment, uses only the standard library and a fixed random seed, and is followed by its actual output. The prices, order books, positions and “pairs” in the book are generated by programs and are not real assets.

Hypothesis · not established

Hypothesis boxes contain the author’s ideas, marked “not established”, with a statement of what result would show them wrong.

Source text

Source text boxes quote classical texts, with the author’s plain-language rendering.

Note

Note boxes give reminders and explain choices.

Where the book applies concepts from physics (criticality, branching ratio, phase transition, diffusion) to markets, these are models and analogies: they help to see structure, but market participants learn and change the rules, and parameters drift over time.

About this edition

This is version 1.0.0, the first complete edition: a preface and eight chapters, in Chinese and English, with 16 programs and 4 vector figures. The text, boxes and code were drafted with an AI writing tool from the author’s title, framework and notes; the author is responsible for reviewing and revising them and for checking every source. Corrections and missing references are welcome through the 5D Library website.

Disclosure

The author uses the works of 5D Library, including this book, as the methodological basis of his community courses, the 5D Ascension Cards (Dimensional Shift Card Decks) and the Yafu AI knowledge base, and therefore has a commercial interest in the subject of this book. The book promotes no course, card deck or service; the Chapter 8 trial is designed to be run and analysed by researchers independent of the author’s business and does not recruit from the author’s community, students or customers; all the code and the study protocol are published openly for anyone to check. The author develops and maintains software tools for a priori analysis and quantitative research scripts based on the symbolic system of the sexagenary (ganzhi) calendar, and provides related open-source research and independent consulting services; while writing this book he may have held routine observation positions in US equity index funds (such as SPY) or related derivatives. All models in this book are offered solely for mathematical and historical-statistical discussion; they constitute no investment advice, trading signal or promise of divinatory prediction, and the book recommends no specific trade or asset.

Fan, Y. (2026). Liquidation Cascades, Order-Book Depth Depletion and Cointegrated Statistical Arbitrage: Ornstein-Uhlenbeck Processes and Kalman-Filter Dynamic Hedging [高杠杆衍生品清算瀑布、订单簿深度衰竭与协整统计套利] (Version 1.0.0). 5D Library. https://doi.org/10.5281/zenodo.23796776 · Licensed under Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).