Dynamic fee hook on BNB Chain

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

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

What it does

A Uniswap v4 hook that sets a dynamic swap fee based on pool state, with router whitelisting and a circuit breaker that can restrict trading.

This read was written for the hook 0x6201…40c0 on Robinhood Chain and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Sets a dynamic LP fee per swap via updateDynamicLPFee, bounded by MAX_DYNAMIC_FEE
  • Applies a PENALTY_FEE in some conditions
  • Tracks per-pool state and the last recorded tick after swaps
  • Restricts swap callers through a router whitelist
  • Can halt swaps through a toggleable circuit breaker with a threshold value
  • Stores parameter values the owner can update
Swap behaviour
beforeSwap computes a dynamic fee (capped by MAX_DYNAMIC_FEE, with a PENALTY_FEE path) and checks router whitelist and circuit breaker state; afterSwap records updated tick and pool state.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fee is set dynamically by the hook (via updateDynamicLPFee in the bytecode) with a MAX_DYNAMIC_FEE cap and a PENALTY_FEE path, apparently tied to tick movement or swap size; exact formula cannot be determined without source.
Owner & admin controls
Owner (slot 0) can whitelist routers (setWhitelistedRouter), set the circuit breaker on/off with a threshold (setCircuitBreaker), set parameters via 0xbb2199eb and 0x6b5bae80 (uint24 storage), and set tick bounds via 0xdc2e70b9 (int24,int24). Owner can be transferred via 0x915ca4bf or similar. Likely no pause or upgrade mechanism identified from the selectors.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap

beforeSwap: computes and applies the dynamic LP fee and checks router whitelist and circuit breaker state before a swap. afterSwap: updates stored tick and pool state after a swap.

Security & trust assessment

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

Who controls it: The owner can whitelist routers, enable or disable the circuit breaker, and change fee-related and tick-related parameters, which can change the fee users pay or restrict which routers can trade.

Risk to user funds: The hook does not appear to hold pool tokens directly from the decoded selectors, but it can restrict swaps via the whitelist and circuit breaker and can change the fee taken on swaps.

Security findings

  • [medium] Owner can gate swap access: Owner-controlled setCircuitBreaker and router whitelist can restrict or block swaps for non-whitelisted routers or when the breaker is active.
  • [medium] Owner can alter fee parameters: Owner can change uint24 and int24 parameters that influence dynamic fee computation, which can raise fees toward the cap.
  • [info] Source not verified: Without verified source the fee formula, penalty conditions and whether the owner key is a multisig cannot be confirmed.

Contract details

Verified source
No
Bytecode size
8,670 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Dynamic fee hook