Dynamic fee hook on BNB Chain

Uniswap v4 Hook Contract 0xc362167be836772ca98c8777e89ab77dac58e080 on BNB Chain · 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

This hook charges swappers a dynamic fee that the owner-controlled logic sets per pool, while liquidity providers who claim accrued fees pay a configurable claim fee to a recipient, and the authority can pause pools.

This read was written for the hook 0x615b…a080 on BNB 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

  • Enables a dynamic fee on pools initialised with this hook (beforeInitialize sets up per-pool fee state and the pool is required to be a dynamic-fee pool)
  • Computes a per-pool current fee via currentFee and autonomousFee, bounded by minimum and maximum pool fees and an ABSOLUTE_MAX_FEE constant
  • Provides a pokeFee mechanism that lets an authorised party set a fee for a pool with an expiry time, with a discount cap (MAX_POKE_DISCOUNT_BPS) and TTL (MAX_POKE_TTL)
  • Manages concentrated liquidity positions in tick ranges through deposit, withdraw, withdrawAndClaim, claimFees and rangeId/rangeState bookkeeping, with positions accounted per user
  • Takes a claim fee (claimFeeBps, up to MAX_CLAIM_FEE_BPS) on accrued fees and routes it to a claimFeeRecipient, tracked in claimFeeOwed and claimFeeHistory
  • Includes pause controls (pause, setPaused, pausePool, setPoolPaused, pausedUntil) and an operator/authority access model (setOperator, setAuthority, canCall)
Swap behaviour
beforeSwap is enabled and reads the current dynamic fee for the pool direction, so swaps pay the hook-computed fee rather than a static fee; pools can be paused, which blocks swaps. afterSwap is also present in the dispatch table but the exact per-direction fee effect cannot be confirmed from decoded bytecode.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present, indicating liquidity changes are inspected or accounted for by the hook; custom position accounting through deposit and withdraw functions is also present.
Fee behaviour
Dynamic fee set via currentFee/autonomousFee within MIN_POOL_FEE and maxFee bounds; an additional claim fee (claimFeeBps, capped at MAX_CLAIM_FEE_BPS) is taken on fees claimed by LPs and sent to claimFeeRecipient; pokeFee can override the fee for a time window.
Owner & admin controls
An owner/authority (storage slot 0 holds an authority address changeable via setAuthority) and designated operators (setOperator) can pause the whole hook or individual pools, set pool configuration and asymmetry, change max fee and claim fee parameters, poke fees, and sweep accrued claim fees. Operator role grants are recorded per address and per pool. Upgradeability is not evident from the decoded selectors.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap

beforeInitialize: validates and configures pool fee state at pool creation. beforeSwap: supplies the dynamic fee for each swap. Liquidity callbacks (before/after add and remove): account for positions and fee claims. afterSwap and beforeDonate/afterDonate are dispatched but their exact role is unclear from decoded bytecode.

Security & trust assessment

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

Who controls it: A single authority address (and any operators it appoints) can pause pools, change fee bounds and claim fee rate and recipient, poke fees for time windows, and sweep claim fees. Users are exposed to these parameters changing without notice.

Risk to user funds: The hook holds LP position balances and accrued fees and transfers tokens via the pool manager; pausing blocks swaps and possibly withdrawals, and parameter changes can alter the fees users pay or earn.

Security findings

  • [high] Privileged fee and pause control: Authority and operators can change pool fees (setPoolConfig, pokeFee, setPoolAsymmetry) and pause pools (pause, setPoolPaused), so a privileged key could raise fees toward the maximum or block swaps.
  • [medium] Claim fee redirected to a single recipient: claimFeeBps is taken from LP fee claims and sent to claimFeeRecipient (set via setClaimFee), and sweepClaimFee can move accrued amounts; a changed recipient or raised bps would divert LP earnings.
  • [medium] Hook moves currency: The hook calls take, transferFrom and settles through the pool manager (unlockCallback, extsload, unlock), so it holds and moves pool and user tokens during deposits, withdrawals and claims.
  • [info] No source to verify: The contract is unverified; behaviour is inferred from selectors and storage slots, so logic bugs cannot be ruled out.

Contract details

Verified source
No
Bytecode size
23,777 bytes
Upgradeable proxy
No
Detected patterns
erc20, moves-currency, pausable, self-unlock

Pools using Dynamic fee hook