Dynamic fee hook on Arbitrum
Uniswap v4 Hook Contract 0xa40a855ee10f7b3dd8d74adef8289aadc41c6888 on Arbitrum · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A dynamic-fee hook that quotes and settles swaps itself via a return delta, with fee exemptions and liquidity tracking tied to an external vault or Curve-style pool.
How it works step by step
- Stores pool-level state in storage slot 1 during beforeInitialize
- Gates liquidity additions through beforeAddLiquidity and tracks pseudo total value locked
- Computes swap quotes via quote/quoteFor and applies a fee in feePips denominated by FEE_PIPS_DENOMINATOR
- Overrides swap settlement through beforeSwapReturnDelta, using take, settle and sync against the pool manager
- Maintains a fee-exempt address registry used to waive the hook fee
- Exposes sweepDust to clear residual token balances
- Swap behaviour
- beforeSwap is nonpayable and uses beforeSwapReturnDelta to return a custom delta, while the bytecode invokes take/settle/sync and a get_dy quote, so swap amounts are computed by the hook rather than the default pool curve.
- Liquidity behaviour
- beforeAddLiquidity is enabled and beforeRemoveLiquidity and afterAddLiquidity/afterRemoveLiquidity selectors are present; pseudoTotalValueLocked(bytes32) and the vault/pool views suggest the hook tracks or routes liquidity to an external vault, but the precise flow is not confirmed.
- Fee behaviour
- Exposes feePips(), MAX_FEE_PIPS and FEE_PIPS_DENOMINATOR with an isFeeExempt(address) registry, indicating a hook-controlled fee with exemptions for certain addresses; the exact fee formula cannot be determined from decoded selectors alone.
- Owner & admin controls
- Selectors for sweepDust(address) and exempt address/fee-exempt registry views suggest an owner-style role; no owner getter or pause was decoded, so the exact privileged key and any parameter setters cannot be confirmed from bytecode alone.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeAddLiquidity, beforeSwap, beforeSwapReturnDelta
beforeInitialize records pool state into storage; beforeAddLiquidity gates or adjusts liquidity additions; beforeSwap computes a custom quote and uses beforeSwapReturnDelta to take over swap accounting, returning a delta that replaces the default pool math.
Security & trust assessment
Risk level: medium (decoded bytecode, low confidence).
Who controls it: Decoded selectors (sweepDust, exempt address management, and the pool/vault/metaRegistry references) suggest a privileged key that can sweep tokens and change fee exemptions; a compromised key could redirect or extract residual balances.
Risk to user funds: The hook can hold tokens and, through beforeSwapReturnDelta and take/settle calls, determine swap settlement amounts, so a bug or malicious configuration could misprice or redirect user swap funds.
Security findings
- [high] Return-delta swap override: The hook enables beforeSwapReturnDelta, so it can alter the net token amounts a swap settles, not only the fee.
- [medium] Hook moves currency: The bytecode calls take, settle and sync on the pool manager and a Curve-style get_dy/balances interface, meaning the hook moves currency during swaps.
- [medium] Dust sweep function: sweepDust(address) is an externally callable privileged-looking function that transfers residual token balances held by the hook.
- [info] Unverified access control: Access control on sweepDust and exempt-list setters could not be verified because no source is available and the caller check was not decoded.
Contract details
- Verified source
- No
- Bytecode size
- 13,803 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, return-delta
Pools using Dynamic fee hook
- USD₮0 / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today