Uniswap v4 hook

Airbag

Impact protection for limit orders. It pays a resting maker for the price displacement caused by the swap that filled them — and, like a real airbag, it only deploys on impact.

UHI10 Hookathon oracle-free no keeper 66 tests live app
The problem

A resting limit order is a free option written to the market

You place an order: sell ETH at 1,866. It rests, waiting. A large trade arrives and does not merely touch your price — it blows through and keeps going to 1,875.

You got your price. Formally, nothing went wrong. But the extra move was captured by whoever ran through you, and it only existed because your order was sitting in the way.

18751872 18691866 1863 your order rests here displacement — what Airbag charges for you are filled here the market ends up here
Crossing your own range is the fill, at the price you asked for. Only what lies beyond the far edge is displacement — which is why the charge is measured from there and not from your near tick.
The mechanism

Measured in the same transaction, from the pool's own tick

Measure

How far past your price the fill pushed the market. One tick is one basis point, so it is exact integer arithmetic — no price reconstruction, nothing to round.

Charge

A capped share of the overshoot, taken from the swap that caused it, and only on the part the pool fee did not already cover.

Credit

To that specific maker's order, held as an ERC-721. Comparable designs pay the pool at large; this pays the person who was run over.

Nothing is read at a later block. A future price is a value the filler themselves could write, which is precisely why deferred settlement is not part of this design.

Why the threshold is the pool's own fee

A maker filled by an ordinary swap already collected the fee on their own fill. Below that line they are not out of pocket, so the hook stays silent. Benign flow pays nothing without a special case existing for it — the threshold falls out of the measurement rather than being tuned.

Evidence

Is the overshoot worth collecting at all?

Measured before any contract was written, over 30 days of Base WETH/USDC — 253,135 swap events, ~11,400 simulated fills. The same median came out of three independent pools and two time windows.

2.0bps median displacement — under the fee, so nothing is charged
22.5%of fills land in the tail
24bps mean displacement in that tail
3independent pools agreeing

The median fill is not the product. The tail is.

Then replayed through the contract itself

48 hours of that same history, driven tick-for-tick through AirbagHook in a fork test, so the number comes from the contract rather than from a model of it.

Replaying real Base historyValue
Swaps replayed1,055
Orders filled611
Of which compensated280
Rebate, median3 bps
Rebate, p9048 bps
Rebate, maximum199 bps

More than half of all fills cost the swapper nothing. That is the design working, not failing. The maximum landing at 199 against a 200 bps cap is a useful sanity check: the ceiling binds and nothing slips past it.

Stated with the numbers rather than under them: this 48-hour window is roughly three times more volatile than typical. The 30-day figures above remain the representative ones.
Honesty

Where it stops

Two adversarial audits ran before anything was deployed. They raised 65 findings; 48 survived independent refutation, and eight were blockers. All eight are closed. The rest are written down rather than quietly left.

Size guards read instantaneous liquidity

Manipulable by adding liquidity in the same transaction. Doing better needs a time-weighted measure of depth, which cannot be read in-transaction without an oracle — and being oracle-free is the point, not an accident. The damage is bounded elsewhere: the charge can never exceed what the paying swap received.

The block's fill list holds 32 orders

Past that, a filler who saturates it can split their swap and escape the top-up. The real fix keys on ticks rather than orders. Until then the overflow emits an event, so the gap is observable from the first block rather than invisible.

Truncation costs compensation, never principal

A swap settles a bounded number of fills. Anything left is recoverable by anyone through settleFills — but no swap is present at that point to charge, and inventing a payer would be worse than admitting the gap.

The maker was not robbed

They got their limit price. Airbag returns the part of the move their own order made possible. On a median fill the maker is already net positive and the hook correctly pays nothing.