Dynamic fee hook on Robinhood Chain

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

Volume (24h)
$0
Value locked (TVL)
$0
All-time volume
$0
Pools using this hook
1
Swaps (24h)
215 (131 traders)
Total swaps
215

What it does

This hook sets a dynamic fee on swaps in its pool, with an extra decaying launch tax on early trades; trades made during the launch window pay more, while later trades pay the base fee plus the hook fee.

How it works step by step

  • Sets a dynamic swap fee for a Uniswap v4 pool, reading a TWAP-based oracle state (slots 0x0e/0x0f/0x10 hold observation/checkpoint data) and a current fee value stored in the hook
  • Applies a time-decaying launch tax (launchTaxStartBps, launchTaxDuration, launchTaxAccrued, launchStart) to swaps shortly after pool launch, capped by MAX_LAUNCH_TAX_BPS and MAX_LAUNCH_TAX_DURATION
  • Takes a hook fee on swaps (hookFeeBps, treasuryShareBps) and accrues it to a treasury and a rewards/buyback reserve
  • Returns deltas from beforeSwap and afterSwap, so it can take or give currency on swap settlement
  • Runs a buyback mechanism: funds are added via fundBuyback, executed via buyback() and tracked by buybackReserve and lastBuybackAt
  • Calls back into the PoolManager through unlock/unlockCallback to settle and take tokens for treasury flushes and buybacks
Swap behaviour
beforeSwap and afterSwap both run, and both can return deltas. The swap fee is the dynamic currentFeeBps plus any launch tax that is still decaying, with the hook fee taken on top. Swaps during the launch window pay the higher launch tax; later swaps pay the base fee. Exact per-direction treatment cannot be confirmed without source.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity selectors are present as view-marked dispatch entries, but the hook permissions do not enable these callbacks, so they are not expected to execute. Liquidity is not otherwise altered.
Fee behaviour
The fee is dynamic: currentFeeBps is derived from the oracle and updated through the hook, with owner-settable fee parameters via setFees(uint16,uint16). A launch tax (launchTaxStartBps decaying over launchTaxDuration, bounded by MAX_LAUNCH_TAX_BPS) is added during the launch window. A hook fee (hookFeeBps, bounded by MAX_HOOK_FEE_BPS) is taken and split between treasury and rewards.
Owner & admin controls
Ownable with a two-step transfer (transferOwnership, pendingOwner, acceptOwnership). The owner can call setFees to change hookFeeBps and the fee parameters within the maximum bounds. The treasury and launchTaxRecipient addresses are set at deployment and cannot be confirmed as changeable. The hook is an upgradeable or proxy pattern only if a proxy is present, which the bytecode does not show. No pause function was identified.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeInitialize: validates and records the pool key and initial state. beforeSwap: computes the dynamic and launch-tax fee and may return a delta. afterSwap: accrues the hook fee, updates oracle/checkpoint state and may return a delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a share of swap amounts as its fee.

Security & trust assessment

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

Who controls it: The owner can change hook fee parameters within fixed maximums and controls ownership transfer. A compromised owner key could raise fees up to the cap on all pool swaps, and could affect treasury-related flows if they are owner-gated.

Risk to user funds: The hook can take a fee from every swap through return deltas and holds accrued treasury and buyback balances, which are moved out by flush and buyback calls. Users are exposed to the fee rate and launch tax, not to direct loss of pooled liquidity.

Security findings

  • [medium] Owner can change hook fee parameters: setFees(uint16,uint16) is an owner-only nonpayable function that writes into the hook fee storage slot. Within the on-chain caps, the owner can raise the fees charged on every swap.
  • [medium] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook takes a portion of each swap as its fee and can settle or take tokens through the PoolManager unlock flow. Users pay this fee on every swap.
  • [info] Launch tax on early swaps: A launch tax decays from launchTaxStartBps over launchTaxDuration. Early swaps pay substantially more, and the tax is routed to launchTaxRecipient.
  • [low] Treasury and buyback fund flows: Accrued fees are stored as treasuryAccrued and buybackReserve and moved by flushTreasury and buyback. The recipients and any restrictions on these calls could not be verified.
  • [low] Oracle-dependent fee: The dynamic fee depends on TWAP observation data updated from swaps. Manipulation of the window (MIN_TWAP_WINDOW, MAX_TICK_DEVIATION are the bounds) could shift the fee, though the bounds limit the effect.

Contract details

Verified source
No
Bytecode size
14,346 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, launchpad, moves-currency, oracle, ownable, return-delta, rewards, self-unlock, tax

Pools using Dynamic fee hook