MyNewHook on Arbitrum
Uniswap v4 Hook Contract 0xbe6e2bc311ce24368c73a4d20f7589d709139080 on Arbitrum · Dynamic fee · Verified contract
- Volume (24h)
- $0
- Value locked (TVL)
- $50
- All-time volume
- $8.01M
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 49,882
What it does
A Uniswap v4 hook that sets a swap fee between 0.01% and 2.00% for each pool based on recent price volatility, raising fees when the price moves quickly and lowering them when it is stable.
How it works step by step
- Records the pool tick over 5, 15, 30 and 60 minute windows and tracks tick-change rate per window.
- Blends the windows into a weighted instant volatility (30/35/25/10 percent) and smooths it with an EWMA (alpha 0.4).
- Classifies the EWMA into stable, low, moderate or high regimes using fixed thresholds.
- Maps the regime to a fee with linear, flat, curved or sigmoid interpolation, clamped between 0.01% and 2.00%.
- Applies a 10 percent discount when pool liquidity exceeds 1e20 and a 10 percent premium when it is below 1e18.
- Updates the stored pool fee via updateDynamicLPFee only when the change is at least 0.01%, and emits regime and fee events.
- Swap behaviour
- On every swap, beforeSwap reads the current tick and liquidity, updates the volatility state, picks a fee from the regime and liquidity depth, and overrides the pool fee for that swap. It takes no token delta.
- Liquidity behaviour
- No liquidity callbacks. Add and remove liquidity hooks revert with 'Hook not supported', so liquidity providers cannot add or remove liquidity through this hook's pools.
- Fee behaviour
- Fee is recomputed on each swap from an EWMA of a multi-timeframe tick-change volatility measure, mapped into four regimes (stable, low, moderate, high) with curved interpolation between a 0.01% floor and a 2.00% cap, then adjusted by plus or minus 10 percent depending on whether pool liquidity is above 1e20 or below 1e18. The fee is pushed to the pool via updateDynamicLPFee only when it changes by at least 0.01%, and returned with the override flag for that swap.
- Owner & admin controls
- No admin controls found. There is no owner, pause, upgrade or parameter-setter function in the verified source; all parameters are constants. Only the pool manager can invoke afterInitialize and beforeSwap.
Enabled Uniswap v4 callbacks
afterInitialize, beforeSwap
afterInitialize seeds the volatility state and sets the initial dynamic fee to 0.01%. beforeSwap updates tick observations, recomputes volatility and regime, and sets the dynamic swap fee.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: No privileged role exists, so no key can change fees, pause swaps or move funds. Users depend on the immutable pool manager address and on the fee formula.
Risk to user funds: The hook does not custody tokens and returns zero before-swap delta, so it cannot directly take or move pool funds. The risk is indirect: fee levels can reach 2.00% in high volatility and can be shaped by a swapper's own trades, and LPs cannot add or remove liquidity through the hook at all.
Security findings
- [info] Unsupported callbacks revert: beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity, afterSwap, donate hooks and beforeInitialize unconditionally revert. Only the pools enabling afterInitialize and beforeSwap are usable, and liquidity cannot be managed through the hook.
- [medium] Fee is manipulable through swap-driven volatility: The hook is wired to the v4 dynamic-fee flag and writes the fee through updateDynamicLPFee on every significant change, so the fee is driven purely by on-chain tick history that the swapper can influence through its own trades.
- [info] Permission flags consistent with implementation: The bytecode-level getHookPermissions declares only afterInitialize and beforeSwap, but the callback permission flags use the address-encoded bits, which match the stated permissions. Address-permission mismatch was not found.
- [low] No direct fund custody: The hook does not hold, move or return any user tokens; it returns zero delta and has no return-delta permissions enabled, so it cannot take funds or block swaps beyond reverting in unsupported paths.
Contract details
- Verified source
- Yes (MyNewHook)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 14,876 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee
Pools using MyNewHook
- ETH / USDC (Dynamic fee) — 24h volume $0, TVL $50, 0 swaps today