Dynamic fee hook on Ethereum

Uniswap v4 Hook Contract 0xf1064ad0c2d8472e6bb47c9bc058b1f26604e888 on Ethereum · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

A Uniswap v4 hook that appears to set swap fees dynamically and route swaps and liquidity through an external Fluid liquidity layer, with the ability to settle currency directly during swaps.

How it works step by step

  • Enables beforeInitialize, beforeAddLiquidity, beforeSwap and beforeSwapReturnDelta callbacks on the pool
  • Reads and writes a uint24 fee parameter stored in slot 0 to set swap pricing
  • Calls external swap, quote and liquidity functions (fluidPool, fluidLiquidity, swapIn, estimateSwapOut)
  • Uses take, settle and transferFrom to move tokens during swaps, so it can return a custom delta
  • Exposes a tokenJar and pollTokenJar, suggesting fee collection or protocol fee routing
  • Includes an expiryBlock and version getter, indicating a time-limited or versioned deployment
Swap behaviour
beforeSwap is enabled and returns a delta, so the hook can settle swap amounts itself, read a stored fee parameter, and call external swap and estimate functions (swapIn, swapOut, estimateSwapIn/Out) on a liquidity pool before the pool executes the swap.
Liquidity behaviour
beforeAddLiquidity is enabled and the hook exposes beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity selectors; the hook appears to interact with a Fluid liquidity layer (fluidPool and fluidLiquidity getters), suggesting liquidity is routed or managed externally rather than held directly by the pool.
Fee behaviour
The hook writes a uint24 value into storage slot 0 via selector c5cda8d2 and reads it during beforeSwap and quote, suggesting the swap fee is set or adjusted dynamically by the hook rather than using a static pool fee; the exact fee formula is not determinable from the decoded data.
Owner & admin controls
Storage slot 0 holds an address (likely admin or a pool/token jar reference) and a uint24 fee value that can be written via selector c5cda8d2, which appears to set a fee parameter; the admin() getter (f851a440) exists but whether a privileged caller can update the fee cannot be fully confirmed without source. pollTokenJar (3f7d1179) and dexCallback (9410ae88) are nonpayable and may be restricted by caller checks, which could not be verified from bytecode alone.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta

beforeInitialize initializes internal state (slot 2 and 3 written during initialization). beforeAddLiquidity gates or processes liquidity additions. beforeSwap performs custom swap logic and returns a delta, letting the hook settle swap amounts itself. beforeSwapReturnDelta means the hook can take or give currency during swaps, so it can move pool funds directly.

Security & trust assessment

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

Who controls it: A privileged admin key (admin getter present) plausibly controls fee-related storage and can trigger token jar or callback paths; the extent of its power is unverified without source.

Risk to user funds: Because beforeSwapReturnDelta is enabled and the hook can call take, settle and transferFrom, it can hold, move or net swap amounts; a malicious or buggy implementation could divert swap proceeds, though exact behaviour cannot be confirmed without source.

Security findings

  • [medium] Hook moves currency during swaps: beforeSwapReturnDelta is enabled and the bytecode includes take, settle and transferFrom selectors, so the hook can move user and pool tokens during swaps.
  • [medium] Mutable fee parameter in storage: Slot 0 holds an address and a uint24 that are written by selector c5cda8d2, indicating a fee or parameter that a function may be able to change.
  • [medium] Privileged functions unverified: Selectors for admin(), pollTokenJar and dexCallback exist; whether they are access-controlled is not determinable from the bytecode alone.
  • [info] Expiry block present: Expiry block getter and a version getter are present, suggesting time-limited operation that could change behaviour at a set block.

Contract details

Verified source
No
Bytecode size
12,442 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Dynamic fee hook