Dynamic fee hook on Ethereum

Uniswap v4 Hook Contract 0x23d11bf40eb3162de69924b6ca4960c0fa3e80c4 on Ethereum · Dynamic fee

Volume (24h)
$311
Value locked (TVL)
$64.19K
All-time volume
$311
Pools using this hook
1
Swaps (24h)
8 (6 traders)
Total swaps
8

What it does

A keeper-driven dynamic-fee hook in which traders pay a pushed or default LP fee plus a treasury hook fee, both of which operators can set to nearly 100%, while LPs can always withdraw freely.

This read was written for the hook 0x1b99…40c4 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

  • Lets an off-chain keeper (pusher) set the LP fee for each configured pool, within a min/max band chosen by an operator.
  • Pushed fees expire after a set time (at least 1 minute); when they expire the pool falls back to a default fee.
  • Charges an extra hook fee on every swap, taken from the swap's unspecified side and credited to a fixed treasury address.
  • Swaps revert in any pool that an operator has not configured yet.
  • Never runs on liquidity adds or withdrawals, so LPs can add and remove freely.
Swap behaviour
Before each swap the hook sets the LP fee to the live pushed fee, or to the default fee if the pushed one has expired. After the swap it takes a separate hook fee from the unspecified amount (output on exact-input swaps, input on exact-output swaps) and credits it to the treasury. Swaps revert if the pool has no fee configuration.
Liquidity behaviour
No liquidity callbacks; LPs can add and withdraw freely.
Fee behaviour
The LP fee goes to LPs and can be set anywhere below 100%. The hook fee goes to the treasury and can be anywhere from 0% to just under 100% of the unspecified swap amount, set by an operator with no meaningful cap. Traders pay both fees combined.
Owner & admin controls
The owner manages operators. Operators and the owner can add pushers and set each pool's fee band, default fee, fee lifetime and hook fee, with the LP fee and hook fee each capped only below 100%. Pushers and the owner can push any fee inside the band at any time, with no step limit or cooldown.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, afterSwapReturnDelta

beforeSwap: overrides the LP fee with the pushed or default fee; afterSwap: computes the hook fee; afterSwapReturnDelta: deducts that hook fee from the swap and mints it to the treasury.

Security & trust assessment

Risk level: high, estimated (decoded bytecode, high confidence).

Who controls it: Not stated.

Risk to user funds: Not stated.

Security findings

  • [high] Hook fee effectively uncapped: Operators can set the treasury hook fee up to 99.9999% of a swap's unspecified amount. That could take almost all of a trader's output.
  • [medium] LP fee band can be near 100%: The min/max LP fee band is only required to stay below 100%. Pushers can move the fee anywhere inside the band instantly, with no cooldown.
  • [low] Unconfigured pools cannot swap: Swaps revert until an operator sets a default fee for the pool.
  • [info] LP withdrawals unrestricted: The remove-liquidity callbacks are disabled, so the hook cannot block withdrawals or charge LPs.

Contract details

Verified source
No
Bytecode size
9,010 bytes
Upgradeable proxy
No
Detected patterns
ownable, return-delta

Pools using Dynamic fee hook