Dynamic fee hook on Monad
Uniswap v4 Hook Contract 0xbbb9e2b3af26a9b547c37bd156a60b4e628cc044 on Monad · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $17.88K
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 109
What it does
A Uniswap v4 hook that charges a governor-adjustable swap fee on pool swaps and routes the collected amounts to a treasury or staking destination.
How it works step by step
- Charges a swap fee after each swap using afterSwap with a return delta
- Stores the fee rate in swapFeeBps, adjustable by a governor role up to a hard cap
- Tracks collected native currency in storage
- Forwards accumulated balances to a treasury or staking address via forward()
- Restricts pool initialization and configuration through stored pool and registry references
- Swap behaviour
- After each swap the hook computes a fee in basis points, takes it through the return delta, and records the collected amount in storage.
- Liquidity behaviour
- Liquidity add and remove callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) are present in the dispatch table, but their bodies were not decoded in detail; they appear to be passthrough or validation only.
- Fee behaviour
- The hook charges a governor-settable swap fee in basis points (swapFeeBps, capped by MAX_SWAP_FEE_BPS and a FeeTooHigh check). It takes the fee after swaps via afterSwap and returns a delta, with collected native currency tracked in storage and forwarded to a treasury or staking destination.
- Owner & admin controls
- A privileged role (GOVERNOR_ROLE checked via hasRole) can call setSwapFeeBps(uint16) to change the swap fee, bounded by MAX_SWAP_FEE_BPS; a forward() function (nonpayable) and a bool flag in slot 2 appear to be controlled by the contract, and the registry, treasury, staking and taxedPool values are read from storage or external contracts. No upgrade proxy pattern was identified.
Enabled Uniswap v4 callbacks
afterSwap, afterSwapReturnDelta
afterSwap is used to compute and collect a fee from swap output; afterSwapReturnDelta lets the hook take a portion of the swap delta, which is how the fee is captured. Other callbacks (initialize, liquidity, donate) are present but their role is not clearly determined.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, medium confidence).
Who controls it: A key holding GOVERNOR_ROLE can change the swap fee up to the cap and may direct the collected fees through the forward and treasury/staking paths.
Risk to user funds: The hook can take a portion of swap output and hold collected native and token balances before forwarding them to a treasury or staking address, so users are exposed to the fee rate and the destination of collected funds.
Security findings
- [medium] Hook takes swap delta: afterSwapReturnDelta lets the hook take part of each swap's output, so the hook holds and moves a share of traded value.
- [medium] Governor-controlled fee: setSwapFeeBps is gated by a role check and capped by MAX_SWAP_FEE_BPS, so the fee can be raised to the cap at will by the governor.
- [low] Collected funds held by hook: The contract includes a transfer and take path with an external token balance check, indicating it holds collected tokens and can forward them via forward().
- [info] Unverified source: Source is not verified, so function behaviour is inferred from selectors and storage access only.
Contract details
- Verified source
- No
- Bytecode size
- 5,447 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta
Pools using Dynamic fee hook
- MON / EMIT (3.00% fee) — 24h volume $0, TVL $0, 0 swaps today