Empirical microstructure research on on-chain perpetual futures, using Hyperliquid as the substrate.
The premise: most quantitative-finance work is benchmarked on synthetic processes, daily equity closes, or private data. Hyperliquid publishes a derivatives market that is fully public, tick-resolved, and — for liquidations — named, with no data licence between you and it. The interesting questions here are the ones nobody else has the data to ask.
→ experiments/FINDINGS.md is the state of claims: what holds,
what has been withdrawn and why, what is open. Read it before any individual experiment file.
Binance leads Hyperliquid by a median 575 ms on BTC — in 100% of 191 measured hours, every hour in the window — and in 100% of 758 asset-hours across BTC, ETH, SOL and HYPE, with zero reversals. The same estimator returns 25 ms between OKX and Binance, a factor of 23.
It survives trade sparsity, liquidation cascades, and every asset the tape covers, with no material dependence on volatility. The CEX do not lead one another, which is what makes this Hyperliquid's property rather than Binance's. Measured with a grid-free Hayashi-Yoshida estimator validated to zero error against known lags.
Open: how much is mechanical (block cadence, network latency) versus genuine price discovery. Trade sparsity is ruled out as the explanation, and the obvious replacement has now been measured and ruled out too: an instrument's print rate tracks its lag across assets (ρ = −0.66) but barely within one (partial ρ = −0.09 over 758 asset-hours). Nothing has replaced it.
Hyperliquid's node-fills archive is a public record of liquidations that is complete and names the liquidated account — a combination no centralised venue publishes, and one whose order-book structure makes fill-tranching measurable at scale. Counting fills rather than liquidation episodes inflates event counts 2.86× (95% CI [2.72, 3.00]) over a fixed-hour archive year — 351,648 episodes from 1,005,157 fills.
The bias is not a multiplier — it is the top decile. Below the 90th percentile a liquidation is a single fill, counted exactly right. In the top percentile the median is 36 fills. That decile alone generates 23.1% of all fills and carries 67.3% of liquidated notional.
Fill-counting also compresses the size distribution — 2.29× at p99, 5.01× at p99.9 — while leaving the median at 1.00× [0.99, 1.01], undistorted. The largest episode ($97.1M, 1,284 fills) appears in the fill record as pieces of at most $11.0M. The two instrument segments compress differently and cross over: majors more in the body, HIP-3 builder markets more in the tail.
The tail is genuinely heavy (exponential is rejected decisively) but not a power law: lognormal and Weibull both beat Pareto at every estimable threshold, across nearly three orders of magnitude of cut-off. Earlier versions of this work quoted a tail index; that claim is withdrawn, and FINDINGS.md explains why.
The tail cannot be named beyond that. Lognormal and Weibull separate — but in opposite directions depending on where the tail is cut, so whichever wins reports the threshold rather than the distribution. That is a result, not a gap waiting to be filled.
The Hill plot above illustrates a withdrawn claim — the plateau is a property of the estimator, not a tail index. It is kept as the record of why that claim was withdrawn (see FINDINGS).
This is the part worth copying, and it is why the results above are stated as narrowly as they are.
- Pre-registered from EXP-017 onward — hypothesis and falsification criterion committed before the run, ordering checkable in the history. The four earliest experiment files (EXP-016, 018–020) entered the history with results included; that is stated rather than implied away.
- Retractions stay in the open, including a headline. A collection bug double-counted every liquidation fill and survived two adversarial reviews before being caught pre-publication; the factor went 5.72× → 2.86×. The correction, its cause and its scope are documented in place. More than a dozen claims have been withdrawn or requalified; each correction sits in the file that made the original claim, with the reason. Nothing is rewritten to have always been right.
- Estimators are validated against known answers before use. This caught a sign inversion in the lead-lag estimator that would have read as "Hyperliquid leads" with perfect confidence, and a tail-index estimator that silently returned 0.00.
- Adversarially reviewed before submission. Two independent model reviewers — one from the
same family as the authoring model, one from a different one — re-derived every headline
figure and attacked the statistics. Their unedited reports, verification code, and the
point-by-point response are in
review/. - Campaigns are reproducible: every reduced dataset is versioned in
experiments/data/, so a result can be checked without re-running the collection.
- Test the boring confound first.
- Read R² before t — in a large panel the p-value measures sample size.
- An implausible
nmeans the bug is upstream of the filter. - A caveat listed is not a confound controlled.
- Validate an estimator against a known answer, sign included.
- Check what a grouping key means before grouping by it.
- Look at the values under a summary statistic.
- A fit on its constraint boundary is not a result.
- A mechanism read off the code is a hypothesis, not a measured effect.
- A ranking always returns a winner — check the winner actually fits.
- Reviews audit the analysis; nobody audits the collection.
| what it does | |
|---|---|
hlm/data/archive.py |
streams the S3 asset_ctxs archive — whole perp universe, minute grain, back to 2023-05-20 — and folds it to hourly Parquet. 8.7 GB compressed becomes 344 MB; nothing lands on disk raw. |
hlm/data/recorder.py |
live capture of activeAssetCtx only — funding, premium, impact prices, open interest. Deliberately narrow: perplog-recorder already covers trades and books multi-venue, and duplicating it would be worse data. |
hlm/data/hl_client.py |
POST /info with real weight accounting (l2Book costs 2, most info requests 20, paginated endpoints bill per item returned). |
hlm/analysis/leadlag.py |
Hayashi-Yoshida lead-lag for asynchronously observed prices. No grid, τ in milliseconds, validated to zero error. |
tools/pfr-dump |
decodes perplog's .pfr tape to CSV — see tools/README.md. |
hlm/{problems,solvers,montecarlo,bench,strategy}/ are empty placeholders for the direction
below. They contain nothing yet, and the README says so rather than implying otherwise.
paper/ — Counting fills misrepresents liquidations: evidence from a complete
on-chain derivatives ledger. Draft, not submitted; paper/README.md states
what remains before it could be. Every figure traces to a versioned dataset and a pre-registered
experiment in this repository.
| code | MIT — LICENSE |
| paper and reduced datasets | CC BY 4.0 — paper/LICENSE |
The licence covers the reductions, analysis and text produced here. The underlying market data is published by Hyperliquid and by the venues named in the paper.
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
cp .env.example .envNo credentials are needed to reproduce anything above — the archive is requester-pays (AWS
credentials), and everything else is public. .env is only for testnet execution and IBM
Quantum, neither of which the current work uses.
mark_px is mechanically entangled with oracle_px. The mark formula includes
oracle + EMA_150s(mid − oracle), so ln(mark) − ln(oracle) mean-reverts by definition, not by
arbitrage. Combining them measures the formula rather than the market — it produced a spurious
R² = 0.14 here before being caught (EXP-004).
Use mid_px for price dynamics.
Published datasets carry a derived account id, not the address (hlm/data/anon.py).
Addresses are public on-chain, so this is not confidentiality — it avoids publishing a
compiled map of 151,730 accounts to their losses. Every number reproduces bit for bit on the
derived ids. The hash is unsalted and deterministic, so a known address can still be tested for
membership: do not call these datasets anonymised.
perplog operates the market-data infrastructure this research consumes:
perplog-recorder (Rust, 24/7, multi-venue tape → R2), crates/archive (SigV4 + lz4 for the HL
S3 archive), and crates/backtest, whose validation discipline — precommitted baselines,
fail-closed evidence, no selectively complete subsets — this repo mirrors rather than reinvents.
Multi-venue coverage is not a convenience: liquidation cascades propagate across venues, so an HL-only capture would be strictly worse.
Declared, not started. The repo is named for what it studies, not for a method it might use, because a year of that method producing nothing should not leave a misleading name behind.
Two problems here are genuinely quantum-shaped, and both are microstructure questions with a quantum solver rather than the reverse:
- Selection under an action budget. Hyperliquid meters actions against traded volume — 1 action per 1 USDC cumulative — making rebalancing a hard-bounded resource with no equivalent in traditional finance. Multi-period selection under that constraint is a QUBO. (EXP-001, pre-registered, not run.)
- Tail risk of liquidation cascades. Quantum amplitude estimation offers a payoff-agnostic quadratic speedup, so its relative value is greatest where classical Monte Carlo struggles. The honest deliverable is a resource estimate — when would this matter — not a claimed speedup.
The state of the field is that no quantum advantage has been demonstrated for portfolio optimisation (arXiv:2509.17876), and quantum ML loses to tree ensembles on DeFi data (arXiv:2508.02685) — which is why quantum-kernel prediction is out of scope. What published work in this area lacks is not cleverness but tuned classical baselines, sealed holdouts, and pre-registration. That gap is the opening, and it is the same discipline this repo already applies.