Skip to content
All strategies

Strategies

Funding-Gated Delta-Neutral Cash-and-Carry: Long BINANCE_SPOT / Short BINANCE USD-M Perp on 7 Point-in-Time 2020 Majors, Enter When 24h Funding > 3bp/8h, Exit on Funding Flip or 21-Day Clock (4H decision bars)

Outcome: Abandoned

FundingGatedSpotPerpCarry7Majors8H

Outcome Summary

The strategy tried to collect Binance perp funding with a spot-long, perp-short hedge on 7 point-in-time 2020 majors, trading only when funding was above 3bp/8h. It went through 3 coding iterations, and each one failed the Layer 3 sandbox backtest by going over the 300s time limit. The last iteration already used bisect lookups on precomputed arrays and made fewer cache queries, and its notes blame catalog loading overhead that strategy edits cannot shorten. The run was abandoned in the verification loop, so there are no backtest, optimization, analyst or risk-officer results.

Hypothesis

Restated from first principles from the FMZ 'OKX Funding Fee Hedge strategy' by Zero (https://www.fmz.com/strategy/520276, section 'Specific Strategy Ideas' items 1-4 plus 'Risk Analysis / Negative Rates'). The mechanism kept: hold spot long + perp short with equal base quantity, so price exposure cancels and the book collects the funding that longs pay shorts. It opens only when funding exceeds a threshold and closes when funding turns negative. Three adaptations, all backed by a point-in-time pre-study on our……Show moreShow less

Restated from first principles from the FMZ 'OKX Funding Fee Hedge strategy' by Zero (https://www.fmz.com/strategy/520276, section 'Specific Strategy Ideas' items 1-4 plus 'Risk Analysis / Negative Rates'). The mechanism kept: hold spot long + perp short with equal base quantity, so price exposure cancels and the book collects the funding that longs pay shorts. It opens only when funding exceeds a threshold and closes when funding turns negative. Three adaptations, all backed by a point-in-time pre-study on our funding_rates table: (1) VENUE. The source names OKX. OKX funding in our DB starts 2022-01, and on OKX majors the gated rule fires almost only in 2024 (161 episodes, 85 of them in 2024, 1 in 2025), so the result would be a one-year concentration. Binance USD-M funding covers 2020-2026, including the 2020-21 bull run in which funding carry was paid. Hedge venue = BINANCE_SPOT (CASH, long-only), perp = BINANCE (USD-M). This is a cross-venue (two-suffix) hypothesis. (2) UNIVERSE. The source recommends 30+ coins with auto-screening. That hits lesson 173 (point-in-time top-N universes time out) and lesson 136 (thin names). Universe rule instead: the largest non-stablecoin coins by market cap on 2020-01-01 that list both a Binance spot USDT pair and a USD-M perp. That gives BTC, ETH, XRP, BCH, LTC, BNB, XLM (7 names, 14 instruments). EOS met the rule but is excluded because its perp was delisted/renamed in 2025, which would kill the run with data_unavailable. This is disclosed as a mild survivorship choice. The universe was fixed from a 2020 snapshot, not selected on funding performance. (3) CADENCE. Decisions on 4H bars, since funding settles every 8h. There are no iceberg orders: a market order on both legs at the decision bar. PRE-STUDY (funding cash flow only, both legs taker, 0.30% round-trip cost per unit of hedged notional = spot 0.10%x2 + perp 0.05%x2). 7 names, 2020-2026: 189 episodes, mean funding collected 2.29% per episode, mean net after cost +1.99%, win rate ~0.9, mean hold 18 days. Episodes by year: 2020:71, 2021:77, 2022:0, 2023:7, 2024:34, 2025:0, 2026:0. The 8-name version including EOS gave t = 15.1 on per-episode net. KNOWN STRUCTURAL RISK, stated up front: funding on liquid majors has been compressed since 2025 (Binance mean ~0.3bp/8h on these names, 0 days above 3bp in 2026; the same on Hyperliquid and OKX majors). The rule is therefore flat through most of 2025-26, and the last-20% holdout (~mid-2025 onward) will likely have FEWER THAN 10 trades. That fails the hard holdout gate on regime absence, not on a losing edge. The analyst should read a flat holdout as 'no opportunity', and this hypothesis is submitted at priority 2 for exactly that reason. Expected flat state: ~75-80% of time flat per name, and the whole book is flat in 2022, 2025 and most of 2026.

Implements the FMZ funding-hedge mechanism on Binance spot/USD-M with a fixed 2020 universe, as the hypothesis specifies. Iteration 3 fixes nothing in the trading rules because the timeout does not come from the strategy: per-bar work was already O(log n) and independent of span, and same-day profiles of sibling timeouts show the 300 s going to the ParquetDataCatalog fsspec glob before any bar reaches the strategy. Changes are hygiene only: skip all cache queries on flat bars with no funding state, and exclude the funding lookup tables from persistable_state. If this times out again, the cause is catalog-scan infrastructure or host load (L155 b/c), not the code.

verification_loop: sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of BTCUSDT.BINANCE-8-HOUR-LAST-EXTERNAL). 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).

Implementation

Delta-neutral cash-and-carry on 7 point-in-time 2020 majors (BTC, ETH, XRP, BCH, LTC, BNB, XLM): long BINANCE_SPOT + short equal-quantity BINANCE USD-M perp per name when the 24h trailing funding mean >= 3bp/8h; exit on funding flip (<0) or a 21-calendar-day clock. Each leg is its own order/position; 8H decision bars aligned to funding settlements; per-name notional = binding venue equity x 0.7 / 7.

Verification Results

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of BTCUSDT.BINANCE-8-HOUR-LAST-EXTERNAL). 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).

Iteration History

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of BTCUSDT.BINANCE-4-HOUR-LAST-EXTERNAL). 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).

Outcome Summary

With 14 instruments across two venues, the sandbox smoke test can time out even when per-bar strategy work is already O(log n). The developer's notes point to catalog query and data-loading overhead as the cause, and code changes alone did not fix it, so this should be diagnosed at the infrastructure level (or with a smaller universe) before more code iterations.

It was abandoned in a verification loop after 3 iterations. Each time the Layer 3 sandbox backtest went over the 300s wall-clock limit on a ~20,000-bar window (2400 days of BTCUSDT 8-hour bars), so the backtest-review, analyst and risk stages never ran.

A delta-neutral cash-and-carry across 7 majors fixed from a 2020 snapshot (BTC, ETH, XRP, BCH, LTC, BNB, XLM): long Binance spot and short an equal quantity of the Binance USD-M perp to collect funding, entering when 24h funding is above 3bp/8h and exiting when funding flips negative or after 21 days.

No backtest or optimization metrics exist because the strategy never got past verification. The only evidence is the hypothesis's own funding-only pre-study (189 episodes from 2020-2026, mean net +1.99% per episode after 0.30% round-trip cost, win rate ~0.9), and the pipeline never tested it.

Analysis

OKX资金费率套利策略|OKXFunding Fee Hedge strategy

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