Dynamic fee hook on Avalanche

Uniswap v4 Hook Contract 0x921c0d13bf7be2303cf684c596efff250f7cc088 on Avalanche · Dynamic fee

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

What it does

A pausable Uniswap v4 hook on Avalanche that runs logic before each swap, with an owner-settable per-pool fee and a pause switch, and can take a return delta on swaps.

How it works step by step

  • Runs a custom check or adjustment in beforeSwap, the only swap callback enabled by the address permissions.
  • Stores an owner-settable fee per pool (setPoolFee takes a pool id and a uint24 fee), which suggests fee-based logic in the swap path.
  • Has a pause flag (setPaused, paused) that the swap path reads, so swaps can be halted while it is set.
  • Uses beforeSwapReturnDelta, meaning the hook can return a delta that changes the amounts settled for the swap, not just its fee.
  • Tracks a pool registry (allPools, getPoolCount, pools, isPoolRegistered) and an owner-controlled poolManager/execute path, suggesting it manages its own set of pools.
  • Liquidity, donate, initialize and afterSwap callbacks are present as functions but are not enabled by the address permissions, so they do not run in the pool.
Swap behaviour
beforeSwap is invoked on every swap in pools using this hook. It reads the pause flag and the per-pool fee mapping, and it can return a delta that alters the swap settlement. The exact arithmetic cannot be read without source.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
The owner can set a fee per pool through setPoolFee, and beforeSwap likely applies it. The bytecode does not confirm whether this overrides the pool's static fee or is added to it.
Owner & admin controls
The owner (storage slot 0, set via setOwner) can pause all swaps through setPaused, set per-pool fees through setPoolFee, and call execute to make arbitrary external calls. Ownership can be transferred to any address with no timelock visible in the bytecode.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: runs the custom swap logic, including the pause check and per-pool fee lookup. beforeSwapReturnDelta: lets the hook alter the amounts settled for swaps, which can move value relative to the pool's standard accounting.

Security & trust assessment

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

Who controls it: A single owner key can pause trading, set fees on any registered pool, and execute arbitrary calls as the hook. This is full administrative control over the hook.

Risk to user funds: The hook can block swaps via the pause flag and alter swap settlement through its return delta. The execute function may let the owner move assets the hook holds. Liquidity providers' funds sit in the pool manager and are not directly controlled by the hook from the decoded callbacks.

Security findings

  • [medium] Owner can pause swaps: setPaused toggles a flag that beforeSwap reads, so the owner can stop all swaps in pools using this hook.
  • [medium] Owner can set arbitrary pool fees: setPoolFee(bytes32,uint24) lets the owner set any fee value per pool. Without a visible cap in the decoded code, a very high fee would effectively block trading.
  • [high] Generic execute function: execute(address,uint256,bytes) is a nonpayable owner-callable function that performs an arbitrary external call with value. This can move tokens or ETH held by the hook or interact with pools on its behalf.
  • [medium] Return delta can alter settlement: beforeSwapReturnDelta lets the hook change the swap's settled amounts. The actual size and direction of any delta cannot be confirmed from bytecode alone.
  • [low] Ownership transfer without visible delay: setOwner(address) appears to change the owner immediately, so a compromised key could take full control at once.

Contract details

Verified source
No
Bytecode size
19,022 bytes
Upgradeable proxy
No
Detected patterns
pausable, return-delta

Pools using Dynamic fee hook