Dynamic fee hook on Robinhood Chain

Uniswap v4 Hook Contract 0x43d4238f590e6598746322f74028c6a60142b0cc 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 sets a dynamic swap fee for each pool from a base and meme fee schedule that decays over time, and it takes a protocol share of collected fees with the rest accruing to liquidity providers.

How it works step by step

  • Sets a per-pool dynamic swap fee via a base fee, a meme fee tier and a time-based fee schedule (feeBipsAt, poolTimestamps, DYNAMIC_FEE_THRESHOLD)
  • Splits collected fees between a protocol recipient (PROTOCOL_SHARE_BIPS) and liquidity accrual (accrued, accruedProtocol, pendingFees)
  • Distributes accrued fees through an unlock callback that settles currency with the pool manager and vault (distribute, payout, unlockCallback)
  • Tracks pool initialization and pair token configuration in afterInitialize and beforeInitialize, enforcing pool fee and pair validity
  • Gates liquidity add and remove operations with before and after liquidity callbacks, while donations are routed through beforeDonate and afterDonate
Swap behaviour
beforeSwap computes the swap fee from the pool's current fee schedule (base fee, meme fee and elapsed time since pool initialization) and can return a before-swap delta. afterSwap records fee accrual and may return an after-swap delta that takes a portion of the swap amount into hook accounting. Exact pricing by direction cannot be fully confirmed from decoded bytecode.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present and are used for liquidity-management bookkeeping and fee settlement around LP changes; they do not appear to block liquidity in normal operation.
Fee behaviour
Dynamic fee: the hook returns an override fee per swap based on baseFeeBips, memeFeeBips, and time-decay via feeBipsAt, bounded by MIN/MAX_MEME_FEE_BIPS and MAX_FEE_BIPS. A share of collected fees (PROTOCOL_SHARE_BIPS of TOTAL_FEE_BIPS) goes to the protocol recipient and the remainder accrues to LPs.
Owner & admin controls
Owner (Ownable with transferOwnership, acceptOwnership, renounceOwnership) can set the protocol recipient, the vault, and the controller. The controller is a separate privileged role set by owner. Owner-set parameters and any fee-related limits cannot be confirmed without source. No pause function is identified in the selectors.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize validate and configure new pools; beforeSwap sets the dynamic fee override and may take a return delta; afterSwap accrues fees and may take an after-swap return delta; beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can move currency on swaps; liquidity and donate callbacks are used for accounting around LP and donation flows.

Security & trust assessment

Risk level: medium, estimated (decoded bytecode, medium confidence).

Who controls it: The owner can reassign the protocol recipient, the vault and the controller, and can renounce or transfer ownership. A malicious or compromised owner or controller could redirect accrued fees or change where swap currency settles.

Risk to user funds: The hook holds accrued fee balances (accrued, accruedProtocol) and moves currency through return deltas and the vault during swaps and distributions. User funds in swaps pass through hook-managed accounting, so the hook can affect amounts received by traders and the value accruing to LPs.

Security findings

  • [medium] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take a share of swap amounts into its own accounting on every swap, which affects what traders receive.
  • [medium] Privileged owner and controller roles: Owner can change protocolRecipient, vault and controller via setProtocolRecipient, setVault, setController; a compromised key could redirect accrued fees or swap settlement to another vault.
  • [low] Dynamic fee parameters set off-chain policy: Fee tiers (baseFeeBips, memeFeeBips, DYNAMIC_FEE_THRESHOLD, time schedule) are stored in mappings writable through controller paths; the bounds MIN/MAX_MEME_FEE_BIPS limit but do not fully prevent high fees.
  • [info] Self-unlock pattern: The hook calls the pool manager unlock path and handles unlockCallback itself to perform payouts and distributions, a standard but privileged pattern that depends on correct caller checks.
  • [info] No source to verify internal logic: Without verified source, correctness of fee math, payout gas handling and access checks cannot be confirmed from bytecode alone.

Contract details

Verified source
No
Bytecode size
8,953 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, liquidity-management, moves-currency, ownable, return-delta, self-unlock

Pools using Dynamic fee hook