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

Chapter 2 Perpetual Contracts, Funding and Forced Liquidation

Note

A reminder. The formulas in this chapter show how close a highly leveraged position is to liquidation; they do not teach how to use leverage. Volatilities and rates in the tables are illustrative and correspond to no particular asset or venue.

Futures without an expiry date

An ordinary futures contract has an expiry date at which its price must converge to the spot price. A perpetual contract never expires, so what holds its price near spot? The answer is a periodic funding payment: when the perpetual trades above the spot price (or a spot index), longs pay shorts a fraction of their position’s notional value; when it trades below, shorts pay longs. The larger the deviation, the higher the funding rate and the costlier it is to hold the side that is out of line, which gives arbitrageurs a reason to push the price back.

Evidence

Theory and evidence on perpetuals. Shiller’s 1993 paper proposed perpetual futures, as a way to create cash-settled derivative markets for illiquid assets such as single-family homes (Shiller 1993). He, Manela, Ross and von Wachter derived no-arbitrage prices for perpetuals in frictionless markets and bounds with trading costs, noting that perpetuals, unlike fixed-maturity futures, are not guaranteed to converge to spot and that the funding mechanism keeps prices close to it; they found that deviations from no-arbitrage prices are larger in crypto than in traditional currency markets, co-move across currencies and shrink over time (He et al. 2022). Ackerer, Hugonnier and Jermann derived no-arbitrage prices for linear, inverse and quanto perpetuals and showed that the futures price equals the risk-neutral expected spot price at a random sampling time; they also characterised funding designs under which futures and spot prices coincide (Ackerer et al. 2024).

Venues compute funding differently, but most add a premium term (the perpetual’s deviation from the spot index, often averaged over a period) to an interest term, clamp the result within bounds and settle every few hours. This book discusses no venue’s parameters. What matters to the holder is a simple multiplication: funding is charged on notional value, while margin is only 1/L1/L of notional, so each payment as a share of margin is LL times the funding rate.

The isolated-margin liquidation price

Under isolated margin each position has its own separate margin. Open a long at price P0P_0, quantity QQ, leverage LL (initial margin QP0/LQP_0/L), with maintenance-margin rate mm (on the notional value at the current mark price). At price PP the position’s equity is QP0/L+Q(P−P0)QP_0/L + Q(P – P_0); when it falls to the maintenance margin mQPmQP the position is liquidated:

QP0L+Q(P−P0)=mQP⇒Pliqlong=P01−1/L1−m,Pliqshort=P01+1/L1+m.\frac{QP_0}{L} + Q(P-P_0) = mQP \quad\Longrightarrow\quad P_{\text{liq}}^{\text{long}} = P_0\,\frac{1-1/L}{1-m}, \qquad P_{\text{liq}}^{\text{short}} = P_0\,\frac{1+1/L}{1+m}.

The distance to liquidation is roughly 1/L−m1/L – m. This is generic algebra that ignores fees, funding and liquidation penalties; real rules often add tiered maintenance rates, a “mark price” computed from an index, insurance funds and auto-deleveraging.

Compute liquidation prices for several leverages, check the formula by solving the equity condition directly with bisection, then use the reflection principle, at an annualised volatility of 60 % (illustrative; driftless log price), to estimate the probability that the price touches the long liquidation price within 1 day and 7 days. Finally, see how funding erodes margin under isolated margin and raises the liquidation price.

Calculation

# Isolated-margin linear perpetual, generic algebra (no fees, tiers or penalties):
#   long P_liq = P0 (1 - 1/L) / (1 - m),  short P_liq = P0 (1 + 1/L) / (1 + m)
import math
from statistics import NormalDist
N = NormalDist()

def liq_long(P0, L, m):  return P0 * (1 - 1 / L) / (1 - m)
def liq_short(P0, L, m): return P0 * (1 + 1 / L) / (1 + m)

def check_long(P0, L, m):                 # bisection on the equity condition
    lo, hi = 1e-9, P0
    for _ in range(200):
        P = (lo + hi) / 2
        eq = P0 / L + (P - P0) - m * P
        lo, hi = (P, hi) if eq < 0 else (lo, P)
    return P

def p_touch(dist, vol_ann, days):         # driftless log-price, reflection principle
    s = vol_ann * math.sqrt(days / 365)
    return 2 * N.cdf(math.log(1 - dist) / s)

m, P0 = 0.005, 100.0
print("lev | long liq  dist | short liq  dist | P(touch long liq), ann. vol 60 %:"
      " 1 day  7 days")
for L in (2, 5, 10, 20, 50, 100):
    pl, ps = liq_long(P0, L, m), liq_short(P0, L, m)
    assert abs(pl - check_long(P0, L, m)) < 1e-6
    dl = 1 - pl / P0
    print(f"{L:3d} | {pl:7.2f} {dl:6.2%} | {ps:8.2f} {ps / P0 - 1:6.2%} |"
          f"   {p_touch(dl, 0.60, 1):7.2%}  {p_touch(dl, 0.60, 7):7.2%}")
# Funding: every 8 hours longs pay shorts rate f x notional (f may also be negative).
# Under isolated margin the payment comes out of the margin and moves P_liq up.
for f in (0.0001, 0.0003):
    L, days = 20, 30
    paid = 3 * days * f * L               # as a fraction of the initial margin
    margin_left = 1 / L * (1 - paid)
    new_liq = P0 * (1 - margin_left) / (1 - m)
    print(f"funding {f:.2%} per 8 h, L = {L}, {days} days: pays {paid:.0%} of margin;"
          f" long liq {liq_long(P0, L, m):.2f} -> {new_liq:.2f}")
# lev | long liq  dist | short liq  dist | P(touch long liq), ann. vol 60 %: 1 day  7 days
#   2 |   50.25 49.75% |   149.25 49.25% |     0.00%    0.00%
#   5 |   80.40 19.60% |   119.40 19.40% |     0.00%    0.87%
#  10 |   90.45  9.55% |   109.45  9.45% |     0.14%   22.72%
#  20 |   95.48  4.52% |   104.48  4.48% |    14.06%   57.75%
#  50 |   98.49  1.51% |   101.49  1.49% |    62.86%   85.49%
# 100 |   99.50  0.50% |   100.50  0.50% |    87.26%   95.17%
# funding 0.01% per 8 h, L = 20, 30 days: pays 18% of margin; long liq 95.48 -> 96.38
# funding 0.03% per 8 h, L = 20, 30 days: pays 54% of margin; long liq 95.48 -> 98.19

A long at 20 times leverage is liquidated after a fall of about 4.5 %; at the illustrative 60 % annual volatility the chance of touching that level within a day is about 14 %, within a week about 58 %. At 50 times the distance is only about 1.5 % and the one-day probability about 63 %; at 100 times, 0.5 % and about 87 %. These numbers assume a lognormal price without jumps; real prices have fat tails and gaps (Chapter 1), so touching probabilities can only be higher. Funding matters too: at 0.01 % every 8 hours, a 20-times long pays away 18 % of its initial margin in 30 days and its liquidation price rises from 95.48 to 96.38; at 0.03 % it pays away 54 % and the liquidation price rises to 98.19.

Note

Relation to Book 19. Book 19, Non-Ergodic Wealth Dynamics, the Kelly Criterion and Volatility Drag, already covered long-run growth under leverage, absorbing barriers of ruin and first-passage times: in a multiplicative wealth process, excessive leverage can turn the time-average growth rate negative even when each step has a positive expected return. This chapter adds only two things specific to perpetuals: the algebra of the liquidation price, and the amplification that comes from funding being charged on notional value.

From one liquidation to many

A single liquidation is just one market sell order. The trouble is that liquidation prices are not spread evenly: longs opened in the same period at similar prices and similar leverage have liquidation prices crowded into the same price band. Once the price enters that band, liquidation sell orders push it lower, into the next batch of liquidation prices.

Evidence

Liquidity spirals. Brunnermeier and Pedersen’s model shows that under certain conditions margin requirements are destabilising: traders’ ability to provide market liquidity depends on their funding, while their funding (capital and margin requirements) depends on market liquidity; the two reinforce each other in “liquidity spirals”. The model explains why market liquidity can suddenly dry up, moves together across securities and is related to volatility (Brunnermeier and Pedersen 2009). Book 20 discussed this mechanism from the angle of credit cycles, so it is not developed further here.

4,000 isolated-margin longs, entry prices uniform between 97 and 103, notionals lognormal (about 2,000 units in all). Two leverage mixes: “moderate” (2, 3, 5 and 10 times, mostly 2 to 5) and “aggressive” (5, 10, 20, 25 and 50 times, mostly 10 to 20). An exogenous shock first lowers the price by ss. Every position whose liquidation price is reached sells its full notional at market into a linear bid side that needs dd units of selling per 1 % fall. The bid side is not refilled during the cascade.

Calculation

The author’s toy model.

# Author's toy model of a long-liquidation cascade (illustrative numbers throughout).
# Liquidated longs sell their notional into a bid side needing d units per 1 % fall.
import math, random
rng = random.Random(2021)
MIXES = {"moderate": [(2, .3), (3, .3), (5, .3), (10, .1)],
         "aggressive": [(5, .2), (10, .3), (20, .3), (25, .1), (50, .1)]}

def book(mix, n=4000, m=0.005, P0=100.0):
    pos = []
    for _ in range(n):
        E = rng.uniform(97, 103)
        r, acc = rng.random(), 0.0
        for L, w in mix:
            acc += w
            if r <= acc: break
        q = rng.lognormvariate(math.log(0.5) - 0.18, 0.6)
        pl = E * (1 - 1 / L) / (1 - m)
        if pl < P0: pos.append((pl, q))   # positions alive at the current price
    return sorted(pos, reverse=True)

def cascade(pos, d, s, P0=100.0):
    P_shock, sold, i = P0 * (1 - s), 0.0, 0
    while True:
        P = P_shock * (1 - 0.01 * sold / d)
        moved = False
        while i < len(pos) and pos[i][0] >= P:
            sold += pos[i][1]; i += 1; moved = True
        if not moved or P <= 0: return max(P, 0.0), i

def max_neff(pos, d, lo=80.0, P0=100.0):
    best, P = 0.0, P0
    while P > lo:
        rho = sum(q for pl, q in pos if P * 0.99 <= pl < P)
        best = max(best, rho / d); P -= 0.25
    return best

for name, mix in MIXES.items():
    pos = book(mix)
    tot = sum(q for _, q in pos)
    print(f"{name} leverage mix: {len(pos)} positions, {tot:.0f} units")
    print("   depth d | max n_eff | final fall (liquidations) after shock 2 %, 5 %, 10 %")
    for d in (1000, 400, 200, 100):
        res = [cascade(pos, d, s) for s in (0.02, 0.05, 0.10)]
        cells = "  ".join(f"{100 - P:5.1f} % ({k:4d})" for P, k in res)
        print(f"   {d:6d}  |   {max_neff(pos, d):5.2f}   | {cells}")
# moderate leverage mix: 4000 positions, 2039 units
#    depth d | max n_eff | final fall (liquidations) after shock 2 %, 5 %, 10 %
#      1000  |    0.11   |   2.0 % (   0)    5.0 % (   0)   10.1 % ( 236)
#       400  |    0.28   |   2.0 % (   0)    5.0 % (   0)   10.3 % ( 245)
#       200  |    0.57   |   2.0 % (   0)    5.0 % (   0)   10.6 % ( 267)
#       100  |    1.13   |   2.0 % (   0)    5.0 % (   0)   11.5 % ( 344)
# aggressive leverage mix: 3898 positions, 1925 units
#    depth d | max n_eff | final fall (liquidations) after shock 2 %, 5 %, 10 %
#      1000  |    0.17   |   2.2 % ( 345)    5.7 % (1471)   11.3 % (2907)
#       400  |    0.43   |   2.5 % ( 457)    7.3 % (1954)   13.5 % (3113)
#       200  |    0.87   |   5.2 % (1334)   12.3 % (3113)   16.9 % (3113)
#       100  |    1.73   |  17.0 % (3113)   23.3 % (3898)   27.3 % (3898)

Under the moderate mix, shocks of 2 % and 5 % trigger no liquidations at all; a 10 % shock reaches the 10-times positions, but even at depth 100 the final fall is only 11.5 %. The aggressive mix is entirely different. At depth 1,000 a 2 % shock becomes a fall of 2.2 %; at depth 400, 2.5 %; at depth 200, 5.2 %; at depth 100 the 2 % shock sets off 3,113 liquidations and a final fall of 17.0 %, more than eight times the initial shock. With the same leverage distribution, halving depth twice turns “almost no amplification” into “chained liquidation”. The “max neffn_{\text{eff}}” column anticipates the next chapter’s explanation: the amplification is governed by a quantity like a branching ratio, which exceeds 1 for the aggressive mix at depth 100.

Hypothesis · not established

The size of a liquidation cascade depends on “leverage distribution × depth” (not established). The author’s hypothesis is that in real perpetual markets, the total liquidation volume set off by an exogenous price shock of given size depends mainly on the leverage distribution of open positions at the time (how near and how concentrated liquidation prices are relative to the current price) and on bid and ask depth, not just on the shock itself. Falsifiable prediction: where data on open interest by liquidation price are available, an index of “liquidation-price density ÷ depth” computed before a shock should predict, out of sample, the total liquidations and the fall that follow; if adding it does not improve on a model using only shock size and volatility, the hypothesis is wrong.

Chapter summary

Perpetual contracts use periodic funding payments to tie their price to spot; funding is charged on notional value and so erodes the margin of leveraged positions many times over. The liquidation price of an isolated long is about P0(1−1/L)/(1−m)P_0(1-1/L)/(1-m); 20 times leverage tolerates a fall of only about 4.5 %, which in volatile markets has a sizeable probability of being touched within a day. The toy model shows that when liquidation prices are concentrated near the current price and the bid side is thin, a small shock can be amplified into chained liquidations. The next chapter describes this amplification with self-exciting point processes and the branching ratio.

References

Ackerer, Damien, Julien Hugonnier, and Urban Jermann. 2024. Perpetual Futures Pricing. NBER Working Paper No. 32936. National Bureau of Economic Research.
Brunnermeier, Markus K., and Lasse Heje Pedersen. 2009. “Market Liquidity and Funding Liquidity.” Review of Financial Studies 22 (6): 2201–38.
He, Songrun, Asaf Manela, Omri Ross, and Victor von Wachter. 2022. Fundamentals of Perpetual Futures. arXiv preprint 2212.06888 (version 6, 2024). https://doi.org/10.48550/arXiv.2212.06888.
Shiller, Robert J. 1993. “Measuring Asset Values for Cash Settlement in Derivative Markets: Hedonic Repeated Measures Indices and Perpetual Futures.” Journal of Finance 48 (3): 911–31.

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).