Possession-level liquidation engine.
A discrete-event liquidation engine for an on-chain leveraged sports market. Possession-by-possession score processes feed real-time liquidation triggers — linear and exponential curves parameterised by β and leverage L. The simulator stress-tests the engine under thousands of game shapes to find where it deleverages too early, and where it leaves the protocol holding bad inventory.
An on-chain leveraged sports market lets bettors take levered positions on the score differential of a live game. The protocol’s liquidity-provider pool absorbs the other side of every position, so the protocol’s solvency hangs on one design decision: when does the engine liquidate a levered position? Trigger too early and bettors get flushed on noise — bad UX, low retention, fewer fills. Trigger too late and a single late-game swing puts the LP pool underwater. The space of trigger curves is large; the cost of the wrong choice is asymmetric.
We built the engine and its simulator together: a possession-by-possession scoring process driven by real team-level pace and efficiency stats, paired with a parameterised liquidation rule that fires when the actual score differential breaches a curve L · β · g(t) — linear or exponential in elapsed game time. Every candidate curve gets stress-tested against the same library of game shapes before it ever reaches production.

Sample output. Six panels: score evolution for both teams, spread (home minus away) over the game, linear-trigger thresholds for each side with realised liquidation events, win-probability trajectory, and a liquidation-event timeline. β = 8.0, L = 10×, linear trigger. Run on a held-out game from the calibration set.
Score process. Possessions arrive as a Poisson process with team-specific intensity calibrated to pace; each possession produces 0/2/3 points drawn from an empirical distribution conditioned on team efficiency and current score-state. The full game evolves as a coupled jump process, not a parametric path.
Liquidation trigger. Two curve families: linear — threshold grows as β · t — and exponential — threshold grows as β · (eγt − 1). The leverage multiplier L scales the curve. We sweep (β, γ, L) on a coarse grid, then refine around the Pareto frontier between false-liquidation rate and protocol drawdown.
Evaluation. For each candidate curve we simulate 5,000+ games drawn from the team distribution, record every liquidation event, and score the curve on three axes: (a) median bettor surrender (early-trigger penalty), (b) 95th-percentile protocol drawdown (late-trigger penalty), and (c) post-liquidation inventory imbalance. The chosen curve dominates the prior heuristic on all three, with the biggest margin on the tail.
TRY IT: LIQUIDATION ENGINE
Pick a game shape. Drag β (the initial point cushion) and L (the leverage multiplier). Watch the threshold band tighten or widen, and the first liquidation event slide along the spread trajectory.