Skip to content

View original

HlBtcFundingExtremeFadeLS

Hypotheses

Hyperliquid Predicted-Funding Extreme Fade, Long-Short (Single-Instrument BTCUSD.HYPERLIQUID Perp — HL-SPECIFIC NEW Information Source: Position AHEAD of Extreme PREDICTED Funding, Fading the Over-Leveraged Crowd the Forward-Looking Funding Reveals, Price-Confirmed, 3-Parameter)

Hypotheses

A LONG-SHORT directional strategy on the BTCUSD.HYPERLIQUID perpetual driven by a genuinely NEW and HL-SPECIFIC INFORMATION SOURCE — Hyperliquid's PREDICTED FUNDING feed (hl_predicted_fundings). This is the one exception the meta-learner's L39 explicitly permits ('an HL-only funding/vault/predicted-funding mechanism that cannot be expressed on BINANCE'): Hyperliquid publishes the UPCOMING funding rate BEFORE it is charged, a forward-looking signal Binance does not provide, so the edge is structurally HL-specific and cannot be a re-pointed Binance mechanism. The thesis: an extreme PREDICTED funding reveals a dangerously over-leveraged crowd about to be charged (very positive → crowded longs about to pay; very negative → crowded shorts). Because it is forward-looking, the strategy can position AHEAD of the funding-driven unwind that other traders execute at the funding timestamp — fading the crowded side before the deleveraging move. It is materially different from all my pending/dead ideas: new venue (Hyperliquid, 6.6% vs a ≥20% quota), new information source (predicted funding, not realized funding/OI/liquidations/L-S/options), and a leading (forward-looking) rather than reactive signal. It trades the HL perp the funding applies to (dev-safe, single instrument). Uses 4H bars so HL history (~2.3 years at 4H) is adequate. Long-short (fills the 13.5% long-short bucket), price-confirmed entries, revert/stop geometry for favorable RR and bounded drawdown. 3 parameters.

Hypotheses

The reported failure was a name collision, not a logic error, and I confirmed it by reproduction rather than inference. The crash was `'float' object is not callable` with 0 bars processed, which means it fired during lifecycle setup, before any signal code could run. The strategy stored its stop PRICE in self._stop, and _stop is a RESERVED lifecycle method on NautilusTrader's Strategy, inherited from Actor, that the engine calls to shut the strategy down. On the Cython base class that slot is read-only, but FactoryStrategy is a Python subclass so instances carry a __dict__, and because a plain method is a non-data descriptor the instance dict wins the attribute lookup. I reproduced the exact error: subclassing Strategy, assigning s._stop = 0.0 and calling s._stop() raises TypeError: 'float' object is not callable, and the attribute's type flips from method to float on assignment. The fix is the smallest one possible: the stop price is renamed self._stop_px across all nine occurrences. To make sure this does not loop again I swept every one of the class's thirty-two instance attributes against both Strategy and Actor and _stop was the ONLY collision, then verified at the AST level that no executable path still references any reserved lifecycle name and that the only remaining _stop mentions are docstring prose. The signal, the funding parsing and source-selection, the entry threshold-crossing logic, the stop-before-target exit geometry and the sizing are all byte-identical to the version that passed the earlier layers. One honesty note I am carrying forward rather than quietly dropping: the hypothesis's distinctive claim is about Hyperliquid's forward-looking PREDICTED funding, but the pipeline only ever injects hl_funding_rates into supplementary_data and the predicted-funding artefact is a seven-day rolling snapshot with just seven distinct timestamps, so what this run actually measures is a REALIZED funding-extreme fade on Hyperliquid. The code still prefers the predicted feed and will switch to it automatically the moment it carries real history; until then the substitution is declared in the class docstring, in the log and in self._fd_source rather than being silent.

Hypotheses

The distinctive premise is untestable and the testable proxy has no edge — not worth 2 hours of optimization. The hypothesis rests on Hyperliquid's forward-looking PREDICTED funding (the L39-permitted HL-specific exception), but that feed is a 7-day rolling snapshot (7 distinct timestamps), so the strategy correctly and by its own declaration falls back to REALIZED HL funding — a reactive funding-extreme fade, which is a different, already-dead mechanism (L73/L18 single-perp funding fade; HL majors funding fade previously died at PF 0.846). On realized funding over 198 trades / 2.6 years the result is no edge: Sharpe 0.222 with bootstrap CI [-0.98, 1.42] straddling zero, PSR 0.607, PF 1.18, IR -0.72, CAGR 3.6%, and the edge decayed in 2026 (annual +0.55%, rolling Sharpe from +10 to -3.87). It is also capacity-dead (impact 15.9% of gross, capacity ~$3.97M, commission 6.96%). The base Sharpe is the ceiling the ~225-trial deflation only lowers, so it will fail the deflated-Sharpe gate. The forward-looking edge cannot be evaluated until the predicted-funding feed accrues real history; the realized proxy that can be tested is flat. Failure pattern: no_edge/capacity single-perp funding fade; distinctive predicted-funding premise structurally untestable (L73/L18/L39).

Implementation

Long-short funding-extreme fade on the BTCUSD.HYPERLIQUID perpetual, 4-hour bars, single instrument and single venue. Each bar the strategy takes Hyperliquid's funding rate as of that bar's open stamp (never later, so the print is already up to four hours old when traded on) and standardises it against its own trailing 20-day rolling distribution, returning the negated z-score as a continuous signal every bar. The negation is the fade and is mechanical: funding pinned far positive means crowded longs are paying to stay long, so the strategy SHORTS them; funding far negative means crowded shorts are paying, so it goes LONG. Entries fire on a fresh threshold crossing of that z-score in either direction, gated identically on both sides so no price-confirmation filter can veto one leg. Exits are structural and fixed at entry: an intrabar stop at stop_atr_mult ATRs tested against the bar's low or high and checked BEFORE the target so a bar that touches both books as a loss, a take-profit at target_atr_mult ATRs measured on the close, and a hard 18-bar (3-day) maximum hold. Sizing is risk-first and gap-aware, qty = equity * risk_pct / (max(stop_atr_mult, gap_atr_mult) * ATR), capped at 35% of equity in gross notional and floored at Hyperliquid's $10 minimum, with leverage 1.0 and no sizing path reading leverage. It reads hl_predicted_fundings first and falls back to hl_funding_rates, accepting a feed only if it carries genuine multi-month history rather than a snapshot; with no usable funding series it stands flat rather than substituting a price-only proxy.

Verification Results

Verification failed (Layer 3 — sandbox backtest): 'float' object is not callable Bar type used: BTCUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL, Bars processed: 0 Ensure your strategy produces trades with the given data and parameters.

Backtest Review

Genuinely new venue/feed angle (HL) with adequate sample (198 trades over 956 days) and both legs traded (119 long / 79 short)

Backtest Review

avg_trade_return_pct 0.334% clears the HL fee floor; drawdown modest (10.4%); low beta (0.01)

Backtest Review

The distinctive forward-looking premise is UNTESTED: hl_predicted_fundings is a 7-day rolling snapshot (7 distinct stamps), so the run falls back to REALIZED HL funding — a reactive fade, not the 'position ahead of predicted funding' edge the hypothesis rests on

Backtest Review

The testable (realized-funding) mechanism has no edge: Sharpe 0.222 with bootstrap CI [-0.98, 1.42] straddling zero deeply, PSR 0.607, profit_factor 1.18, information_ratio -0.72, CAGR 3.6% over 2.6 years

Backtest Review

Edge decayed in the recent regime: 2026 annual +0.55%, rolling Sharpe fell from ~+10 (2025-08) to -3.87 (2026-09); normal-vol tercile is negative (Sharpe -0.98)

Backtest Review

Capacity-constrained: impact_cost_pct 15.9% of gross, capacity_usd only ~$3.97M; commission another 6.96% of gross

Backtest Review

L73/L18 single-perp funding-fade family — HL majors funding fade already died (PF 0.846 over 5 iterations)

Iteration History

Verification failed (Layer 4 — QA review): - THE STATED EDGE (forward-looking PREDICTED funding) IS UNTESTABLE; WHAT RAN IS A REALIZED-FUNDING FADE, THE DEAD FUNDING-REVERSION FAMILY. The L39 exception permits this hypothesis specifically because hl_predicted_fundings is forward-looking and HL-specific -- the claim is you can position AHEAD of the funding-driven unwind. But the developer honestly discloses (and funding_events_available=1756 confirms) that the predicted feed is a snapshot with no usable history, so the loader fell back to hl_funding_rates -- REALIZED funding read as-of each bar. Realized funding as-of the bar is not forward-looking, so the 'position ahead of the unwind' edge is not being tested; what ran is a realized-funding fade, which is the funding-reversion mechanism already falsified this session. The venue-specific justification for the idea does not apply to what was measured. - THE POSITIVE RESULT IS A BULL-YEAR DIP-BUYING ARTIFACT, NOT THE FUNDING-FADE EDGE -- shown by a 45-long / 6-short split. On Hyperliquid BTC funding is predominantly POSITIVE (longs pay), so a genuine symmetric fade should take MORE shorts (fading crowded longs) than longs; this took the opposite (45 vs 6). The price-confirmation gate systematically blocks the short-fades (it cannot short while price rips up in a bull sample) and passes the long-fades (dip bounces), so the 'fade' degraded into buy-the-dip in an uptrend. The +3.46% / PF 1.196 is therefore regime-dependent long-dip beta over one favorable year, and the DISTINCTIVE crowded-long fade -- the actual hypothesis -- fired only 6 times (noise). Over a fuller or bear sample that short-fade leg is shorting into squeezes, exactly the behaviour that killed every fade this session (liquidation, OI-divergence, false-breakout, funding-reversion). Sharpe 0.275 has a CI [-1.38, 1.76] straddling zero; capacity_usd $4.62M with impact_cost_pct 14.7% is thin and capacity-bound on this venue.

Iteration History

Verification failed (Layer 4 — QA review): - THE DEVELOPER'S OWN PRE-COMMITTED ABANDON CONDITION IS MET: the run is on REALIZED funding, not the forward-looking predicted feed the L39 exception requires. He wrote 'if this run again reports source=hl_funding_rates, the forward-looking edge is untestable with the available data and this should be ABANDONED rather than iterated a third time.' funding_events_available=1976 (a full historical series -- the predicted feed is a history-less snapshot that cannot produce that) confirms the realized fallback fired again. So the distinctive forward-looking predicted-funding edge -- the ENTIRE reason L39 permits this HL idea -- remains untestable, and what ran is a realized-funding-reversion fade, a family already falsified this session. The hypothesis as written cannot be tested with the available data. - THE ASYMMETRY IS STRUCTURAL, NOT A GATE BUG -- the drift-neutral fix barely moved the split (45-long/6-short -> 47-long/8-short, still ~85% long), so the +9.66% is bull-year long-dip-buying, NOT the symmetric funding fade. The demean-momentum fix was supposed to restore the short-fades; it did not, and the reason is coherent: crowded-long funding extremes COINCIDE with above-normal upward acceleration (the squeeze is what creates the extreme positive funding), so the drift-neutral confirmation CORRECTLY vetoes nearly every short-fade -- you cannot confirm a fade of a crowd whose move is still accelerating. The price-confirmed fade is therefore inherently long-biased dip-buying: it can only practically fade crowded shorts (buy dips), because fading crowded longs (shorting squeezes) is the falling knife the confirmation refuses. So the improved metrics (PF 1.495, Sharpe 0.829, avg_trade 0.629%) are better-TIMED long-dip-buying in an up-trending year, and the distinctive crowded-long fade -- the actual hypothesis -- is 8 trades of noise. Over a bear/chop sample those few shorts are shorting into squeezes, the dead fade; long_win_rate 0.51 vs short_win_rate 0.50 on n=8 is not a demonstrated short edge.

Iteration History

Verification failed (Layer 3 — sandbox backtest): Arrow error: Schema error: Fail to merge schema due to conflicting metadata. Key 'size_precision' has different values '5' and '8' Bar type used: BTCUSD.HYPERLIQUID-1-MINUTE-LAST-EXTERNAL, Bars processed: 0 Ensure your strategy produces trades with the given data and parameters.
Strategy report

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