Kalman stat-arb
A pair of cointegrated assets drifts apart and back. The classic trade is long the cheap leg, short the rich one. On Solana spot we cannot short, so this strategy trades the same signal by rotating capital: hold the cheap leg outright, return to a 50/50 split when the spread normalizes.
The signal
We estimate the hedge relationship online rather than fitting it once. A Kalman filter treats the hedge ratio and intercept as a random walk on log prices and updates them every bar. Its standardized innovation — the surprise in the latest observation, divided by the square root of its predicted variance — is the z-score we trade.
state: w = [beta, alpha] — random walk obs: log(y) = beta · log(x) + alpha + eps signal: z = e / sqrt(F) — standardized innovation
After R. E. Kalman, "A New Approach to Linear Filtering and Prediction Problems", J. Basic Eng. 82(1), 1960. Pair qualification uses Engle & Granger (1987) cointegration and an Ornstein–Uhlenbeck half-life.
Rules
| Parameter | Default | Meaning |
|---|---|---|
| |z| > 2.0 | rotate | From balanced, go fully into the cheap leg. Sells queue before buys, so the sale funds the purchase. |
| |z| < 0.5 | normalize | Spread has normalized — return to a balanced 50/50 holding. |
| |z| > 4.0 | freeze | Relationship treated as broken: flatten to balanced, freeze a full warm-up before trading again. |
| warmup | 300 bars | No trades until the filter's covariance has settled. |
Parameters
| Parameter | Default | Meaning |
|---|---|---|
| entry_z | 2.0 | Rotation threshold. Lower trades more, pays more cost. |
| exit_z | 0.5 | Normalization band for returning to balanced. |
| stop_z | 4.0 | Relationship-broken guard, triggers freeze. |
| delta | 1e-4 | Process noise. Higher adapts faster, tracks noise. |
What would make us turn it off
Cointegration p-value on the trailing window rising above 0.05 for a sustained period; half-life extending beyond the holding horizon; or repeated stop-z freezes, which indicate the pair is no longer mean-reverting rather than merely stretched. Any of the three kills the pair publicly on the pair explorer, with the reason recorded.
Known failure modes
Rotation costs two fills per signal, so a chopping z-score bleeds fees. A slow structural drift in the LST peg looks like a tradable spread until it doesn't. Strategy-internal position beliefs are reconciled from actual fills, never trusted directly.