Dynamic fee hook on Base
Uniswap v4 Hook Contract 0x16c0a78b6fbbc4ee56074954ba9193d1f31e90c0 on Base · Dynamic fee
- Volume (24h)
- $13.71K
- Value locked (TVL)
- $21.73K
- All-time volume
- $674.44K
- Pools using this hook
- 1
- Swaps (24h)
- 139 (38 traders)
- Total swaps
- 7,823
What it does
A Uniswap v4 hook that sets a dynamic swap fee per pool based on stored parameters, with an owner-tunable fee range and fallback.
How it works step by step
- Records per-pool initial state after pool initialization (afterInitialize).
- Computes and applies a dynamic fee override before each swap (beforeSwap).
- Updates per-pool fee or observation state after each swap (afterSwap).
- Falls back to a configured fallback fee when no valid fee is available.
- Exposes owner-controlled bounds (min, max, floor) for the dynamic fee.
- Swap behaviour
- beforeSwap returns a dynamic fee override based on per-pool stored state and owner-set bounds; afterSwap records updated per-pool state for future fee calculation.
- Liquidity behaviour
- Liquidity add and remove callbacks (before/after) are present in the selector table but appear to be pure/no-op stubs; no state changes identified for liquidity actions.
- Fee behaviour
- Dynamic fee computed in beforeSwap from stored state (previewFee, minFee/maxFee, fallbackFee, floor/directive values keyed by pool id). Fee bounds are governed by owner-set uint24 parameters, with a fallback fee used when the computed value is unavailable. Afterswap updates per-pool state that feeds the next fee. Exact formula cannot be recovered from decoded bytecode alone.
- Owner & admin controls
- Owner (slot 0) can transfer ownership and set parameters: setMaxFee, setFallbackFee and several uint24 fee setters (selectors 0x6a786210, 0xde0bc4fb, 0xed406181, 0x965ed291, 0xc8058828, 0xcc508a00, 0x2c0b84c6, 0x364fe150, 0xc21b4623, 0x7e565e87, 0x6828a486, 0xb8a4a872). An operator address (slot 6, setOperator 0xb3ab15fb) is also privileged and can call a directive-setting function (0x9dcd14e4). Owner and operator can change fee bounds and fallback fee on the fly; exact access checks cannot be confirmed without source.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap, afterSwap
afterInitialize records initial per-pool state (timestamp and tick-related values). beforeSwap computes and applies the dynamic fee override for swaps. afterSwap updates per-pool observation/fee state after each swap.
Security & trust assessment
Risk level: medium (decoded bytecode, low confidence).
Who controls it: The owner can change maximum fee, fallback fee and other fee-related parameters at will, directly affecting the cost of every swap in pools using this hook. An operator can also set directives. A compromised owner or operator key could set extreme fees to extract value or grief traders.
Risk to user funds: The hook does not appear to hold tokens or take return deltas, so it does not custody pool funds. Its main exposure is through the fee it sets on each swap, which the privileged owner or operator can raise, so traders could pay excessive fees.
Security findings
- [medium] Owner-controlled fee parameters: Owner can set max and fallback fees via setMaxFee, setFallbackFee and several uint24 setters, so swap cost can be raised arbitrarily within uint24 limits.
- [medium] Operator role can influence pool state: Slot 6 holds an operator address set by owner that can call a privileged state-changing function, adding a second privileged role.
- [info] Ownership transfer present: Hook exposes ownership transfer (transferOwnership). No pause or upgrade mechanism was identified, and the contract does not appear to be a proxy from the bytecode.
- [info] Unverified source: Without verified source, exact access control checks on setter functions and the fee formula cannot be confirmed.
Contract details
- Verified source
- No
- Bytecode size
- 16,973 bytes
- Upgradeable proxy
- No
- Detected patterns
- oracle, ownable
Pools using Dynamic fee hook
- USDC / cbBTC (Dynamic fee) — 24h volume $13.71K, TVL $21.73K, 139 swaps today