Skip to content

View original

VenueSegmentationFundingSpreadHarvestNeutral

Hypotheses

Venue-Segmentation Funding-Spread Harvest — Delta-Neutral SHORT Hyperliquid Perp / LONG Binance USD-M Perp on 6 Never-Paired Alts, Entered Only When the HL-minus-Binance Funding Differential Is Elevated (Daily Bars, One-Sided by Design, 3 Parameters)

Hypotheses

A CROSS-VENUE, DELTA-NEUTRAL CARRY strategy that harvests a persistent, measured funding-rate differential between two perpetual venues on the SAME underlying. This is NOT a directional price bet and NOT a supplementary-gated trend trade: the price legs are matched notional on the same asset, so the P&L source is the funding cash flow, not a forecast of price. For each of 6 alts (LINK, AVAX, SUI, TIA, APT, WLD) the strategy runs one pair: SHORT {SYM}USD.HYPERLIQUID (receives HL funding when funding is positive) and LONG {SYM}USDT.BINANCE (pays Binance funding). Net carry = HL_funding - Binance_funding. MEASURED ON THIS FACTORY'S OWN DATA (2024-01-01 to 2026-08-31, HL hourly funding_history vs Binance 8h fundingRate, daily-summed): the HL-minus-Binance differential is POSITIVE on every one of 12 assets checked, mean +1.3 to +3.0 bp/day (5-11% annualized) with lag-1 autocorrelation 0.50-0.80, i.e. persistent and forecastable, and only 0.33 average cross-asset correlation so the six pairs are largely independent decisions. The strategy is deliberately ONE-SIDED (never long-HL/short-Binance): the mirror trade was measured at -0.04% per decision with a 21% win rate, because the premium is structural to Hyperliquid, not a symmetric mispricing. Universe chosen for corpus diversity (TIA, SUI, WLD, APT have near-zero prior use; no BTC, no ETH, no DOGE, no SOL). Daily bars on both venues, ~18-day median hold, 3 tunable parameters.

Hypotheses

Iteration 3 changes ONLY the sizing/solvency layer the feedback named; the signal, pair construction, one-sidedness and exit logic are untouched. (1) ROOT CAUSE FIXED: a cross-venue pair books each leg's directional P&L on its OWN account, so iteration 2's 6 x 0.10 x leverage 3.0 = 1.8x one-sided gross per venue let the Feb-2024 alt rally drive the Hyperliquid account to ~-$238k on $100k funded, after which get_account_equity() (primary = HL) was non-positive and entries stopped forever. Now leverage=1.0 and _pair_gross_frac=0.05 give 6 x 0.05 = 0.30x gross per venue, with _max_gross_utilisation=0.30 capping the six pairs' combined notional at 0.30x of EITHER account's capacity. (2) Sizing base is now min(HL equity, BINANCE equity), read per venue via resolve_account_equity(cache, venue) rather than the primary venue alone. (3) SOLVENCY GUARD: _solvent() blocks new entries and emits a one-shot CRITICAL-style log plus a _n_solvency_blocks counter when either account falls below 50% of its starting equity — the silent death mode is gone, and on_stop prints each venue's start/min equity. (4) Per-pair adverse-move cap: notional <= HL_equity * _max_equity_loss_frac(0.40) / _adverse_move_frac(0.60), so a 60% squeeze on the short leg can consume at most 40% of HL equity. (5) entry_bp_per_day default 2.0 -> 3.0 with the lower bound lifted 1.5 -> 2.0 (declared in _param_bounds), since ex-squeeze carry ran ~0.4 bp/day against a ~1.05 bp/day amortized round trip. (6) REPORTING: each closed pair logs held days, notional, net funding captured since entry in bp of notional and the two legs' combined price slippage in bp; on_stop prints entries per calendar year. Entry prices and notional are stored as plain scalar attributes per pair so a paper restart restores them exactly. One caveat for the record: the engineering items the analyst flagged (an account losing 3.4x its funded equity with liquidated=false, and the identical +-3.2% daily MTM cycle on a flat book) are engine-side and cannot be fixed from strategy code — the sizing cut above is what keeps the book inside survivable territory regardless.

Hypotheses

premise_falsified on the hypothesis's quantitative claim, verified on the trade ledger and equity curve rather than the headline metrics. The mechanism is real — funding credited +$1,948.07 against $741.58 of all-in cost (2.63x), per-pair residual price risk ~0, per-decision return +1.19% of leg notional over 34 days — but at the only sizing that keeps both venue accounts solvent it delivers +$1,608.29 on $200,000 (+0.80%) across a 5.3-year span, all of it between 2023-11-01 and 2024-06-14. The claim of a continuously harvestable +1.3..+3.0 bp/day differential is false as stated: 27 pair decisions in five years, 14 positive, PF 1.024; only 12 entries inside the pre-registered 2024-01-01..2025-12-24 window against the >=40 I precommitted in iteration 3 (a 3.3x miss); and ZERO decisions in the final 18.3 months, with realized equity pinned at exactly 201,608.29 over 138 consecutive points. QA's concern #3 is confirmed — the qualifying episodes are the TIA/WLD/AVAX/SUI listing-squeeze window (TIA 2.43->15.60), so the differential clears the ~1.05 bp/day amortized round trip only in that regime. No parameter remains: lowering entry_bp_per_day re-admits the ~0.4 bp/day non-squeeze carry that loses to costs (measured in iteration 2), holding 3.0 bp/day yields 12 entries in two years, and both branches were already spent across iterations 1-3. Not an optimize candidate: 4 searchable parameters against 27 observations, and the optimizer's objective is the mtm Sharpe, which is contaminated (see below). Not abandon_class=artifact: the leg accounting is coherent and QA's concern #4 is explicitly cleared — the +-$26k leg P&Ls on $5k notionals are a real unhedged-leg move on an asset that 6x'd, and they cancel against the paired leg. Flagged for ENGINEERING, not as the abandon ground and with no mechanism asserted: the daily-return series prints a repeating +0.8954%/-0.8875% pair every ~4 days from 2024-07 to 2025-12 on a provably flat book; the pair cancels to ~1.00000 so realized PnL is unaffected, but sharpe 0.0798, vol 7.36%, max_drawdown, exposure_pct 880% and cagr 1.3895 all derive from it and must not be trusted. Third consecutive run with multi-venue MTM marking symptoms.

Implementation

Delta-neutral cross-venue funding carry on six alts (LINK, AVAX, SUI, TIA, APT, WLD): for each asset SHORT {SYM}USD.HYPERLIQUID and LONG {SYM}USDT.BINANCE at equal USD notional, so price exposure cancels and the P&L source is the HL-minus-Binance funding differential. Entry when the 14-day point-in-time daily-equivalent differential exceeds entry_bp_per_day (default 3.0 bp/day, floor 2.0 — clear of the ~1.05 bp/day amortized round trip) AND the live 3-day realised differential is still non-negative. Exit on the fast differential turning negative, on a -15bp accrued-carry stop, on normalisation below exit_bp_per_day after a 5-day minimum hold, or at max_hold_days. Iteration 3 sizes for PER-VENUE survival: leverage 1.0, 0.05 equity per pair (0.30x one-sided gross per venue), sizing base = min(HL equity, BINANCE equity), a per-pair cap so a 60% adverse move on the short leg consumes at most 40% of HL equity, and an explicit solvency guard that halts and logs when either account drops below 50% of its starting equity. Daily bars, one-sided by design.

Verification Results

Gate the fast-exit (and optionally the carry stop) on the round trip being amortized: require held >= ceil(round_trip_bp / entry_bp_per_day) days, or require accrued_bp(entry_ts, ts) >= the ~19bp round trip before allowing a non-emergency close. Keep the broken-leg and no-funding-data exits unconditional.

Verification Results

The fast-exit path ('fast-differential-negative', 3-day window) has NO minimum hold, while the round trip on a pair is four taker fills (~0.045%x2 on HL + ~0.05%x2 on Binance = ~19bp of leg notional). At the 3.0 bp/day entry bar the trip amortizes in ~6.3 days, so a pair whipsawed out after 1-3 days collects <=9bp against 19bp of cost and is fee-negative by construction. _min_hold_days (5) only gates the 'carry-normalised' exit, and the -15bp accrued-carry stop likewise fires without regard to the fee already paid. The analyst asked for either a higher entry bar OR a longer minimum hold; only the former was done.

Verification Results

Only reset the per-pair entry state once both legs report flat (e.g. re-check _open_positions on the following bar and keep the state until then), or store a _closing_ts_i and fall back to the stored entry_ts for the hold/carry clocks while the close is pending.

Verification Results

_close_pair clears _entry_day_i / _entry_ts_i unconditionally, before knowing the closes actually filled. If a leg's close_position is rejected or partially filled, the next bar sees both legs still open with entry_day = 0, so held is pinned at 0 and entry_ts = 0 makes _accrued_bp return 0.0 — max-hold, min-hold/normalisation and the accrued-carry stop all become unreachable and the pair can only ever exit on fast < 0. In a backtest market closes fill in-event so this is latent, but in paper/live it is a hang path on exactly the leg that needs flattening.

Verification Results

Accept the barrier for ENTRIES (contemporaneous prices are required for neutral sizing) but drive exits from a path that does not need full alignment — e.g. an on_extra_bar hook that runs the exit-only checks for the pairs whose own two legs have printed, since the exit tests need only that pair's funding series and its own legs.

Verification Results

The entire book — entries AND exits, including the accrued-carry stop and max-hold — runs inside calculate_signal, which the base template only reaches once every one of the 11 same-timeframe extra legs has printed a bar at the primary timestamp (_maybe_process_primary's cross-leg barrier). One missing daily bar on any of the 12 legs (data gap, halt, delisting) freezes all six pairs for that day with positions open and no risk management; a permanent gap freezes them indefinitely. This is also why only 481 of 1950 sandbox days were evaluated.

Verification Results

Thin, small-sample carry — advisory only. (1) SIZE OF THE PRIZE: iteration 3 cuts gross to 6 x 0.05 x leverage 1.0 = 0.30x one-sided per venue (which is exactly what the analyst asked for and what makes the book survivable), but it also caps the mechanism's ceiling: the hypothesis's measured +1.3..+3.0 bp/day differential on 0.30x gross is ~1.5-3.3%/yr gross, and the sandbox delivers CAGR 3.15% against 10.78% reported vol (Sharpe 0.098, PSR 0.54, Sharpe CI -0.67..+0.92). Even if the carry is entirely real, this configuration cannot produce a promotable risk-adjusted number unless the reported vol of a delta-neutral book is itself an artifact. (2) SAMPLE: the sandbox evaluated only 481 aligned daily bars (12 legs must all print; TIA/SUI/WLD history plus HL start date bind the joint window) and produced 27 pair-decisions / 54 leg-positions. The analyst's iteration-3 precommitment was >=40 pair-entries inside 2024-01-01..2025-12-24 — check that on the full-history run before optimizing, because 4 searchable parameters against ~40-60 pair decisions is thin. (3) EX-SQUEEZE CARRY: iteration 2's detail file showed 14 of 16 pair-holds earning ~0.4 bp/day vs a ~1.05 bp/day amortized round trip, with 95% of net PnL from two episodes. The entry bar is now 3.0 bp/day (floor 2.0) on a 14-day trailing window, but the screen is backward-looking and lag-1 persistence of 0.5-0.8 does not guarantee the forward window clears cost — check per-pair realized carry-minus-cost (the new EXIT log prints carry_bp and price_bp) before concluding the differential is harvestable rather than squeeze-conditional. (4) REPORT INTERNALS STILL LOOK ENGINE-SIDE, NOT STRATEGY-SIDE: at 0.05 equity/pair the leg notional is ~$5k (confirmed by total_commission $239.88 over 108 fills = ~$2.22/fill at ~0.0475% taker), yet avg_win $2,018 / avg_loss $2,242 / largest +-$26.7k imply leg notionals an order of magnitude larger, and a 0.30x-gross matched-notional book reports 34.5% max drawdown and 10.8% annualized vol. These are the same multi-venue MTM/accounting symptoms the analyst flagged for engineering in iterations 1-2 (account losing 3.4x funded equity with liquidated=false; repeating +-3.2% daily MTM on a flat book). Treat mtm-derived risk metrics on this run with suspicion and judge the edge off per-pair carry and per-leg PnL sums in the detail file.

Backtest Review

The carry mechanism is REAL and is credited: the trade ledger shows +$1,948.07 of funding captured against total costs of $741.58 (commission $258.94 + modeled impact $142.86 + combined price slippage $339.78) — carry beat cost by 2.63x. QA's worry that this family is uncreditable never applied.

Backtest Review

The delta-neutral construction works exactly as designed. Per-pair price residual is tiny (-$11, -$4, -$5, +$0.2 ...) even when a leg moves 6x, because the two legs cancel.

Backtest Review

QA edge-concern #4 is NOT borne out and should be closed: the +-$26k leg P&Ls on ~$5k notionals are legitimate, not an accounting bug — the TIA short leg ran 2.4308 -> 15.5950 (-542% of notional) while its paired Binance long booked +540%, netting -$368 for the pair. Leg notionals are uniformly $2.6k-$5.0k, consistent with the $258.94 commission over 108 fills.

Backtest Review

Per-DECISION economics clear the two-venue round trip: mean +$59.57 per pair on a $5,000 leg notional = +1.19% of leg notional over a 34-day mean hold. The report's avg_trade_return_pct of 0.028% understates a two-leg book, so I did not judge on it.

Backtest Review

Iteration 3's survival sizing fixed the iteration-2 defect: no venue account went insolvent, no liquidation, zero solvency blocks.

Backtest Review

SIZE: realized equity runs $200,000.00 -> $201,608.29 over the whole 5.3-year span = +0.80% total, +$1,608.29. Every dollar of it was earned between 2023-11-01 and 2024-06-14.

Backtest Review

FREQUENCY COLLAPSE, and the iteration-3 precommitment is missed by 3.3x: I pre-registered >=40 pair entries inside 2024-01-01..2025-12-24. Delivered: 12. The last entry is 2024-02-28 and the last exit 2024-06-14 — the final 18.3 months of data (138 equity points, value pinned at exactly 201,608.29) contain ZERO decisions.

Backtest Review

QA edge-concern #3 IS borne out: the four qualifying episodes are TIA (2.43->15.60), WLD (2.24->7.95), AVAX (11.89->41.13), SUI (0.62->1.39) — the late-2023/early-2024 alt listing-squeeze window. At the 3.0 bp/day bar the differential clears cost only in that one regime, found once in five years.

Backtest Review

27 pair decisions, 14 positive, profit factor 1.024. Four searchable parameters against 27 observations cannot be validated; the optimizer would fit noise for two hours.

Backtest Review

No tuning room remains, and both branches were already spent: lowering entry_bp_per_day restores frequency but re-admits the ~0.4 bp/day non-squeeze carry that loses to the ~1.05 bp/day amortized round trip measured in iteration 2; holding the 3.0 bp/day bar yields 12 entries in two years. That is a structural ceiling, not a parameter.

Backtest Review

ENGINEERING FLAG (symptom only — I am not asserting a mechanism): the daily-return series prints a repeating +0.8954% / -0.8875% pair every ~4 days from 2024-07 through 2025-12 while the book is provably FLAT (realized equity constant at 201,608.29 across all 138 points). The pair multiplies to ~1.00000 so realized PnL is unaffected, but sharpe_ratio 0.0798, annualized_volatility 7.36%, max_drawdown, exposure_pct 880.19%, cagr 1.3895 and the 2024/2025 annual figures all derive from that series and are not trustworthy. This is the third consecutive iteration with multi-venue MTM marking symptoms; it needs an engine-side fix, not strategy code.

Analysis

The carry is real and credited — do NOT change the signal, pair construction or one-sidedness. The strategy fails for one verified reason: it goes bankrupt on Hyperliquid in Feb 2024 and can never trade again. (1) ROOT CAUSE: per-leg P&L is HL -$338,415 / BINANCE +$344,131 on $100k per venue; HL equity goes to ~-$238k, get_account_equity() (primary = HL) returns <= 0, _open_pair returns False, entries stop permanently on 2024-01-02. (2) SIZE FOR PER-VENUE SURVIVAL: today 6 x 0.10 x leverage 3.0 = 1.8x one-sided gross per venue; set _pair_gross_frac ~0.05 and leverage 1.0, target <= 0.3x gross per venue. (3) Size off min(HL_equity, BINANCE_equity), and add a solvency guard + explicit log/counter when either account falls below 50% of start — the strategy currently dies silently, which is why iteration 1's feedback aimed at the wrong lever. (4) Cap each pair so a 60% adverse move on the short leg cannot consume >40% of HL equity. (5) Raise entry_bp_per_day default to ~3.0 (lift the 1.5 lower bound): ex the two squeeze episodes the carry was ~0.4 bp/day against a ~1.05 bp/day amortized round trip. (6) Log per closed pair the net funding captured in bp of notional and price slippage, plus per-year entry counts. PRECOMMITMENT for iteration 3 — the metric I expect to move: pair-entries inside 2024-01-01..2025-12-24 from 0 to >= 40, with neither venue account ever below 50% of starting equity. If the next run is still dead/dormant across that window, or non-squeeze carry is still below the ~1 bp/day cost hurdle, I will abandon rather than issue a fourth pass. FOR ENGINEERING (not the developer, not the ground for this verdict): (a) an account lost 3.4x its funded equity with liquidated=false and no margin rejection; (b) the MTM daily series prints an identical ±3.2%/-3.1% cycle for 22 months on a flat book.

Outcome Summary

VenueSegmentationFundingSpreadHarves-716805fce5

Outcome Summary

VenueSegmentationFundingSpreadHarvestNeutral bet that Hyperliquid's structurally higher funding versus Binance USD-M could be harvested delta-neutrally across six never-paired alts, entering only when the differential exceeded 3.0 bp/day. The mechanism worked as designed — the paired legs cancelled price risk almost exactly, funding credited +$1,948.07 against $741.58 of cost, and iteration 3's survival sizing kept both venue accounts solvent after iteration 2's insolvency — but the whole 5.3-year run produced just 27 pair decisions and +0.80% on $200,000, every dollar of it between November 2023 and June 2024. The analyst abandoned it at backtest review as premise_falsified: at the only threshold that clears costs the differential qualifies solely during the TIA/WLD/AVAX/SUI listing-squeeze regime, leaving 18.3 months of data with no trades and no parameter left to tune. The review also flagged, without asserting a mechanism, a repeating +0.8954%/-0.8875% daily-return artifact on a provably flat book that makes the Sharpe, volatility, drawdown, exposure and CAGR figures untrustworthy — the third consecutive run with multi-venue mark-to-market symptoms, referred to engineering rather than used as the abandon ground.

Outcome Summary

A funding differential that is positive on average can still be tradable only inside one rare regime — verify the edge clears the round-trip cost outside the squeeze episodes, and pre-register entry counts so a frequency collapse is caught before three iterations are spent.

Outcome Summary

The analyst's backtest-review verdict was abandon (premise_falsified) after iteration 3: all profit came from the 2023-11-01 to 2024-06-14 alt listing-squeeze window, only 12 entries landed inside the pre-registered 2024-2025 window against a precommitted 40, and the final 18.3 months held zero decisions. With 4 searchable parameters against 27 observations and both the lower-threshold and hold-threshold branches already spent in iterations 1-3, it was not sent to optimization.

Outcome Summary

Harvest a delta-neutral cross-venue carry by shorting Hyperliquid perps and going long matched-notional Binance USD-M perps on six alts (LINK, AVAX, SUI, TIA, APT, WLD) whenever the trailing HL-minus-Binance funding differential was elevated.

Outcome Summary

Over a 1,950-bar/5.3-year backtest it made 54 trades (27 pair decisions, 108 fills) for +0.80% total return, Sharpe 0.0798, profit factor 1.024, win rate 51.9% and avg_trade_return_pct 0.028%; funding captured +$1,948.07 against $741.58 of all-in cost (2.63x carry-to-cost) and +1.19% per pair decision on leg notional, but realized equity only moved $200,000 to $201,608.29.
Strategy report

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