Quant Strategies
Last updated: August 2025

Stat Arb Models Deep Dive: Pairs, Cointegration & PCA Factors

Statistical arbitrage (stat arb) in crypto transforms noisy multi-exchange price series into mean‑reverting residuals and factor-neutral spreads. This 2025 deep dive covers data normalization, stationarity diagnostics, cointegration testing, principal component (PCA) factor extraction, z‑score based entry sizing, risk overlays, backtest pitfalls, execution drag mitigation (see slippage profiling) and KPI instrumentation for robust deployment.

Market Data Preparation & Normalization

Synchronized Bars

Resample multi-exchange prices to uniform interval; forward-fill small gaps; drop assets with >2% missing.

Return Standardization

Log returns scaled by rolling volatility to stabilize variance for tests & PCA.

Outlier Handling

Winsorize extreme tails (e.g. 99.5%) to prevent spurious cointegration acceptance.

Pre-Filtering & Pair Selection Heuristics

1

Liquidity & Availability

Average daily dollar volume & effective spread thresholds eliminate execution impractical pairs.

2

Correlation Window

Rolling Pearson/Spearman to identify potential relationships prior to formal tests.

3

Regime Stability

Hurst exponent / variance ratio filters to prefer mean‑reverting candidates.

Cointegration & Stationarity Diagnostics

1

ADF / PP Tests

Test residual series (priceA - β priceB) for unit root; require p-value < 0.05.

2

Johansen Trace

Multivariate sets (e.g. basket) for rank r; ensures stable linear combination existence.

3

Half-Life Estimation

Ornstein-Uhlenbeck fit on residual for mean reversion speed; screen out half-life > horizon.

4

Residual Diagnostics

Check autocorrelation (Ljung-Box) & volatility clustering (ARCH LM) to size risk overlays.

Residual Modeling & Signal Generation

Z-Score Bands

Entry when |z| > z_enter (e.g. 2); scale with linear function up to z_max; exit at mean or opposing band.

Volatility Targeting

Position size = target_vol / residual_vol * base_notional; prevents oversizing quiet pairs.

Dynamic Mean Shift

Apply exponentially weighted mean to adapt to slow structural drifts.

PCA Factor Extraction & Neutrality

Compute principal components of standardized return matrix; drop top k components explaining > X% variance to isolate idiosyncratic residual. Regress candidate spread on retained factors to ensure neutrality. Periodically recompute (e.g. weekly) with overlap to avoid look-ahead. Monitor eigenvalue drift as early warning of structural change.

Feature Engineering & Enhancements

1

Volume Imbalance

Lead-lag features capturing liquidity shifts preceding residual mean reversion.

2

Funding Differential

In perp/spot variants adjust expected reversion speed by funding spread (link basis risk).

3

Vol Regime Indicator

Switching threshold sets (z_enter/z_exit) under high vs low realized volatility regimes.

Portfolio Risk Controls & Guardrails

Pair Correlation Cap

Limit aggregate weight in highly correlated pairs to prevent hidden factor bets.

Drawdown Circuit

Pause signal for pair if rolling 30 trade PnL < −Xσ of historical mean.

Residual Vol Spike

Auto scale down when residual realized vol > 1.8× 30d avg.

Backtesting Methodology & Evaluation Pitfalls

1

Look-Ahead Bias Removal

Lag factor & volatility estimates by one bar; align weights with available info only.

2

Execution Slippage Modeling

Apply impact model (see slippage profiling) plus spread half; adjust for latency.

3

Multiple Testing Adjustment

Control false discovery across many pair candidates via p-value correction or empirical FDR.

Execution & Routing Considerations

Prioritize route to minimize expected residual distortion: partial passive orders where spread tight, aggressive where reversal speed high. Integrate MEV defense for on-chain legs (link AMM mechanics) and consider settlement batching (see settlement pipeline) to reduce fees.

Performance KPIs & Drift Monitoring

Residual Half-Life Stability

Track distribution shift; rising median warns structural change.

Capture Efficiency

Realized vs theoretical spread; target >60% median.

Slippage Ratio

Actual impact / modeled impact (see slippage analytics) < 1.2 threshold.

Pair Turnover

% of active pairs replaced quarterly; excessive churn implies overfitting.

Stat Arb Trade Execution Checklist

  1. Residual Validated: Cointegration still passes threshold tests.
  2. Z-Score Trigger: |z| within allowed max; sizing computed with vol cap.
  3. Risk Headroom: Pair exposure & correlation limits not breached.
  4. Execution Route Chosen: Passive/aggressive mix minimizing expected drag.
  5. Logging & Metrics: Residual stats, predicted vs realized impact armed.
  6. Drift Watch: Half-life & eigenvalue monitors green.

Tools, Libraries & Data Stack

  • Pandas / NumPy (data prep)
  • statsmodels (ADF, Johansen)
  • scikit-learn (PCA)
  • Arch (volatility diagnostics)
  • CCXT / Web3 (market data)
  • DuckDB / Parquet (storage)
  • Prometheus + Grafana (KPI dashboards)
  • Airflow / Dagster (pipeline orchestration)

Evolve Residuals into Scalable Edge

Integrate stat arb signals with slippage analytics, secure infrastructure and automated settlement to professionalize deployment.

Conclusion

Robust stat arb unites rigorous stationarity validation, adaptive factor neutrality and disciplined execution to convert transient pricing noise into stable alpha. Treat residuals as living objects—monitor half-life drift, eigenvalue shifts and capture efficiency to prune failing pairs early. Coupling modeling excellence with execution intelligence and risk guardrails compounds edge over naive correlation trades.

Share this article

Sources & References

Skip to main content