Dynamic fee hook on Robinhood Chain

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

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

What it does

A Uniswap v4 hook that gives pools a dynamically adjusted swap fee and can take a portion of swap value through return deltas, with owner-managed pool registration and fee settings, deployed on Avalanche C-Chain.

This read was written for the hook 0xc038…c088 on Avalanche and reused here: the two share a code shape, so constants such as fees, owners and addresses can differ.

How it works step by step

  • Implements beforeSwap, which runs before each swap in an enabled pool and can set the fee for that swap via an updateDynamicLPFee-style pool manager call
  • Uses beforeSwapReturnDelta, so the hook can alter the swap's currency deltas and take or settle a share of swap amounts on behalf of the pool
  • Keeps a per-pool configuration (getPoolConfig) and an enable flag set through setPoolEnabled, so only registered pools are affected
  • Stores admin-set fee parameters (setPoolFee and an admin fee-setting function taking several uint24 values) that feed the dynamic fee and hook fee
  • Includes a backend-driven pricing or validation path (validatePool, backendSqrtPriceX96, swapExactInput, validation errors) that appears to check pool price against an external backend before swaps or routing
  • Provides a withdrawToken and tokenBalance facility so accumulated tokens held by the hook can be moved out by the owner
Swap behaviour
beforeSwap is a nonpayable callback that reads the pool config and enable flag, computes or looks up a fee, and returns a delta and fee override; it can also consult an external backend price and interact with the pool manager (take/settle/sync calls appear in the bytecode). Exact fee formula cannot be confirmed without source.
Liquidity behaviour
The hook exposes before/after add and remove liquidity and donate callbacks, but their selectors are view-only stubs that appear to return without changing state; no liquidity-related logic is evident.
Fee behaviour
Sets a dynamic LP fee per swap, bounded by MAX_LP_FEE, and takes a hook fee bounded by MAX_HOOK_FEE_BPS (basis points against BPS_DENOMINATOR); accumulated hook fees appear to be held by the contract and withdrawable by the owner.
Owner & admin controls
An owner (owner() view) and an executor address are present; owner-restricted (NotOwner error) functions set pool enablement, pool fees and hook fee parameters, and withdraw tokens. Exact role boundaries between owner and executor cannot be confirmed without source. No proxy or upgrade pattern is evident from the selectors.

Enabled Uniswap v4 callbacks

beforeSwap, beforeSwapReturnDelta

beforeSwap: sets the dynamic fee and runs the swap logic; beforeSwapReturnDelta: lets the hook return a delta so it can take part of the swap amount as its own fee.

Security & trust assessment

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

Who controls it: A single owner (and possibly an executor) can enable or disable pools, set fees, set hook fee parameters, and withdraw any tokens the hook holds, so users depend on that key acting honestly.

Risk to user funds: The hook can take a share of swap value through return deltas and holds accumulated fees, so it can hold and move pool-related funds; owner withdrawal functions can remove those balances, and a disabled or misconfigured pool can block or alter swaps.

Security findings

  • [high] Owner can withdraw hook-held tokens: withdrawToken(address,address,uint256) and withdraw(uint256) are owner-gated and the hook holds fee-derived balances, so the owner can drain accrued funds from the contract.
  • [medium] Owner controls the swap fee: setPoolFee and the fee-parameter setter let the owner change LP and hook fees per pool; the bounds (MAX_LP_FEE, MAX_HOOK_FEE_BPS) limit but do not eliminate abuse, and a high hook fee would extract value from swappers.
  • [medium] Return-delta fund movement: beforeSwapReturnDelta lets the hook alter swap deltas and move currency via take/settle/sync, so a bug or malicious change could divert value from swaps.
  • [medium] External backend dependency: The presence of backendSqrtPriceX96 and validatePool suggests swap behaviour depends on an off-chain or privileged price source, which introduces trust in that backend and possible manipulation or griefing if it is wrong.
  • [info] Source not verified: No verified source is available, so the exact logic, access control roles and fee formulas are inferred from selectors and cannot be confirmed.

Contract details

Verified source
No
Bytecode size
14,454 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, moves-currency, return-delta

Pools using Dynamic fee hook