Aven

Uniswap v4 hook pricing every swap from Hyperliquid's in-block oracle, so LPs stop losing to arbs

ETHGlobal MumbaiShipped November 5, 2026Prize winner Shipping#defi#gaming#infra#security#uniswap
Visit Repo
Aven banner

About

Aven is a Uniswap v4 dynamic-fee hook on HyperEVM that charges each swap a fee based on Hyperliquid's live perp market, read in the same block as the swap.

THE PROBLEM

An AMM's price only moves when someone trades against it. When the market moves elsewhere, the pool goes stale, and arbitrageurs buy cheap or sell high against LPs at the same low fee. LPs lose that value (loss-versus-rebalancing, LVR). A fixed fee charges arbitrage and ordinary flow the same. Existing dynamic-fee hooks, such as Uniswap's VolatilePairHook, learn from the pool's own past trades, so they react after the damage is done. Oracle-based designs need a relayer, a keeper or a signer you have to trust.

THE IDEA

Aven reads the market's present. HyperEVM gives smart contracts in-block access to Hyperliquid's perp oracle and mark prices through precompiles (0x807, 0x806). HyperCore and HyperEVM share one consensus, so there is no relay, no signer and no cross-chain delay. The fair price is already chain state.

On every swap, AvenHook reads both prices and computes three signals: 1. Fair-value gap: how far the pool's price is from the oracle, anchored to the top of the block. Charged only when the swap moves the pool toward fair, i.e. when it is arbitrage. 2. Perp premium: mark vs oracle. Charged when the swap trades with perp-market pressure. 3. Mark stress: how far the mark has moved from a time-weighted anchor (tau = 60 s). Charged above 50 bp.

fee = clamp(0.05% base + gap term + premium term + stress term, 0.05%, 1%). The fee goes to LPs. Ordinary flow pays 0.05%; an arbitrageur closing a 1.5% gap pays up to 1%. If a price read fails, the swap never reverts: it pays a 0.30% fallback fee. Every input is emitted in a FeeComputed event, so anyone can recompute every fee.

There is no owner, admin key, keeper, proxy, upgrade path or custody. Every config value is immutable. Two anti-gaming rules: a top-of-block gap anchor (splitting an arb into many swaps in one block doesn't lower the fee) and a time-weighted mark anchor (a dust swap can't reset the stress term).

LIVE ON HYPEREVM MAINNET (chain 999)

AvenHook 0xfdd13cA6D7FcF4Ca710Bc8C77546592F42CF6080, deployed on Uniswap's own canonical v4 PoolManager. In the first live test, a shock pushed two identical pools about 188 bp off the oracle. The bot's arbitrage paid 9,950 pips (0.995%) on the Aven pool vs 3,000 (0.30%) on the plain control pool, so Aven LPs kept $97.25 more. That fee was recomputed off-chain from the event and matched exactly. Uniswap's own V4Quoter and Universal Router also route through the Aven pool.

REPLAY ON REAL HISTORY

We replayed the Oct 29 2026 Binance-halt window (Hyperliquid mainnet data) through four identical pools. LP value vs holding: fixed 0.05% -$318, fixed 0.30% +$7, Aven with a 60 s-delayed price +$114, Aven live +$141. Live beats delayed, so the edge comes from reading the market in-block. On a calm day, Aven roughly matches fixed 0.30% while charging ordinary trades only 0.05%. No parameters were tuned on this data.

THE APP

A web app with a trade terminal (market, limit, stop and TP/SL orders on the pools), swap, add liquidity, a live dashboard that shows the fee repricing in the same block as the oracle moves, the replay, an on-chain ledger and portfolio, and in-browser verification of any Aven swap.

Limits: the pools trade open-mint demo tokens (aETH/aUSD), but the prices the hook reads are real Hyperliquid prices. There has been no third-party audit; our internal security review is in docs/SECURITY.md.

Prizes

  • Uniswap Foundation · Build with Uniswap · 3rd place

From the public ETHGlobal showcase page. Votes, swipes and the judge score are hackfeed's own.

AI judge

7.6

Aven is a live Uniswap v4 dynamic-fee hook using Hyperliquid's in-block oracle to reduce LP arbitrage losses.

Originality7
Execution8
Usefulness7
Clarity8

nvidia/nemotron-3.5-super-vl via OpenRouter, Nov 17. Judged from this page only.

Still being built?

ShippingLast push 20 days ago

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.

StoikovHook

Uniswap v4 hook that sets fees like a market maker: higher in volatile markets, skewed by direction

Adaptive Hook AMM

Uniswap v4 dynamic-fee hook that neutralizes sandwich attacks & LVR via intra-block MEV dampening.

OniBlock

Uniswap v4 hook where an AI prices toxic arbitrage every block, and loses power if it's wrong.

AsymmetricFeesHook

It’s a Uniswap v4 hook inspired by Nezlobin’s Directional Fee, designed to make LPs more profitable by dynamically adjusting the pool fee.