Dynamic fee hook on Base

Uniswap v4 Hook Contract 0xef8f0fe5ddaddafe51889588703b716a89b0d4c0 on Base · Dynamic fee

Volume (24h)
$1.00K
Value locked (TVL)
$1.47K
All-time volume
$357.01K
Pools using this hook
18
Swaps (24h)
110 (37 traders)
Total swaps
14,691

What it does

A Uniswap v4 hook that applies a configurable dynamic fee to swaps for registered pools, with owner-managed pool registration and parameters.

How it works step by step

  • Registers pools and their configuration when they are initialized (afterInitialize)
  • Sets a dynamic LP fee before each swap (beforeSwap)
  • Updates hook bookkeeping after each swap (afterSwap)
  • Tracks liquidity additions after they occur (afterAddLiquidity)
  • Maintains per-token pool lists and whitelist-style enable flags
  • Restricts configuration changes to the owner and executor roles
Swap behaviour
beforeSwap and afterSwap are enabled. beforeSwap likely sets a dynamic LP fee from stored per-pair parameters, and afterSwap updates hook state after the swap.
Liquidity behaviour
afterAddLiquidity is enabled and reads per-pair configuration; beforeAddLiquidity and beforeRemoveLiquidity selectors exist but are not enabled as hook permissions. Liquidity removal callbacks are not enabled.
Fee behaviour
Hook has the dynamic-fee tag and calls updateDynamicLPFee on the pool manager path, so the LP fee is likely set dynamically per pair from stored per-pair values (mappings for uint24 and uint16 parameters in slots 8 and 9), but the exact formula cannot be determined without source.
Owner & admin controls
Owner (storage slot 2) can change the owner via changeOwner, change the executor address via changeExecutorAddress, enable or disable addresses via 0x45b1bf7c and 0x6934c2e6 (likely whitelist or pool-enable flags), and configure per-pair parameters via the 0x0f631371 and 0x161ba132 setters. Callers of 0xace25c0e and 0xd6b8604c manage token pool lists.

Enabled Uniswap v4 callbacks

afterInitialize, afterAddLiquidity, beforeSwap, afterSwap

afterInitialize: runs once when a pool is initialized, likely to register the pool and its parameters. afterAddLiquidity: runs after liquidity is added, likely to update pool bookkeeping. beforeSwap: runs before each swap, likely to compute and return the dynamic fee override. afterSwap: runs after each swap, likely to update state or pool statistics.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, low confidence).

Who controls it: The owner and executor roles can change core parameters and whitelist status, which could alter fees charged to swappers or affect which pools the hook serves. A compromised owner key could change configuration for live pools.

Risk to user funds: The hook does not appear to hold tokens directly based on the decoded permissions, but the dynamic fee configured by privileged roles affects swap outcomes. Return-delta permissions are not listed, so the hook is not indicated to take tokens from swaps, though this is not confirmed.

Security findings

  • [medium] Privileged owner and executor roles: Owner can change owner and executor, and set enable or whitelist flags. These privileged roles control hook behaviour for all pools that use it.
  • [medium] Owner-configurable dynamic fee: beforeSwap is enabled and hook fee logic is configurable by the owner through stored per-pair values, so a malicious or erroneous parameter change could set high fees on swaps.
  • [info] Unverified source: No source is available, so the exact fee formula, access checks and upgrade mechanics could not be verified from bytecode alone.

Contract details

Verified source
No
Bytecode size
16,504 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Dynamic fee hook