Dynamic fee hook on Ethereum
Uniswap v4 Hook Contract 0xc6d1c4f02a8f7ec291fbe4f8d75c763a7a7010c0 on Ethereum · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $8.04
- All-time volume
- $557
- Pools using this hook
- 2
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 37
What it does
A dynamic-fee hook that adjusts the pool's LP fee on each swap based on recent volatility, within fixed minimum and maximum bounds, so traders pay a fee that tracks market conditions.
How it works step by step
- afterInitialize seeds the stored tick or state for the pool at creation
- beforeSwap reads the volatility value and computes a dynamic LP fee
- beforeSwap pushes the fee to the PoolManager with updateDynamicLPFee
- afterSwap updates stored state to reflect the executed swap
- Fee is clamped between MIN_FEE and MAX_FEE using BASE_FEE, K, ALPHA and SCALE constants
- Liquidity and donate callbacks are present but do not alter funds
- Swap behaviour
- beforeSwap sets a volatility-adjusted LP fee via updateDynamicLPFee; afterSwap updates the stored state used for the next fee calculation.
- Liquidity behaviour
- Has before and after callbacks for add and remove liquidity and donate, which appear to be pass-through (no return deltas or fund movement evident from the selectors).
- Fee behaviour
- Sets a dynamic LP fee via updateDynamicLPFee on the PoolManager, bounded by MIN_FEE and MAX_FEE constants, with a BASE_FEE constant and a volatility input vol(bytes32) read from storage; the exact fee formula cannot be confirmed without source.
- Owner & admin controls
- No admin controls found.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap, afterSwap
afterInitialize records initial state in storage; beforeSwap computes and applies the dynamic fee for each swap; afterSwap updates post-swap state used for volatility tracking.
Security & trust assessment
Risk level: low, estimated (decoded bytecode, medium confidence).
Who controls it: No privileged role or owner function was identified in the dispatched selectors, so no single key appears able to change fee parameters after deployment.
Risk to user funds: The hook does not appear to take or hold tokens: no return-delta functions were identified and it only calls updateDynamicLPFee and extsload externally, so it does not move user or pool funds directly, though fee outcomes affect swap costs.
Security findings
- [info] Immutable fee parameters: Fee bounds (MIN_FEE, MAX_FEE, BASE_FEE, K, ALPHA, SCALE) are exposed as pure getters, suggesting they are compile-time constants; the hook appears non-upgradeable with no setter selectors found.
- [low] Volatility-driven fee may be manipulable: The hook sets a fee in beforeSwap that is driven by on-chain volatility state; volatility-based fees can be influenced by swap sizing and may be manipulated within the bounded range.
- [info] Limited storage visibility: Decoded storage shows a single mapping slot 0 used for int24 values read in swap paths; with no source, the write conditions and any reentrancy or overflow guards cannot be verified.
Contract details
- Verified source
- No
- Bytecode size
- 8,631 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee
Pools using Dynamic fee hook
- USDC / TRAC (Dynamic fee) — 24h volume $0, TVL $8.04, 0 swaps today
- USDC / TRAC (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today