Skip to content

View original

HyperliquidCrossSectionalWeeklyReversalNeutralBasketDaily

Hypotheses

Hyperliquid Cross-Sectional Short-Term Reversal Basket — Weekly Dollar-Neutral: Long Last Week's Relative Losers / Short Last Week's Relative Winners Across the Liquid HL Perp Universe (HYPERLIQUID, Market-Neutral, 1D Bars, 3-Parameter)

Hypotheses

A MARKET-NEUTRAL, MULTI-INSTRUMENT cross-sectional RELATIVE-VALUE strategy native to Hyperliquid — the single most under-represented venue (6.7% vs the ≥20% target) — and deliberately outside every dead/colliding family: it is NOT time-series trend/momentum (the 0.003-survival single-name class of L62), NOT calendar seasonality, NOT an always-in factor composite (L60), NOT short-vol options, NOT a funding-carry (the positive-funding carry just died fee_edge). MECHANISM: short-horizon CROSS-SECTIONAL REVERSAL — within a peer group of similar assets, the names that most OVER-performed their peers over the last week tend to give some of it back the next week, and the biggest relative laggards tend to catch up, because alt flows overshoot relative to the group and revert. This is a distinct, well-documented effect that operates at the opposite sign and shorter horizon than the trend-following momentum that dominates (and dies in) this factory. Each week, rank a fixed liquid HL perp universe (~16-20 names selected by TRAILING dollar volume — e.g. BTC, ETH, SOL, and the most liquid HL alt perps — no look-ahead) by their trailing `rank_lookback`-day return; LONG the bottom quintile and SHORT the top quintile, equal-weighted and dollar-neutral, so the book carries ~zero net crypto-beta and profits only from relative convergence. HORIZON: 1D bars, ~1-week holds — safely within Hyperliquid's history limit (1d = full history back to venue launch, unlike the sub-hourly HL windows the brief warns get abandoned for insufficient history). DATA (named per L61, confirmed present, no thin/absent feed): HYPERLIQUID 1D OHLCV for the universe only — no funding feed, no liquidations, no options surface. Only 3 tunable parameters (rank_lookback, quintile_fraction, rebalance_days).

Hypotheses

ITERATION 4 fixes the reported failure only: Layer 3 sandbox_timeout. I reproduced it on the real catalog (BTCUSD.HYPERLIQUID 1-DAY + 16 HL extras, 2400 days: 165 s end-to-end, 2,757 trades) and profiled it. The wall clock is NOT per-bar strategy work: 197 s of a 204 s profiled run is ParquetDataCatalog.query() -> fsspec glob walking the entire catalog tree ONCE PER INSTRUMENT (17 queries x ~10.4 s, + 22 s for the instruments() scan); the whole bar loop and order handling is ~7 s, and a 500-day window cost the same as a 2400-day one, so the cost is fixed per leg. The only lever a strategy has over that number is how many instruments it requests, so the universe is trimmed from 17 legs to the 8 deepest HL perps (measured on the same box and the same 2400-day window: ~133 s / 1,556 trades vs ~165 s / 2,757 trades). Two supporting perf/cost changes: per-instrument closes and dollar volumes now live in fixed-length deques appended once per bar (O(1) per leg, no re-slicing of _bars/_extra_bars and no repeated Bar.close.as_double() over 17 legs x ~2,100 bar groups), and a rebalance_band skips deltas smaller than 30% of a name's target notional so weekly drift top-ups no longer emit an order per held name (trades 2,757 -> 1,628 measured at 10 legs, 1,556 at 8). The EDGE IS UNTOUCHED: same trailing-return ranking, same long-laggards/short-winners construction, same equal-USD-notional dollar neutrality, same calendar-anchored slot from bar.ts_event, same 3 tunables and _param_bounds. Layer 1 static analysis still passes (warnings only, unchanged) and Layer 1.5 is unaffected (primary and venue unchanged; the check only requires the declared instrument to appear as primary or an extra leg).

Hypotheses

backtest_failed:data: the full backtest could not run 3 times — ktest_agent.py", line 424, in _ensure_funding_for_perp_legs raise RuntimeError( RuntimeError: Funding data unavailable for perp leg 'BTCUSD.HYPERLIQUID' — on-demand collection failed or the venue has no funding history (backtest blocked for accuracy; set SF_DISABLE_ONDEMAND_FUNDING=1 to bypass) Pipeline/data failure, not a verdict on the strategy; revive once the cause is fixed.

Implementation

Dollar-neutral cross-sectional short-term reversal across the 8 deepest Hyperliquid USD perps (BTC, ETH, SOL, BNB, XRP, DOGE, AVAX, LINK) on 1-DAY bars. Every calendar-anchored weekly slot the names are screened by trailing 30-day dollar volume, ranked by their trailing rank_lookback-day return, and the book goes LONG the bottom quintile_fraction (relative laggards) and SHORT the top quintile_fraction (relative over-performers), equal-weighted with EQUAL USD notional per side so gross exposure is 80% of equity at zero net delta. Positions are moved with netting delta orders and only when the delta clears both the $10 exchange minimum and a 30% turnover band, so a name that stays in the same quintile is not re-traded for drift. No leverage, no supplementary feeds — pure HL 1-DAY OHLCV.

Verification Results

If the mechanism were to be pursued, restore the 16-20 name universe (the fix belongs in catalog query batching, not in shrinking the tradable cross-section) so the quintile legs hold enough names to be a genuine cross-sectional bet.

Verification Results

Hypothesis specifies a ~16-20 name liquid HL perp universe; the code ships an 8-name universe (max_universe=8), so with quintile_fraction=0.20 each rebalance holds only 2 longs and 2 shorts (k=round(8*0.2)=2). The cross-sectional reversal mechanism is preserved and the reduction is documented as a Layer-3 wall-clock fix (per-instrument catalog query cost), but the effective cross-section is much thinner than the hypothesis's stated breadth, which weakens diversification and makes the ranking noisier. The optimizer could restore breadth if the timeout is addressed at the catalog level rather than by dropping legs.

Verification Results

Strong negative-expectancy signal on adequate sample: sandbox avg_trade_return_pct -0.41% (below the ~0.09% HL round-trip floor), total_return -81.5%, profit_factor 0.88 over 922 trades, and the developer's engine-free replay on real HL 1-DAY closes (2021-2026) finds cross-sectional reversal negative in essentially every cell across 5 constructions / 85+ (lookback,hold) combinations with several significantly negative t-stats (L14/H1 -0.180% t=-4.36; L7/H1 vol-adj -0.200% t=-5.05). Evidence points to cross-sectional MOMENTUM (opposite sign) being the real effect on this universe, i.e. a different hypothesis. Analyst should treat the reversal premise as likely falsified; a sign-flip is a Research Lead call, not a re-parameterization. The book is verifiably dollar-neutral (beta measured -0.022 on iter 1) so this is a mechanism failure, not a construction bug.

Analysis

Backtest gate: - metrics unreliable: 1382 trades / 2207 data days is too little evidence (need >=5 trades over >=10 days) — increase signal frequency or widen the window

Iteration History

Verification failed (Layer 4 — QA review): - Fee viability / edge failure demonstrated by the Layer-3 backtest (checklist #7, L6/L7). On real Hyperliquid 1-DAY data over 364 days (essentially the bulk of available HL 1d history) the strategy returns -26.4% net, Sharpe -1.59, profit_factor 0.77, probabilistic_sharpe 0.03, with sharpe_ci_high only +0.06 (the entire Sharpe CI is at or below zero). avg_trade_return_pct is -0.58% NET; adding back the ~0.09% HL round-trip taker cost gives a GROSS per-trade edge of roughly -0.49% — the cross-sectional reversal signal is negative BEFORE fees, so this is not merely fee drag but an anti-predictive signal at the 7-day horizon. Crucially the book is verifiably dollar-neutral (beta -0.022, benchmark_correlation -0.077), so the loss cannot be excused as a beta/regime artifact — it is pure negative relative-convergence alpha. This is the documented cross-sectional-reversal/rank graveyard (L6: 5592-trade cross-sectional reversal -58%; L7: cross-sectional momentum rank, zero survivors), and the developer's own rationale flags that a 7-day reversal is swamped by cross-sectional momentum in trending regimes. Per L6 the correct action is to reject at Layer 4 rather than spend the full backtesting + optimization budget rediscovering a negative edge the sandbox has already measured. - Not a defect, recorded for the analyst: the negative result is NOT a polarity bug. losers=ranked[:k] (lowest trailing return) are bought and winners=ranked[-k:] are shorted, which is correct cross-sectional REVERSAL. A reversed (momentum) sign would have profited in a trending regime; this correctly-implemented reversal lost, confirming the reversal signal itself is anti-predictive at rank_lookback=7 on this universe. So no sign flip will rescue it within the reversal thesis.

Iteration History

Verification failed (Layer 4 — QA review): - The hypothesis is falsified across its ENTIRE horizon grid, confirming the iteration-1 rejection (this is a re-review of the same strategy I failed at Layer 4). The developer rebuilt the experiment engine-free on the real HYPERLIQUID 1-DAY closes for the exact 17-name universe (2021-01..2026-08), charging the 0.09% HL round trip on both legs at every rebalance: across 35 raw-rank cells (lookback 1/2/3/5/7/14/21 x hold 1/2/3/5/7 days) every cell is negative except two noise cells (t=+1.20 and t=+0.18), and many are SIGNIFICANTLY negative (L14/H1 -0.180% t=-4.36, L7/H1 -0.146% t=-2.75, L14/H3 -0.421% t=-3.68) on up to 2,044 rebalances; the standard vol-adjusted rank is worse (L7/H1 -0.200% t=-5.05); an alts-only peer group and a wider 0.35 quantile reproduce it. So cross-sectional short-term reversal on this universe is not merely absent, it is INVERTED with high significance across every lookback, hold and construction variant -- what exists is cross-sectional MOMENTUM. The sandbox is unchanged from iteration 1 (no edge logic was altered): total_return -26.44%, Sharpe -1.59, PF 0.77, avg_trade -0.58% net (~-0.49% GROSS), dollar-neutral at beta -0.022 so not a beta/regime artifact.

Iteration History

Verification failed (Layer 4 — QA review): - This is the third review of the same strategy (failed at iterations 1 and 2), and the hypothesis is now EXHAUSTIVELY falsified. The developer tested the last construction flagged as untested -- sector-neutral ranking (majors/L1/DeFi/other, long the bottom third / short the top third within each sector, averaged to keep the book dollar-neutral) -- engine-free on real HYPERLIQUID 1-DAY closes (2021-01..2026-08, 0.09% HL round trip on both legs): 29 of 30 (lookback x hold) cells are NEGATIVE, many significantly (L5/H1 -0.129% t=-3.64, L14/H1 -0.110% t=-3.29, L7/H1 -0.106% t=-3.13, L2/H7 -0.499% t=-2.40) on up to 2,044 rebalances, the single positive cell pure noise (t=+0.18). Combined with iterations 1-2, that is FIVE independent constructions (universe-wide raw rank, vol-adjusted rank, alts-only peer group, wider 0.35 quantile, sector-neutral ranking) across 85+ cells, all negative essentially everywhere and significantly negative in dozens of cells. The sandbox is unchanged: total_return -26.44%, Sharpe -1.59, PF 0.77, avg_trade -0.58% net (~-0.49% GROSS), dollar-neutral at beta -0.022 so not a regime artifact. The effect is not merely absent but INVERTED with high significance -- what exists is cross-sectional momentum.

Iteration History

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of BTCUSD.HYPERLIQUID-1-DAY-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).
Strategy report

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