Skip to content

View original

EthCrossVenueFundingDifferentialCarryLS

Hypotheses

Cross-Venue ETH Funding-Rate Differential Carry, Delta-Neutral Long-Short (ETHUSD.HYPERLIQUID vs ETHUSDT.BINANCE USD-M — Collect the STRUCTURAL Funding Gap Between Hyperliquid's HOURLY Funding and Binance's 8H Funding; Short the Richer-Funding Leg / Long the Cheaper-Funding Leg at Statistical Differential Extremes, Delta-Neutral, Revert-to-Zero Exit, 2-Parameter)

Hypotheses

A DELTA-NEUTRAL, CROSS-VENUE, LONG-SHORT carry strategy that harvests the persistent funding-rate DIFFERENTIAL between the SAME underlying (ETH perpetual) quoted on two venues with structurally different funding mechanics: Hyperliquid funds EVERY HOUR while Binance USD-M funds every 8 HOURS. This mismatch, plus the venues' different participant mixes, creates recurring, mechanically-driven funding gaps that are a real cash flow rather than a sub-fee price move. It is deliberately chosen to fill the factory's TWO largest structural gaps at once — cross_venue (6.7% vs 15% target) and HYPERLIQUID (6.0% vs 20% target) — while also pushing direction toward long_short (13%) and being market-neutral (which sidesteps the crypto-beta drawdown that risk_rejects long-only baskets, L48). It avoids every currently-dead family: NOT COIN-M (L51), NOT options (L50), NOT a cross-sectional momentum-rank basket (L52), NOT a non-price gate on a price impulse (L46 — the edge here IS the funding cash flow, not a gated price breakout), and NOT a dated-quarterly/liquidation feed that risks data_unavailable (L47 — both perps and both funding feeds exist in the catalog: Binance funding_rates + Hyperliquid funding history / predicted fundings). Only 2 parameters (entry differential threshold, exit differential threshold) to resist the 301-death overfit failure mode.

Hypotheses

Iteration 3 addresses the Layer-4 fee/edge rejection with the smallest change that attacks the exact measured cause. QA confirmed the iteration-2 plumbing is correct and the failure is economic: carry accrues ~0.01%/day so covering the ~0.19% two-leg round trip needs 19-34 days, and over that horizon the ETHUSD-vs-ETHUSDT basis drifts +-0.5%, dominating realised PnL ~2:1 - so trades died on the max_hold cap at -0.073%/trade. I did not add an unrelated edge; I aligned the term that was already dominating PnL. Entry now additionally requires the richer-funding venue to be the price-rich venue (direction * basis_z >= basis_z_entry over a 40-bar rolling z-score of hl_close/bn_close - 1), so the +-0.5% basis move becomes a same-signed tailwind rather than a coin flip, and the exit hurdle is measured on carry + engine-reported pair price PnL rather than carry alone. Holding period therefore collapses from ~45 days to days and the round trip is covered by convergence + carry together. max_hold_days 45->12 (a basis dislocation that has not converged in 12 days is not going to), carry_hurdle_mult 2.0->1.5 (the hurdle is now met by two components), and a -3x round-trip stop bounds the diverging-basis tail that previously ran unchecked to the cap. Everything that already passed Layers 1-3 is untouched: same imports, same class, common-footing annualization, funding-collection polarity, O(log n) cumsum carry from actual settlements, pos.ts_opened anchoring, staleness flattening, one-legged flattening, no price-only fallback (the basis filter can only GATE a funding-driven entry, never trigger one). The basis history is a single ring of same-timestamp ratios, so the two legs can never desynchronise. Venue stays cross-venue futures (the edge is funding, both legs short-capable); leverage 2.0 is now genuinely consumed in _open_pair (notional = equity * notional_frac * leverage), with notional_frac cut 0.50->0.35 so gross stays ~0.7x equity per leg and margin use ~0.7x equity. Tuned parameters go from 2 to 3 (entry_diff_ann, exit_diff_ann, basis_z_entry) - the minimum needed to express the fix - with all costs/caps frozen. One caveat for the record, as the Analyst owns the call: QA has now falsified the carry-alone premise twice, and if the basis-alignment gate does not clear the fee floor the honest conclusion is that the Hyperliquid-vs-Binance ETH funding gap is structurally too small to harvest at taker cost, not that it needs more tuning.

Hypotheses

Fee/edge viability failure on a CREDITED backtest (not a funding-data issue — 28,215 funding events are folded into PnL). The realized net per-trade edge is avg_trade_return_pct 0.0506%, roughly one-quarter of the ~0.19% two-leg round-trip cost, producing profit_factor 0.98, Sharpe -0.08, and total_return -7.73% over 198 trades — a structural loser in the [0.85,1.10] fee-fragility band (L18, L22). The Hyperliquid-hourly vs Binance-8h funding differential, correctly annualized and netted against the two-leg commission, is simply smaller than the cost to harvest it. This is already iteration-3 and the key rescue (aligning the price basis to work with the carry) has been implemented without lifting per-trade edge above fees; a 2-3 parameter threshold sweep cannot 4x the mechanism's realized edge. Abandon rather than spend the optimization budget or another iteration.

Implementation

Delta-neutral cross-venue ETH pair (SHORT/LONG ETHUSD.HYPERLIQUID vs LONG/SHORT ETHUSDT.BINANCE USD-M, equal USD notional) harvesting the funding-rate differential between Hyperliquid hourly funding and Binance 8-hourly funding. Both rates are annualized onto a common footing (hl*24*365 vs bn*3*365) and the differential is the continuous signal. The pair is opened only when the richer-funding venue is ALSO trading rich on price (cross-venue basis z-score aligned with the differential), and closed when realised carry PLUS pair price PnL has covered 1.5x the two-leg round-trip cost and either the differential or the basis has converged; a -3x round-trip stop cuts a diverging basis and a 12-day cap releases a dislocation that never converges. Flattens and refuses new entries whenever either funding feed is missing or stale (no price proxy).

Verification Results

Verification failed (Layer 4 — QA review): - FEE/EDGE VIABILITY FAILURE — CONFIRMED A SECOND TIME (iteration 2). The developer correctly implemented the iteration-1 fee-hurdle fix (exit requires realized accrued carry >= round_trip_cost x hurdle_mult AND revert-to-zero, carry summed from actual settlements via O(log n) cumsums, entry anchored on pos.ts_opened), but the fix reveals rather than cures the problem. Sandbox with the hurdle live: avg_trade_return_pct=-0.0726% (NEGATIVE, below floor), total_return -0.91%, profit_factor 0.984 (<1, losing), Sharpe -0.08. Diagnostic tell: avg_holding_period=44d 22h ≈ the 45-day max_hold cap — trades exit on the stale-gap cap, not because carry cleared the hurdle, so collected carry essentially never covers the round trip within a reversion window. Developer's own entry x hurdle x cap scan is net-negative in nearly every cell; the only floor-clearing cells degenerate to 1-3 trades in 2.1 years (trade-count noise). Decisive fourth kill: covering 0.19% fees needs ~19-34 days of carry at ~0.01%/day, but over that horizon the ETHUSD-vs-ETHUSDT basis drifts ±0.5%, so the 'delta-neutral' pair's PnL is dominated ~2:1 by basis noise, not carry. Maker execution still loses (per-trade carry only 0.025-0.063%). Per L6, reject at Layer 4. - NOT A DEFECT — the fail is economic, not a coding bug. The iteration-2 changes are correct: the fee-hurdle exit gates on REALISED carry (actual settlements, direction-signed, O(log n) cumsums), entry timestamp read from pos.ts_opened (restart-safe), max_hold_days cap releases a never-reverting gap. All prior-passing logic (cross-venue instruments, common-footing annualization, correct funding-collection polarity, staleness/one-legged flattening, no price proxy) is intact. Faithful, correct implementation; fails only because the harvested cash flow is structurally below its harvesting cost and swamped by basis noise at any fee-covering horizon.

Verification Results

Analyst: confirm the funding differential contributes real separable edge (attribute realised PnL into carry vs basis) rather than acting as a spurious sign gate.

Verification Results

Edge-attribution drift. The hypothesis is funding-differential CARRY and explicitly claims 'the edge here IS the funding cash flow, not a gated price breakout.' Iteration 3 adds a cross-venue basis z-score gate and makes the exit hurdle depend on carry + engine-measured pair price PnL; the developer honestly reports the basis term now dominates realised PnL ~2:1. Not critical — funding is still read, annualized on a common footing, thresholded, and sets direction (mechanic present, not absent) — but the economic character has shifted toward basis convergence gated by funding sign.

Verification Results

Analyst at BACKTEST_REVIEW: decide optimize/iterate/abandon on this near-zero-Sharpe, high-variance result. Per the developer's own caveat, if the gap is too small to harvest at taker cost, tuning cannot rescue it.

Verification Results

Result is statistically indistinguishable from zero: Sharpe 0.056, PSR 0.527, Sharpe CI [-1.58, 1.67], with trade-level noise (avg ±$5-6K, largest ±$30K) dwarfing the +3.65% annual drift. avg_trade_return_pct 0.211% clears the 0.15% floor only marginally over 84 trades. A ~0.06 full-sample Sharpe has little chance of clearing the OOS Sharpe >= 0.5 gate.

Verification Results

Verify BacktestRunner applies funding settlements to perp-leg PnL; if not, the carry premise is untested and the hurdle is mis-calibrated.

Verification Results

Exit hurdle total_edge = accrued_carry + pair_price_pnl. If the engine does not settle funding into equity, accrued_carry is a decision-only phantom that can trigger take-profits on carry the account never booked. funding_events_available=8341 suggests funding is present, but engine settlement should be confirmed.

Backtest Review

Well-engineered, restart-safe implementation: delta-neutral pair sized off contemporaneous aligned bars, realized (not modeled) carry accrual, correct annualization of the hourly-vs-8h funding cadences, no-feed/one-legged safety flattening

Backtest Review

Balanced long/short book (99 long / 99 short), max_drawdown a modest 12.7%, funding cash flow genuinely credited (28,215 funding events folded into PnL)

Backtest Review

avg_trade_return_pct 0.0506% is ~4x BELOW the strategy's own ~0.19% two-leg round-trip cost — the edge does not clear fees (L22)

Backtest Review

profit_factor 0.98 (<1.0), Sharpe -0.08, total_return -7.73%, expectancy -$54/trade — a net loser across 198 trades, losing in 2024 and 2025 with only a marginal 2026 carried by a single anomalous day

Backtest Review

PF sits in the [0.85,1.10] fee-fragility band (L18): whatever gross funding differential exists is entirely consumed by the two-leg commission drag

Backtest Review

Already at iteration-3; the primary rescue (aligning the price basis with the carry) has been applied and still fails to lift per-trade edge above cost — no 2-3 parameter tuning can 4x the mechanism's realized edge

Outcome Summary

EthCrossVenueFundingDifferentialCarryLS aimed to collect the persistent funding gap between Hyperliquid's hourly and Binance's 8-hourly ETH funding as a delta-neutral cross-venue carry, filling the factory's cross-venue and Hyperliquid buckets at once. The implementation was well-engineered — contemporaneous aligned legs, realized (not modeled) carry accrual, correct annualization, and 28,215 funding events genuinely credited — and iteration 3 added a basis-alignment filter to convert basis drift from noise into a tailwind. But the credited backtest still lost: at 0.0506% per trade the edge was about a quarter of its own ~0.19% round-trip cost, giving profit factor 0.98, Sharpe -0.08, and -7.73% total return over 198 trades. The analyst abandoned it at backtest review because the differential is smaller than the cost to harvest it and no threshold tuning could close a 4x gap; it never reached optimization, analysis, or risk review.

Outcome Summary

A structurally real funding differential is not tradeable if the gross carry per round trip is a fraction of the two-leg commission it must cross — cross-venue carry needs a gross edge several times the doubled fee load before any threshold tuning matters.

Outcome Summary

The analyst abandoned it at backtest review on a fee/edge-viability failure: the annualized funding differential, correctly netted against the two-leg commission, is simply smaller than the cost to harvest it, leaving profit factor in the fee-fragility band. At iteration 3 the key rescue (aligning the price basis with the carry) had already been applied without lifting per-trade edge above cost, and a 2-3 parameter sweep cannot 4x the realized edge.

Outcome Summary

A delta-neutral, cross-venue long-short carry strategy (2-3 parameters) that harvested the funding-rate differential between ETH perpetuals on Hyperliquid (hourly funding) and Binance USD-M (8-hourly funding) — shorting the richer-funding leg and longing the cheaper one at differential extremes, with a price-basis alignment filter added in iteration 3 to shorten holding periods.

Outcome Summary

The credited backtest (ETHUSD.HYPERLIQUID vs ETHUSDT.BINANCE 4H, 926 data days, 28,215 funding events folded into PnL) was a net loser: avg_trade_return_pct 0.0506% — roughly a quarter of the ~0.19% two-leg round-trip cost — with profit factor 0.98, Sharpe -0.08, total return -7.73%, and expectancy -$54/trade over 198 balanced trades (99 long/99 short), max drawdown 12.7%.

Iteration History

Verification failed (Layer 4 — QA review): - FEE VIABILITY FAILURE — the edge (funding differential) is structurally below the round-trip cost of harvesting it, confirmed three ways. (1) The developer's own measurement on real overlapping data: gross carry 0.025%-0.063% of notional per trade vs ~0.19% two-leg round-trip (HL 0.045% + Binance 0.05% each side) → -0.11% to -0.17% NET per trade, 1-14% win rates at every entry/exit pair scanned; a static short-HL/long-Binance position earned only ~0.01%/day gross, so one round trip of fees consumes ~19 days of carry while the differential mean-reverts in ~24 hours. (2) The sandbox confirms it with funding CREDITED (funding_events_available=400): avg_trade_return_pct=0.00135% — ~100x below the 0.15% futures floor — with total_return -1.0%, profit_factor 0.90 (losing), Sharpe -0.48, PSR 0.28. (3) Per lesson L6, cross-venue funding capture/fade is a repeat offender that must be rejected at Layer 4 rather than sent into optimization. The entry_diff_ann threshold does not gate on a per-trade gross move that beats the ~0.19% round-trip, so the strategy loses money after fees at any threshold. - NOT A DEFECT — so the fail is not misread as a coding bug. The code is a faithful, correct implementation of the hypothesis: cross-venue instruments, delta-neutral equal-USD-notional pair opened on one bar, both funding cadences annualized to a common footing before differencing (correctly avoiding the 8x hourly-vs-8h unit error), correct funding-collection polarity (short the richer-funding leg to receive funding), signed revert-to-zero/sign-flip exit, one-legged-book and stale/missing-feed flattening with no price proxy, and O(log n) searchsorted lookups. The fail is purely economic (edge < fees).
Strategy report

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