Dynamic fee hook on Arbitrum

Uniswap v4 Hook Contract 0xdd7726467976e3e388605a2d310d856bcf780080 on Arbitrum · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
<$0.01
All-time volume
$5.29M
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
25,471

What it does

A dynamic-fee hook that raises or lowers the pool's swap fee based on recent price volatility, so traders pay more when the market is moving fast and LPs are compensated for that risk.

How it works step by step

  • Tracks per-pool volatility state via poolVolatilityData keyed by pool id
  • Smooths volatility samples with an EWMA filter (EWMA_ALPHA)
  • Evaluates volatility across immediate, short, medium-short and medium windows
  • Maps volatility against moderate and high thresholds to choose a fee tier
  • Clamps the resulting fee between MIN_FEE_BPS and MAX_FEE_BPS, starting from BASE_FEE_BPS
  • Calls updateDynamicLPFee on the pool manager before each swap
Swap behaviour
Before each swap, the hook reads the pool's volatility state, computes a fee between the minimum and maximum bounds, and sets it as the dynamic LP fee for that swap.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fee is set dynamically: beforeSwap computes a volatility-based fee within configured MIN_FEE_BPS and MAX_FEE_BPS bounds from a base BASE_FEE_BPS, and pushes it via updateDynamicLPFee on the pool manager. Pool volatility is tracked per pool through poolVolatilityData, updated with an EWMA smoothing factor (EWMA_ALPHA) across several windows (IMMEDIATE, SHORT, MEDIUM_SHORT, MEDIUM) and thresholds (MODERATE, HIGH).
Owner & admin controls
No admin controls found.

Enabled Uniswap v4 callbacks

beforeSwap

beforeSwap is the only enabled callback; it recalculates and applies the dynamic LP fee before each swap.

Security & trust assessment

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

Who controls it: No owner or privileged setter was found in the decoded functions. Fee parameters appear to be immutable constants, so no key can alter fees after deployment.

Risk to user funds: The hook does not take tokens, return deltas, or hold funds; it only sets the LP fee on swaps, so user funds are not directly held or moved by the hook.

Security findings

  • [info] Fee derived from on-chain volatility: beforeSwap is nonpayable and writes state (volatility storage keyed by pool) and calls updateDynamicLPFee, so the fee is recomputed on every swap based on on-chain price history.
  • [low] Volatility measurement manipulable by price movement: Fee updates depend on recorded price/volatility samples; an attacker able to move the pool price repeatedly around swaps could influence the computed fee, though bounds are capped by MIN_FEE_BPS and MAX_FEE_BPS.
  • [medium] Unverified source: Source is unverified and the storage layout inferred from bytecode is minimal, so the exact update logic and clamping could not be fully confirmed.

Contract details

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

Pools using Dynamic fee hook