Dynamic fee hook on Polygon
Uniswap v4 Hook Contract 0x453905d83fb03cb1df0fc69bc2ae71ae0fc48088 on Polygon · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 2
What it does
A dynamic-fee hook that charges a configurable hook fee on swaps and can change the pool fee, controlled by an owner key.
How it works step by step
- Overrides the pool LP fee on swaps via setPoolFee and beforeSwap
- Takes a configurable hook fee (hookFeeBps) from swap amounts using beforeSwapReturnDelta
- Tracks a hook executor role set by the owner
- Holds token balances that the owner can withdraw with withdrawToken
- Calls the pool manager's take, settle and sync functions to settle deltas
- Swap behaviour
- beforeSwap runs on every swap and can set the pool fee and take a hook fee through the return delta.
- Liquidity behaviour
- Liquidity callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) are exposed as selectors but are not enabled by the hook permissions, so they are not invoked by the PoolManager.
- Fee behaviour
- Hook sets a dynamic LP fee via setPoolFee and a hook fee in basis points (hookFeeBps, capped by MAX_HOOK_FEE_BPS); beforeSwap appears to return a fee override and a return delta that takes a hook fee from swaps.
- Owner & admin controls
- Owner (0x8da5cb5b) can call setExecutor, setHookFeeBps, setPoolFee, withdrawToken and the unnamed nonpayable selectors 0x8e5c0c39 and 0xbbfe243e; the owner can change the hook fee in basis points and the pool's dynamic fee, and can withdraw tokens from the hook. Executor role is set by owner.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: used to compute and apply a dynamic fee and a return delta that moves a hook fee on each swap; beforeSwapReturnDelta: allows the hook to take part of the swap amount as its own delta.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: A single owner key controls the executor, the hook fee rate, the pool fee and token withdrawals from the hook, so it could raise fees up to the caps or drain tokens the hook holds.
Risk to user funds: The hook can take a share of swap amounts through its return delta and the owner can withdraw tokens the hook holds; swaps are not shown to be blockable by a pause, but this could not be confirmed without source.
Security findings
- [medium] Owner withdrawal of hook-held tokens: Owner can call withdrawToken, which transfers tokens out of the hook contract.
- [medium] Hook takes a swap fee through return delta: beforeSwapReturnDelta lets the hook take a share of each swap, and the owner sets that share via setHookFeeBps.
- [low] Owner can change fees: setPoolFee and setHookFeeBps are owner-controlled and bounded only by on-chain constants (MAX_POOL_FEE, MAX_HOOK_FEE_BPS), so fees can be raised within those limits instantly.
- [info] Unidentified privileged functions: Unnamed nonpayable selectors 0x8e5c0c39, 0xbbfe243e and 0xe4e78bb0 could not be identified, so their effects are unknown.
Contract details
- Verified source
- No
- Bytecode size
- 11,304 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using Dynamic fee hook
- RNT / USDT0 (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today