Dynamic fee hook on Base

Uniswap v4 Hook Contract 0x487f034772b128e917b23a4edfd53442aa8de0cc on Base · Dynamic fee

Volume (24h)
$0.05
Value locked (TVL)
$3.88K
All-time volume
$3.66M
Pools using this hook
938
Swaps (24h)
1 (1 traders)
Total swaps
26,122

What it does

A Uniswap v4 hook that applies a time-based anti-sniper fee to swaps in its pool, with fixed buy and sell fee settings and per-pool deployment tracking.

How it works step by step

  • Records pool deployment block and timestamp in beforeInitialize
  • Computes an anti-sniper fee through calculateAntiSniperFee based on elapsed time since deployment
  • Exposes FIXED_BUY_FEE and FIXED_SELL_FEE constants and getCurrentFees for fee introspection
  • Takes currency through the pool manager during swaps via return deltas
  • Has no liquidity-specific custom accounting despite exposing liquidity callbacks
Swap behaviour
beforeSwap and afterSwap run on every swap and use return deltas that can take currency, applying the anti-sniper fee logic based on pool deployment time.
Liquidity behaviour
Liquidity add and remove callbacks are present in the selector table but the hook does not appear to add custom liquidity logic beyond the standard flow; behaviour is not confirmed.
Fee behaviour
Exposes FIXED_BUY_FEE, FIXED_SELL_FEE and getCurrentFees, and calculateAntiSniperFee, suggesting a time or anti-sniper based fee schedule applied in beforeSwap and afterSwap; exact fee formula cannot be determined without source.
Owner & admin controls
No admin controls found.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize records pool deployment data; afterInitialize is exposed; beforeSwap and afterSwap may adjust swap amounts or fees via return deltas; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take or redirect currency during swaps.

Security & trust assessment

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

Who controls it: No owner or privileged setter selectors were decoded, so no obvious key can change fees, but a fixed fee configuration is baked in and cannot be altered without redeploying.

Risk to user funds: The hook can take and redirect swap currency through return deltas, so it can affect the amounts users receive; it does not appear to hold a persistent balance beyond what the pool manager settles.

Security findings

  • [medium] Hook takes currency via return deltas: Permissions include beforeSwapReturnDelta and afterSwapReturnDelta, and bytecode references take(address,address,uint256), so the hook can move pool currency during swaps.
  • [low] Per-pool state written in beforeInitialize: Storage slots 0 and 1 are mapping-based and written in beforeInitialize, indicating per-pool state that drives fee logic, without any observed access control on that write.
  • [info] Fee depends on block timing: Anti-sniper fee logic depends on deployment block and timestamp, which can be manipulated only marginally by block producers.

Contract details

Verified source
No
Bytecode size
4,071 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta

Pools using Dynamic fee hook