Dynamic fee hook on Robinhood Chain

Uniswap v4 Hook Contract 0x419887c557091b0f4189da7a7e7f6082b0c9aacc on Robinhood Chain · Dynamic fee

Volume (24h)
$0
Value locked (TVL)
$458
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, time-decaying swap fee with a dev share and buyback/royalty flows, gated by a trading open time and a per-block liquidity cap.

How it works step by step

  • Computes a dynamic swap fee that decays from a high level toward a base fee over a decay window
  • Accrues a dev share of fees (devBps) into devDue, withdrawable by withdrawDev
  • Gates swaps until a trading open time and a trading latch
  • Caps liquidity added per block (capPerBlock, capRoom)
  • Runs buyback and royalty unwrapping that moves hook-held tokens via the pool manager
  • Exposes owner-only parameter setters for fee, shift, decay start, dev share and cap
Swap behaviour
beforeSwap computes the dynamic fee and gates trading; afterSwap updates fee and shift state and accounting; return deltas let the hook take a portion of swap amounts.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity and afterRemoveLiquidity are hooked, and addLiquidity and removeLiquidity wrappers exist that call back into the pool manager via unlockCallback; the hook manages its own position with tick bounds (posFloorSqrt, poolReady) and tracks a per-block liquidity cap (capPerBlock, capRoom).
Fee behaviour
Fee is dynamic: currentFee and feeAt(time) are computed from an epoch price ceiling and a decay schedule (decayStartBps, decayEndsAt, DECAY_WINDOW, DECAY_FEE_MAX), bounded by FEE_MIN and FEE_MAX, with a devBps share of fees accrued to devDue and withdrawn via withdrawDev. Owner can set the base fee via setFee.
Owner & admin controls
Owner (Ownable, two-step ownership handover) can set fee via setFee, set shift via setShift, set decay start via setDecayStart, set dev share via setDevBps, set cap via setCap, set collection via setCollection, and renounce or transfer ownership. Owner-gated functions are present in storage slot 0x...8738 (owner) reads/writes; no upgrade proxy pattern was identified.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeAddLiquidity, beforeRemoveLiquidity, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize and afterInitialize validate and set up the pool; beforeAddLiquidity and beforeRemoveLiquidity gate liquidity changes; beforeSwap sets the dynamic fee override and gates trading (tradingOpen, TRADING_OPENS_AT); afterSwap updates fee/shift state and accounting; beforeSwapReturnDelta and afterSwapReturnDelta let the hook take a share of swap amounts as return deltas (buyback, royalties, dev share).

Security & trust assessment

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

Who controls it: The owner can change the fee, shift, decay start, dev share and per-block cap at any time, and can change the collection address that receives funds. A malicious or compromised owner could set the fee to FEE_MAX, redirect collection, or raise the dev share, extracting value from swappers.

Risk to user funds: The hook uses self-unlock and currency movement to take tokens, and return deltas can redirect part of each swap to the hook, dev and royalty accounts. The hook can also hold buyback and royalty balances. Owner parameter changes can change how much is taken per swap.

Security findings

  • [medium] Return-delta fee extraction: Hook takes a share of swap amounts through return deltas and accrues devDue; the dev share is set via setDevBps and withdrawn via withdrawDev.
  • [medium] Owner-controlled fund routing: Owner can set the collection address via setCollection and trigger buyback and unwrapRoyalties, moving tokens held by the hook.
  • [low] Trading gate: tradingOpen and TRADING_OPENS_AT gate swaps by time; swaps can be blocked before the open time or when the latch is set.
  • [low] No timelock on parameter changes: Owner can change the fee to any value within bounds, with no timelock visible in the decoded functions.
  • [info] Unverified source: Source is not verified; behaviour is inferred from selectors, storage and the heuristic tags moves-currency, ownable, return-delta and self-unlock.

Contract details

Verified source
No
Bytecode size
16,024 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, ownable, return-delta, self-unlock

Pools using Dynamic fee hook