Skip to content

View original

SolAvaxCointPairSpreadMR

Hypotheses

SOL/AVAX Cointegrated Pair Spread Mean-Reversion on Binance USD-M 4H (Market-Neutral Long-Short, Rolling Hedge Ratio)

Hypotheses

A market-NEUTRAL, long-SHORT statistical-arbitrage strategy trading the SOLUSDT-vs-AVAXUSDT spread on Binance USD-M perpetual futures using 4-HOUR bars and OHLCV-ONLY data. SOL and AVAX are both high-throughput smart-contract L1 tokens whose prices are economically linked and have historically co-moved tightly; their relative price (log-spread) tends to oscillate around a slowly-drifting equilibrium rather than wander, so extreme divergences in the spread tend to revert. This is the analyst-SANCTIONED re-target of a previously-abandoned SOL/AVAX pair: the prior attempt failed ONLY because it was placed on Hyperliquid 15m (which has ~2 months of history and cannot populate a walk-forward); the mechanism itself was judged sound and the analyst explicitly recommended re-targeting to SOLUSDT/AVAXUSDT.BINANCE at 1H/4H with >=12 months of data and an explicit cointegration check. Both legs trade on the SAME venue (BINANCE USD-M), so this avoids the cross-venue/multi-venue walk-forward injection bug that zeroed out prior cross-venue strategies, and both have ~5 years of clean Binance history (deep enough for a 3-window walk-forward + holdout). The strategy is deliberately simple (<=5 parameters) to resist the overfitting that killed prior multi-condition strategies, and at 4H with z-score entries it fires dozens-to-hundreds of times over the sample (>>10 entries per walk-forward window), directly addressing this session's recurring event-sparsity / all-zero-OOS abandons. Being market-neutral, it diversifies a portfolio that is 86% long-only.

Hypotheses

Fixes the blocking QA defect — over-leveraged sizing that liquidated the account on 2021-02-08 — with the smallest change that actually removes the failure mode, and leaves the signal untouched. Root cause was that sizing capped each leg separately: base = equity * 0.5 * leverage(2.0) = 1.0x equity for one leg, the hedge leg carried base * beta with beta clamped as high as 5.0, and nothing bounded the sum, so gross ran 1.2x-6x equity on a 2x margin account. Because a market-neutral pair's traded risk IS the unhedged spread, one divergence to the 4-sigma stop took ~74% of the account in a single trade. Three coupled risk-control changes: (1) an AGGREGATE gross cap — base is now min(per-leg target, max_gross_frac * equity * leverage / (1 + beta)), which bounds base * (1 + beta) at 0.8x equity for every possible hedge ratio (verified arithmetically: 0.38x gross at beta 0.5, 0.75x at beta 2.0); (2) beta clamped [0.2, 5.0] -> [0.5, 2.0], since a SOL/AVAX ratio outside that is a broken regression and the 5.0 end was what let the hedge leg alone reach 5x equity; (3) per_leg_pct 0.50 -> 0.25 and z_stop 4.0 -> 2.8, which directly attacks QA's secondary finding that avg_loss was 2.3x avg_win because the 4-sigma stop let losers run while winners were capped at z_exit. Leverage is requested as 1.0 (gross <= 0.8x equity needs no margin multiplier) and is still referenced in the single sizing path so the cap scales if a future config raises it. Both new clamps are declared in _param_bounds. With gross bounded and the stop tightened, the run should survive the full ~5 years of history so the walk-forward and >=10-entries-per-window measurability the hypothesis was re-targeted for can finally be assessed.

Hypotheses

Negative expectancy on a reliable 1042-trade / 5.9-year sample: avg_trade_return_pct -0.366% (below zero), profit_factor 0.788, total_return -76.3%, CAGR -20.0%, Sharpe -0.008 with a CI [-0.87, 0.78] that straddles zero, and max_drawdown 77.6%. This is the analyst-sanctioned re-target of the SOL/AVAX pair onto its correct venue (same-venue Binance USD-M 4H, ~5y history, balanced 521/521 legs), so the mechanism got a fair test — and it is falsified: the strategy loses in every calendar year (2020-2026) and in every vol regime (stressed -62%). Commission is only 3.78% of gross, so this is NOT fee-fragility — the spread mean-reversion signal is gross-negative. Optimizing z_entry/z_exit/z_stop cannot invert a PF-0.788, below-zero-expectancy signal. The SOL/AVAX log-spread does not revert profitably on Binance 4H. abandon_class=negative_expectancy.

Implementation

Market-neutral mean reversion on the SOL/AVAX log-price spread, both legs on BINANCE USD-M perpetuals at 4-hour bars, OHLCV only. A rolling OLS of log(SOL) on log(AVAX) gives the hedge ratio beta and a residual spread; the residual's z-score over the same window is the decision variable. z at or above +2 means SOL is rich, so the book shorts SOL and buys AVAX; z at or below -2 means SOL is cheap, so it buys SOL and shorts AVAX. Exits are reversion inside +/-0.5, a 2.8-sigma relationship-break stop, or a 60-bar time stop. The AVAX leg carries beta times the SOL leg's dollar notional so the pair is return-neutral, and the BASE notional is bounded by an aggregate gross cap: base = min(25% of equity, 80% of equity / (1 + beta)), so the SUM of both legs never exceeds 0.8x equity for any hedge ratio. beta itself is clamped to [0.5, 2.0]. Leverage 1.0.

Verification Results

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] Beyond the liquidation, the payoff is inverted and deeply negative even on the truncated pre-blowup window: win_rate 0.56 but avg_loss $15,303 is 2.3x avg_win $6,734 (PF 0.57, avg_trade_return_pct -1.59%), because the z_stop=4 exit lets a diverging spread run to a large basis loss while winners are capped at the z_exit=0.5 reversion. But the blocking issue is the liquidation/sizing defect below, not the edge. - OVER-LEVERAGED SIZING -> ACCOUNT LIQUIDATION. The sandbox reports liquidated=true, total_return -100%, max_drawdown 100%, liquidation_date 2021-02-08 (the backtest terminated ~139 days in). Cause: base leg notional = equity * per_leg_pct(0.5) * leverage(2.0) = 1.0x equity for the SOL leg ALONE, and the AVAX leg = base * beta with beta clamped to [0.2, 5.0], so the AVAX leg can reach 5x equity and there is NO aggregate gross cap -> total gross exposure ranges 1.2x to 6x equity on a 2x MARGIN account. A market-neutral pair's traded risk IS the spread/basis (unhedged by construction), so a divergence to the wide z_stop=4 (4 sigma) at 2-6x gross produces a catastrophic basis loss: largest_loss -$73,980 (~74% of the account in ONE trade), avg_loss $15,303. This is a risk-control/sizing defect (a full margin blowup, not merely a losing edge), and it prevents the strategy from even completing the full-history walk-forward the hypothesis requires. - The measurability the hypothesis was re-targeted to achieve is not demonstrated: the run liquidated at 139 data_days with only 32 trades before the full ~5y history could produce the promised dozens-to-hundreds of entries / 3-window walk-forward. Until the sizing defect is fixed and a full-history run completes, the >=10-entries-per-window claim is unverified.

Verification Results

Optimizer should explore wider z_entry and/or a tighter z_exit-relative stop so captured reversion exceeds the four-fill round-trip cost; confirm positive expectancy over full history before promotion.

Verification Results

At the default parameter draw the strategy has a negative per-trade edge net of fees (avg_trade_return_pct -0.366% vs the ~0.20% round-trip cost of a two-legged pair). This is a viability/edge concern, not a code defect — it is left to the optimizer/analyst to resolve, not blocked here.

Backtest Review

Same-venue (Binance USD-M) pair on ~5y of clean 4H history — the prior cross-venue/short-history blockers are gone, so this is a fair test of the mechanism

Backtest Review

Reliable 1042-trade sample with balanced long/short legs (521/521), matching the market-neutral hypothesis

Backtest Review

Sizing/liquidation defect from the prior iteration is fixed (liquidated=false, gross cap enforced)

Backtest Review

Negative expectancy on a decisive sample: avg_trade_return_pct -0.366% (below ZERO, not merely below the fee floor), profit_factor 0.788, total_return -76.3%, expectancy -$70/trade

Backtest Review

Sharpe -0.008 / Sortino -0.007 with CI [-0.87, 0.78] straddling zero; loses in every calendar year 2020-2026 and in all three vol regimes (stressed regime -62%)

Backtest Review

commission_pct_of_gross only 3.78% — the signal is gross-negative, not fee-killed; the SOL/AVAX spread does not revert profitably

Backtest Review

max_drawdown 77.6% (recovery_factor -0.97, DD duration ~2037 days) — no capital-survivable edge

Iteration History

Verification failed (leverage_set_but_unused): config sets leverage=2.0 but the strategy never references leverage in sizing. Size positions on it — notional = equity * fraction * leverage / price (read self.config.leverage) — or set leverage=1.0. As written the leverage is inert and the backtest is identical to 1x.

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - config.instrument_id is SOLUSDT.BINANCE but the hypothesis declares AVAXUSDT.BINANCE — a different asset. Implement the hypothesis as written (or the Research Lead must revise it).
Strategy report

Backtest and paper results are hypothetical. Trading involves risk of loss.