Dynamic fee hook on Arbitrum

Uniswap v4 Hook Contract 0x8d149ca48e4073d181ca4ce3a1c61feac8660080 on Arbitrum · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$175.30K
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
1,770

What it does

A Uniswap v4 hook that sets a swap fee dynamically from recent price volatility, so traders pay more when the market is turbulent and less when it is calm.

How it works step by step

  • Tracks pool volatility over short, medium and long windows using an EWMA with an update frequency
  • Classifies the market into volatility regimes using moderate, high and ultra-high thresholds
  • Maps each regime to a fee between MIN_FEE_BPS and MAX_FEE_BPS, with ULTRA_MAX_FEE_BPS as an upper ceiling
  • Pushes the computed fee to the pool manager through updateDynamicLPFee before each swap
  • Exposes getCurrentFee, getVolatilityInfo, getPoolObservations and getFeeRanges for off-chain reads
Swap behaviour
On every swap, beforeSwap recomputes the volatility-based LP fee within configured minimum and maximum bounds and applies it to that swap.
Liquidity behaviour
No liquidity callbacks are enabled; beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are dispatched but the permissions only enable beforeSwap, so they are not invoked by the PoolManager.
Fee behaviour
Computes a volatility-driven fee per swap in beforeSwap, bounded between MIN_FEE_BPS and MAX_FEE_BPS (with ULTRA_MAX_FEE_BPS as a higher cap), using regime thresholds and an EWMA of volatility, and pushes the result via updateDynamicLPFee on the pool manager. getCurrentFee and getFeeRanges expose the current values.
Owner & admin controls
No admin controls found. No owner, pause or upgrade selectors were decoded; the view getters expose fixed constants (MIN_FEE_BPS, MAX_FEE_BPS, ULTRA_MAX_FEE_BPS, thresholds, EWMA_ALPHA, windows, UPDATE_FREQUENCY) that appear immutable, but parameter changes cannot be ruled out from bytecode alone.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap: recalculates the dynamic LP fee from observed volatility and applies it before each swap. Other selectors (afterInitialize, beforeInitialize, donate and liquidity callbacks) are present in the dispatch table but are not enabled by the address permission bits.

Security & trust assessment

Risk level: low, estimated (decoded bytecode, medium confidence).

Who controls it: No privileged role was identified in the bytecode, so the fee logic appears permissionless and self-contained; if a hidden setter exists in the unverified code, a privileged key could push fees to the bounded maximum and make swaps expensive for traders.

Risk to user funds: The hook does not take tokens via return deltas and does not hold pool funds; its effect is limited to choosing the LP fee charged on swaps within fixed bounds, so user funds are not directly moved or blocked.

Security findings

  • [info] Unverified source:
  • [info] Fee bounds exist: Fee is bounded by MIN_FEE_BPS and MAX_FEE_BPS read from constants, limiting the worst-case fee charged to traders.
  • [low] Shared volatility state: The hook stores pool volatility data in a single mapping slot written during initialization and swaps, which is the only persisted state observed.
  • [low] External calls to pool manager: The contract calls extsload and updateDynamicLPFee on the pool manager, so its fee output depends on external pool state and correct manager behaviour.

Contract details

Verified source
No
Bytecode size
14,877 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee

Pools using Dynamic fee hook