CrossVenueFundingDifferentialCarryHlBinance
Hypotheses
Cross-Venue Funding-Differential Carry: Hyperliquid vs Binance USD-M on the SAME Coin — 8 Self-Hedged Delta-Neutral Pairs (Short the Rich-Funding Venue / Long the Cheap-Funding Venue), 4H Decisions, 7-Day Hold, One Shared Parameter Set (3 parameters)
Hypotheses
A MARKET-NEUTRAL, CROSS-VENUE CARRY strategy whose payoff IS the funding cash flow, not a directional bet gated on funding. For each of 8 never-traded alt perps that trade on BOTH venues (SEI, ONDO, ENA, TIA, RUNE, LDO, AAVE, NEAR), we run an independent, self-hedged 2-leg pair: SHORT the SAME COIN on the venue whose funding is rich and LONG it on the venue whose funding is cheap, equal USD notional, so the price exposure cancels and the residual PnL is (a) the funding differential received every hour and (b) the small inter-venue basis drift. There is NO cross-sectional ranking across coins and therefore NO alt-market beta — the structural difference from the abandoned 12-name Binance-only cross-sectional funding-carry basket, whose PnL turned out to be residual alt beta. ECONOMIC CAUSE: Binance USD-M funding is a clamped 8-hour rate on a deep arb-heavy book; Hyperliquid charges funding EVERY HOUR off an oracle/impact-price premium with a much wider clamp on a far thinner, retail/vault-dominated book. When positioning crowds on one venue the two funding clocks diverge for DAYS, because closing them requires simultaneous funded margin on a CEX and a perp DEX. MEASURED ON THIS FACTORY'S OWN CATALOG (2024-02 → 2026-09, 8 coins, 8bp/8h trigger, 7-day hold, non-overlapping): 161 pair-trades (322 legs, 62 entries/yr), mean carry +0.539%, mean basis PnL +0.025%, taker round trip 0.19% → NET +0.375% mean / +0.360% median per pair-trade, 81% net-positive, p10 −0.262%, worst −4.07%. Per-LEG ≈ 0.19% = 2× round trip. The effect is present in all 29 coin pairs scanned (carry +0.17% to +0.78%, positive fraction 0.74–1.00). CRITICAL: HL funding is PER HOUR, Binance PER 8 HOURS — compare only after summing the trailing 8 hourly HL observations, strictly point-in-time. Sizing: per-leg 30% of equity, ≤5 concurrent pairs, gross ≤300% (leverage 3.0), delta-neutral by construction.
Hypotheses
Implements the hypothesis exactly: 8 independent 2-leg same-coin pairs across the two declared venues (all 16 declared instruments are in the config), 4H decisions, 7-day holds, one shared 3-parameter set (entry_diff_8h, hold_days, per_leg_frac). The HL-per-hour vs Binance-per-8h cadence mismatch is handled as specified -- HL is summed over its trailing 8 hourly observations before any comparison, via np.searchsorted on pre-parsed sorted arrays (O(log n) per coin per bar, cost independent of backtest span). Per-leg funding for all 16 legs is read from supplementary_data['funding_rates_by_instrument'], which is also what the engine uses to accrue real funding cash flow on both legs, so the payoff IS the carry rather than a directional bet gated on funding. Delta neutrality is enforced by using an identical coin QUANTITY on both legs of a pair (exact for one coin; equal-USD sizing would leave a residual delta equal to the cross-venue basis), plus a naked-leg guard that flattens a pair if only one leg is open. Sizing uses the SMALLER of the Binance and Hyperliquid account equities because collateral cannot be swept between venues, and a gross check caps concurrent notional at equity x leverage. leverage=3.0 is genuinely consumed (per-leg notional = equity * per_leg_frac * leverage). Independent replication on this catalog (2024-02 to 2026-09, 8 coins, non-overlapping 7d holds at 8bp) gave 135 pair-trades, mean carry +0.588%, +0.398% net of a 0.19% two-leg taker round trip, 79% net-positive -- consistent with the hypothesis. One caveat for the record: the alignment barrier requires all 16 same-timeframe legs to publish a bar at the same timestamp; catalog coverage is 99.9% from 2024-04-02 (ENA's listing) onward, so decisions effectively start there.
Hypotheses
The mechanism is present but the framing cannot pay for itself. QA's concern is half borne out: impact WAS omitted from the cost budget and is now the largest single cost (1.4x commission) — but QA's remedy fails on full history, because it reconstructed +0.37% gross from the truncated sandbox while the real figure is +0.246%. Halving per_leg_frac to the declared 0.05 floor cuts impact to ~0.19% (dollars ×0.5, bps ×0.71), leaving costs 0.38% vs gross 0.246% — still negative. In the ZERO-impact limit the edge is +0.056% per pair-trade = +0.028% per leg, ~5x BELOW the 0.15% venue floor. No point in the declared grid (entry_diff_8h 4–30bp, hold 3–14d, per_leg_frac 0.05–0.15) closes a 5x gap, so this is neither optimizable nor a sizing fix.
Implementation
Market-neutral CROSS-VENUE funding-differential carry on 8 alt perps (SEI, ONDO, ENA, TIA, RUNE, LDO, AAVE, NEAR) listed on BOTH Binance USD-M and Hyperliquid. Every 4H bar each coin's own funding is compared at a common 8-hour scale: the sum of the trailing 8 HOURLY Hyperliquid observations minus the latest 8-HOURLY Binance stamp, both strictly point-in-time. When |diff| exceeds entry_diff_8h (default 8 bps/8h) the strategy opens a self-hedged pair in that coin: SHORT the rich-funding venue and LONG the cheap-funding venue in the SAME coin quantity, so price exposure cancels and the residual P&L is the funding differential plus a small inter-venue basis drift. Pairs are held hold_days (7d, anchored to the bar timestamp) then closed; at most 5 pairs run concurrently, each leg sized equity * per_leg_frac * leverage = 30% of the smaller of the two venue accounts (1.5x gross per venue inside leverage 3.0). No cross-sectional ranking across coins, so no alt-market beta. If either leg's funding series is missing or stale, that coin stays flat -- no price proxy is substituted.
Verification Results
Analyst: judge this strategy on total_return / PF / Sharpe / funding P&L, and treat avg_trade_return_pct as not-applicable for a delta-neutral cross-venue carry book (state it in a gate_waiver naming that floor). Engineering: extend apply_funding_to_report to also adjust `realized_return` (funding_pnl / position notional) so per-trade % is meaningful for every funding-driven archetype, or emit a separate avg_trade_return_pct_incl_funding field.
Verification Results
MEASUREMENT MISMATCH THAT WILL MISFIRE A HARD PROMOTION GATE (not a code defect — flagging for the analyst/gates). metrics.py:823 computes avg_trade_return_pct from NautilusTrader's `realized_return` column, which is a PRICE-only return per position. funding_accrual.apply_funding_to_report folds funding into `realized_pnl`/`pnl` but deliberately does NOT touch `realized_return`. For this strategy the entire edge IS the funding differential and the price return is ~0 by construction (equal coin quantity, opposite sides), so the report shows avg_trade_return_pct = +0.0103% while total_return is -1.18% and avg_trade_pnl_usd is -$14.23. That is not the sign-disagreement accounting bug seen on previous multi-leg books — the USD figures reconcile exactly (166 positions x -$14.23 = -$2,362 = -1.18% of the two-venue $200k) — it is the per-trade % metric being blind to the only P&L source this archetype has. Consequence: the VALIDITY hard floor 'per-trade return below round-trip cost' (promotion_gates.py, 0.15% futures) will reject this run no matter how well the carry performs, and lesson L107/L116's sign-disagreement heuristic would misclassify it as a bookkeeping defect.
Verification Results
This faithfully implements the hypothesis's stated sizing so it is not a defect, but the sizing is the binding economic constraint. Let the optimizer search per_leg_frac across its full declared [0.05, 0.15] band and expect the optimum at/near 0.05; consider sizing the HL leg off that coin's own recent HL bar volume (participation cap, e.g. <= 0.25% of the trailing 4H volume) rather than a flat equity fraction, so thin coins get smaller legs than deep ones.
Verification Results
Per-leg notional is equity * per_leg_frac * leverage = 0.10 * 3.0 = 30% of the SMALLER venue account, with up to 5 concurrent pairs (150% gross per venue). Half the legs are Hyperliquid alt perps (SEI, ONDO, RUNE, LDO), whose 4H bar volume is a fraction of the Binance USD-M leg's. The implied participation rate (~0.8% of a 4H bar per fill, backed out of the 7.5bp/fill modeled impact) makes impact the largest single cost line in the book — larger than the commission the hypothesis actually budgeted for. capacity_usd $38,302 is below the notional the strategy deploys in a single leg.
Verification Results
Acceptable for backtest. Before any paper deployment, add a fallback so pair EXITS and the naked-leg flatten run on a primary bar even when a non-involved leg is missing (e.g. drive exits from on_bar/a timer rather than only from the barrier-gated calculate_signal), or drop a coin from the basket when its bar is stale instead of blocking the whole strategy.
Verification Results
The base class's cross-leg alignment barrier (base_template.py:_maybe_process_primary) defers _process_primary until ALL 15 same-timeframe extra legs publish a bar at the primary timestamp. Because _manage() is driven from calculate_signal(), that barrier gates EXITS and the naked-leg guard too, not just entries: a single missing 4H bar on any one of the 16 legs freezes management of all 8 pairs for that bar. In backtest this is benign (avg_holding_period is exactly 7d 0h 0m, so it did not bite on this window), but in paper/live a one-coin feed outage stalls every pair's 7-day exit and the naked-leg flatten.
Verification Results
Have _submit_entry_instrument return a bool (or check cache.orders_open / _inflight_entries immediately after each submit) and, if the second leg fails, immediately cancel/close the first leg in the same event rather than waiting a bar. At minimum log an ERROR when only one leg was accepted so a live operator sees it.
Verification Results
_open_pair submits the HL leg then the BN leg via _submit_entry_instrument, which can silently return without submitting (spot-short block, _market_ready false, _entry_order_inflight, instrument not in cache). If one of the two returns silently, the strategy is left with a single UNHEDGED leg at 30% of equity until the next 4H bar, when the naked-leg guard flattens it. entry_ts is also set unconditionally even if neither order was accepted. The guard is correct and the sandbox shows a clean 83 long / 83 short split, so it never fired here, but the exposure window is one full 4H bar.
Verification Results
Add a span check alongside the staleness check: reject the pair when hl_ts[i-1] - hl_ts[i - hl_window] exceeds, say, 10 hours, so a gapped window is treated as missing data rather than a valid 8h block.
Verification Results
_diff_8h builds the 8-hour-equivalent HL rate as hl_rate[i-8:i].sum() — the last 8 OBSERVATIONS at or before the bar, without checking they actually span ~8 hours. Verified against the catalog (data/supplementary/hyperliquid/funding_history/SEI/all.parquet, 26,854 rows at exactly 3600s spacing, rates ~1.25e-5/hr == Binance's 1e-4/8h) the series is dense, so this is correct in practice; but a collection gap would silently make the sum span 12-20 hours and compare a wider window against Binance's single 8h stamp, biasing the differential. The 6-hour _hl_stale_ns guard only bounds the MOST RECENT observation, not the span of the window.
Verification Results
Re-raise in backtest/verification (mirror the base's `if not _live_node(): raise` pattern) and keep the swallow only for live/paper, or at least count the swallowed exceptions and surface the count so a degraded run is visible.
Verification Results
calculate_signal wraps the whole of _manage() in a bare `except Exception` that only logs a warning. In a backtest this means a systematic bug in pair management (bad instrument id, missing extra instrument, cache error) would silently produce a zero-trade or partially-trading run rather than failing loudly — the base class deliberately re-raises on non-live nodes for exactly this reason (base_template.py: 'a crash must fail the run').
Verification Results
Sandbox is net -1.18% / PF 0.99 over 957 days and 83 pair-trades, but the decomposition says the MECHANISM largely worked and MODELED IMPACT killed it. Reconstructed from the report: impact_cost_pct 161.58% with total_impact_usd $6,197.88 implies PnL-before-impact = 6197.88/1.6158 = +$3,836 (already net of $3,899 commission). So per pair-trade: gross carry+basis ~ +$93 (~+0.37% of a ~$25-30k leg, vs the hypothesis's claimed +0.564%), commission ~ -$47 (~0.19%, exactly as budgeted), and impact ~ -$75 (~0.30%) -> net -$28. The hypothesis budgeted ONLY a 0.19% taker round trip and ignored market impact entirely; impact here is 1.6x the commission. That is a SIZING-scaled cost, not a dead edge: the engine charges half_spread + 70bps*sqrt(participation) per fill, and per-leg notional is 30% of equity (per_leg_frac 0.10 x leverage 3.0) across four fills per pair, half of them on thin Hyperliquid alt books. capacity_usd is only $38,302. Halving per_leg_frac to the declared lower bound 0.05 cuts total impact to roughly 35% of current (notional x0.5, impact_bps x0.71), which on these numbers flips the book positive. Recommend the optimizer be allowed to drive per_leg_frac to the 0.05 end and that the analyst read impact_cost_pct, not headline return, as the binding constraint. Secondary: 83 pair-trades vs the hypothesis's pre-registered 161 (the 5-concurrent-pair cap plus the 16-leg alignment barrier bind harder than the researcher's non-overlapping replication assumed), so the sample is thinner than pre-registered. Positive structural evidence: annualized vol 3.85%, max_drawdown 1.79%, long/short legs exactly 83/83 -> the delta hedge is genuinely working, which is the part most cross-venue pair strategies get wrong.
Backtest Review
Delta hedge genuinely works: summed reference price move (exit-entry) over all 188 legs = +$401 on $3.48M leg notional (+0.0115%); legs 94 long / 94 short; vol 3.93%, DD 2.77%.
Backtest Review
Funding differential is REAL and significant: +0.223% of one leg's notional per pair-trade (median +0.353%, t = +4.57, 74% positive), stable at +0.247% (2024) / +0.209% (2025).
Backtest Review
Basis drift +0.023% vs the pre-registered +0.025% — the researcher's basis estimate was accurate.
Backtest Review
Not concentration-driven, not an artifact: top 5 of 94 pair-trades are only 15% of the total, funding is credited (18,732 events), trades implement the hypothesis exactly (94 clean 2-leg groups, no naked legs).
Backtest Review
Net -0.211% per pair-trade: gross (funding +0.223% + basis +0.023%) = +0.246% vs costs (commission -0.190% + folded spread/impact -0.267%) = -0.457%. price_pnl reconciles exactly (reference move − $3,304 commission − $4,646 impact = −$7,950).
Backtest Review
Total return -1.84%, Sharpe -0.198, PF 0.985, avg_trade_return_pct 0.0118% vs 0.15% floor, negative in all three calendar years with trades.
Backtest Review
Carry claim overstated 2.4x (0.539% pre-registered vs 0.223% delivered); only 13% of the naive 7-day accrual at an 8bp/8h trigger survives mean reversion.
Backtest Review
capacity_usd $4,410, impact_cost_pct 476% — deployable only at toy scale.
Outcome Summary
CrossVenueFundingDifferentialCarryHl-697da98530
Outcome Summary
This strategy attempted a genuinely market-neutral cross-venue funding carry, pairing each of eight alt perps against itself on Hyperliquid and Binance USD-M so that only the funding differential and inter-venue basis remained. The backtest confirmed the mechanism was real — the delta hedge cancelled price exposure to +0.0115% of leg notional, funding was credited across 18,732 events and delivered a statistically significant +0.223% per pair-trade, and the basis drift matched the pre-registered +0.025% almost exactly — but the gross edge of +0.246% could not cover the 0.457% of commissions plus spread/impact, leaving -1.84% total return, Sharpe -0.198, and a per-trade return of 0.0118% versus the 0.15% floor. The analyst abandoned it at the backtest-review gate before optimization, reasoning that the pre-registered carry was overstated 2.4x and that even at zero impact the edge sits about 5x below the viability floor, so neither re-parameterization nor smaller sizing could rescue it. The run ended after one iteration with no optimization, risk review or promotion stage reached.
Outcome Summary
Pre-registering a carry estimate from a raw funding-accrual scan overstated the realized differential 2.4x (0.539% claimed vs 0.223% delivered) and omitted spread/impact, which here exceeded commissions by 1.4x — future funding-carry hypotheses should budget the full two-leg round-trip cost including impact and validate the accrual survives mean reversion before coding.
Outcome Summary
The analyst returned an 'abandon' verdict at the pre-optimization backtest review, so the 3-phase optimization, risk review and promotion stages were never reached. The decisive finding was that even in a zero-impact limit the edge is +0.056% per pair-trade (+0.028% per leg), roughly 5x below the venue floor, and no point in the declared parameter grid closes that gap — with capacity_usd of only $4,410 and impact_cost_pct of 476% confirming it is deployable only at toy scale.
Outcome Summary
A delta-neutral cross-venue carry strategy running eight self-hedged same-coin pairs (SEI, ONDO, ENA, TIA, RUNE, LDO, AAVE, NEAR) that shorted the perp on the rich-funding venue and went long on the cheap-funding venue between Hyperliquid and Binance USD-M, holding 7 days on 4H decisions, so the payoff would be the funding differential rather than any directional or cross-sectional alt exposure.
Outcome Summary
Over 957 days and 5,736 primary bars it ran 188 trades (94 two-leg pair-trades) for a total return of -1.84%, Sharpe -0.198, Sortino -0.159, profit factor 0.985, max drawdown 2.77% and a 50% win rate, with avg_trade_return_pct of 0.0118% against the 0.15% viability floor. The hedge and the edge both worked mechanically — funding delivered +0.223% per pair-trade (t = +4.57, 74% positive) and basis drift +0.023% — but commissions (-0.190%) plus folded spread/impact (-0.267%) turned the +0.246% gross into -0.211% net per pair-trade.
Backtest and paper results are hypothetical. Trading involves risk of loss.