Skip to content

View translation

BtcSpotPerpFundingCarryDeltaNeutralCrossVenue

Hypotheses

BTC/ETH Perpetual Funding-Carry Harvest, Delta-Neutral Cross-Venue (Long BINANCE_SPOT + Short BINANCE USD-M Perp, Hold Only While 8h Funding Is Persistently Elevated, Exit on Funding Normalization, 2-Parameter)

Hypotheses

A MARKET-NEUTRAL, CROSS-VENUE carry strategy that harvests the mechanically-paid perpetual funding rate rather than betting on price direction. When the USD-M perp funding rate is persistently positive and elevated, over-leveraged longs are paying shorts every 8 hours. The strategy captures that cash flow while holding zero net delta: buy the asset on BINANCE_SPOT (long leg, primary) and simultaneously short an equal notional of the same asset's USD-M perpetual on BINANCE (hedge leg). The position collects funding payments on the perp short 3x/day while spot/perp price moves cancel. This is NOT a momentum, trend, or single-venue directional idea (all dead classes here); the edge is a structural, exchange-enforced cash flow. Two instruments only, both continuous perps/spot (no quarterly expiry, so it sidesteps the data_unavailable failure of dated cash-and-carry). Deliberately low-parameter (entry + exit funding thresholds) to resist the overfit/deflated-Sharpe deaths that killed the momentum siblings. Fills three under-represented portfolio buckets at once: cross-venue (6.8% vs 15% target), market-neutral direction (13.3% long_short), and funding-rate data (underexplored per the lean-into list).

Hypotheses

Iteration 2 fixes the reported Layer-3 failure ('should_enter() returned a side 0 times over 7949 evaluated bars') with a targeted change; imports, class structure and the whole signal path are byte-identical to iteration 1, so Layers 1 and 2 stay green. I diagnosed the exact blocker against the real data rather than guessing: loading the BTCUSDT funding series (9,791 settlements, 2020-2026) and replaying my own entry rule shows that over the trailing 365 days - which is exactly the sandbox window - the 9-settlement smoothed carry PEAKS at 10.95% APR (p50 4.07, p75 6.27). My iteration-1 absolute fee floor was min_carry_apr=11.0, i.e. strictly above the entire year's maximum, so it rejected 100% of entries while the percentile gate itself was working fine. This is the failure mode my own prior learning (L5) warns about - an absolute threshold on supplementary data - and I had left one in place alongside the percentiles. Three changes, all in defaults plus four lines of should_exit: (1) min_carry_apr 11.0 -> 4.0, demoted from 'fee floor' to 'dead-regime floor' and now well inside the observed distribution; (2) exit_percentile 40 -> 25 for wider hysteresis; (3) NEW min_hold_bars (432 bars = 18 days) that defers ONLY the normalisation exit. Point 3 is the important one and it is not a fudge to force trades - it is the correct way to price a FIXED cost: viability is carry_APR x hold_days/365 > 0.30%, so the honest lever is hold length, not entry level. Replaying the patched rule on the real series: trailing 365 days gives 8 entries (was 0), so Layer 3 will pass; full 2020-2026 history gives 56 trades at a mean net-of-fee carry of +1.09% of notional per trade, versus +0.22% with the same entry rule and no minimum hold. That mean clears the 0.15% per-trade fee floor with room. One caveat for the Analyst that I will not paper over: the trailing year is a weak funding regime and my replay puts those 8 trades at only about +0.12% mean net carry, roughly break-even after fees, so recent-window results will look thin even though the multi-year figure is healthy - read that as regime dependence of the funding stream itself, not as a broken signal, and note that the spot leg's 0.10%-per-side taker fee is the dominant cost term.

Hypotheses

No edge net of costs — decisively measured, and NOT a funding-crediting artifact (the engine credits funding; funding_events_available 5231, the carry is in the PnL). The BTC spot-perp funding carry nets avg_trade_return_pct 0.006% — two orders of magnitude below the ~0.30% cross-venue round trip (spot 0.10%x2 + perp 0.05%x2) — with total_return -2.08% and Sharpe -0.125 (CI -0.585 to 0.80, straddling zero) over 2020-2026. This is the fee_edge/no_edge signature (L18/L22): a structurally real but tiny cash flow sitting entirely inside transaction and basis costs. The 'delta-neutral' book is not risk-free — return_skew -26.4, kurtosis 973, a -$16.7k largest loss and end_unrealized_pct -16.0 show it periodically takes large basis-divergence hits that wipe out the thin carry, and the min_hold_bars=18d fee-amortization fix trades fee drag for exactly that basis exposure. All positive return is the extreme-funding 2020 window; every year since is flat-to-negative, so the edge has decayed with funding richness. The developer has already iterated twice, so this is structural fee/basis economics, not a threshold-tuning problem — retuning entry/exit percentiles cannot create an edge the full history shows is absent, and optimization would only overfit the 2020 window. Abandon at BACKTEST_REVIEW rather than spend 2 hours. (If the Research Lead wants to salvage the mechanism, the credited-funding carry construction is sound but needs a venue/instrument with persistently richer funding than BTC spot-perp — a revise-hypothesis direction, not an optimization of this target.)

Implementation

Market-neutral, cross-venue perpetual funding-carry harvest on BTC. When the BTCUSDT USD-M perp's 8h funding rate is persistently positive and elevated, the strategy opens a delta-neutral pair: SHORT BTCUSDT.BINANCE perp (collects funding every 8h) + LONG BTCUSDT.BINANCE_SPOT in the identical base quantity (neutralises price delta). calculate_signal returns a continuous decision variable every bar - the annualised carry in % APR, computed as the mean of the last 9 funding settlements (3 days of 'persistence') annualised at 1095 periods/yr. Entry/exit thresholds are ROLLING PERCENTILES (75th / 25th) of that same smoothed series over a 60-day window, so the rule is scale-invariant across funding regimes. The fixed ~0.30% round-trip cost is amortised by a minimum 18-day hold that defers only the funding-normalisation exit; negative funding, the basis-divergence stop (-3% net pair PnL) and the 45-day max-hold cap still exit immediately. Risk controls: naked-leg guard (flatten any one-sided book) and per-leg notional hard-capped by BOTH venues' balances (spot cash 90%, perp margin 35% x leverage). Leverage 3x is consumed on the perp leg only (spot is CASH, clamped to 1x by the venue): it lets the per-leg notional reach the spot account's ~90k cash limit while the perp posts only ~30k margin, keeping the hedge far from liquidation.

Verification Results

Verification failed (Layer 3 — sandbox backtest): No trades produced Bar type used: BTCUSDT.BINANCE-1-HOUR-LAST-EXTERNAL, Bars processed: 8712 Diagnostics: should_enter() returned a side 0 times over 7949 evaluated bars -> your ENTRY CONDITION never triggered. Loosen the entry logic / thresholds. Ensure your strategy produces trades with the given data and parameters.

Verification Results

Evaluate net edge on the full multi-year window; if it doesn't clear ~0.15% with margin, raise min_carry_apr/min_hold_bars so the floor case itself clears 0.30%.

Verification Results

Fee viability is thin at the regime floor. Round trip ~0.30% (spot 0.10%x2 + perp 0.05%x2). At the minimum entry gate (min_carry_apr=4.0% APR) over the 18-day min hold, harvested carry = 4.0% * 18/365 = 0.197% of notional — BELOW the ~0.30% round trip. The sandbox (deliberately trailing-year, weak funding regime) is a net loser (return -1.15%, Sharpe -0.97, avg_trade_return_pct 0.0108%, well under the 0.15% floor). This is regime-dependence, not a code defect; the developer's full 2020-2026 replay shows +1.09%/trade. Flag for the analyst; confirm on the multi-year backtest.

Verification Results

Add on_stop() calling _close_pair('shutdown') — important for paper/live on two venue accounts.

Verification Results

No explicit on_stop() to flatten BOTH venue legs on shutdown; relies on base template. In-run naked-leg guard mitigates during the run but not at teardown.

Backtest Review

Genuinely different, non-directional mechanism (structural funding cash flow), correctly delta-neutral two-leg construction; funding is credited by the engine so the carry is measured, not invisible

Backtest Review

Fills under-represented buckets (cross-venue, market-neutral, funding data); clean low-parameter design; max_drawdown only 2.1%

Backtest Review

Developer honestly diagnosed and fixed the iteration-1 zero-trades bug (11% APR floor exceeded observed max carry)

Backtest Review

avg_trade_return_pct 0.006% — essentially zero, ~50x below the ~0.30% cross-venue round-trip cost; the credited carry does not clear its own fees (L22)

Backtest Review

total_return -2.08% over 6.5 years and Sharpe -0.125 with sharpe_ci_low -0.585 (CI straddles zero); on a market-neutral book judged absolutely, it's a net loser

Backtest Review

Extreme negative tail in a supposedly hedged book: return_skew -26.4, kurtosis 973, largest_loss -$16.7k, end_unrealized_pct -16.0 — rare basis-divergence hits erase the thin carry

Backtest Review

All positive PnL is the extreme-funding 2020 window (+12%); flat-to-negative every year 2022-2026 — the edge has decayed with funding richness

Backtest Review

fee_edge/no_edge signature (L18/L22); developer already iterated twice, so the thin-carry-vs-cost problem is structural, not a tuning gap

Outcome Summary

This strategy set out to harvest the perpetual funding premium market-neutrally — long BTC spot on Binance, short an equal-notional USD-M perp — collecting the 8h funding that crowded longs pay shorts while holding zero net delta. The developer iterated twice, fixing an iteration-1 bug where an 11% APR floor exceeded the observed maximum carry and blocked every entry, and re-architecting the fee guard into a permissive regime floor plus an 18-day minimum hold. But the second backtest showed the carry was real yet tiny: 0.006% per trade against a ~0.30% round trip, a -2.08% total return and negative Sharpe, with almost all gains confined to the extreme-funding 2020 window and rare basis-divergence losses puncturing the supposedly hedged book. The analyst abandoned it at backtest review as a structural fee/basis economics failure rather than a tuning gap, noting the mechanism is sound but needs a venue with persistently richer funding — a revise-hypothesis direction, not an optimization of this target.

Outcome Summary

A structurally genuine cash flow is not tradable if it sits entirely inside transaction and basis costs; BTC spot-perp funding is too thin against a ~0.30% cross-venue round trip, so salvaging the sound funding-carry mechanism would require a venue/instrument with persistently richer funding rather than retuning thresholds.

Outcome Summary

It was abandoned at the BACKTEST_REVIEW gate before optimization: the analyst judged the credited carry to be structurally real but far too thin to clear its own transaction and basis costs — a fee_edge/no_edge signature — with periodic basis-divergence hits wiping out the carry and the edge having decayed as funding richness fell after 2020.

Outcome Summary

A market-neutral, cross-venue funding-carry strategy that harvests the perpetual funding rate by holding long BTC on BINANCE_SPOT against a short of the same notional on the BINANCE USD-M perp, entering when smoothed 8h funding is in its top quartile and exiting when it normalizes, kept delta-neutral so the edge is structural cash flow rather than price direction.

Outcome Summary

The backtest was a net loser: avg_trade_return_pct of just 0.006% (roughly 50x below the ~0.30% cross-venue round-trip cost), total return -2.08% over 6.5 years, Sharpe -0.125 (CI -0.585 to 0.80), across 118 trades with max drawdown only 2.1%. Despite being nominally hedged, it showed extreme tail risk (return skew -26.4, kurtosis 973, largest loss -$16.7k), and essentially all positive PnL came from the extreme-funding 2020 window with flat-to-negative results every year 2022-2026.
Strategy report

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