Dynamic fee hook on BNB Chain

Uniswap v4 Hook Contract 0x3e537686c5662a1c6348732b64632f8f995780c4 on BNB Chain · Dynamic fee

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

What it does

A dynamic-fee hook that charges swap fees chosen from tiered rates based on gas price, and takes a share of swap output for the owner to withdraw.

How it works step by step

  • Sets a swap fee in beforeSwap from defaultFee or one of three tier fees depending on gas conditions
  • Counts swaps per pool in a mapping keyed by pool id in afterSwap
  • Takes a share of swap output via afterSwapReturnDelta and accumulates it in the hook
  • Lets the owner pause swaps through setPaused
  • Lets the owner adjust fee tiers and the gas threshold
  • Lets the owner withdraw tokens held by the hook
Swap behaviour
beforeSwap reads the paused flag, gas threshold and fee tiers to set the swap fee; afterSwap increments a per-pool swap counter and can apply a return delta that moves part of the output to the hook.
Liquidity behaviour
No liquidity callbacks are enabled by permissions; the decoded beforeAddLiquidity/afterRemoveLiquidity selectors are not part of the active permission set.
Fee behaviour
Fees are tiered: tierOneFee, tierTwoFee and tierThreeFee are read in beforeSwap alongside defaultFee and a gas threshold, so the hook appears to set a dynamic LP fee per swap based on tier and transaction gas price, with the owner able to reconfigure tiers via 0xca14a65b.
Owner & admin controls
Owner (slot 0) can setPaused, setGasThreshold, updatePool-style fee configuration via selector 0xca14a65b (tier fees, thresholds, gas parameters), transferOwnership, and withdraw tokens held by the hook. Owner also has a function 0xf3fb9437 writing a bool in slot 3, likely a flag toggle.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, afterSwapReturnDelta

beforeSwap sets the dynamic fee for each swap, afterSwap updates per-pool swap counters (mapping in slot 4 keyed by pool id) and may apply a return delta, and afterSwapReturnDelta lets the hook take a portion of the swap output as a delta.

Security & trust assessment

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

Who controls it: The owner can change all fee tiers and the gas threshold, pause swaps, transfer ownership, and withdraw funds the hook holds, so a compromised owner key could raise fees or drain accrued tokens.

Risk to user funds: The hook can take a portion of swap output via return delta and holds those tokens until the owner calls withdraw, and an owner pause can block swaps; user principal in LP positions is not directly controlled by the hook since liquidity callbacks are disabled.

Security findings

  • [medium] Hook holds and can withdraw user-derived tokens: afterSwapReturnDelta allows the hook to take tokens from swap output; the owner can withdraw accumulated balances through withdraw(address,address,uint256).
  • [medium] Owner can pause swaps: setPaused is callable by owner and paused() is checked in swap path, so the owner can halt all swaps on this pool.
  • [medium] Owner-adjustable fee tiers: Owner can set tier fees and the gas threshold through setGasThreshold and the fee configuration selector, with no visible bounds in the decoded code.
  • [info] Single owner key: Owner is stored in a plain slot with transferOwnership and no timelock or multisig evidence in the bytecode.

Contract details

Verified source
No
Bytecode size
8,666 bytes
Upgradeable proxy
No
Detected patterns
ownable, pausable, return-delta

Pools using Dynamic fee hook