Dynamic fee hook on Robinhood Chain

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

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

What it does

This hook charges a basis-point tax on swaps, routed to a tax router, while maintaining a tick oracle, but the exact rate and which trades pay more could not be confirmed from the decoded bytecode.

How it works step by step

  • Maintains a per-pool oracle of observations (tick cumulatives) in a ring buffer, updated on swaps, similar to a Uniswap v3 oracle
  • Exposes observe, getObservation and increaseCardinalityNext so external contracts can read time-weighted tick data
  • Computes a swap-time tax using the pool's observed price, routed through a tax router (taxRouter selector present)
  • Uses beforeSwap and afterSwap return deltas, which indicates the hook can take or redirect part of swap amounts and call take() on the pool manager
  • Reads and writes pool state through getState and states mappings and validates cardinality limits (MAX_CARDINALITY, MIN_OBS_SPACING)
Swap behaviour
On each swap beforeSwap and afterSwap run; the hook applies a fee/tax denominated in basis points (FEE_BPS), can return a delta that changes the amounts settled, and calls take() on the pool manager to move the tax amount. Which swap direction pays more cannot be determined from the decoded bytecode.
Liquidity behaviour
beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are dispatched but appear to be view or pass-through checks; no clear liquidity-altering logic was identified.
Fee behaviour
A tax in basis points (FEE_BPS) is taken on swaps via return deltas and routed to a tax router; exact rate and recipient split could not be confirmed from bytecode.
Owner & admin controls
No owner or pause selector was identified among dispatched functions; a manager() and taxRouter() getter exist, so the tax destination appears to be set at deployment or by the router. Whether any setter exists could not be determined.

Enabled Uniswap v4 callbacks

beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta

beforeSwap: sets the swap-time tax and optional return delta. afterSwap: updates the oracle observation and may apply a return delta. beforeSwapReturnDelta and afterSwapReturnDelta: allow the hook to take a portion of swap amounts. Liquidity and donate callbacks: present but apparently non-intervening.

Security & trust assessment

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

Who controls it: Without source, the taxRouter address and any parameter setters are unknown; a privileged key controlling them could redirect or raise the tax on swaps.

Risk to user funds: The hook can take tokens from swaps through return deltas and take() calls, so user swap proceeds are directly exposed to the tax logic.

Security findings

  • [medium] Return-delta fee capture: beforeSwapReturnDelta and afterSwapReturnDelta are enabled and take() is called, so the hook can skim tokens from every swap; the tax amount is not verifiable without source.
  • [medium] Unverified tax router dependency: Tax proceeds are routed to an external taxRouter address; if it is mutable or upgradeable, the destination of user funds could change.
  • [info] Oracle-dependent tax: The tax appears to depend on observed tick data, which can be influenced by large trades within the same block, so tax levels may be manipulable.

Contract details

Verified source
No
Bytecode size
10,621 bytes
Upgradeable proxy
No
Detected patterns
moves-currency, oracle, return-delta, tax

Pools using Dynamic fee hook