Dynamic fee hook on Polygon
Uniswap v4 Hook Contract 0x18e982bdc3d5ae598e120c89c826630d3c6bc088 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
- 0
What it does
A Polygon Uniswap v4 hook that applies a dynamic, owner-adjustable fee on swaps and can take a share of swap currency through return deltas.
How it works step by step
- Runs logic in beforeSwap on every swap in pools using this hook
- Sets dynamic LP fee and stores pool fee configuration on-chain
- Takes a hook fee in basis points, capped by MAX_HOOK_FEE_BPS
- Uses beforeSwapReturnDelta to adjust the swap's settled amounts
- Holds token balances that the owner can withdraw via withdrawToken
- Exposes executor-based swap and settlement helpers
- Swap behaviour
- beforeSwap runs on every swap, sets or reads the dynamic pool fee and hook fee, and returns a delta that adjusts settled amounts, so the hook can take a cut of swap currency.
- Liquidity behaviour
- No liquidity callbacks are enabled; beforeAddLiquidity and beforeRemoveLiquidity selectors exist in the ABI but permissions only enable beforeSwap and beforeSwapReturnDelta.
- Fee behaviour
- Dynamic fee: the hook sets or updates the LP fee via a pool fee storage slot and a hook fee in basis points, bounded by MAX_POOL_FEE and MAX_HOOK_FEE_BPS. Exact fee formula could not be determined without source.
- Owner & admin controls
- Owner-gated functions include setExecutor(address), setHookFeeBps(uint24), setPoolFee(PoolKey,uint24) and withdrawToken(address,address,uint256). Owner is exposed via owner(). Owner can set the executor address, change the hook fee in basis points (capped by MAX_HOOK_FEE_BPS), change the pool fee, and withdraw tokens held by the hook. Upgradeability not determined from the input.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap is used to compute a dynamic fee and/or take a fee on swaps; beforeSwapReturnDelta lets the hook return a delta that alters the amounts settled for the swap, meaning the hook takes or gives currency during swaps.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can change pool and hook fees, change the executor, and withdraw tokens from the hook, which can affect swap pricing and fund custody.
Risk to user funds: The hook can hold and move tokens during swaps through return deltas and the owner can withdraw tokens the hook holds. Users' swaps depend on the hook's fee and settlement logic, which cannot be fully verified without source.
Security findings
- [medium] Hook takes currency via return delta: beforeSwapReturnDelta lets the hook move currency during swaps, so the hook contract can hold balances that are subject to owner withdrawal.
- [medium] Owner can withdraw hook-held tokens: withdrawToken(address,address,uint256) is owner-gated and can transfer tokens held by the hook out to an arbitrary recipient.
- [low] Owner-adjustable fees: setPoolFee and setHookFeeBps let the owner change fees; the caps MAX_POOL_FEE and MAX_HOOK_FEE_BPS limit the damage but the exact values are not known from input.
- [info] Privileged executor role: setExecutor sets a privileged executor address whose role could not be fully decoded; executor appears tied to swapExactInput and settlement helpers.
Contract details
- Verified source
- No
- Bytecode size
- 10,894 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