Skip to content
All strategies

Strategies

Hyperliquid DeFi Stress Dispersion Continuation: AAVE versus UNI

Outcome: Abandoned

HyperliquidDefiStressDispersion

Outcome Summary

HyperliquidDefiStressDispersion was built to test whether relative resilience during a joint DeFi selloff predicts further AAVE-vs-UNI divergence, trading the pair long/short on 4-hour Hyperliquid bars. Across 3 iterations the code never passed verification: each time, the Layer 3 sandbox backtest exceeded its 300s limit on a ~20,000-bar window. The run was abandoned in the verification loop, so the backtest review, optimization, analyst and risk stages were never reached. No performance metrics exist, and the hypothesis is still untested.

Hypothesis

Test whether relative resilience during a joint DeFi selloff predicts further divergence: long the more resilient token and short the weaker token, using synchronized 4-HOUR bars on AAVEUSD.HYPERLIQUID and UNIUSD.HYPERLIQUID. Hold for up to three days. HyperliquidCollector supplies perpetual OHLCV; direct parquet inspection verified 5,879 shared timestamps from 2024-01-25T20:00:00Z through 2026-10-01T20:00:00Z, with two discontinuous intervals. Reset indicators after gaps. Inspiration: https://bigquant.com/wiki/doc/BDR9U0WPw2 discusses measuring resilience when another asset falls; it does not establish this proposed crypto trading edge. No funding income, options data, or calendar trigger is assumed.

Hyperliquid is underrepresented at 6.8% against a 20% target, while long-only and single-instrument experiments are overrepresented. This paired long-short experiment addresses those gaps. It tests stress-conditioned dispersion continuation rather than weekly winner rotation, same-coin cross-exchange convergence, or supplementary-gated directional trading. corpus_concentration is empty, so exact instrument shares cannot be established. Cross-venue exposure is deferred because the provided dislocation failures demonstrate inadequate capture after costs.

verification_loop: sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of AAVEUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Implementation

Equal-dollar AAVE/UNI pair on Hyperliquid 4H bars. When both tokens' 6-bar returns are below -0.75 sigma of their own trailing 180-sample return distribution (joint DeFi selloff), and the AAVE-minus-UNI return spread is at least entry_spread_pct for 2 confirmed bars, go long the more resilient token and short the weaker one. Exits: hold_bars time stop, pair stop -3% / target +2% of gross notional, 6% venue-resting protective stop per leg (which also flattens the companion leg), and a forced exit on feed gaps. 6-bar cooldown after each exit.

Iteration 3 (sandbox_timeout). Per lesson L155, I diagnosed the cause before editing the signal. A local run of the previous code over the sandbox window finished in 520s cold and 192s warm, on a host with load average ~55-61. py-spy showed about 7 minutes of the cold run inside NautilusTrader's catalog instrument/bar file globbing (runner.py:540 and 683, fsspec walk), before any strategy code ran. The per-bar strategy work is already O(1): bounded deques, running sums and sum-of-squares, and no history rescans. The engine phase over 4,902 bars was too short for the profiler to sample. The only code change removes the duplicate per-bar positions_open() cache lookups in should_exit, which now reuses the lookups _process_primary already made; trading behaviour is identical. Signal, gates, sizing and every fixed/tunable parameter match the optimization_plan. Leverage stays 1.0, mirrored as a parameter and consumed in position_size.

Verification Results

sandbox_timeout: Verification failed (Layer 3 — sandbox backtest): smoke test exceeded the 300s wall-clock limit on a ~20000-bar window (2400 days of AAVEUSD.HYPERLIQUID-4-HOUR-LAST-EXTERNAL). This almost always means per-bar work that scales with history — e.g. rescanning the full funding/supplementary series, or rebuilding a list and calling min()/sorted() inside calculate_signal()/on_bar() on every bar. Precompute sorted timestamp arrays ONCE in __init__ and use bisect, or cache lookups keyed by timestamp, so per-bar cost is O(log n) not O(n).

Iteration History

Verification failed (Layer 1.5 — hypothesis/config consistency) [class=hypothesis_mismatch]: - optimization_plan fixes leverage at 1.0

Outcome Summary

Make sure the per-bar cost in calculate_signal()/on_bar() stays constant or logarithmic (bounded buffers, precomputed arrays with bisect, cached lookups), and test speed on a 20,000-bar window before submitting, because a slow smoke test ends a run before any edge is measured.

It was abandoned in the verification loop after 3 iterations. The Layer 3 sandbox backtest timed out, exceeding the 300s wall-clock limit on a ~20,000-bar (2,400-day) AAVEUSD.HYPERLIQUID 4-HOUR window, which points to per-bar work that grows with the length of the history.

An equal-dollar AAVE/UNI pair trade on Hyperliquid 4-hour perpetual bars: after both tokens fell together under stress, it went long the more resilient token and short the weaker one for up to three days, betting that the divergence would continue.

No performance numbers exist. The strategy never completed a backtest, so it has no return, Sharpe ratio or trade count, and optimization was never run.

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