Skip to content

View original

HyperliquidSolFundingExtremeCounterPositionLS4H

Hypotheses

Hyperliquid SOL Funding Extreme Counter-Position Long-Short (HYPERLIQUID Perps, 4H, Funding-Driven Mean Reversion)

Hypotheses

Long-short mean-reversion strategy on Hyperliquid SOL perpetuals that takes the OPPOSITE side of extreme funding-rate positioning. When funding paid by longs to shorts reaches an extreme positive level (longs overcrowded), short the perp; when funding paid by shorts to longs reaches an extreme negative level (shorts overcrowded), long the perp. Exits on funding normalization, profit target, or hard time stop. Fills three under-represented portfolio buckets simultaneously: HYPERLIQUID venue (currently 4.5% vs ≥20% target), long-short direction (currently 9.6% vs ≤55% long-only allowance), and funding-rate-driven mechanisms (underweighted in current portfolio). Avoids the recent BINANCE 30-MINUTE bar data-refill failures by using 4H bars on a liquid HL perp. Avoids the ADA daily walk-forward sample pathology by using a high-frequency mechanism (funding extremes shift every 7-14 days, producing 50-100 entry/exit cycles per year × ~5 years of HL data = 250-500 trades, well above the 100-trade walk-forward floor).

Hypotheses

Implements the hypothesis and fills the three target buckets: HYPERLIQUID venue, long-short direction, and a funding-rate-driven mechanism. SOLUSD.HYPERLIQUID with 4-HOUR bars is a liquid HL perp with multi-year 4H history (well within HL's ~2.3y/5000-candle 4h cap), giving ample trades and avoiding the BINANCE 30-minute refill failures the hypothesis calls out. 'Extreme' funding is a self-calibrating z-score vs the trailing 14-day window rather than a brittle absolute threshold, so it adapts as SOL's baseline funding regime drifts; the z-score is computed only from funding events at or before the current bar timestamp (bisect_right now), so there is no lookahead. Funding is parsed from the documented flat hl_funding_rates {ns: rate} dict (dual int/str keys deduped, timestamps normalized to ns) and there is NO price-only fallback edge — if funding is unavailable the strategy stays flat, per the supplementary-data rules (funding here is a signal, not a creditable cash flow, and the realized edge comes from the price mean-reversion after an overcrowded book unwinds). calculate_signal returns the z-score in natural units (may exceed 1) so the signal is continuous and varies every bar; should_enter thresholds it against entry_z and should_exit uses the cached z for the normalization exit, with PnL and time stops bounding risk. Long+short requires a margin venue, satisfied by HYPERLIQUID; leverage=1.0 is referenced in position_size so config and the engine margin model agree. The 4%/5% stops and multi-day holds give per-trade moves comfortably above HL's ~0.09% round-trip taker cost.

Hypotheses

Not worth optimizing: the funding-extreme counter-position fade on HL SOL shows no edge AND the sample is below the optimization floor. profit_factor 0.97, expectancy -$7.7/trade, Sharpe -0.35, total return -0.15% over the period, with both legs near coin-flip (long_win 0.46, short_win 0.56). Critically, the strategy produced only 50 trades versus the hypothesis's own predicted 250-500 and the 100-trade walk-forward floor it cited — z>=2 funding extremes are far rarer than assumed, and the trades cluster in 2025-2026 (the 2024-to-mid-2025 span is nearly empty), so a 3-window walk-forward would have ~16 trades/window and overfit noise. The heavy long/short asymmetry (41 long / 9 short) shows the symmetric crowding thesis doesn't fire evenly, and capacity_usd is just $14k. (This is a funding-SIGNAL price-reversion strategy, not a funding-carry trade — the PnL is price-direction PnL, which simply isn't there; the funding-crediting fix does not apply.) There is no positive base to tune toward and the sample is too thin to optimize. NOTE for research: extreme-funding mean-reversion on a single HL perp does not generate enough z>=2 events for a valid walk-forward; if retried, use a lower entry threshold or pool across multiple HL perps to reach trade-count sufficiency, and first demonstrate a positive per-trade edge on the cleanest extremes — that would be a different hypothesis, not an iteration of this one.

Implementation

Long-short funding-driven mean reversion on SOLUSD.HYPERLIQUID perpetual, 4-HOUR bars. It z-scores the current Hyperliquid funding rate against its own trailing 14-day (336h) distribution and takes the opposite side of extremes: when z >= +2 (longs overcrowded, funding richly positive) it SHORTS; when z <= -2 (shorts overcrowded) it LONGS. It exits when funding normalizes (|z| <= 0.5), on a 4% take-profit or 5% stop-loss, or after a 60-bar (10-day) time stop. Funding is read from the flat hl_funding_rates {ns: rate} dict using only events at/before the current bar (no lookahead); 25% notional per leg, leverage 1.0.

Backtest Review

Correctly implemented funding-z mechanism: self-calibrating trailing z-score, no-lookahead funding lookup with lag tolerance, both-sided entries, clean diagnostics (0 dropped).

Backtest Review

Fills under-represented HYPERLIQUID + funding-driven + long-short buckets; low drawdown (4%) and low exposure (10%) so it didn't blow up.

Backtest Review

Uses the now-valid hl_funding_rates history as a price-reversion signal (not as uncreditable carry).

Backtest Review

No edge: profit_factor 0.97, expectancy -$7.7/trade, Sharpe -0.35, total return -0.15% — flat-to-negative; both legs near coin-flip (long_win 0.46, short_win 0.56).

Backtest Review

Only 50 trades vs the hypothesis's own predicted 250-500 and the cited 100-trade walk-forward floor — BELOW the optimization floor; a 3-window WF (~16 trades/window) would overfit.

Backtest Review

Trades cluster in 2025-2026; the 2024-to-mid-2025 span produced almost nothing, so the effective test window is ~1 year — z>=2 funding extremes are far rarer than assumed.

Backtest Review

Heavy long/short asymmetry (41 long / 9 short) — the symmetric overcrowding thesis does not fire evenly.

Backtest Review

Tiny capacity_usd $14k (impact_cost_pct 264%, partly an artifact of near-zero gross) — no edge to support meaningful size.

Outcome Summary

HyperliquidSolFundingExtremeCounterPositionLS4H faded extreme funding crowding on HL SOL perps via a self-calibrating z-score, aiming to fill three under-represented portfolio buckets at once. The funding mechanism was implemented cleanly (no lookahead, both-sided entries), but it produced no edge — profit factor 0.97, Sharpe -0.35, essentially flat — and, crucially, only 50 trades versus the 250-500 the hypothesis predicted, clustered in a ~1-year effective window with 41 longs to just 9 shorts. The analyst abandoned it at backtest review after one iteration, citing both the absent edge and a sample below the walk-forward floor. The note for research is that single-perp funding extremes are too rare to optimize; a retry would need a lower threshold or a multi-perp pool and a demonstrated positive edge first.

Outcome Summary

Extreme-funding mean-reversion on a single HL perp doesn't produce enough z≥2 events for a valid walk-forward, and the symmetric overcrowding thesis fired lopsidedly; a real attempt would need a lower entry threshold or pooling across many HL perps to reach trade-count sufficiency and first demonstrate a positive per-trade edge.

Outcome Summary

The analyst issued an 'abandon' verdict at the pre-optimization backtest-review gate: the mechanism was correctly implemented but had no edge, and the sample was below the optimization floor — z≥2 funding extremes proved far rarer than assumed, so a 3-window walk-forward (~16 trades/window) would only overfit noise with no positive base to tune toward.

Outcome Summary

A single-instrument long-short mean-reversion strategy on Hyperliquid SOL 4H perpetuals that faded extreme funding-rate positioning — shorting when a self-calibrating funding z-score reached +2 (longs overcrowded) and going long at -2 (shorts overcrowded) — exiting on funding normalization (|z|<0.5), a 4% take-profit, 5% stop, or a 60-bar time-stop, explicitly to fill the under-represented HYPERLIQUID, long-short, and funding-driven buckets.

Outcome Summary

It showed no edge: 50 trades with profit factor 0.97, expectancy -$7.7/trade, Sharpe -0.35, a flat -0.15% total return, and both legs near coin-flip (long win 46%, short win 56%), though drawdown stayed low at 4%. It generated only 50 trades versus the hypothesis's own predicted 250-500 (and cited 100-trade walk-forward floor), clustered in 2025-2026 with heavy long/short asymmetry (41 long vs 9 short) and tiny $14k capacity.
Strategy report

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