Hippocampus on Ethereum

Uniswap v4 Hook Contract 0x0ee851f1fe2f4bdba79fee78969e329c136ca0cc on Ethereum · Dynamic fee · Verified contract

Volume (24h)
$661
Value locked (TVL)
$1.56K
All-time volume
$1.49M
Pools using this hook
1
Swaps (24h)
8 (8 traders)
Total swaps
6,534

What it does

A Uniswap v4 hook for the ETH / ENGRAM pool that sets each swap's fee with an on-chain pricing model and takes a 1.04% hook fee split between the owner and a trainers' pot.

How it works step by step

  • Prices each swap's LP fee from a bounded on-chain model: 0.30% plus the predicted markout, clamped to 0.05% to 3.00%.
  • Takes a 1.04% hook fee on the ether leg via return deltas, minted as ERC-6909 claims.
  • Splits the hook fee: 1.00% claimable by OWNER, 0.04% accrued to a trainers' pot paid only to winners named by the Dreams.
  • Queues trades of 0.005 ETH or more, labels each after eight later trades, and appends it to a hash-chained trace.
  • Updates a per-trader memory average of markouts that feeds the next fee prediction.
  • Pins the pool to one native ETH / ENGRAM pool and refuses swaps that end out of range or in an empty pool.
Swap behaviour
On every swap the hook computes ten features from pool depth, timing, flow, volatility, trend and the trader's memory, feeds them to the champion mind to set the LP fee between 0.05% and 3.00%, and takes a 1.04% fee on the ether leg. Trades of at least 0.005 ETH are queued and later labelled with their realised markout.
Liquidity behaviour
No liquidity callbacks. Adding and removing liquidity does not touch the hook.
Fee behaviour
Sets a dynamic LP fee per swap: 0.30% plus the champion mind's predicted markout times 100, clamped to 0.05% to 3.00%. Takes a hook fee of 1.04% of the ether leg: 1.00% to OWNER and 0.04% to the trainers' pot, minted as ERC-6909 claims and paid out later.
Owner & admin controls
No owner, settings, pause or upgrade functions. The Dreams contract can call setChampion to change the pricing mind and payPot to pay pot winners. OWNER (immutable) can be paid via payOwner, which anyone may call; OWNER cannot change parameters.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize restricts the pool to native ETH / ENGRAM with dynamic fee and tick spacing 60 and binds it once. beforeSwap computes features, prices the LP fee, and takes the hook fee. afterSwap checks for partial fills and empty pools, tallies fees, and records the trade for later labelling. beforeSwapReturnDelta and afterSwapReturnDelta let the hook take its fee as a return delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: Only the Dreams contract can change the champion mind and pay pot winners; the Dreams are the single point of control over pricing and pot payouts. No owner key can change fees or pause swaps.

Risk to user funds: The hook holds ERC-6909 claims on ether minted from fees and pays them to OWNER or pot winners; it does not custody user principal beyond the fee it takes. Pot payouts are limited to the pot balance by payPot.

Security findings

  • [info] Fixed hook fee taken on every swap: The hook takes 1.04% of every swap's ether leg through return deltas and mints claims for it, so user input is reduced on every swap by design.
  • [low] Pricing mind replaceable by Dreams: setChampion lets the Dreams contract replace the fee-pricing mind; the fee is bounded to 0.05% to 3.00%, so a bad mind limits but cannot break swaps.
  • [low] Swaps can revert on empty or out-of-range pool: afterSwap reverts if the price ends outside tick range or pool liquidity is zero, so swaps can be refused under those conditions.
  • [info] Trader memory keyed by tx.origin: Memory is keyed by tx.origin, so relayers and bundlers share one memory and rotating addresses reset it; this affects prediction quality, not fund custody.

Contract details

Verified source
Yes (Hippocampus)
Compiler
solc 0.8.28+commit.7893614a
Bytecode size
11,484 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta, self-unlock

Pools using Hippocampus