Strategies
Hyperliquid Multi-Factor Composite Cross-Sectional Book (Source Replication), Point-in-Time Top-15 Universe, Daily Rebalance with Opposite-Tercile Hysteresis
Outcome: Abandoned
HlMultiFactorCompositeCrossSectionalBook
Outcome Summary
This strategy tried to faithfully replicate a source composite-factor long/short tercile book on a point-in-time top-15 Hyperliquid universe; the hypothesis itself noted that multi-leg neutral books had a 0/150 record here. Over three iterations, the rebalance moved from daily to weekly and gross exposure was cut, but the final 809-day backtest still lost 3.06% (Sharpe -0.04, PF 0.975, -$6.54 per leg), and costs were roughly equal to the loss. The analyst abandoned it at backtest review for having no edge, noting that its positive per-trade % was a ledger artifact. The analyst also flagged an unverified weekly -2.5%/+2.5% return pattern around rebalance flips as a possible engine/ledger issue with NETTING flips.
Hypothesis
The closest faithful version of what the source actually trades. It is ranked last because multi-leg neutral books have a 0/150 record here (lesson 137). Setup: HL 4H bars. Each day, the universe is rebuilt point-in-time as the top 15 names by trailing 30-day dollar volume among listed candidates with at least 30 days of bars. The composite is an equal-weight sum of three z-scored factors, each clipped at the 20th/80th cross-sectional quantiles: -(24h/96h volume ratio), -(96h close-volume correlation), -(24h vol of close/open). The source's 3h-momentum term is dropped as below fees, and its buy-ratio term is dropped because HL has no taker split. Long the bottom tercile, short the top tercile. A secondary, separately scored variant stays flat when composite dispersion is below its 90-day median.
negative_expectancy (failure code: no_edge; the per-trade % is not usable and USD expectancy is negative). Over 809 days and 495 legs, the HL top-15 composite tercile L/S book has Sharpe -0.04, PF 0.975, total return -3.06% and expectancy -$6.54 per leg, with a Sharpe CI of [-1.36, 1.26]. The +0.39% avg_trade_return_pct has the opposite sign to the USD PnL and is a netting and position-flip ledger artifact, as QA suspected. Commission plus impact (~$3.3k) roughly equals the loss, so the gross factor edge is about zero. Iteration 2 at daily cadence had 2,624 trades at a 0.045% per-trade return. Cutting the cadence to weekly reduced costs but still left the book with negative PnL. There is no edge for optimization to tune. This is a multi-leg neutral book (lesson 137 family), and lesson 141 applies: a negative Sharpe on more than 100 trades is a completed, falsified measurement. Separately, the weekly -2.5%/+2.5% daily-return pattern around rebalance flips should be checked as an engine/ledger issue for NETTING flips; this is unverified.
Implementation
Hyperliquid 20-perp candidate pool on 4H bars. On calendar-anchored rebalance days (UTC day index % 7 == 0, taken from the bar timestamp) it builds a point-in-time top-15 universe by trailing 30-day dollar volume. Each name gets three factors: -(24h/96h volume ratio), -(96h close-volume correlation) and -(24h stdev of close/open). Each factor is clipped at the 20th/80th quantiles and z-scored, and the composite is their equal-weight sum. The book is long the bottom tercile and short the top tercile, with opposite-tercile hysteresis. Each leg is its own order at equity*0.35/(2*tercile), so target gross is 0.35x and the maximum is ~0.53x. The dispersion-gated variant sits behind dispersion_filter=True; dispersion is sampled daily.
Verification Results
Record in the run that the variant being tested is weekly-cadence. Keep rebalance_every_days as a parameter so the optimizer and analyst can compare it against the daily cadence.
The hypothesis title specifies a DAILY rebalance, but this iteration defaults to rebalance_every_days=7, a weekly calendar grid (day % 7 == 0 on the bar-timestamp UTC day). The mechanism is otherwise intact: PIT top-15 by 30-day dollar volume, 3 clipped z-scored factors with the correct signs and horizons (6/24/24/6 4H bars = 24h/96h/96h/24h), long bottom tercile / short top tercile, and opposite-tercile hysteresis. Setting rebalance_every_days=1 recovers the stated hypothesis exactly, so this is a parameter value, not a structural swap.
This is acceptable as-is. If early-history coverage matters, drop the late-listed names from extra_bar_types or accept that the effective start is the latest listing date.
The base template's alignment barrier (_maybe_process_primary) only processes a primary timestamp once ALL 19 same-timeframe extra legs have a bar at that ts. So the book cannot trade until every candidate is listed (SUI/APT/ARB/OP list later than BTC/ETH on HL), and any single-leg gap skips the whole timestamp. The strategy's own per-name PIT listing logic (min_history_bars, stale check) is correct, but in practice the barrier means names never enter the universe one at a time as they list. The alignment itself is not look-ahead (extra bars are recorded before calculate_signal runs, and the code rejects last_ts > ts). A skipped first bar of a rebalance day is handled, because the day check fires on the next processed bar.
No change needed. Optionally return min_history_bars for clarity.
min_bars_required() is overridden to 25 while min_history_bars is 180. This is harmless: calculate_signal starts recording earlier and _cross_section enforces the 180-bar listed-history requirement itself. Layer 1 flagged it as a base shadow.
Evaluate per-trade economics on USD PnL divided by leg notional, or have the metrics layer split reversed netting positions, before comparing against the fee floor.
A flip is exit (close_position) + new entry on the same instrument in the same bar. On a NETTING account this nets correctly, but the positions report appears to book these reversals in a way that makes avg_trade_return_pct disagree in sign with USD expectancy (+0.39% vs -$4.2/trade) in the sandbox.
Iteration 2 had 2624 trades at avg_trade_return_pct 0.045%, below HL's ~0.09% round trip, and commission plus impact ate the whole return. The sandbox (809 days, 495 trades) gives PF 0.984, Sharpe -0.10 and a -1.9% return. Its ledger does not reconcile: avg_trade_return_pct is +0.39% while avg_trade_pnl_usd is -$4.2. At a ~3.5% leg notional, +0.39% should be about +$13 per trade, and 0.39% x 495 implies roughly +190% against the -1.9% actual. The likely cause is that NETTING position flips (close + re-open on the same instrument/bar) distort per-position pct returns. Until that is fixed, the per-trade pct figure cannot be compared with the fee floor; use USD expectancy (negative) and PF. The factors are 24h/96h horizons, so a 7-day cadence may dilute them. Funding is not folded (funding_folded=false, 0 events) even though HL funding exists and legs are held for weeks. Check first: the full-history avg PnL in USD per leg vs the ~0.09% round trip, and funding drag on the net book.
Backtest Review
- Sharpe
- -0.04
- Total return
- -3.06%
- Max drawdown
- 18.68%
- Trades
- 495
- Win rate
- 44.6%
- Profit factor
- 0.98
The full-history run is reliable: 809 days, 495 closed legs, 20 names, and funding and impact both folded in.
Point-in-time universe construction and bar alignment look correct. The trades are balanced (246 long / 249 short), as a neutral book should be.
Negative expectancy on an adequate sample: Sharpe -0.04, PF 0.975, total return -3.06%, expectancy -$6.54 per leg, Sortino -0.05, PSR 0.48, and the Sharpe CI [-1.36, 1.26] straddles zero.
The QA concern is confirmed. avg_trade_return_pct is +0.39%, but avg_trade_pnl_usd is -$6.54. At a ~3.6% leg notional, +0.39% would be about +$14 per leg. The two numbers have opposite signs, so the pct figure is a ledger artifact and cannot be used. Judged on USD expectancy, the edge is negative and below HL's ~0.09% round-trip cost. It is further below the leg-scaled floor for a multi-leg book (lesson 127).
Commission ($1,528) plus modeled impact ($1,753) is about $3.3k, roughly the same size as the whole loss. With costs removed, the gross edge is close to zero.
The calendar years are inconsistent: 2024 +0.63%, 2025 -2.68%, 2026 YTD -3.98%. The drawdown lasted 427 days. The book loses in the calm and normal vol regimes, and all of its gains come from the stressed tercile.
Iteration trail (per the code docstring): iteration 2 ran 2,624 trades at a 0.045% per-trade return. This third pass cut the rebalance cadence to weekly, but PnL is still negative. Reducing turnover did not reveal an edge.
From 2025 onward the daily returns show a regular weekly pattern of ~-2.5% then ~+2.5% on consecutive days. It lines up with the weekly flip-rebalance, which suggests a mark-to-market or accounting artifact around flips. I have not checked this, and it does not change the verdict.
This is a multi-leg neutral cross-sectional book, a family that research-level lesson 137 already covers. Lesson 141 also applies: a negative Sharpe on more than 100 trades is a completed, falsified measurement.
Analysis
Backtest gate: - metrics unreliable: Incoherent: Sharpe 0.44 disagrees in sign with total_return -25.47% — the Sharpe is computed from the mtm_equity_curve series while the return comes from the equity curve. Judge on the equity curve.
Outcome Summary
Cutting turnover (from 2,624 trades at daily cadence to 495 at weekly) lowered costs but exposed no underlying edge. For multi-leg neutral books, check USD expectancy and gross pre-cost PnL rather than the per-trade % figure, which can be distorted by netting and position flips.
The backtest-review stage returned 'abandon' for negative expectancy (failure code no_edge): USD expectancy was negative on an adequate sample, and gross edge was roughly zero before costs. Optimization, analyst, and risk-review stages were not reached.
A replication of a source multi-factor cross-sectional book on Hyperliquid 4H perps: each rebalance day it built a point-in-time top-15 universe by 30-day dollar volume, ranked names on an equal-weight composite of three clipped z-scored factors (negative volume ratio, negative close-volume correlation, negative intraday volatility), went long the bottom tercile and short the top tercile, and used opposite-tercile hysteresis to hold positions.
Over 809 days and 495 closed legs (246 long / 249 short), the third iteration returned -3.06% with Sharpe -0.04 (CI -1.36 to 1.26), profit factor 0.975, expectancy -$6.54 per leg and max drawdown 18.68%. Commission ($1,528) plus impact ($1,753) was about the size of the whole loss, and the reported +0.39% avg_trade_return_pct had the opposite sign to the USD PnL, so it was judged a ledger artifact.
Backtest and paper results are hypothetical. Trading involves risk of loss.