Dynamic fee hook on Ethereum

Uniswap v4 Hook Contract 0x10300de01cef706a3b2fe10b45395069e6144088 on Ethereum · Dynamic fee

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

What it does

A Uniswap v4 hook that applies a configurable dynamic fee to swaps on pools it is registered to, with owner-controlled pool settings.

How it works step by step

  • Runs beforeSwap on swaps in pools that are enabled for this hook
  • Sets a dynamic LP fee per pool, capped by MAX_LP_FEE
  • Takes a hook fee from swap amounts, capped by MAX_HOOK_FEE_BPS, via return delta
  • Stores per-pool configuration keyed by pool id in storage
  • Lets the owner enable or disable pools and withdraw accumulated tokens
Swap behaviour
beforeSwap runs on every swap in an enabled pool, sets the LP fee and may take a hook fee through return deltas before the swap executes.
Liquidity behaviour
No liquidity callbacks are enabled for this hook; beforeAddLiquidity and beforeRemoveLiquidity selectors exist in the ABI but the address permissions only enable swap callbacks.
Fee behaviour
Pools registered with this hook have fees set through setPoolFee and updateDynamicLPFee-style calls, with a MAX_LP_FEE bound and a MAX_HOOK_FEE_BPS bound; the hook can also take a fee from swaps via return deltas.
Owner & admin controls
Owner-gated functions include setPoolEnabled, setPoolFee, withdrawToken and the owner() getter; an executor address is also exposed. Selector-only evidence, no source to confirm modifiers or timelocks.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap is used to adjust swap pricing or fees for registered pools; beforeSwapReturnDelta lets the hook take a share of the swap amount, so it can move currency during swaps.

Security & trust assessment

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

Who controls it: The owner can enable or disable pools, change pool fees within the configured bounds and withdraw tokens held by the hook, so a privileged key can alter trader costs and drain balances held in the contract.

Risk to user funds: The hook takes currency via return deltas during swaps and holds balances that the owner can withdraw with withdrawToken, so user funds routed through pools using this hook depend on the owner not abusing those powers.

Security findings

  • [medium] Owner can change fees and withdraw hook balances: Owner-only setPoolFee and withdrawToken selectors are present, so the owner can change fees on registered pools and remove tokens the hook holds.
  • [medium] Return delta lets hook move currency during swaps: beforeSwapReturnDelta permission means the hook settles part of swap deltas itself, using take, settle and transfer calls, which adds a path where tokens move through the hook.
  • [info] Per-pool configuration stored on chain: Storage slot 0 is a mapping keyed by uint256 and written in swap, pool-config and fee setters, indicating per-pool configuration that the owner controls.
  • [info] Unverified source limits analysis: No verified source is available, so the exact fee formula, bounds enforcement and upgrade mechanism cannot be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
13,701 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, return-delta

Pools using Dynamic fee hook