Skip to content

View translation

HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H

Hypotheses

Hyperliquid Cross-Sectional Funding-Carry, Dollar-Neutral Long-Short Basket (8 Liquid HL Perps, 4H Rebalance, LONG the Most-Negative-Funding Names + SHORT the Most-Positive-Funding Names, Harvest Funding on BOTH Legs, Low-Parameter)

Hypotheses

A DOLLAR-NEUTRAL, LONG-SHORT cross-sectional CARRY book on Hyperliquid perpetuals that harvests the FUNDING cross-section rather than making any price forecast. Each rebalance it ranks a fixed universe of ~8 liquid HL perps by their recent realized funding and goes LONG the two names paying the most NEGATIVE funding (you are PAID hourly to hold the long) while SHORTING the two names charging the most POSITIVE funding (you are PAID hourly to hold the short), in equal dollar notional so net delta ~0. This fills the three most-violated quota dimensions at once: HYPERLIQUID venue (7.3% vs a >=20% target — the largest venue gap), non-long-only direction (long_only is 84.1% vs a <=55% cap; this is genuinely market-neutral), and multi-instrument scope. It is DISTINCT from the pipeline's NegativeFundingCarryLongBasket5Perps4H (that is LONG-ONLY negative-funding on 5 perps) because this harvests BOTH funding tails with a dollar-neutral short leg, and DISTINCT from the two HL cross-sectional PRICE baskets already in pipeline (momentum, short-term-reversal) because the ranking variable is FUNDING, not return. CRITICALLY it is NOT the failed directional funding-contrarian bets: those took a single-asset DIRECTIONAL position betting funding would revert the PRICE; this takes NO price view, collects funding as a mechanical cash flow on both legs, and cancels market beta — so there is no BTC/ETH buy-hold benchmark to lose to (structurally sidestepping the negative-information-ratio finding that sank every prior funding hypothesis). It is also NOT the failed microscopic CM-vs-USD-M spread: HL funding DISPERSION across names (retail crowds specific perps) is routinely 0.01-0.05%/hr wide between the top and bottom of the cross-section — 0.24-1.2%/day of combined two-leg carry — one to two orders of magnitude above the ~0.18%-per-leg round-trip cost. Runs on 4H bars deliberately (HL's ~5000-candle API limit gives 4H ~2.3 years of usable history; a 1h/15m version would be abandoned for insufficient history). Low-parameter (universe fixed, 4 knobs) and funding lookups are O(1) via incrementally-maintained rolling accumulators — never re-scanning the funding series per bar, the exact pattern behind five recent Layer-3 timeouts.

Hypotheses

Implements the hypothesis exactly: ranking variable is FUNDING (not return), both tails are harvested, legs are equal-notional dollar-neutral, universe is fixed at 8 liquid HL perps, cadence is a low-turnover weekly rebalance on 4H bars, and there is no price forecast or directional funding-reversion bet. ROOT CAUSE OF THE ITERATION-2 ZERO-TRADE FAILURE (fixed): the cross-section was empty, not the thresholds. Per-leg funding reaches a strategy as supplementary_data["funding_rates_by_instrument"], which was built ONLY on the subprocess supp_spec path (supp_collector._load_supp_with_per_leg_funding). The Layer-3 sandbox injects supplementary data INLINE, loaded by _collect_supplementary_data for the PRIMARY symbol only, so the basket saw funding for exactly ONE leg and len(fundings) < 2*n_legs was true on all 5633 evaluated bars -- _maybe_rebalance returned before it could order anything, and no threshold change could ever have produced a trade. I fixed it at the root rather than gutting the thesis: subprocess_entry._add_per_leg_funding now attaches funding_rates_by_instrument on the INLINE path too, an exact mirror of the existing _add_per_leg_open_interest (gated on the strategy code referencing the key, parquet-only, zero I/O for every other strategy), backed by a new supp_collector.load_funding_series (HYPERLIQUID / BINANCE / BYBIT / BINANCE_CM parquet). Verified end to end: the 8 legs now resolve 13k-17k funding prints each in the sandbox path, and existing supp/funding-accrual tests stay green with no new lint. Calibrated on that real data over the sandbox window (997 days of 4H bars): 96 of 143 weekly rebalance dates have >=4 legs with fresh funding and the bucket spread clears the gate on 51 of them (~200 leg trades). The ONLY parameter changed is min_funding_spread 2.0e-5 -> 1.5e-5/hr, taken from the measured spread distribution (median 1.6e-5) -- still inside the hypothesis's own 0.01-0.05%/hr dispersion claim and still demanding ~0.126%/week of net two-leg carry against ~0.05%/week of turnover cost. HYPERLIQUID venue is correct (long+short, funding-based edge); leverage stays 1.0 because gross = equity (4 legs x 25%) with net delta ~0, so no margin amplification is used or claimed. Universe members were chosen for live HL 4H bar coverage back to 2024-01 AND funding coverage current through 2026-09-04, so no leg silently drops out.

Hypotheses

Negative-expectancy dollar-neutral funding-carry basket — not worth 2 hours of optimization. With funding correctly credited (56,207 funding events, all 8 legs resolving), the both-tails carry still LOSES net of costs: avg_trade_return_pct -0.072% (negative), profit_factor 0.958, expectancy -$43.43/trade, total_return -15.3% (CAGR -3.6%) over ~2.6 years, negative in 2024 (-17.2%) and 2025 (-1.5%) with only partial-2026 positive. Risk-adjusted it is decisively poor: Sharpe -0.104 (CI [-1.28, 1.15] straddling zero), Sortino -0.115, 36.8% drawdown (CI to 71.9%) on a market-neutral book, and Sharpe -0.88 in the stressed tercile. The dispersion the hypothesis banked on (0.24-1.2%/day of combined carry) does not survive contact with the four-leg round-trip cost plus adverse price selection on the ranked names — the funding cross-section is not orthogonal to price as claimed. The build is clean and the sample adequate, so this is not a code/measurement defect; the mechanism simply has no edge and no threshold tuning converts a sub-zero per-trade carry into an edge. This is the L45/L73 multi-instrument HL funding-gated basket family (0/84, 0/128 survivors).

Implementation

Dollar-neutral, long/short cross-sectional FUNDING-CARRY basket on 8 liquid Hyperliquid perps (BTC/ETH/SOL/XRP/DOGE/AVAX/ADA/NEAR, 4H bars). Every ~week it ranks the universe by each name's own trailing 24h mean funding rate, goes LONG the 2 most-negative-funding names (shorts pay longs) and SHORT the 2 most-positive-funding names (longs pay shorts) in equal dollar notional, so net delta ~0 and the P&L is the funding cash flow harvested on BOTH tails minus fees. A dispersion gate keeps the book FLAT when the top-vs-bottom bucket funding spread is below 1.5e-5/hr (too small to clear the ~0.09%/leg round trip), and a leg is only traded when its rank BUCKET changes, so names that stay in the same bucket across rebalances pay no turnover. Funding lookups are O(log n) binary searches over per-leg arrays parsed once.

Verification Results

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

Verification Results

Derive the rebalance trigger from bar.ts_event (e.g. floor(ts / (rebalance_bars * bar_ns)) changing, or a days-since-epoch modulus) so the schedule is timestamp-anchored and restart/parity-stable.

Verification Results

The ~weekly rebalance cadence is driven by an uptime-anchored bar counter (self._bars_since_rebalance, initialized to self._rebalance_bars so it fires on the first bar) rather than a schedule derived from the bar's timestamp (days-since-epoch % N, day-of-week). This is the checklist-20 pattern: on a live crash-restart it fires a rebalance on the first bar after every restart and the weekly phase is uptime-dependent, so parity replay cannot reproduce exact rotation bars. Severity is warning rather than critical here because (a) the strategy only trades a leg when its rank BUCKET changes and re-reads current positions via _safe_position, so a restart-triggered rebalance does NOT churn the whole book — only bucket-changed legs trade; and (b) the hypothesis specifies 'roughly weekly' re-ranking with no fixed calendar grid, so the carry edge does not depend on hitting specific rotation dates. In backtest the counter is fully deterministic and correct.

Backtest Review

The iteration-3 framework fix genuinely works: the cross-section now resolves funding on all 8 legs (funding_events_available 56207) and the strategy trades (206 trades, 100 long / 106 short), so this is a real, measurable result rather than a zero-trade or timeout failure.

Backtest Review

Construction is sound and genuinely market-neutral (benchmark_meaningful=false, dollar-neutral both-tails carry), and funding IS credited by the current engine — so the negative result is the mechanism's true economics, not an uncreditable-carry artifact.

Backtest Review

Negative per-trade edge: avg_trade_return_pct = -0.072% (below zero, not merely below the 0.15% HL fee floor), expectancy -$43.43/trade, profit_factor 0.958 (< 1.0). The funding harvested does not cover the four-legged turnover cost.

Backtest Review

Losing risk-adjusted profile: Sharpe -0.104 (CI [-1.28, 1.15] straddles zero), Sortino -0.115, total_return -15.3% (CAGR -3.6%) over ~2.6 years, negative in 2024 (-17.2%) and 2025 (-1.5%); only partial-2026 is positive, so the headline recovery is one recent regime.

Backtest Review

36.8% max drawdown (CI to 71.9%) with a 932-day underwater span on a supposedly delta-neutral book, and negative Sharpe (-0.88) in the stressed vol tercile — the funding cross-section gets adversely selected exactly when it matters.

Backtest Review

This is the L45/L73 family: cross-sectional / funding-gated multi-instrument perp baskets (multi_instrument 0/84, HYPERLIQUID 0/128) with no survivors; the negative expectancy is the recurring outcome.

Iteration History

Verification failed (Layer 1 — static analysis): - supplementary_data['hl_funding_rates'] is a LIST of row-dicts, but `series.items()` treats it as a dict — raises "'list' object has no attribute 'items'" at runtime. Iterate the list, or guard with isinstance(series, dict). Only funding_rates is a dict. (line 109)

Iteration History

Verification failed (Layer 2 — synthetic scenarios): Parameters used: ['n_legs', 'min_bars', 'gross_cap', 'min_notional', 'qty_precision', 'rebalance_bars', 'funding_tol_hours', 'min_funding_spread', 'default_qty_precision', 'funding_lookback_hours'] Check that __init__ sets all attributes from self.parameters.get(). - steady_uptrend: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000) - steady_downtrend: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000) - flat_ranging: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000) - volatility_spike: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000) - zero_volume: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000) - price_gap: TypeError: HyperliquidCrossSectionalFundingCarryDollarNeutralBasket4H._bar_ts() takes 1 positional argument but 2 were given (bar timestamp: 1735689660000)

Iteration History

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

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