Dynamic fee hook on Base

Uniswap v4 Hook Contract 0x2f4a713980425df85b2b756c7484565a9b8778c8 on Base · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$30
All-time volume
$0
Pools using this hook
6
Swaps (24h)
0 (0 traders)
Total swaps
0

What it does

This hook sets a dynamic fee on swaps for registered pools and collects curve fees for its owner, but without verified source it is unclear which trades pay more or less.

How it works step by step

  • Registers pools with the hook via registerPool, storing per-pool parameters keyed by pool id in storage mappings.
  • Uses beforeSwap to apply a dynamic LP fee through the return-delta mechanism, so the fee can vary per swap.
  • Uses afterSwap for post-swap accounting of pool reserves and fees.
  • Restricts pool initialization and liquidity addition to registered pools via beforeInitialize, afterInitialize and beforeAddLiquidity checks.
  • Accumulates curve fees that can be collected by an owner-controlled call (collectCurveFees).
  • Uses unlockCallback with the pool manager to settle balances and move currency during hook-driven operations.
Swap behaviour
beforeSwap computes a dynamic fee and returns a delta adjustment, and afterSwap updates accounting; the exact fee formula cannot be determined without source, so which trades pay more or less is unclear.
Liquidity behaviour
beforeAddLiquidity runs on adds and is gated to registered pools; removal callbacks are not enabled. Reserve and effective liquidity views are exposed.
Fee behaviour
Dynamic LP fee set by the hook in beforeSwap via the return-delta path; curve fees are accumulated and collectable via collectCurveFees. Exact fee parameters are not determinable from decoded bytecode.
Owner & admin controls
Ownable with a two-step ownership transfer (transferOwnership, acceptOwnership, pendingOwner). The owner can register pools (registerPool) and collect curve fees (collectCurveFees). A treasury and fee sink exist, with an issuer role referenced. Whether the owner can change fee parameters or upgrade the contract could not be fully confirmed from decoded bytecode.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta

beforeInitialize and afterInitialize validate and record pool setup; beforeAddLiquidity gates liquidity additions; beforeSwap sets the dynamic fee and return delta; afterSwap performs post-swap accounting; beforeSwapReturnDelta allows the hook to take or give currency during swaps.

Security & trust assessment

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

Who controls it: A single owner key controls pool registration and collection of accumulated curve fees, and may hold influence over treasury and issuer roles.

Risk to user funds: The hook can take and move currency during swaps through return deltas and holds accumulated fees, so user swap amounts and pool balances pass through hook-controlled accounting.

Security findings

  • [medium] Return-delta currency movement: beforeSwapReturnDelta is enabled, so the hook can take a share of swap amounts from users and move currency to itself or a treasury.
  • [medium] Owner-controlled pool registration and fee collection: The owner can register pools and call collectCurveFees to withdraw accumulated fees, which concentrates control in a single key.
  • [info] Dynamic fee parameters not verifiable: Without verified source the fee formula and any owner limits on fee values cannot be confirmed.
  • [low] Unlock callback settlement: unlockCallback performs settlement with the pool manager; correctness depends on caller checks that cannot be fully verified from bytecode.

Contract details

Verified source
No
Bytecode size
24,047 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, erc20, moves-currency, ownable, return-delta, self-unlock

Pools using Dynamic fee hook