Dynamic fee hook on Robinhood Chain
Uniswap v4 Hook Contract 0x247f19f97e90572d1577b771bf59017423c260c4 on Robinhood Chain · 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
This hook charges an additional return-delta fee on swaps in pools it manages, with the amount set per pool by a privileged admin, so traders receive less output than the pool's base fee alone implies, and liquidity providers are not affected by the hook directly.
How it works step by step
- Implements beforeInitialize to register a pool configuration keyed by pool id, storing per-pool parameters such as fee settings and module configuration.
- Uses beforeSwap and afterSwap callbacks, with afterSwap able to adjust the swap's return delta so the hook can take or give back a portion of the swap amounts.
- Maintains a mapping of pools and configs (poolKeys, configs, getPool) and exposes a MIN_FEE/MAX_FEE and MIN/MAX stale-after parameter set, suggesting a configurable, module-driven fee or accounting scheme.
- Includes a royalty/protocol-share mechanism (PROTOCOL_SHARE_BPS, MAX_TOTAL_ROYALTY_BPS) and a modules list with a registry, indicating fees are split between the protocol and other recipients.
- Exposes admin functions such as transferAdmin and resign on a per-pool basis, and a quoteFee view that computes the fee a swap would pay in a given direction.
- Liquidity callbacks (beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity, afterRemoveLiquidity) exist in the ABI but are not enabled by the hook permissions, so they are not invoked by the pool manager.
- Swap behaviour
- beforeSwap and afterSwap run on every swap. afterSwap can alter the return delta, so the hook may take a fee or share from swap amounts on top of the pool's own fee. Exactly which trade directions pay more or less cannot be determined from the decoded bytecode alone.
- Liquidity behaviour
- Liquidity callbacks are not enabled in the hook permissions, so adding or removing liquidity is not intercepted by the hook.
- Fee behaviour
- Fees are computed per pool by the hook, with quoteFee exposing the computed value for a given direction and MIN_FEE/MAX_FEE bounding it. Protocol and royalty shares are taken from swap flows via return deltas. The exact formula is not recoverable without verified source.
- Owner & admin controls
- A transferAdmin function and a resign function indicate per-pool admin roles that can be transferred or relinquished. Parameter-setting selectors (setting fees via 0x8c22f993, 0x142ac90d, 0x912a22a8, 0x971914a4, 0xb732649a) suggest admins can change fee and module parameters. Whether there is an upgrade path or pause is not determinable from the bytecode.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap, afterSwap, afterSwapReturnDelta
beforeInitialize registers pool configuration when a pool is created. beforeSwap runs pre-swap checks and state refresh. afterSwap updates accounting and applies the return-delta fee or share. afterSwapReturnDelta lets the hook claim part of the swap output.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: A per-pool admin can likely change fee parameters and reassign admin, and could redirect protocol or royalty shares to another recipient within the configured bounds.
Risk to user funds: The hook can take a portion of swap output through return deltas, so traders pay the extra fee on swaps routed through this pool. It does not hold liquidity directly, but parameter changes can alter the amounts users receive.
Security findings
- [medium] Return-delta fee capture: afterSwapReturnDelta is enabled, so the hook can take a share of each swap output. Fee magnitude is bounded by MAX_FEE, but the bound depends on admin-set parameters.
- [medium] Admin-adjustable fee parameters: Multiple nonpayable selectors write fee and module state (for example 0x8c22f993 and 0xb732649a), so a privileged key could raise fees toward the MAX_FEE bound and change which modules receive shares.
- [low] Role transfer and resignation: transferAdmin (0x63ed2f60) and resign (0x5a31613b) change who controls a pool's configuration; a compromised admin key could redirect fee recipients.
- [info] Unverified logic: No verified source is available, so the exact fee arithmetic and access checks are inferred from selectors and storage layout only.
Contract details
- Verified source
- No
- Bytecode size
- 20,911 bytes
- Upgradeable proxy
- No
- Detected patterns
- liquidity-management, return-delta
Pools using Dynamic fee hook
- TSLA / USDG (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today