StablePairHook on Robinhood Chain

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

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

What it does

An upgradeable dynamic-fee hook for stable pairs that charges near-peg trades a small spread-based fee (optimal spread at most 1%), while off-peg trades moving the price further away pay 0% and trades restoring the peg pay a decaying fee capped at 99.9998%; all fees go to LPs, who can always withdraw.

This read was written for the hook 0x0000…fcc0 on Ethereum 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

  • Sets a dynamic LP fee on every swap for pools of two assets meant to trade at the same price (stablecoin pairs).
  • Inside a target band around a reference price, it sets fees so every buyer and seller gets the same effective price at the edges of that band.
  • When the pool price drifts outside the band, trades that push the price further away pay 0% LP fee, while trades that bring it back pay a fee that decays block by block toward a target.
  • Fee is computed from the start-of-block price, so splitting a trade into pieces within one block gives no advantage.
  • Pools can only be created through the hook by an approved initializer role. The contract is an upgradeable proxy controlled by an admin role.
Swap behaviour
Before each swap the hook overrides the LP fee based on how far the pool price is from a configured reference price and on the trade direction. When the price is outside the band, swaps moving it further away pay 0%, and swaps moving it back pay a decaying fee that can in theory reach almost 100% (capped at 99.9998%). No tokens are taken directly by the hook.
Liquidity behaviour
The add-liquidity callbacks do nothing in the current implementation. Remove-liquidity callbacks are disabled, so LPs can always withdraw freely.
Fee behaviour
All fees go to LPs as a normal pool LP fee. Inside the band the fee is tied to a configurable optimal spread of at most 1%. Outside the band the fee starts at the gap to the far edge of the band and decays exponentially toward a lower target, with the hard ceiling at 99.9998%.
Owner & admin controls
The config manager can change each pool's reference price, optimal spread (capped at 1%), decay speed and target multiplier (0 to 100%), and the pool initializer creates pools. The default admin manages roles and can upgrade the implementation, but only to code using the same PoolManager and the same permission set, so remove-liquidity and return-delta callbacks stay off.

Enabled Uniswap v4 callbacks

beforeInitialize, afterInitialize, beforeAddLiquidity, afterAddLiquidity, beforeSwap, afterSwap

beforeInitialize: blocks pool creation except through the hook's own initializer; afterInitialize: unused; beforeAddLiquidity/afterAddLiquidity: no-op placeholders; beforeSwap: computes and applies the dynamic LP fee; afterSwap: no-op.

Security & trust assessment

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

Who controls it: An admin role controls upgrades and role assignment, and a config manager sets the per-pool reference price and fee parameters. The worst realistic outcome is a misconfigured or upgraded fee logic that overcharges traders, but neither role can block withdrawals or take tokens through deltas.

Risk to user funds: The hook never holds or moves user funds; it only sets the LP fee, which ranges from 0% up to a cap of 99.9998%. LP principal cannot be locked or drained because remove-liquidity callbacks are disabled.

Security findings

  • [medium] Upgradeable proxy: The admin can replace the hook logic via a UUPS upgrade. Upgrades are restricted to the same PoolManager and permission flags, so withdrawals can never be blocked and swap amounts cannot be altered through deltas.
  • [medium] Fee can approach 100% off-peg: When the price is outside the band, trades that restore the peg pay the gap to the far edge of the band. A config manager setting a wrong reference price could therefore make one trade direction very expensive. That fee goes to LPs and is capped at 99.9998%.
  • [info] LP withdrawals unrestricted: Remove-liquidity callbacks and all return-delta flags are disabled at the address level, so LPs can always exit.

Contract details

Verified source
Yes (StablePairHook)
Compiler
solc 0.8.26+commit.8a97fa7a
Bytecode size
135 bytes
Upgradeable proxy
Yes
Detected patterns
dynamic-fee, ownable, upgradeable

Pools using StablePairHook