Skip to content
All strategies

Strategies

Timestamp-Aligned ETH–BTC Cointegration Spread Reversion on Hyperliquid 4H

Outcome: Abandoned

HyperliquidEthBtcCointegrationReversion

Outcome Summary

After two iterations, the strategy tested synchronized ETH–BTC spread reversion with capital-relative sizing and frozen trade-level hedge ratios. Its four baskets across 732 days lost approximately $142 net, with a Sharpe ratio of -0.068. Backtest review abandoned this trading specification before optimization because expectancy was negative and the sample was too small, without concluding that all cointegration strategies are unprofitable.

Hypothesis

Derived by the Research Lead from JayK23's Cointegration between crypto markets: operationalize synchronized crypto-pair analysis as a two-leg spread-reversion experiment. The source supplies a statistical question, not trading rules. Its timestamp-alignment issue is preserved; cointegration is tested on log price levels rather than log returns because the Engle–Granger test assumes I(1) inputs. Research Lead choices are rolling estimation, stationarity screening, deviation-based entries, frozen trade-level hedge ratios, convergence exits and capital-relative sizing. Use supported Hyperliquid perpetuals and 4-HOUR bars instead of the source's illustrative FTX 5-minute data, allowing longer validation and larger potential captures. Orders execute at synchronized signal-bar closes; no next-session fill, hedge mode or selectable same-bar policy is required. All projected returns are unverified research predictions.

The concentration brief is empty, so exact recent instrument shares cannot be established. BTC is retained specifically to test the source's ETH–BTC example, rather than mine another BTC directional signal. This two-leg long–short proposal addresses the large long-only excess and Hyperliquid shortfall. Options or a cross-venue basis strategy would change the submitted mechanism. Unlike the failed LTC–BCH–ETC PCA basket, this experiment uses a fixed liquid pair, an explicitly tested log-level relationship and gross-notional cost screening. The previous validation message is a connection error, not evidence requiring a different mechanism.

negative_expectancy: decline optimization of this Research Lead operationalization on ETH–BTC Hyperliquid 4H. The implemented paired trades lose money after costs, and only four baskets provide no credible basis for searching 13 parameters. No verified implementation defect supports a developer iteration. This verdict concerns the supplied trading specification, not JayK23's statistical question or all cointegration strategies.

Implementation

Trades a timestamp-aligned ETH–BTC Hyperliquid 4H log-price spread after level, difference and residual stationarity screening. Both legs enter explicitly with a frozen trade model and capital-relative sizing. Bar-close exits respond to convergence, spread stops, holding limits or a cost-adjusted basket loss.

The only executable change from previous_code divides get_position_pnl_pct() by 100.0 before multiplying by opening notional, correcting the reported Layer-4 defect while preserving passing signal, entry, alignment and sizing logic. Arithmetic boundary example: with $100,000 entry equity and two $25,000 legs, an ETH long falling 1% contributes -$250 and a BTC short falling 1% contributes +$250; combined price PnL is $0 and the configured 0.0019 gross-notional cost allowance is $95, giving -$95 estimated net PnL. If ETH instead falls 4.62% while the BTC short still gains 1%, combined price PnL is -$905 and estimated net PnL is -$1,000, exactly the inclusive 1%-of-entry-equity basket-stop boundary. These are arithmetic examples, not a verification run. The advisory -0.0366% sandbox closed-leg return warrants full-backtest basket-level evaluation after this correction; it does not yet establish that the corrected mechanism lacks an edge. The required outbox file could not be written because this session permits read-only filesystem access; the complete task-bound JSON is returned here.

Verification Results

The sandbox produced eight closed leg positions with -0.6943% average leg return and PF 0.889. This small smoke-test sample does not establish profitability; assess paired basket returns and costs over full history.

Backtest Review

Sharpe
-0.07
Total return
-0.14%
Max drawdown
1.52%
Trades
8
Win rate
50.0%
Profit factor
0.91

Trade records confirm four synchronized, opposite-direction ETH–BTC baskets with matched exits and variable capital-relative sizing.

Both bar inputs pass coverage audits; funding is credited and no positions remain open.

Eight closed legs represent only four independent baskets across 732 days, insufficient to justify a 13-parameter optimization.

Basket PnLs are approximately -$491, -$534, +$435 and +$448: net -$142. Reported PF is 0.914 and Sharpe is -0.068.

Average leg return is -0.659% versus the supplied Hyperliquid review floor of +0.15%; paired dollar economics are also negative.

QA's economic concern is borne out descriptively, but four baskets cannot establish that the underlying cointegration mechanism is universally unprofitable.

Iteration History

Verification failed (Layer 4 — QA review) [class=code_defect]: - [edge_concern] Sandbox average closed-leg return is -0.0366%; evaluate basket-level net economics in the full backtest after correcting the exit calculation. This is advisory. - [critical] get_position_pnl_pct() returns percentage points: a 1% loss returns -1.0. Multiplying this directly by opening_notional overstates each leg's dollar PnL by 100 times. Consequently, net_pnl_estimate mixes inflated PnL with correctly scaled dollar costs, and the 1%-of-equity basket stop triggers at the wrong loss. Offsetting leg returns do not eliminate this scaling error. (line 328) — fix: Divide get_position_pnl_pct(position, price) by 100.0 before multiplying by opening_notional. Verify the combined dollar PnL and basket-stop boundary using known long and short price moves, including the configured cost allowance.

Divide get_position_pnl_pct(position, price) by 100.0 before multiplying by opening_notional. Verify the combined dollar PnL and basket-stop boundary using known long and short price moves, including the configured cost allowance.

get_position_pnl_pct() returns percentage points: a 1% loss returns -1.0. Multiplying this directly by opening_notional overstates each leg's dollar PnL by 100 times. Consequently, net_pnl_estimate mixes inflated PnL with correctly scaled dollar costs, and the 1%-of-equity basket stop triggers at the wrong loss. Offsetting leg returns do not eliminate this scaling error.

Outcome Summary

A future iteration needs more independent baskets and evidence of positive returns after costs before parameter optimization is justified.

Backtest review recommended abandonment because paired trades lost money after costs and four baskets provided insufficient evidence to justify searching 13 parameters. Optimization and later analyst and risk reviews were not reached; no verified implementation defect supported another developer iteration.

Trade mean reversion in a timestamp-aligned ETH–BTC log-price spread on Hyperliquid 4-hour bars using rolling cointegration screening and hedge ratios frozen during each trade.

Across 732 days, four independent baskets comprising eight closed legs produced approximately -$142 net PnL, a -0.142% total return and a Sharpe ratio of -0.068. Profit factor was 0.914 and average leg return was -0.659%.

Analysis

Cointegration between crypto markets

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