Dynamic fee hook on BNB Chain
Uniswap v4 Hook Contract 0xca9d131ad04fd800d4dd71620d219f63ebec5800 on BNB Chain · Dynamic fee
- Volume (24h)
- $9.42K
- Value locked (TVL)
- $0
- All-time volume
- $145.72K
- Pools using this hook
- 6
- Swaps (24h)
- 26 (3 traders)
- Total swaps
- 928
What it does
A dynamic-fee hook that lets an admin set per-pool LP fees and restricts who can add liquidity to a pool.
How it works step by step
- Sets an initial dynamic LP fee for each pool when it is initialized (afterInitialize).
- Stores per-pool fee values and pushes them to the pool manager via updateDynamicLPFee.
- Allows the owner or fee manager to set fees per pool or in batch, bounded by a fee cap.
- Gates liquidity additions (beforeAddLiquidity) to an allowlist of addresses or trusted routers.
- Lets the owner manage the allowlist and trusted router set.
- Swap behaviour
- No swap callbacks.
- Liquidity behaviour
- beforeAddLiquidity restricts adds: the sender must be on the liquidity allowlist (mapping at slot 6) or the call is routed through a trusted router (slot 7); otherwise it reverts. beforeRemoveLiquidity and afterRemoveLiquidity are present as selectors but not enabled in the hook permissions, so removals are not hooked. afterAddLiquidity is selector-present but not enabled.
- Fee behaviour
- Fees are per-pool and set by the owner or fee manager through setLPFee and a batch fee setter, bounded by DEFAULT_FEE and HARD_MAX_FEE constants and a FeeOutOfBounds check; the stored fee is pushed to the pool via updateDynamicLPFee and currentFee reads it back. Initial pool fee is assigned in afterInitialize.
- Owner & admin controls
- Owner (Ownable2Step: transferOwnership, acceptOwnership, renounceOwnership) can set the fee manager, set per-pool LP fees via setLPFee, manage the liquidity allowlist (setLiquidityAllowed), manage trusted routers (setTrustedRouter), and call the batch function at selector 0xb5569976 that updates pool fees for arrays of pool keys. The owner can also renounce ownership.
Enabled Uniswap v4 callbacks
afterInitialize, beforeAddLiquidity
afterInitialize: assigns the initial dynamic LP fee and marks the pool as initialized. beforeAddLiquidity: gates liquidity additions to allowlisted addresses or trusted routers.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: The owner controls pool fees, the liquidity allowlist and trusted routers. A compromised owner or fee manager could raise fees up to the hard max on any pool or grant or revoke liquidity provision access, affecting LP and trader economics, but cannot directly move pooled tokens based on the decoded functions.
Risk to user funds: The hook does not appear to take or hold user tokens directly. Users are exposed to fee changes by the owner or fee manager and to being unable to add liquidity if they are not allowlisted. Swap logic is present via beforeSwap and afterSwap selectors but the hook permission set indicates no swap callbacks are enabled, so swaps use the pool's dynamic fee path.
Security findings
- [medium] Admin-adjustable dynamic fee: Owner and fee manager can change LP fees per pool within bounds; fees can be set up to HARD_MAX_FEE, which can extract value from traders.
- [medium] Restricted liquidity provision: beforeAddLiquidity reverts for addresses not on the allowlist and not from trusted routers, so the pool may only accept liquidity from approved parties.
- [low] Single privileged owner key: Owner rights are managed through Ownable2Step (pending owner, accept step), which reduces accidental transfer risk but a single key still controls all administrative functions.
- [info] Fee bounds enforced: Bytecode contains selectors for FeeOutOfBounds and a fee-manager role, implying bounded admin changes rather than unlimited ones.
Contract details
- Verified source
- No
- Bytecode size
- 6,495 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, ownable
Pools using Dynamic fee hook
- USDT / POP (Dynamic fee) — 24h volume $9.42K, TVL $0, 26 swaps today
- USDT / POP (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- CT / USDT (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- CT / USDT (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- USDT / MarsCoin (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today
- USDT / Nailoong (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today