Skip to content

View original

CrossVenueFundingSpreadBestOfThreeRotationDeltaNeutral1H

Hypotheses

Cross-Venue Funding-Spread Carry, Best-of-Three Rotation (Hyperliquid vs Binance USD-M Perps, Delta-Neutral Two-Perp-Leg, Trade Whichever of BTC/ETH/SOL Has the Widest HL-vs-Binance Funding Divergence, Engine-Safe by Construction, Low-Parameter)

Hypotheses

A MARKET-NEUTRAL, CROSS-VENUE funding-rate arbitrage that improves on the single-asset BTC funding-spread carry by adding a CROSS-SECTIONAL SELECTION layer: each evaluation it scans a fixed universe of three deep-data majors {BTC, ETH, SOL} on BOTH Hyperliquid (hourly funding) and Binance USD-M (8h funding), and deploys capital ONLY to the asset whose inter-venue funding spread is currently widest. Both legs are PERPETUALS of the same asset (e.g. long ETHUSDT.BINANCE perp + short ETH-USD.HYPERLIQUID perp), so equal-and-opposite notional makes the pair delta-neutral — directional price risk cancels and the strategy harvests ONLY the funding DIFFERENTIAL. This is engine-safe BY CONSTRUCTION against the two documented base defects: (1) it is a hedged two-leg book (net delta ~0), so it sidesteps the single-instrument USD-M perp over-exposure defect that killed six directional runs; (2) BOTH legs are perps (never a BINANCE_SPOT CASH leg), so it avoids the broken spot-CASH mark-to-market accounting. It uses only the funding feed (the confirmed multi-year-deep data source) and OHLCV — never liquidations/OI/taker-ratio (the data-wall feeds). Distinct from the existing BtcBinanceHlFundingSpreadCarry (single-asset, always-on BTC) by the rotation/selection mechanism, which concentrates capital in the single best mispricing at any time. Deliberately low-parameter (one entry threshold, one exit threshold, one max-hold) to resist overfitting; the universe is fixed, never optimized.

Hypotheses

Iteration-3 fix for the Layer-3 wall-clock timeout: the previous _nearest() did an O(n) linear scan over each funding dict on every bar for every asset/leg, so per-bar cost scaled with history and the smoke test blew past 300s. The change is minimal and surgical — each flat funding dict is now converted ONCE to sorted (timestamp, value) arrays cached by object identity in _nearest_cache, and _nearest() uses bisect for an O(log n) nearest-timestamp lookup. All edge logic (cross-sectional funding-differential selection, delta-neutral two-perp legging, entry/exit thresholds, sizing, rotation) is byte-for-byte unchanged, so the earlier-passing Layer 1 and Layer 2 checks remain green while the O(n)→O(log n) reduction eliminates the timeout.

Hypotheses

Not worth optimizing. This is a correctly-implemented, genuinely delta-neutral cross-venue funding carry (funding is now credited, so the carry income IS in the PnL) that nonetheless loses money in every one of the 9 months tested — total_return -10.47%, Sharpe -3.80, profit_factor 0.86, negative expectancy — because the captured funding differential on well-arbitraged majors (BTC/ETH/SOL) is structurally smaller than the two-leg round-trip fee. Fees consume 9.41% of gross across 352 trades (turnover 116); at the 2% APR entry threshold a multi-day hold harvests ~0.05% while paying ~0.19% round-trip on two legs, so per-rotation expectancy is negative by construction. Raising entry_apr only cuts trade count — it cannot conjure the persistent ~7%+ net differential the cost math demands, which does not exist on these majors. With only 261 days of uniformly-losing data, an optimization sweep would curve-fit noise rather than surface a real edge. This is a thin-edge-below-costs failure, not a code bug (the mechanism executes exactly as hypothesized), so send it back rather than spending 2 hours optimizing.

Implementation

Market-neutral cross-venue funding-spread carry with best-of-three rotation over {BTC,ETH,SOL}. Each hour it computes the annualized Binance-USD-M-vs-Hyperliquid funding differential per asset and deploys equal-and-opposite two-perp-leg positions only on the asset with the widest |differential|, harvesting the funding differential while directional price risk cancels. Enters above entry_apr, exits below exit_apr or at max-hold.

Verification Results

Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit. This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Backtest Review

Delta-neutrality is real and working (beta -0.0002, benchmark_correlation -0.0096); the hedged two-leg book behaves as designed.

Backtest Review

No execution defects: 176 delta-neutral entries submitted, zero dropped-size/min-notional/cash-short, funding read per-instrument as intended.

Backtest Review

Engine-safe construction as claimed (two perp legs, no spot-CASH leg), and funding is now credited so the carry income is actually reflected in PnL.

Backtest Review

Credited (funding-inclusive) result loses money every single month across the entire 261-day sample: total_return -10.47%, Sharpe -3.80, PF 0.86, negative expectancy (avg_trade_return -56.6).

Backtest Review

Structural fee drag: 352 trades, turnover 116, commission 9.41% of gross ($11,435). Two-leg round-trip cost (~0.19%) exceeds the differential captured per hold — at a 2% APR entry over a multi-day hold the harvested carry (~0.05-0.06%) cannot cover fees.

Backtest Review

Only ~261 days of data (HL funding history limited); a best-of-N optimization sweep over uniformly-losing data would overfit to noise rather than find a robust edge.

Backtest Review

On well-arbitraged majors the net cross-venue funding differential is too thin to clear two-leg costs; raising the entry threshold reduces trade count but cannot manufacture the persistent large differential the cost math requires.

Outcome Summary

The Cross-Venue Funding-Spread Best-of-Three Rotation strategy set out to improve single-asset funding carry by rotating capital into whichever of BTC, ETH, or SOL showed the widest Hyperliquid-vs-Binance funding divergence, hedged as two perp legs to be delta-neutral and engine-safe by construction. Mechanically it succeeded — the book was genuinely market-neutral (beta ~0), funding was credited into PnL, and 176 entries submitted cleanly with no size, notional, or cash defects. But economically it failed everywhere: it lost money in all nine months tested (total return -10.47%, Sharpe -3.80, profit factor 0.86), because two-leg fees (~0.19% round-trip, 9.41% of gross) dwarfed the ~0.05% carry captured per hold on these tightly-arbitraged majors. The analyst abandoned it at the backtest-review gate, ruling that no entry-threshold tuning could conjure the persistent differential the cost math demanded and that optimizing 261 days of uniformly-losing data would only fit noise.

Outcome Summary

On well-arbitraged majors the net cross-venue funding differential is structurally smaller than the two-leg round-trip fee, so a correctly-built, genuinely delta-neutral carry can still be negative-expectancy by construction — and raising the entry threshold only cuts trade count without manufacturing a differential wide enough to clear costs.

Outcome Summary

It was abandoned at the pre-optimization backtest-review gate with an 'abandon' verdict — a thin-edge-below-costs failure where the ~0.05% carry harvested per multi-day hold could not cover the ~0.19% two-leg round-trip fee, so optimization was skipped rather than curve-fitting 261 days of uniformly-losing data.

Outcome Summary

A market-neutral cross-venue funding-rate arbitrage that each hour scanned BTC/ETH/SOL on both Hyperliquid and Binance USD-M and deployed capital only to the asset with the widest inter-venue funding differential, holding equal-and-opposite two-perp legs to harvest the funding spread while cancelling directional price risk.

Outcome Summary

The delta-neutrality worked as designed (beta -0.0002, benchmark correlation -0.0096, 176 clean two-leg entries with no execution defects), but the credited, funding-inclusive result lost money in every month of the 261-day sample: total return -10.47%, Sharpe -3.80, profit factor 0.86, negative expectancy of -$56.6/trade, with commissions consuming 9.41% of gross ($11,435) across 352 trades at turnover 116.

Iteration History

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: BTCUSDT.BINANCE-1-HOUR-LAST-EXTERNAL, Bars processed: 56184 Diagnostics: should_enter() returned a side 0 times over 56161 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.