Dynamic fee hook on Polygon

Uniswap v4 Hook Contract 0x68a83e6cc83a8f0f29067f60902b6a1404724088 on Polygon · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$0.03
All-time volume
$6.06
Pools using this hook
1
Swaps (24h)
0 (0 traders)
Total swaps
11

What it does

A dynamic-fee hook for a Uniswap v4 pool on Polygon that sets the swap fee and takes a hook fee on swaps, with owner-controlled fee parameters.

How it works step by step

  • beforeSwap computes and applies a dynamic pool fee for the swap
  • A hook fee (hookFeeBps) is taken from swap currency via return delta
  • Owner sets pool fee through setPoolFee and updateDynamicLPFee
  • Owner sets hook fee through setHookFeeBps, capped by MAX_HOOK_FEE_BPS
  • Hook balances can be withdrawn by owner via withdrawToken
  • Liquidity and donate callbacks are present in the ABI but not enabled by permissions
Swap behaviour
On each swap the beforeSwap callback sets the dynamic LP fee and returns a delta so the hook collects a fee in basis points before the swap executes.
Liquidity behaviour
Liquidity add/remove callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) are present as selectors but the enabled permissions indicate only beforeSwap and beforeSwapReturnDelta are active, so liquidity operations are not hooked.
Fee behaviour
Pool fee is stored in the hook and updated by owner via setPoolFee and updateDynamicLPFee; a hook fee in basis points (hookFeeBps, capped by MAX_HOOK_FEE_BPS) is taken from swaps and routed via the pool manager, with the hook fee bounded by BPS_DENOMINATOR.
Owner & admin controls
Owner (0x8da5cb5b) can call setExecutor, setPoolFee and setHookFeeBps (max hook fee capped by MAX_HOOK_FEE_BPS), and withdrawToken to pull tokens out of the hook. Executor address (executor()) is a privileged role. No upgrade proxy pattern was detected.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: runs before each swap to set the dynamic fee and compute the hook fee; beforeSwapReturnDelta: lets the hook take a currency delta from the swap, which is how the hook fee is collected.

Security & trust assessment

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

Who controls it: The owner can change pool fee, hook fee (up to the cap), the executor and withdraw tokens held by the hook, so a compromised owner key could drain accumulated fees and alter swap pricing for users.

Risk to user funds: The hook can hold and move currency delta during swaps and the owner can withdraw token balances from the hook; users' pool liquidity is not directly controlled by the hook since liquidity callbacks are disabled.

Security findings

  • [medium] Owner can withdraw hook-held tokens: withdrawToken lets the owner move arbitrary tokens held by the hook contract.
  • [medium] Owner can change swap fees: setPoolFee and setHookFeeBps let the owner change fees that apply to every swap; the hook fee is capped by MAX_HOOK_FEE_BPS but the pool fee bound should be verified.
  • [info] Hook holds and moves swap currency: The hook takes currency via return deltas on swaps, so it holds funds between settlement steps; take/settle/sync calls appear in bytecode.
  • [info] Unverified source: Without verified source, exact fee bounds and access checks cannot be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
8,430 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, return-delta

Pools using Dynamic fee hook