VolumeDynamicFeeHook on Optimism
Uniswap v4 Hook Contract 0x64870831397e21c61e5ffad717395c2d8c0c1044 on Optimism · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $1.04M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 64,300
What it does
A dynamic-fee hook that raises or lowers the pool's LP fee among floor, cash and extreme tiers based on recent trading volume, and skims a small owner-set share of LP fees as protocol revenue.
How it works step by step
- Tracks stable-side swap volume per fixed period and smooths it with an EMA.
- Moves the pool between floor, cash and extreme LP fee tiers using trigger thresholds and confirmation streaks.
- Applies hold periods after entering cash or extreme, and an emergency reset to floor on sustained low volume.
- Takes up to 10 percent of LP fees on each swap as HookFee, accrued as ERC6909 claims.
- Resets the regime after a lull period with no sufficient activity.
- Allows owner pause, parameter updates while paused, and claims of accrued HookFees.
- Swap behaviour
- After each swap the hook records stable-side volume above a threshold, rolls periods, updates an EMA and may change the LP fee tier, then takes a HookFee from the unspecified currency via afterSwapReturnDelta.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- The hook sets the pool's dynamic LP fee among three owner-configured regime tiers (floor, cash, extreme) based on period stable-side volume versus an EMA, with hold and confirmation counters. It additionally takes a HookFee of up to 10 percent of the LP fee on the unspecified currency of each swap, accrued as ERC6909 claims and claimable by the owner.
- Owner & admin controls
- Owner (two-step transfer via proposeNewOwner/acceptOwner) can pause and unpause the controller, set regime fees, controller params and timing params only while paused, schedule HookFee percent changes (max 10 percent, 48h timelock), schedule min counted swap threshold changes (no timelock, applies at next period boundary), claim accrued HookFees, rescue non-pool tokens and ETH. Owner cannot change LP fees directly outside the regulator state machine.
Enabled Uniswap v4 callbacks
afterInitialize, afterSwap, afterSwapReturnDelta
afterInitialize sets the initial dynamic fee tier and period state. afterSwap runs the volume telemetry, period rollover and fee regime transitions, updates the LP fee via updateDynamicLPFee, and accrues HookFee. afterSwapReturnDelta lets the hook take a HookFee amount from the unspecified side of each swap.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A single owner key controls the fee tier configuration and state machine parameters (while paused), the HookFee percent (capped at 10 percent with a 48h delay), the ability to pause or resume, and claims of accrued HookFees. The owner cannot directly move pool liquidity. Min counted swap threshold can be changed instantly at period boundaries within a 1 to 10 USD range without a timelock.
Risk to user funds: The hook does not custody pool liquidity but mints and burns ERC6909 claims for HookFees and takes a share of the unspecified-currency amount on each swap; accrued HookFees are held by the PoolManager under the hook's claim and can be withdrawn only by the owner. Users may pay higher LP fees in cash or extreme regimes, and owner-set tiers determine those fees.
Security findings
- [medium] Owner-controlled fee tiers: The owner can pause the controller and reconfigure all regime fees and thresholds while paused, changing the LP fee tiers that apply to all future swaps; this is bounded by fee validation (floor > 0, floor < cash < extreme, max LP fee) but not by user protection.
- [low] Pause does not halt swaps: Pausing freezes regime transitions but swaps continue and HookFee accrual continues at the last tier; the owner can also emergency reset fee regime while paused.
- [info] Hook fee skim on swaps: The hook takes a percentage of LP fees as HookFee via afterSwapReturnDelta on the unspecified currency, capped at 10 percent of the LP fee, with accrued balances claimable by the owner.
- [low] Untimelocked telemetry threshold: The min counted swap threshold can be changed by the owner without timelock within 1 to 10 USD, affecting which swaps feed volume telemetry and therefore fee regime decisions.
- [info] Immutable logic: Contract is not upgradeable (no proxy pattern visible); the bytecode is fixed at deployment.
Contract details
- Verified source
- Yes (VolumeDynamicFeeHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 20,272 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta, self-unlock
Pools using VolumeDynamicFeeHook
- ETH / USDC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today