Dynamic fee hook on Avalanche
Uniswap v4 Hook Contract 0x95f6ab5aed1cd1818f14c814d61fd958be770088 on Avalanche · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 158
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
A pausable Uniswap v4 hook on Avalanche that gates swaps through a beforeSwap callback and can adjust per-pool fees through an owner-set function, with the ability to return a balance delta that changes how a swap settles.
How it works step by step
- beforeSwap callback runs on every swap in pools that use this hook and can return a delta that alters swap accounting
- setPoolFee(bytes32,uint24) lets a privileged account set a fee value for a specific pool id, stored in a mapping keyed by pool id
- setPaused(bool) toggles a pause flag that the swap path reads, so the owner can halt swaps
- Owner-gated admin functions (setOwner, setPaused, setPoolFee, execute) let a single address control configuration and arbitrary external calls
- Contains a pool registry (allPools, getPoolCount, pools mapping) suggesting it tracks pools it manages
- Liquidity and donate callbacks exist as selectors but permissions show only beforeSwap and beforeSwapReturnDelta are enabled, so they are not invoked by the pool manager
- Swap behaviour
- beforeSwap runs before each swap and can return a delta through the return-delta permission. The function reads the paused flag and the per-pool fee mapping. Exact fee arithmetic and delta calculation cannot be confirmed without source.
- Liquidity behaviour
- No liquidity callbacks are enabled by the hook permissions. Liquidity add and remove selectors are present in the dispatch table but the pool manager will not call them for this hook.
- Fee behaviour
- Per-pool fees are set by the owner via setPoolFee and stored in a mapping keyed by pool id. The hook may override the pool fee during beforeSwap; the exact way the fee is applied cannot be confirmed from bytecode alone.
- Owner & admin controls
- Owner (storage slot 0) can transfer ownership via setOwner, pause and unpause swaps via setPaused, set per-pool fees via setPoolFee, and execute arbitrary calls via execute(address,uint256,bytes). Pool registry functions are also present. No timelock or multisig is evident from the bytecode. No upgrade proxy pattern was detected.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap runs the pause check and fee/delta logic on every swap. beforeSwapReturnDelta allows the hook to return a balance delta that changes the amounts settled for the swap.
Security & trust assessment
Risk level: high, estimated (decoded bytecode, medium confidence).
Who controls it: A single owner key controls pausing, fee levels per pool, ownership transfer and arbitrary external calls. Compromise or misuse of that key could freeze trading or extract fees from users.
Risk to user funds: The hook can block swaps via the pause flag and can influence amounts through fees and return deltas. Whether it can hold or move pool funds directly depends on the execute function and on balances it holds, which cannot be confirmed from bytecode alone.
Security findings
- [high] Owner can pause all swaps: setPaused writes a flag at storage slot 0 offset 23 that beforeSwap reads, so the owner can block swaps for every pool using this hook.
- [high] Owner can set arbitrary pool fees: setPoolFee(bytes32,uint24) writes to a per-pool fee mapping without a visible upper bound check, so a privileged key could set a very high fee and extract value from traders.
- [high] Generic execute function: execute(address,uint256,bytes) lets the owner make arbitrary external calls as the hook, which could move tokens or interact with the pool manager if the hook holds balances or approvals.
- [medium] Return-delta permission: beforeSwapReturnDelta lets the hook alter settled amounts on swaps; without source, the bounds on that delta cannot be verified, so it may take a portion of swap value.
- [info] Source not verified: No verified source is available, so the exact logic, bounds and checks are inferred from decoded selectors and storage access only.
Contract details
- Verified source
- No
- Bytecode size
- 18,093 bytes
- Upgradeable proxy
- No
- Detected patterns
- pausable, return-delta
Pools using Dynamic fee hook
- AquaLP / bUSDT (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- AquaLP / sBWPM (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ELP / ELK (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ELP / ELK (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- WETH.e / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- PEARL / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDC / SLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- sBWPM / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- WETH.e / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- PEARL / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- SLP / USDC (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- RLP / USDC.e (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- WBTC.e / HAKU-LP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- ELP / ELK (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- RADIO / RLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- PEARL / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USDC.e / HAKU-LP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- sADOL / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- bUSDT / AquaLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today
- USV / RLP (0.00% fee) — 24h volume $0, TVL $0, 0 swaps today