Dynamic fee hook on Polygon
Uniswap v4 Hook Contract 0x0903febef74279db5fc456fbf6e3c7c83e398088 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 Uniswap v4 hook that applies a dynamic LP fee and a hook fee on swaps, with owner-configurable fee parameters and token withdrawal.
How it works step by step
- Runs beforeSwap on every swap and returns a delta to take fees in the swap currency
- Applies an owner- or executor-set LP fee for the pool up to MAX_POOL_FEE
- Charges a hook fee expressed in basis points, capped by MAX_HOOK_FEE_BPS
- Accumulates hook fee balances that can be withdrawn by the owner via withdrawToken
- Interacts with the PoolManager using take, settle and sync to settle currency
- Swap behaviour
- On swaps, beforeSwap runs and can return a currency delta, taking a hook fee and settling tokens through the PoolManager while applying the configured pool fee.
- Liquidity behaviour
- No liquidity callbacks are enabled in the permissions; the beforeAddLiquidity/afterAddLiquidity/beforeRemoveLiquidity/afterRemoveLiquidity selectors exist in the dispatch table but are not among the enabled hook permissions, so they are not invoked by the PoolManager.
- Fee behaviour
- Fee is set by the owner or executor via setPoolFee (LP fee, bounded by MAX_POOL_FEE) and a hook fee in bps via setHookFeeBps; beforeSwap is the path that applies these fees and can return a currency delta, and updateDynamicLPFee is referenced, indicating the LP fee is dynamically updated through the PoolManager.
- Owner & admin controls
- Owner can set the executor address (setExecutor), set the per-pool LP fee (setPoolFee), set the hook fee in basis points (setHookFeeBps, capped by MAX_HOOK_FEE_BPS), and withdraw tokens (withdrawToken). Owner is exposed via owner(); access checks appear to use a NotOwner error and the executor may be a separate privileged caller.
Enabled Uniswap v4 callbacks
beforeSwap, beforeSwapReturnDelta
beforeSwap: adjusts or applies fees and takes currency on swaps. beforeSwapReturnDelta: lets the hook return a delta that alters the swap amounts, allowing it to take a fee or settle currency from the swap.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner and executor can change the pool LP fee up to the maximum, change the hook fee up to its cap, and withdraw tokens held by the hook. A malicious or compromised key could extract hook-held balances or manipulate fee rates to the cap affecting swappers.
Risk to user funds: The hook takes and settles currency during beforeSwap via return deltas and can hold fee balances, which the owner can withdraw with withdrawToken; swaps route through this accounting, so a misbehaving hook could affect swap outcomes for users.
Security findings
- [medium] Hook moves currency during swaps: The hook can return a delta in beforeSwap and takes/settles currency via take, settle and sync, so it directly moves user swap funds to its own accounting.
- [medium] Owner can withdraw hook-held tokens: withdrawToken lets the owner transfer tokens the hook holds, including any fee balances accumulated from swaps.
- [medium] Fees adjustable by privileged keys: setPoolFee and setHookFeeBps allow the owner or executor to change fees up to the configured maximums, with no timelock evident in the bytecode.
- [info] Separate executor role: Selector-based dispatch shows an executor role separate from owner, which expands the set of addresses with privileged control.
- [info] Unverified source: No source is available, so the exact access-control checks and any upgrade or pause mechanism could not be confirmed from bytecode.
Contract details
- Verified source
- No
- Bytecode size
- 7,991 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, moves-currency, return-delta
Pools using Dynamic fee hook
- USDC / RNT (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today