Dynamic fee hook on Ethereum
Uniswap v4 Hook Contract 0xfb9711dc16f0b89eacf5145d6c4e2656122228cc on Ethereum · Dynamic fee
- Volume (24h)
- $5.00
- Value locked (TVL)
- $4.88
- All-time volume
- $5.00
- Pools using this hook
- 1
- Swaps (24h)
- 3 (1 traders)
- Total swaps
- 3
What it does
This hook skims a per-pool swap fee from every trade in registered pools, splitting it between the pool creator and a protocol recipient for later collection, while LPs can add (in registered pools) and withdraw freely.
This read was written for the hook 0xeedf…28cc on Base and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.
How it works step by step
- Charges a hook-level fee on swaps in registered pools, taken from swap amounts via return deltas.
- Fee rate per pool comes from a stored config (current fee readable on-chain); a share (CREATOR_BPS) goes to a pool creator, with the rest accruing to a pot or fee recipient.
- Accrued fees are tracked as owed balances and can be withdrawn later through a collect function.
- An admin can register approved 'spoke' addresses that are allowed to set up pools; pools must be registered or initialization and liquidity adds revert.
- LP withdrawals are never touched by the hook.
- Swap behaviour
- On each swap the hook looks up the pool's fee and deducts it from the swap input or output using return deltas, recording amounts owed to the creator and fee recipient. Exact fee levels and caps are not verifiable from bytecode, though a BadFee check suggests fees are bounded by some maximum.
- Liquidity behaviour
- Adding liquidity is checked only to confirm the pool is registered with the hook. Remove-liquidity callbacks are disabled, so LPs can always withdraw freely.
- Fee behaviour
- A per-pool swap fee (in pips, validated against a maximum) is skimmed from swaps and split between a pool creator (fixed creator share) and a protocol fee recipient/pot; exact percentages are unknown from bytecode.
- Owner & admin controls
- The admin can change the admin address and approve spoke addresses; spokes or registered parties configure pool fees and fee recipients within a BadFee-checked limit whose exact cap cannot be confirmed from bytecode.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize: only allows pools created via approved spokes/registered configs; beforeAddLiquidity: rejects liquidity for unknown pools; beforeSwap: computes and takes the fee on exact-input side; afterSwap: takes fee on the output side and records owed amounts; beforeSwapReturnDelta/afterSwapReturnDelta: lets the hook deduct its fee from swap amounts.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, medium confidence).
Who controls it: An admin key controls which spokes can register pools and can transfer admin rights; pool configurers set fees subject to an unverified cap.
Risk to user funds: Only the swap fee portion of trades is taken and held as claimable balances; the exact maximum fee is unknown from bytecode. LP principal stays in the PoolManager and cannot be locked or drained.
Security findings
- [medium] Swap fee via return deltas: The hook deducts fees directly from swap amounts; the maximum fee is checked but its exact value is not visible in unverified bytecode.
- [info] LP withdrawals unrestricted: Remove-liquidity callbacks are disabled, so the hook cannot block or charge LP withdrawals.
- [info] Not upgradeable: Direct contract with no proxy, so logic cannot be swapped.
Contract details
- Verified source
- No
- Bytecode size
- 6,831 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta, self-unlock
Pools using Dynamic fee hook
- USDC / TEST (0.00% fee) — 24h volume $5.00, TVL $4.88, 3 swaps today