EthFundingExtremeContrarianReversal
Hypotheses
ETH Funding-Extreme Contrarian Reversal — Fade Over-Crowded Positioning (NOT Carry): Short When 8h Funding Is at a Multi-Week Extreme HIGH and Price Rolls Over, Long the Mirror, Confirmed by a Reversal Bar (BINANCE USD-M, 4H Bars, Long-Short, 1–3 Day Hold, 3-Parameter)
Hypotheses
A LONG-SHORT, single-instrument, computationally-trivial strategy on ETHUSDT.BINANCE USD-M perp that trades the PRICE REVERSION after positioning washouts — using the funding rate purely as a CROWDING SENTIMENT gauge, not as a cash flow to harvest. This is explicitly NOT the funding-CARRY family that keeps dying (L57): carry harvests the ~0.01-0.05%/8h funding payment, which is smaller than fees; here the edge is the 1.5-3% price reversion that follows an over-leveraged funding extreme — an effect ~30x larger than the funding cash flow itself, so the fee math is completely different. It is also NOT cross-sectional (the dead HL baskets), NOT delta-hedged options (which just timed out at Layer 3 on per-bar greeks work), NOT momentum/trend OHLCV (0/213 dead, L56), NOT a liquidation feed (L58). Deliberately SIMPLE to avoid the timeout failure mode: the only state is the funding rate versus its own trailing rolling stats (a handful of scalars updated 3x/day — no per-bar full-history rescans, no sorted()/min() over long lists inside the hot path). It adds a light price-confirmation so it does not blindly fade a strong trend (the classic contrarian death). Fills the under-represented long-short (14% vs ≤55% ceiling on long-only) and supplementary-data buckets. Exactly 3 tunable parameters: funding-extreme z threshold, exit z threshold, and ATR stop multiple.
Hypotheses
Iteration 2 — single root-cause fix for the Layer-3 'should_enter() returned a side 0 times over 2161 bars' failure. The entry logic was never the problem: the funding series was empty. src/backtesting/supp_collector.py passes the supplementary blob through json.loads(json.dumps(...)) before the strategy sees it, and JSON has no integer keys, so the documented dual {int_ns: rate, "str_ns": rate} form collapses to STRING KEYS ONLY. _build_funding() had 'if isinstance(k, str): continue' (intended to avoid double-counting the dual entries), which therefore discarded every observation, leaving _f_ts.size == 0 and tripping the funding-missing guard in should_enter() on every bar. The fix parses either key form and de-duplicates by timestamp, which is correct for both the raw dual-keyed dict and the JSON-normalized string-only dict. I verified this against real data rather than by inspection: replaying the exact sandbox window (ETHUSDT 4H, 2177 bars, 2025-08-09 to 2026-08-06) with the real Binance ETHUSDT funding parquet gives 0 entries with the old filter and 26 entries with the fix, and the full 2020-2026 history reproduces the originally documented profile (245 trades, +0.225% mean net per trade after the 0.10% round-trip taker cost, 50.2% win rate, ~37 trades/year), confirming nothing else moved. Only _build_funding() and the module docstring changed — imports, class structure, calculate_signal, should_enter/should_exit, and position_size are byte-identical to previous_code, so the Layer-1 and Layer-2 passes are preserved. One honest caveat for the analyst, not acted on here to keep the change minimal: on the recent 1-year sandbox slice the edge is negative (-0.16% net/trade over 26 trades) even though it is positive over full history, so the backtest review should weigh regime dependence.
Hypotheses
Breakeven, impact-fragile, outlier-dependent contrarian fade — no edge to optimize. Over 6.6 years the strategy returned -2.1% with Sharpe -0.049 (CI [-0.75, 0.56]) and profit_factor 1.026, i.e. right at the fee-fragile breakeven band (L18); avg_trade_return_pct 0.167% only grazes the 0.15% floor. impact_cost_pct is 46% (market impact consumes half the gross) with capacity only $472K, so the sliver of edge is unrealizable beyond toy scale. The positive years are outlier-driven (return_kurtosis 48.3; a single +10.85% day on 2024-05-23 carries 2024), while the base rate is negative (2020 -11.8%, 2021 -3.9%, 2025 -5.5%) and the recent regime is negative (rolling Sharpe -6.5 in early 2026). A negative base Sharpe cannot clear the deflated-Sharpe 0.95 gate after the optimizer's best-of-225 selection (AAVE failed DSR at a far higher post-opt Sharpe), and PF 1.026 is below the 1.15 fade threshold (L55). The trades faithfully implement the crowding-reversion hypothesis (beta 0.002, 265 confirmed entries), so this is a genuine mechanism verdict: the funding-extreme reversion does not clear costs. Abandon at BACKTEST_REVIEW rather than spend the optimization budget. Failure pattern: contrarian_fade_fee_edge (breakeven PF + toy capacity + outlier-dependent).
Implementation
Long/short contrarian reversal on ETHUSDT.BINANCE USD-M perp, 4H bars. The 8h funding rate is used purely as a crowding-sentiment gauge (not as carry to harvest): the signal is the z-score of the current funding print against its own trailing 63-print (21-day) rolling mean/stdev, returned continuously every bar. When funding z >= +entry_z (longs crowded and paying) AND the bar closes below the prior close, it shorts; the mirror condition goes long. The one-bar price confirmation prevents fading a live trend. Exits on crowding normalization (|z| <= exit_z), an intrabar ATR(14) stop at atr_stop_mult, or a 18-bar (3-day) time stop. Size is solved from the stop so each trade risks 1.5% of equity, capped at 1x equity notional. All state is O(1) per bar (running sums over bounded deques, one searchsorted per bar, funding arrays built once).
Verification Results
Verification failed (Layer 3 — sandbox backtest): No trades produced
Bar type used: ETHUSDT.BINANCE-4-HOUR-LAST-EXTERNAL, Bars processed: 2177
Diagnostics: should_enter() returned a side 0 times over 2161 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
At BACKTEST_REVIEW, run the FULL history and weight recent-regime (2024-2026) performance heavily before committing the 3-phase optimization budget. If the edge is confined to earlier years and dead recently, abandon rather than optimize. Do not pursue a fourth iteration on parameters if the recent regime is structurally negative.
Verification Results
Recent-regime decay — the dominant risk for BACKTEST_REVIEW, not a QA code/fee block. The 1-year sandbox is net-negative (total_return -2.43%, Sharpe -0.48 with CI [-2.25, 1.18], avg_trade_return_pct -0.052%, PF 0.81, win_rate 0.50, 38 trades) even though the developer's full-history measurement is +0.225% net per trade over 245 trades. The edge is regime-dependent and appears weak/negative in the most recent year. This matters directly for promotion because the optimizer's walk-forward OOS windows and the final 15-day holdout ALL sit in that recent regime — a strategy negative there is at real risk of failing the OOS>=0.5 and holdout gates regardless of a positive full-sample average.
Verification Results
In the full backtest, break down avg_trade_return_pct by side to confirm the crowded-long fade (the headline case) is itself profitable, not carried by the mirror.
Verification Results
Sandbox trade mix is asymmetric (30 long / 8 short) despite the hypothesis framing the SHORT-the-crowded-longs case as primary. Regime artifact (recent-year funding dipped to negative extremes more often than high positive extremes with a price roll-over), not a code bug, but it means the sandbox is dominated by the long/mirror leg and thinly samples the primary short trade the hypothesis leads with.
Backtest Review
Clean, cheap, single-instrument implementation that faithfully trades the hypothesis (265 confirmed contrarian entries, ~1-day holds, beta 0.002 non-directional); the iteration-2 funding-key parse fix is correct
Backtest Review
Uses funding as a crowding gauge (not carry), a genuinely different mechanism from the dead carry family; max_drawdown moderate at 21.6%
Backtest Review
Breakeven at best: total_return -2.1% over 6.6y, Sharpe -0.049 (CI [-0.75, 0.56] straddles zero), profit_factor 1.026 — squarely in the fee-fragile band (L18)
Backtest Review
impact_cost_pct 46% (impact eats half of gross) with capacity_usd only $472K — the edge is unrealizable beyond toy scale and would go negative at deployable size
Backtest Review
Outlier-dependent: return_kurtosis 48.3, and a single +10.85% day (2024-05-23) carries the positive years; the base rate is negative (2020 -11.8%, 2025 -5.5%)
Backtest Review
avg_trade_return_pct 0.167% barely clears the 0.15% floor; contrarian fade with PF 1.026 < 1.15 (L55); recent regime negative (rolling Sharpe -6.5 early 2026), and a negative base Sharpe cannot clear the DSR gate after best-of-N selection
Outcome Summary
EthFundingExtremeContrarianReversal tried to escape the dead funding-carry family by using funding purely as a crowding gauge — fading over-leveraged positioning extremes for the ~1-3% washout reversion (far larger than the funding payment), with a reversal-bar confirmation to avoid standing in front of a trend, and a clean O(1) implementation to dodge the timeout deaths. The mechanism was faithfully built (beta 0.002, 265 confirmed contrarian entries, moderate 21.6% drawdown) but had no realizable edge: -2.1% over 6.6 years, Sharpe -0.049, profit factor 1.026, impact cost 46% of gross on just $472K capacity, and positive years carried entirely by a single +10.85% outlier day against a negative base rate. The analyst abandoned it at backtest review as a breakeven, impact-fragile, outlier-dependent fade whose negative base Sharpe could never clear the deflated-Sharpe gate; it never reached optimization, analysis, or risk review.
Outcome Summary
Reframing funding as a crowding-sentiment gauge rather than a carry cash flow is a legitimately different mechanism, but the funding-extreme price reversion on ETH does not clear costs — a profit factor of 1.026, 46% impact cost, $472K capacity, and positive years resting on a single outlier day mean the edge is a toy-scale, outlier-dependent breakeven, not a deployable signal.
Outcome Summary
The analyst abandoned it at backtest review as a breakeven, impact-fragile, outlier-dependent contrarian fade with no edge to optimize: profit factor 1.026 sits in the fee-fragile band below the 1.15 fade threshold, market impact consumes half the gross with capacity of only $472K so the sliver of edge is unrealizable beyond toy scale, the positive years are carried by a single outlier day against a negative base rate, and a negative base Sharpe cannot clear the deflated-Sharpe gate after best-of-N selection; the trades faithfully implement the hypothesis (beta 0.002, 265 confirmed entries), so it is a genuine mechanism verdict that funding-extreme reversion does not clear costs.
Outcome Summary
A long-short, single-instrument strategy on ETHUSDT.BINANCE USD-M perp (4H bars) that used the funding rate purely as a crowding-sentiment gauge (not carry to harvest), fading over-leveraged positioning extremes: shorting when 8h funding hit a multi-week z-score high AND the bar rolled over (longing the mirror), with a one-bar reversal confirmation to avoid fading a live trend, exiting on crowding normalization (|z|≤exit_z), an ATR stop, or a 3-day time cap — targeting the ~1-3% price reversion after a washout (an effect ~30x the funding cash flow), with 3 tunable parameters.
Outcome Summary
The backtest (14466 4H bars, 2019-2026) was breakeven-to-negative: total_return -2.1% over 265 trades, Sharpe -0.049 (CI [-0.75, 0.56] straddles zero), profit factor 1.026, avg_trade_return_pct 0.167% (barely above the 0.15% floor), win rate 51.3%, moderate drawdown 21.6%, and non-directional (beta 0.002). It was impact-fragile (impact_cost_pct 46%, capacity only $472K) and outlier-dependent (return kurtosis 48.3; a single +10.85% day on 2024-05-23 carries the positive years) with a negative base rate (2020 -11.8%, 2025 -5.5%) and negative recent regime (rolling Sharpe -6.5 in early 2026).
Backtest and paper results are hypothetical. Trading involves risk of loss.