MarlinDynamicFeeHookV2 on Robinhood Chain

Uniswap v4 Hook Contract 0xa1393e61ee9b9a605103551e1e54b317e2a86080 on Robinhood Chain · Dynamic fee · Verified contract

Volume (24h)
$11.40K
Value locked (TVL)
$22.57K
All-time volume
$18.33K
Pools using this hook
5
Swaps (24h)
113 (74 traders)
Total swaps
715

What it does

A Uniswap v4 dynamic-fee hook that prices each swap against a trusted on-chain oracle, charging higher fees to arbitrage flow that pushes the pool away from the oracle price and lower fees to flow that brings it back.

How it works step by step

  • Initializes each dynamic-fee pool with default base, floor, cap and TTL settings.
  • Compares live pool spot price against a freshness-checked push oracle price on every swap.
  • Raises the fee on the arbitrage direction toward the observed divergence plus a buffer.
  • Discounts the repeg direction to the configured floor to invite price-correcting flow.
  • Applies a calendar session fee or flat base fee, plus an optional static directional surcharge.
  • Allows a keeper to set bounded, self-expiring fee overrides that a guardian or keeper can clear.
Swap behaviour
On every swap the hook reads the pool's current price and liquidity, compares the price to the oracle, and sets a directional fee: elevated on the arbitrage side up to a 50% cap, floored on the repeg side, with an optional circuit breaker that reverts toxic-side swaps beyond a set band.
Liquidity behaviour
No liquidity callbacks.
Fee behaviour
Fee resolves from a calendar session fee or flat base fee, plus a static directional surcharge, then an oracle-anchored term: on the arbitrage side the fee rises to the pool-to-oracle divergence times captureBps plus a buffer (and optional size impact), on the repeg side it drops to the floor. A keeper override can raise the fee for a limited time. The result is clamped between floor and cap, with a hard ceiling of 50% (500000 pips). The fee is returned with the override flag on every swap.
Owner & admin controls
Roles: DEFAULT_ADMIN_ROLE, GOVERNOR_ROLE, KEEPER_ROLE, GUARDIAN_ROLE. Governor can configure pool fee bounds (cap up to 50%), directional surcharge, oracle config (oracle address, priceToken, staleness, capture multiple, circuit-breaker band), calendar and holidays. Keeper can set a time-limited fee override (clamped to floor/cap, TTL up to 6 hours). Guardian and keeper can clear overrides. Roles are granted by DEFAULT_ADMIN_ROLE via AccessControl. No pause, no upgrade proxy and no fund-moving functions were found.

Enabled Uniswap v4 callbacks

beforeInitialize, beforeSwap

beforeInitialize: rejects non-dynamic-fee pools and seeds default configuration for new pools. beforeSwap: reads pool slot0 and liquidity, computes the directional dynamic fee and returns it as an override fee; takes no tokens and returns zero delta.

Security & trust assessment

Risk level: medium (verified source, high confidence).

Who controls it: A governor can set caps up to 50%, set surcharges, redirect the oracle address or change the circuit-breaker band, which can make swaps on the toxic side revert (PriceOutOfBand) or charge up to the cap. A keeper can impose overrides up to the cap for up to 6 hours. Overrides are bounded and expire, but the governor retains broad control over fee parameters.

Risk to user funds: The hook does not custody or move funds and returns zero delta, so it cannot directly take user tokens. Exposure is indirect: fees can be raised up to 50% on the toxic side, and the circuit breaker can revert swaps in that direction.

Security findings

  • [medium] Very high fee possible on toxic side: The oracle-driven fee can reach the 50% hard ceiling if the pool diverges sharply from a fresh oracle on the arbitrage side. Users trading that direction could pay a very high fee.
  • [medium] Governor can block toxic-direction swaps: When the circuit breaker is enabled, beforeSwap reverts for toxic-side swaps whose divergence exceeds maxBandPips, so governance can block one swap direction.
  • [medium] Oracle trust assumption: The oracle address and priceToken are set by the governor. A malicious or compromised oracle could distort fees for the pool, though staleness checks limit the effect and a failing oracle falls back to base fees.
  • [low] Privileged role concentration: Governor and admin hold broad privileges and roles are managed through AccessControl with no timelock or multisig requirement visible in the contract.
  • [info] No custody of user funds: The hook is non-custodial: it does not hold tokens, takes no return delta and cannot move liquidity or balances.

Contract details

Verified source
Yes (MarlinDynamicFeeHookV2)
Compiler
solc 0.8.33+commit.64118f21
Bytecode size
14,449 bytes
Upgradeable proxy
No
Detected patterns
dynamic-fee, oracle

Pools using MarlinDynamicFeeHookV2