Skip to content

View translation

EthHyperliquidFundingExtremeContrarianReversalLS

Hypotheses

ETH Hyperliquid Funding-Extreme Contrarian Positioning Reversal, Long-Short (Single-Instrument ETHUSD.HYPERLIQUID Perp, DAILY Bars — Fade Crowded Leveraged Positioning When Funding Hits a Statistical Extreme, Capture PRICE Reversion Not the Coupon, 3-Parameter)

Hypotheses

A LONG-SHORT, single-instrument, DAILY-bar strategy on ETHUSD.HYPERLIQUID that uses the perpetual FUNDING RATE as a contrarian POSITIONING gauge and trades the resulting PRICE reversion. This is explicitly NOT funding-carry (L33): we do not hold a delta-neutral book to collect the 8h coupon — the coupon is below fees and that entire family is dead. Instead, an extreme funding reading is a proxy for crowded, over-leveraged one-sided positioning, and the EDGE is the multi-day price snapback when that crowd is forced to unwind — a move (~3-8% on ETH) an order of magnitude larger than the funding coupon or the ~0.09% round-trip HL fee. It fills the two biggest structural gaps after options: HYPERLIQUID venue (6.3% vs a ≥20% quota — this genuinely shifts the venue mix off Binance's 71%) and long_short direction (13.6% vs an 86%-long-only book). It uses DAILY bars specifically so HYPERLIQUID's ~5000-candle history limit is a non-issue (1d = full history back to 2020), avoiding the sub-hourly-HL trap. Distinct from the recent Binance RetailCrowding contrarian idea (different venue, and funding — a hard cash-flow-driven signal — rather than top-trader L/S ratios). Only 3 parameters and deliberately LOW frequency (only statistical funding extremes qualify) to resist the overfitting that killed 259 prior hypotheses and to keep fee drag negligible. NOT momentum/trend confluence (exhausted/overfit), NOT a tick/book microstructure scalper (repeated no-trades/timeout/instrument-swap deaths — this is bar-driven with a supplementary gate).

Hypotheses

Iteration 3 fixes exactly the reported Layer-3 failure (should_enter returned a side 0 times) with a single localised change in _build_funding, leaving the signal, entry/exit and sizing logic that already passed Layers 1-2 untouched. Root cause: the Layer-3 sandbox serialises supplementary_data to the backtest subprocess with json.dump (src/backtesting/subprocess_runner.py:143), and JSON converts every integer dict key to a string. My previous parser skipped string keys (to avoid double-counting the loader's dual int+str key mirror), so after that JSON hop it parsed 0 of ETH's 16,314 HL funding readings, _feed_ok stayed False on every bar, and no entry could ever fire. _build_funding now accepts both int and str keys and de-duplicates into a {ns: rate} dict, so the dual-key mirror still cannot double-count while a string-only feed parses in full. Verified by replaying the real on-disk ETH hl_funding_rates through a json.dumps/loads round-trip against the catalog's own ETHUSD.HYPERLIQUID 1-DAY bars for the exact 365-day sandbox window: old parse -> 0 funding points, 0 entries; new parse -> 16,314 points, ~24/day cadence, 81 seeded history days and 45 entry signals (43 long, 2 short). An empty feed still yields zero trades by design plus a one-time WARNING, so a genuine data-injection failure remains distinguishable from an over-tight threshold. Leverage stays 1.0 (referenced only as the gross-notional cap) since the edge is price reversion, not amplified exposure, and per-trade risk is capped at 2% of equity per L15.

Hypotheses

Negative-expectancy single-perp funding-gated contrarian reversal — no edge to optimize. The iteration-3 fix got it trading (73 trades over the ~3-year funding-covered window), and the result is decisively negative: total_return -9.95%, avg_trade_return_pct -0.642% (negative), profit_factor 0.89, expectancy -$78/trade, Sharpe -0.076 with bootstrap CI [-0.881, 0.687] straddling zero (PSR 0.457, IR -0.79), and avg_loss exceeds avg_win despite a 52% win rate. It deteriorates rather than mean-reverts: 2023/2024 marginally positive, then 2025 -9.5% and 2026 -0.26% with rolling Sharpe negative through the entire recent (holdout) window, and it loses in both the normal and stressed vol terciles. This is the zero-survivor Hyperliquid single-perp directional class (0/128, L82) crossed with the single-perp funding/supplementary-gated directional family (L73, edge-dead this session): the 'fade the crowd at funding extremes' premise does not produce a positive price snapback on this venue/asset. 73 trades is a measurable sample and the signal is refuted, not underpowered — no tuning of entry_z/stop_atr_mult/risk_frac flips a PF-0.89, -0.64%-per-trade mechanism, and the only reframe (trade with funding as momentum) is a different hypothesis, not a parameter change. Failure pattern: no_edge single-perp funding-gated contrarian, HL directional (L73/L82).

Implementation

Long-short daily-bar contrarian strategy on the ETHUSD Hyperliquid perp. The HL funding rate is used as a crowding gauge, not a coupon: each bar the prior 24h of hl_funding_rates is aggregated into a coverage-normalised daily figure and scored as a robust median/MAD rolling z-score over the trailing 90 valid days. The signal is -z (continuous, computed every bar), so its sign is the trade direction: deeply negative funding (crowded shorts) buys, deeply positive funding (crowded longs) sells. Entry fires when |signal| exceeds entry_z sigma, floored by the trailing 95th percentile of |signal| so the threshold is distribution-free. Exits on a 1.5x ATR stop, a 2.0x ATR target, normalisation of the positioning signal, or a 7-bar time stop. Sizing risks 2% of equity per stop-out, capped at 0.75x equity gross notional. If the funding feed is missing the strategy stays flat -- there is no price-only fallback.

Verification Results

CLEAN RESTART 2026-09-04 — this run's verdict history and learning records were removed and it was restarted from verification. Its previous abandonment came from the pipeline, not from the market: the Layer-2 harness mis-bound @staticmethod helpers (fixed), QA issued terminal performance verdicts on an unoptimized smoke test (removed — QA now judges correctness only), and sandbox timeouts came from backtest-slot starvation (fixed). The hypothesis and the strategy code are unchanged. Verify the code on its merits; performance is decided later by the full backtest and the optimizer.

Verification Results

Thin sample / likely limited coverage: 48 trades, Sharpe CI spans zero, all 2021-2024 stress windows flat at 0.0 — consistent with the HL funding feed covering only ~2023+ rather than the full 6-year bar history. The entry gate (entry_z 2.5, 95th-pct floor) is low-frequency by design. Not a bug; optimizer-tunable. Verify coverage, evaluate on the covered sub-window, consider loosening entry_z while keeping per-trade return above the HL fee floor; abandon if Sharpe stays ~0.

Backtest Review

The iteration-3 JSON-key fix works — the funding feed now parses and the strategy trades 73 times, a measurable sample

Backtest Review

Clean single-instrument/single-venue construction, low frequency, fee drag negligible (commission 4.2% of gross); genuinely fills the HL/long-short buckets

Backtest Review

Drawdown contained at 20.5% — no blow-up or liquidation

Backtest Review

Negative expectancy: total_return -9.95%, avg_trade_return_pct -0.642%, profit_factor 0.89, expectancy -$78/trade; avg_loss > avg_win

Backtest Review

Sharpe -0.076 with CI [-0.881, 0.687] straddling zero, PSR 0.457, IR -0.79 — no edge, negative point estimate

Backtest Review

Deteriorating: 2025 -9.5% and 2026 -0.26% with rolling Sharpe negative throughout the recent (holdout) window; loses in normal and stressed vol terciles

Backtest Review

Zero-survivor class stack: HL single-perp directional (0/128, L82) + single-perp funding/supplementary-gated directional (L73)

Iteration History

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: ETHUSD.HYPERLIQUID-1-DAY-LAST-EXTERNAL, Bars processed: 371 Diagnostics: should_enter() returned a side 0 times over 341 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.

Iteration History

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: ETHUSD.HYPERLIQUID-1-DAY-LAST-EXTERNAL, Bars processed: 370 Diagnostics: should_enter() returned a side 0 times over 349 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.

Iteration History

Verification failed (Layer 4 — QA review): - SUB-100-TRADE, STATISTICALLY UNMEASURABLE SAMPLE from a deliberately low-frequency gate. The sandbox produced total_trades=19 over 363 data_days, and the Sharpe of 0.599 has a CI of [-1.14, 2.06] that STRADDLES ZERO -- i.e. the edge is not statistically distinguishable from no edge at this sample. The strategy is by design low-frequency (only |z|>=2.5 funding extremes qualify), so ~19 trades/year is the intended rate; but ETH's Hyperliquid funding history is only ~2-3 years deep, so even the FULL backtest span yields well under the ~100 trades needed to separate edge from noise (per learning L16). This is the same funding-reversion family L16 explicitly flags as a repeat time-sink: 'XRP funding reversion (6 iterations to no_trades)' and other funding-reversion variants that reached measurable-trade or no-trade deaths after burning iterations. With profit_factor 1.90 and win_rate 0.58 resting on 19 trades -- and return_skew 2.46 / kurtosis 31.7 showing the P&L is dominated by a few extreme trades -- these headline metrics cannot be trusted as evidence of a real, repeatable edge. - The strategy is sold as LONG-SHORT (a core part of its rationale -- 'helps the direction quota, 13.6% vs an 86%-long-only book'), but the sandbox realized 19 LONG trades and ZERO shorts (long_trades 19 / short_trades 0), and the developer's own offline replay was 43 long / 2 short. So over the sample it is effectively LONG-ONLY, and with benchmark_correlation 0.41 / beta 0.0375 to buy-hold in a rising-ETH window, a meaningful share of the return may be ETH long beta rather than the symmetric contrarian-reversion edge the hypothesis claims. This also undercuts the stated portfolio-fit justification (it does not actually add short exposure). Note too that ETH perp funding is structurally POSITIVE most of the time (longs pay), so a contrarian rule should, if anything, fire more SHORTS than longs -- the all-long realization is the opposite and warrants understanding before the LS claim is trusted. - The reported max_drawdown is 3.21 (321%, CI [1.80, 8.16]) despite leverage=1.0, risk_frac=0.02 (stated ~2% of equity per stop-out) and avg_position_pct ~25%. A >100% drawdown figure is implausible for a 1x, 2%-per-trade design and signals that realized per-trade risk substantially exceeds the stated cap and/or a metrics anomaly the analyst should confirm. Mechanism: the ATR stop is evaluated on the DAILY bar CLOSE (get_position_pnl_pct on self._closes[-1]), so a large down day gaps THROUGH the 1.5-ATR stop and realizes far more than 2% -- consistent with largest_loss -$2392 being ~3x avg_win $864 and ~4x the intended risk unit. The 'one stop-out costs ~risk_frac of equity' guarantee therefore does not hold on gap days.
Strategy report

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