Dynamic fee hook on Base
Uniswap v4 Hook Contract 0x9e39e2aea10df684c9bef7a6ce52c02a26bf98cc on Base · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0.95
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook sets a dynamic oracle-based LP fee on pools and can pause swaps and liquidity additions, with a protocol share of fees that is claimable by recipients.
How it works step by step
- Sets a dynamic LP fee per pool using an on-chain oracle derived from pool observations
- Records a tick/price observation ring buffer (OBSERVATION_CARDINALITY, OBSERVATION_INTERVAL) on initialization and after swaps
- Adjusts swap fees via updateDynamicLPFee and can take currency through take() during beforeSwap/afterSwap
- Accrues fee-related balances per (owner, token) that can be claimed via claim/claimFor
- Supports pausing swap and liquidity paths through pause/unpause with an emergency guardian role
- Includes a bootstrap phase controlled by bootstrapAuthority that is finalized via finalizeBootstrap
- Swap behaviour
- beforeSwap and afterSwap run on every swap; beforeSwap can return a delta and the hook may take currency during swaps, and the swap path reverts when the contract is paused. Exact direction-dependent fee differences could not be determined without source.
- Liquidity behaviour
- beforeAddLiquidity is enabled and gates liquidity additions (including the paused check); no liquidity removal callback is enabled.
- Fee behaviour
- Sets a dynamic LP fee via updateDynamicLPFee, bounded by MAX_TOTAL_FEE_PIPS and MAX_PROTOCOL_FEE_PIPS, with a protocol share accrued per token and claimable by recipients.
- Owner & admin controls
- Owner/protocol authority can set emergency guardian, pause and unpause the hook, finalize bootstrap, and manage pool factory and protocol authority roles; exact parameter-change functions are not identifiable from decoded selectors.
Enabled Uniswap v4 callbacks
afterInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
afterInitialize records the initial oracle observation and pool config; beforeAddLiquidity gates liquidity adds; beforeSwap computes and applies the dynamic fee and may return a delta; afterSwap records a new observation and settles fee accounting; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a share of swap amounts.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: A privileged owner, emergency guardian or protocol authority could pause swaps and liquidity adds, reassign roles, and influence fee accrual and claims.
Risk to user funds: The hook can take currency through return deltas and take() and accrues balances for claimants, and a pause can block user trades and liquidity additions; funds are not directly confiscated based on decoded functions.
Security findings
- [medium] Pausable swap path: The hook exposes pause/unpause and a paused() check on swap and liquidity paths, so a privileged key can halt trading in pools using this hook.
- [medium] Return-delta swap settlement: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and the hook calls take(), so it can take a portion of swap amounts from pool flows.
- [medium] Privileged role management: Multiple roles (emergency guardian, bootstrap authority, protocol authority, pool factories) are stored in storage and can be reassigned by the owner or guardian.
- [low] Dynamic fee updates by hook: The hook calls updateDynamicLPFee on the pool manager, bounded by MAX_TOTAL_FEE_PIPS, so fees are capped but can change over time.
- [info] Upgradeability unknown: No proxy or upgrade selectors were identified in decoded bytecode, but this could not be fully verified.
Contract details
- Verified source
- No
- Bytecode size
- 14,128 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc20, moves-currency, oracle, pausable, return-delta
Pools using Dynamic fee hook
- BFREVIEW / WETH (Dynamic fee) — 24h volume $0, TVL $0.95, 0 swaps today