Sentinel: a Uniswap v4 hook that prices adverse selection — failed its first test publicly, then passed the holdout. Full research arc + interactive lab inside. #1
chaosxcode
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TL;DR
We built a Uniswap v4 hook that keeps LP fees at 0.05% in calm markets and raises them continuously toward 1% when informed flow is bleeding liquidity providers. Our first signal failed its pre-registered test — we published the failure — the post-mortem showed us where the signal actually lives, and the rebuilt policy passed a locked 7-month holdout evaluation on all three pre-registered bars. Live on Unichain Sepolia at 14k gas. Play with it: Sentinel Lab.
The problem we measured first
Before building anything, we ran a pre-registered study on 123 sampled days of Unichain mainnet: 2,536,933 labeled trades across the deepest native-ETH/USDC v4 pool. Liquidity providers paid adverse-selection costs on 126 of 126 active days. The worst 10% of five-minute windows carried ~80% of all losses. If you LP on volatile pairs, you're selling insurance at a flat price against a spiky risk.
The honest failure
Our first signal — the thing that was supposed to predict which trades hurt LPs — scored ρ ≈ 0.02 against a pre-registered bar of 0.15. Dead. We published the failure exactly as committed, with seeds, exclusions, and methodology, because a research program that only publishes wins is marketing.
What the data actually showed
Zoom out from trades to time windows and the signal appears: trailing losses predict next-window losses at ρ = 0.61. Toxic flow clusters. A fee doesn't need to predict individual trades — it needs to know when to be high. So v2 is a continuous policy:
No oracle, no keeper, computed entirely from the hook's own state.
The holdout
Seven months of data the policy never saw (Jan–Jul 2026, 1,243,673 labeled trades), evaluated exactly once under a protocol frozen before ingestion:
Security
100,000-step stateful fuzz campaign, zero invariant violations. We also attacked our own signal and published the results: wait-out dodges work once (disclosed), volatility poisoning costs the attacker 3.29 units/3min with zero revenue, and split-trading a large order is not cheaper. Dossier: docs/SECURITY.md.
Try to break it
The Lab lets you replay 25k real labeled trades through the fee engine with your own parameters, and polls our deployed testnet contract live. In our sweeps, 18/18 configurations beat static — if you find ones that don't, that's research: post your sliders.
Links
Feedback welcome — especially on the holdout methodology and the pilot design (research/PILOT_DESIGN.md). Mainnet pilot is frozen and waiting on an independent security review.
All reactions