Dynamic fee hook on Robinhood Chain

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

Volume (24h)
$414
Value locked (TVL)
$18.94K
All-time volume
$4.57M
Pools using this hook
1
Swaps (24h)
28 (14 traders)
Total swaps
27,161

What it does

A Uniswap v4 hook that applies a time-decaying dynamic fee on swaps, captures part of the swap flow via return deltas for dev and buyback purposes, and manages liquidity additions and withdrawals through a queue, with the owner controlling fee and cap parameters.

How it works step by step

  • Sets a dynamic fee that decays from a starting level over a decay window after trading opens
  • Applies a per-block cap on activity as tracked by capPerBlock and capRoom
  • Accumulates fees in totalFees and reserves a dev share (devBps) withdrawable as devDue
  • Runs buyback logic that spends accumulated value (buybackSpent, buybackBurned) via the buyback function
  • Manages liquidity through addLiquidity, removeLiquidity and a withdrawal queue
  • Uses an unlock callback to perform currency movements within the pool manager
Swap behaviour
beforeSwap and afterSwap are enabled with return-delta permissions, so the hook adjusts the swap fee based on the decay schedule and can take a share of the swap amounts for fees and buybacks.
Liquidity behaviour
beforeAddLiquidity and beforeRemoveLiquidity are enabled and afterAddLiquidity/afterRemoveLiquidity are present as selectors; the hook exposes addLiquidity and removeLiquidity wrappers and a withdrawQueue function, suggesting it manages liquidity positions and a queue of pending withdrawals. The hook also uses a self-unlock pattern (unlockCallback, unlock), so it takes control of pool currency movements itself.
Fee behaviour
Fee is computed by feeAt/feeAtTime/currentFee from fee parameters (FEE_DEFAULT, FEE_MIN, FEE_MAX, DECAY_FEE_MAX, decay window and decay start) that decay over time after trading opens, and the owner can set the base fee via setFee and decay start via setDecayStart. Fee-related balances accumulate as totalFees and a dev share (devBps, devDue) is withdrawable by the owner. The exact fee formula could not be verified without source.
Owner & admin controls
Owner-gated via Ownable (owner(), transferOwnership, renounceOwnership, two-step requestOwnershipHandover/completeOwnershipHandover). Owner can call setFee (fee bps), setShift (shift bps), setDevBps (dev share), setDecayStart, setCap (per-block cap), setCollection (one-time set of collection address), withdrawDev and withdrawQueue. No pause or upgrade function was identified in the decoded selectors.

Enabled Uniswap v4 callbacks

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

beforeInitialize and beforeSwap set initialization and fee logic, afterSwap updates accounting/buyback state, beforeSwapReturnDelta and afterSwapReturnDelta allow the hook to take or give currency deltas during swaps (used for fee or buyback capture), beforeAddLiquidity and beforeRemoveLiquidity gate or account liquidity changes.

Security & trust assessment

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

Who controls it: The owner controls fee level, shift, dev share, per-block cap and the collection address and can withdraw dev funds. The owner can raise the fee to its maximum and change the cap, altering trader costs and the amount of fee or buyback capture.

Risk to user funds: The hook has custody of accumulated fee, buyback and queued withdrawal balances and moves currency during swaps and liquidity operations through return deltas and unlock callbacks. Owner can withdraw dev balances and adjust fees, so users depend on the owner honestly configuring and not misusing these balances; the exact flows could not be fully verified without source.

Security findings

  • [medium] Swap return-delta captures value: Return-delta permissions let the hook take currency from swaps; the owner can change the fee and shift parameters that determine how much is taken.
  • [medium] Owner can change fee and cap parameters: setFee, setShift, setDevBps and setCap are owner-only with bounds checked by BadFee/BadShift errors; owner can adjust economic parameters at any time.
  • [medium] Hook holds and moves funds: The hook uses a self-unlock callback and moves currency with take and transfer selectors, so it holds and moves pool funds, and withdrawDev/withdrawQueue let the owner and queue withdraw balances.
  • [info] Single-owner control: Ownership can be transferred or renounced via Ownable; single owner key controls all admin functions.

Contract details

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

Pools using Dynamic fee hook