HlPerpBinanceSpotFundingCarryPool18Daily
假设数
Hedged Perp-Funding Carry: Long BINANCE_SPOT / Short HYPERLIQUID Perp Per Coin, Entered Only When Trailing 7-Day Funding Is Elevated, Exited on Funding Decay or a Negative Print (Daily Bars, 18-Coin Pool)
假设数
This is the article's cash-and-carry funding harvest, changed where our own data shows the original no longer works. For each coin in a pool, the strategy holds a long spot position plus an equal-notional short perpetual. That pair has almost no price exposure, so its P&L is the funding the short collects, minus fees and minus drift in the basis. Pre-proposal check on our supplementary data: the article's same-exchange version (Binance spot long + Binance USD-M short) still worked in 2020-2024. Across 507 Binance spot/perp twins, episodes won 73-91% of the time with a median net gain of 2-4% after a 0.30% round trip. In 2025-26 it broke down to median net about 0% and a 50% win rate, and on the 12 most liquid non-BTC Binance pairs a 7-day trailing funding above 0.06%/day NEVER fired after 2024. Binance funding on majors is now arbitraged down to near the 0.01%/8h interest floor. Hyperliquid perps still pay materially positive funding, because the venue is structurally long-crowded and retail-heavy with hourly funding. So the short leg moves to HYPERLIQUID and the hedge stays on the most liquid spot book (BINANCE_SPOT). Pool of 18 coins, BTC excluded for corpus-concentration reasons: ETH, SOL, XRP, DOGE, SUI, ENA, NEAR, WLD, ARB, LINK, AVAX, LTC, AAVE, ADA, BNB, SEI, WIF, CRV. Selection rule: HL perps that have a Binance USDT spot twin, are among the most liquid on HL, and are not new listings or meme coins under a year old (the article's 'avoid new coins and 妖币' rule). A coin is eligible only on days when both legs have a bar. This pool is a hand choice and is declared as such (lesson 151); the Binance-spot-twin requirement is its only economic justification. A daily-bar carry simulation on this pool (funding only, basis ignored) gave: 2023 36 episodes, mean net +6.8%; 2024 58, +4.9%; 2025 49, +1.5% (90% win); 2026 YTD 5 episodes, about +0.1%. Duty cycle was about 34% of coin-days, with a typical hold of 20-55 days. It is an honest carry premium that shrinks as the regime cools, and it is NOT a price prediction.
假设数
Strategy logic and parameters are unchanged (feedback item 3). Item 1: the sawtooth comes from the harness, not the strategy. Instrumented reproduction shows EquityCurveActor sums BINANCE_SPOT cash and HYPERLIQUID margin correctly on every bar, and equity is exactly flat while the book is flat (e.g. 199,872.51 for all of 2024-08-11..25). Root cause is in src/backtesting/runner.py. _sample_points() (line ~117) returns the same dict objects as mtm['equity_curve'], or the identical list when there are <=500 points. _fold_impact_into_curve(rich['equity_curve'], funding_curve_delta) (line ~1066) mutates those shared dicts in place. Then _dense = [dict(p) for p in mtm['equity_curve']] (line ~1175) copies the already-folded points and folds funding and impact a second time. Over 1,670 days only every ~3.3rd point is shared, so those days carry 2x cumulative funding. That gives +X/-X/0 with X equal to cumulative funding (9.46% by 2025-03). On runs of <=500 bars all funding is double-counted uniformly: a 4-month repro reported Sharpe 15. Suggested one-line harness fix: rich['equity_curve'] = [dict(p) for p in _sample_points(...)]. The same applies to drawdown_series. This also silently inflates every other funding-folded backtest, so it needs a manual/harness review. Per the analyst's instruction I did not work around it in strategy code. Item 2: the 2025-03-16 end is the pipeline's sealed holdout boundary (final_exam_boundary, holdout_pct 20); catalog bars run to 2026-09-23. So 2025-26 is in the one-shot holdout by design, and strategy code cannot change that; it is an operator decision. Item 4 (pair-episode ledger) is also report-side. The only code change is a docstring note, so the hash differs and this can be re-run once the harness is fixed.
假设数
no_change: iteration 2 reproduced iteration 1 exactly (148 trades, Sharpe 0.3678252073638065) — the code change did not alter trading; nothing left for the analyst to judge
实现
Hedged funding carry over an 18-coin pool: per coin, long Binance spot + equal-quantity short Hyperliquid perp, entered when trailing 7-day HL funding >= 0.05%/day and the last 24h print is positive, exited on decay below 0.02%/day or a negative print. Max 8 concurrent pairs, gross <= 0.9x equity per venue, leverage 1.
验证结果
Optionally defer a pair exit until both legs are aligned, or at most one bar later. The effect is minor on liquid daily bars.
验证结果
Exits (decay, negative print, missing coverage, or orphan flatten) are submitted with no check that the leg has a bar at this timestamp. If one leg's feed has a gap, its market exit fills at that instrument's last (stale) price, which can misstate basis P&L on that episode. Entries are guarded correctly by _leg_aligned (ts equality, no later bar, L147 satisfied).
验证结果
Consider a per-pair basis/price-move stop (e.g. close the pair if the coin moves >+100% since entry) or a HL margin-ratio check before new entries.
验证结果
Each perp short is sized at 0.1125x HL equity at leverage 1, and HL margin is held separately from the spot hedge. A violent squeeze in one coin (e.g. WIF/SEI/ENA +300-800%) drains HL margin while the offsetting gain sits in the Binance spot account. Cross-venue margin is not pooled. Liquidation is unlikely at 8 x 11.25%, but worst-case single-coin loss on the HL account is unbounded.
验证结果
None required. Keep the docstring explaining that the required interface is vestigial.
验证结果
min_bars_required, _maybe_process_primary and _process_primary override framework methods. I checked each: the _maybe_process_primary override only narrows _sync_extra_iids to legs that delivered within the last 2 intervals, then defers to the base. The base still sets _last_processed_ts, applies warmup/staleness guards and calls the overridden _process_primary. should_enter/should_exit/position_size are therefore dead code (the book logic lives in _process_primary). That is intentional and harmless.
验证结果
The trade ledger books each leg separately. avg_trade_return_pct 0.0487% x 148 legs = ~7.2%, against a reported +9.28% total, so the magnitudes reconcile (L140), and the sign agrees with PF 1.18 (L116). For a hedged pair, though, per-leg return is not the economic unit. Pair net ~= 2 x 0.049% = ~0.1% of one-leg notional per ~40-day episode, AFTER the ~0.29% round trip (spot 0.10% x2 + HL 0.045% x2). That is thin. Also: HL history starts ~2023, so the stress windows before 2023 are empty (0 days traded). 2025-26, the period the hypothesis itself flags as decaying, sits entirely in the sealed holdout. The analyst should judge on the pair-episode ledger (74 episodes) and on the 2025+ holdout, not on the headline Sharpe. The developer's harness-bug claim is VERIFIED in src/backtesting/runner.py. _sample_points() returns the same dict objects as mtm['equity_curve'] (the identical list when there are <=500 points). _fold_impact_into_curve() mutates those dicts in place (the funding fold at ~L1067, the impact fold at ~L1078). _dense (~L1175) copies the already-folded points and folds funding and impact a second time. As a result the daily-return series, and so Sharpe, regime attribution and drawdown, double-count funding and impact on the sampled days. Trade-level P&L is unaffected. Treat the sandbox Sharpe/regime numbers as unreliable until the harness is fixed (e.g. rich['equity_curve'] = [dict(p) for p in _sample_points(...)], and the same for drawdown_series). This affects every funding-folded backtest, not only this one.
分析
The mechanism is sound, but the measurement is not. (1) The equity/daily-return series has a regular sawtooth: +X% / -X% / 0 repeating, with X growing to about 9.4% (roughly the cumulative PnL). It continues with identical values on no-trade days, which inflates vol to 60% and pushes the measured Sharpe down to 0.37. The pair-level ledger (funding +$21.5k, basis -$1.9k, fees -$1.5k, worst episode -$63) shows the true book is nearly riskless. Make sure both venue accounts (BINANCE_SPOT cash + HYPERLIQUID margin) are summed on every snapshot. If that is an engine/harness issue, escalate for manual review rather than working around it. Target: annualized_volatility under 10% and no sawtooth. (2) Extend the data to the latest available HL/Binance bars. The run ends 2025-03-16 and misses the 2025-26 decay the hypothesis itself predicts. (3) Do not change parameters yet. (4) Judge economics per pair episode against the 4-leg floor of ~0.87%. If the corrected series with 2025-26 included still gives Sharpe < 1.0, abandon. Full notes: workspace/discussions/54c81641-838f-4643-943f-a1cef3f6e5da/iteration_1_feedback.md
结局总结
HlPerpBinanceSpotFundingCarryPool18D-d8da1c37db
结局总结
This strategy tried to collect Hyperliquid perp funding while hedging with Binance spot across 18 liquid coins, based on the view that Binance funding has been arbitraged away but HL funding has not. Its first backtest was weak: 148 trades, Sharpe 0.37 and an average trade return of 0.048%, below the 0.15% cost floor. In iteration 2 the developer left the trading logic unchanged and instead attributed a return-series anomaly to a harness bug. The resubmission reproduced iteration 1 exactly and was abandoned before the analyst, optimization or risk stages.
结局总结
An iteration must change trading behaviour to be judged; a suspected harness bug should be escalated separately instead of resubmitting unchanged logic, and the thin 0.048% per-trade edge should have been addressed first.
结局总结
The run was abandoned as 'no_change': iteration 2 reproduced iteration 1 exactly (148 trades, Sharpe 0.3678), so the code change did not alter trading. Iteration 2 left the strategy logic unchanged and only added a note that blamed a daily-return sawtooth on a BacktestRunner double-folding defect. The analyst and later stages never ran.
结局总结
A delta-neutral funding carry across an 18-coin pool: long Binance spot and short an equal quantity of the Hyperliquid perp, entered when the trailing 7-day HL funding reached at least 0.05%/day and exited when funding decayed below 0.02%/day or a negative 24h print appeared.
结局总结
The daily-bar backtest (2020-08-20 to 2025-03-16) produced 148 trades with a Sharpe of 0.37 (CI -0.56 to 1.26), a 52.7% win rate, profit factor 1.17, total_return 9.83 and CAGR 5.56. The average trade return was 0.048% of notional, well below the 0.15% viability floor.
Stratmill 是研究与模拟交易工具,不提供财务建议,也不是经纪商。回测与模拟结果均为假设性结果。交易存在亏损风险。