Dynamic fee hook on Ethereum

Uniswap v4 Hook Contract 0x8593d5f1fa2a074a257edacb6dd1cdf51d96c0cc on Ethereum · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$9.11K
Pools using this hook
3
Swaps (24h)
0 (0 traders)
Total swaps
113

What it does

A dynamic-fee hook that charges a time-decaying fee on swaps, with an apparent launch-period snipe penalty, and takes a share of swap amounts through return deltas.

How it works step by step

  • Registers pools with per-pool parameters through registerPool, including a uint16 value
  • Computes the current fee in basis points via feeBpsNow, likely decaying over SNIPE_SECONDS from SNIPE_START_BPS
  • Overrides swap fees in beforeSwap during the launch window to discourage sniping
  • Takes a share of swap amounts with take() and tracks amounts owed in afterSwap
  • Settles its accounting through a self-unlock pattern with unlockCallback and flush
Swap behaviour
beforeSwap computes a dynamic fee per pool (fee boosted during a snipe window controlled by SNIPE_START_BPS and SNIPE_SECONDS) and afterSwap settles amounts, with return deltas letting the hook take a portion of the swap.
Liquidity behaviour
Liquidity add and remove callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) are present as selectors, but the hook does not enable these permissions, so they are not invoked by the PoolManager.
Fee behaviour
The hook exposes feeBpsNow(bytes32,address) and config(bytes32) and registerPool with a uint16 parameter, which suggests per-pool fee values set at registration and a time-dependent fee schedule (SNIPE_START_BPS and SNIPE_SECONDS suggest a higher fee for a window after launch that decays). Exact fee formula could not be verified from bytecode alone.
Owner & admin controls
A stored admin address (slot 0) can call setFactory(address) and the admin() getter is exposed; setFactory is gated by an admin check (NotAdmin error selector present). The admin can point the hook at a factory contract, which may influence pool registration. No pausing or upgrade mechanism was identified in the decoded selectors.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap sets a dynamic fee for swaps; afterSwap runs post-swap accounting and may record amounts owed; beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take a slice of the swap amounts as a return delta, which is how it captures fees or snipe penalties.

Security & trust assessment

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

Who controls it: The admin can change the factory address and could influence which pools are registered and fee settings; the admin address should be verified before trusting the hook's fee schedule.

Risk to user funds: The hook can take a portion of swap amounts via return deltas and holds balances tracked in the owed mapping, so user swap proceeds may be partially captured by the hook. It is not identified as able to block swaps outright.

Security findings

  • [medium] Hook takes swap proceeds via return deltas: Hook has beforeSwapReturnDelta and afterSwapReturnDelta enabled and includes a take(address,address,uint256) call, so it can take part of user swap amounts.
  • [medium] Admin can change factory reference: setFactory is callable only by the stored admin and can redirect pool-related logic to a different factory contract.
  • [info] Self-unlock accounting pattern: The hook is self-unlocking (unlockCallback and unlock selector present) and uses flush and owed mappings, so it manages PoolManager accounting itself.
  • [info] No pause or upgrade path identified: No pause, upgrade proxy or emergency stop selector was found in the decoded functions.

Contract details

Verified source
No
Bytecode size
6,313 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, return-delta, self-unlock

Pools using Dynamic fee hook