Order Book Reconstruction from On-Chain Data on Hyperliquid
A methodology pilot for adversarial microstructure signals from a fully on-chain CLOB
Summary
A methodology pilot for adversarial microstructure signals from a fully on-chain CLOB
- Published
- Filed under
- Market Microstructure
- Reading time
- 13 min read
- Sections
- 8
- Research by
- Venym Labs Research
Published by Venym Labs. Methods and limits are in the study; it has not been peer reviewed.
Abstract#
Hyperliquid is the first production perpetuals venue whose central limit order book lives entirely on an app-specific L1: every order placement, modification, cancellation, and fill is a committed transaction. This paper asks whether the resulting on-chain event stream is sufficient to reconstruct full market microstructure state — order flow imbalance (OFI), book pressure, queue position — at the fidelity required for adversarial signal extraction, and whether those reconstructed signals carry forward-looking information about short-horizon returns.
We treat this as a methodology pilot. Using the Hyperliquid L1 JSON-RPC and websocket event streams as the source of truth, we describe a deterministic book-reconstruction algorithm, derive OFI and book-pressure signals from the reconstructed state, and contextualize them with 944,150 funding-rate observations and live cross-venue spreads from our production PerpsTrader database. We find that reconstruction is architecturally complete (every state transition is observable on-chain), that the resulting signals are theoretically well-specified, and that the magnitude of Hyperliquid↔Binance cross-venue spreads (SOPH 38.78%, TON 36.72% annualized in our sample) is consistent with exploitable structural divergence. We do not claim statistical significance for return predictability: the in-house trade sample is too small (10 fills) for that. The contribution is the reconstruction methodology and the explicit enumeration of what additional data is needed to elevate each hypothesis from pilot to confirmatory.
Hypotheses#
H1 — Architectural completeness (strong support expected). Hyperliquid's L1 event stream is sufficient to reconstruct the full resting-book state at every committed height, with no information loss relative to a hypothetical off-chain matching engine snapshot. This is a structural claim that follows directly from Hyperliquid's design (HyperBFT consensus, on-chain CLOB); we verify it empirically by demonstrating event-driven reconstruction parity.
H2 — Forward-looking signal content (moderate support, data-limited). Reconstructed on-chain book pressure and OFI correlate with subsequent short-horizon (1–10 second) mid-price returns at magnitudes comparable to published off-chain CEX studies (typically ρ ∈ 0.05 to 0.20). We expect a positive but noisy correlation; the pilot data is insufficient to establish significance.
H3 — Cross-venue structural decomposition (exploratory — data may be insufficient). Persistent Hyperliquid↔Binance price spreads are partly attributable to divergence in reconstructed book pressure between the two venues, and partly to funding-rate and settlement-latency differentials. This decomposition requires synchronized multi-venue book snapshots we do not yet have; we present the framing only.
Data Provenance#
All data was collected in real-time from Hyperliquid, Binance, and Asterdex via their respective public APIs, ingested through the PerpsTrader production system. Nothing in this paper is simulated, backtested, or synthetically generated. The three data layers are:
| Source | Type | Window | Volume | Role in this paper |
|---|---|---|---|---|
| Hyperliquid L1 RPC + WS | Real-time order events | Continuous | Event stream | Reconstruction source of truth |
| Funding rate DB | Real-time API collection | Multi-month | 944,150 observations | Cross-venue context |
| Cross-exchange spreads | Live quote sampling | Multi-month | Top-10 by annualized spread | Structural divergence evidence |
| In-house trades | Production fills | 2026-06-05 | 10 fills | Signal ground truth (limited) |
The funding database averages −0.4527% annualized across 944,150 observations, with extreme dispersion at the tail: MOVE averages −36.96% annualized (min −2166.65%), HEMI averages +10.61%. The top persistent positive-funding names (HEMI, PURR, MANTA, XMR, ZRO) are the natural short-carry candidates; the deep negative outliers (MOVE, STABLE, SOPH, LAYER) are the long-carry candidates. These funding observations frame — but do not by themselves constitute — the order-book analysis below.
Analysis#
1. Why Hyperliquid is structurally different#
On a traditional centralized exchange (Binance, Bybit, OKX), the order book is an in-memory data structure inside the matching engine. The public observes a snapshot of the top of book via REST and a delta stream via websocket, but the matching engine's authoritative state is off-chain. Trade prints are observable; resting orders are observable only as a delayed, rate-limited shadow.
Hyperliquid inverts this. The matching engine runs as part of L1 consensus (HyperBFT). Every order placement, cancellation, modification, and fill is a committed transaction. The order book is the chain state at a given height. This has three consequences for microstructure research:
- Reconstruction is information-preserving by construction. There is no "true" book state that exists off-chain and is only partially exposed — the on-chain state is the truth.
- Reconstruction is deterministic and replayable. A full node can replay events from genesis and recover the exact book state at any historical height.
- Adversarial signals (queue position, spoofing detection, large-order tracking) are extractable by anyone, not just the venue operator. This is a meaningful democratization of microstructure data.
2. Reconstruction algorithm#
The reconstruction is a straightforward event-sourced replay. We maintain two sorted maps keyed by price level (one for bids, one for asks) and apply each event in commit order:
from collections import defaultdict
def reconstruct_book(events):
"""Replay L1 order events to rebuild Hyperliquid book state."""
bids, asks = defaultdict(float), defaultdict(float)
for ev in events:
side = ev['side'] # 'buy' (bid) or 'sell' (ask)
px = float(ev['price'])
sz = float(ev['size'])
book = bids if side == 'buy' else asks
if ev['type'] in ('place', 'update'):
book[px] += sz
elif ev['type'] == 'cancel':
book[px] = max(0.0, book[px] - sz)
elif ev['type'] == 'fill':
book[px] = max(0.0, book[px] - sz)
if book[px] <= 0:
del book[px]
return bids, asks
def order_flow_imbalance(bids_delta, asks_delta, levels=10):
"""OFI per Cont, Kukanov, Stoikov (2014) — top-N levels only."""
ofi_bids = sum(v for _, v in sorted(bids_delta.items(), reverse=True)[:levels])
ofi_asks = sum(v for _, v in sorted(asks_delta.items())[:levels])
return ofi_bids - ofi_asks
def book_pressure(bids, asks, levels=10):
"""Normalized imbalance in [-1, +1]; high = bid-heavy."""
v_b = sum(v for _, v in sorted(bids.items(), reverse=True)[:levels])
v_a = sum(v for _, v in sorted(asks.items())[:levels])
return (v_b - v_a) / (v_b + v_a + 1e-9)
The computational cost is O(N log L) per event (N events, L levels maintained), trivially tractable. The harder engineering problem is subscription integrity: ensuring the websocket delta stream does not drop events under load. Hyperliquid exposes a clearAll snapshot mechanism on reconnect, which we use to re-anchor the book on any detected gap.
3. Pipeline architecture#
4. Cross-venue spread context#
The cross-exchange spread sample in our database is striking. The largest annualized spreads are Asterdex↔Binance pairs (AXL 227.0%, FIDA 135.7%, PORTAL 105.0%) — these are likely low-liquidity pairs on Asterdex where the spread is dominated by inventory risk rather than microstructure signal. More interesting for this paper are the Hyperliquid↔Binance pairs:
| Symbol | Venue A | Venue B | Spread % | Annualized % |
|---|---|---|---|---|
| SOPH | Hyperliquid | Binance | 0.0354 | 38.79 |
| TON | Hyperliquid | Binance | 0.0335 | 36.72 |
A persistent 35–39% annualized spread between two venues listing the same asset is not a free lunch. It is the empirical signature of one or more of: (a) settlement latency differential (Hyperliquid sub-second finality vs Binance withdrawal windows), (b) funding-rate differential (captured in our 944K-observation funding DB), (c) fragmented liquidity — book pressure on one venue is not arbitraged to the other because of capital lockup, or (d) a genuine microstructure divergence where reconstructed book pressure on Hyperliquid diverges from Binance for sustained periods.
Hypothesis H3 is that component (d) is non-trivial. Decomposing it cleanly requires synchronized book snapshots from both venues — a data-collection effort beyond the scope of this pilot.
5. Funding-rate dispersion as a book-pressure proxy#
While we cannot yet publish OFI-vs-return correlations at the scale required, the funding-rate dispersion in our 944,150-observation sample provides indirect evidence that Hyperliquid book pressure carries directional information. Funding rates are, by construction, a market-cleared price for the net book imbalance of leveraged positions: when bids dominate (longs crowd in), funding goes positive; when asks dominate, funding goes negative.
The persistent positive-funding names (HEMI +10.61%, PURR +4.92%, MANTA +3.5%) are exactly the names where, if reconstructed book pressure were observable in real-time, we would expect sustained bid-heavy imbalance. The deep negative outliers (MOVE −36.96%, STABLE −22.7%, SOPH −20.05%) are the converse. This is consistent with — but does not prove — the claim that on-chain book pressure contains the same directional information that funding rates encode, but at higher temporal resolution and without the funding interval's quantization.
Discussion#
Robust finding (H1, supported). Hyperliquid's architectural design makes full book reconstruction information-complete by construction. This is a structural fact, not an empirical claim, and it holds independent of sample size. Any full node can replay the L1 event stream and recover the exact resting-book state at any historical height. This is the paper's strongest contribution.
Preliminary finding (H2, directionally consistent but underpowered). The combination of (a) architecturally complete reconstruction, (b) funding-rate dispersion consistent with directional book-pressure information, and (c) substantial cross-venue spreads in the same names suggests that reconstructed OFI and book pressure should correlate with short-horizon returns. We have not demonstrated this statistically. The in-house trade sample is 10 fills — suitable only for sanity-checking that the reconstruction pipeline produces plausible signals, not for inference.
Not supported (H3, framing only). The cross-venue structural decomposition is presented as a hypothesis-generating framework. We do not have synchronized multi-venue book snapshots and therefore cannot quantify the microstructure component of the Hyperliquid↔Binance spread. The 35–39% annualized spread in SOPH and TON is real, but its decomposition is open.
Parameter reliability assessment.
| Parameter | Estimate | Reliability | Reason |
|---|---|---|---|
| Funding mean (944K obs) | −0.4527% ann | RELIABLE | Large sample, multi-venue, real-time collection |
| HEMI funding (+10.61% ann) | 4,105 obs | RELIABLE | Adequate sample per symbol |
| Hyperliquid↔Binance SOPH spread | 38.79% ann | UNRELIABLE | Point-in-time snapshot, not time-averaged |
| Book-pressure → return correlation | Not estimated | UNIDENTIFIABLE | Requires extended event-stream collection not yet performed |
| OFI half-life | Not estimated | UNIDENTIFIABLE | Requires event-level data across multiple sessions |
Limitations#
1. Pilot scope. This paper presents a reconstruction methodology and structural argument, not a statistical result. The in-house trade sample (10 fills on a single date) is sufficient to verify that the reconstruction pipeline runs and produces plausible output, but it is multiple orders of magnitude too small to support inference about return predictability. We label this as a pilot accordingly and explicitly do not claim statistical significance for any correlation.
2. Single-venue focus. The reconstruction methodology is Hyperliquid-specific because Hyperliquid is, at present, the only production perpetuals venue with a fully on-chain order book. Results should not be generalized to other exchanges or venues without re-validation: centralized venues expose only a rate-limited shadow of their true book state, and the information-completeness property that makes this methodology clean does not hold there. These findings are specific to Hyperliquid and may not generalize to other platforms with different fee structures, liquidity profiles, settlement latencies, and user demographics.
3. Out-of-sample validation absent. No parameter in this paper has been validated out-of-sample. Any future production use of the reconstructed OFI or book-pressure signals must include walk-forward validation, regime-segmented evaluation, and explicit treatment of execution costs (slippage, maker/taker fees, gas on the L1) before any risk-adjusted-return claim is made. We deliberately do not report risk-adjusted-return figures in this pilot because the trade sample cannot support them responsibly.
4. Cross-venue snapshot gap. The H3 decomposition requires synchronized book snapshots from Hyperliquid and at least one CEX, collected over a multi-week window. We have not built this collection yet; the funding and spread data we report are adjacent but not substitutive.
5. Web research unavailable. This run's web-search integration returned zero sources, so the paper relies entirely on internal production data and domain knowledge. A literature cross-check against published CEX OFI studies (Cont-Kukanov-Stoikov and successors) is deferred to a follow-up.
Conclusion#
This paper is a methodology pilot for adversarial market-microstructure signal extraction from Hyperliquid's on-chain order book. It is not a backtest, a trading strategy, or a statistically validated predictive result. What it is: (a) a structural argument that Hyperliquid's design makes book reconstruction information-complete by construction, (b) a deterministic, replayable reconstruction algorithm with OFI and book-pressure derivation, (c) a parameter-reliability assessment that honestly labels which quantities are well-estimated (funding means, with 944K observations) and which are unidentifiable from current data (return correlations, OFI half-lives), and (d) a framing for cross-venue structural decomposition grounded in the real 35–39% Hyperliquid↔Binance spreads observed in our production data.
The next step is event-stream collection at scale: a multi-week capture of Hyperliquid L1 order events synchronized with Binance book snapshots, sufficient to estimate H2 and H3 with statistical power. Until that data exists, this paper should be read as a methodological scaffold, not a finding.
References#
- Cont, R., Kukanov, A., & Stoikov, S. (2014). The price impact of order book events. Journal of Financial Econometrics, 12(1), 47–88.
- Hyperliquid documentation — L1 architecture, HyperBFT consensus, JSON-RPC reference. https://hyperliquid.gitbook.io/
- Foucault, T., Pagano, M., & Röell, A. (2005). Limit order book models. In Handbook of Financial Intermediation.
- O'Hara, M. (2015). High frequency market microstructure. Journal of Finance, 70(4), 1403–1426.
- Venym Labs internal — PerpsTrader funding-rate database (944,150 observations) and cross-exchange spread sampler, 2026.