Dynamic fee hook on Robinhood Chain
Uniswap v4 Hook Contract 0x3685cc4aa1266813fa0ef346853341b0778c80cc on Robinhood Chain · Dynamic fee
- Volume (24h)
- $2.07K
- Value locked (TVL)
- $86.29K
- All-time volume
- $11.20M
- Pools using this hook
- 1
- Swaps (24h)
- 17 (15 traders)
- Total swaps
- 44,316
What it does
A Uniswap v4 hook that charges a dynamic fee which decays from a start rate to a final rate over time, with part of the fee routed to an ops address.
How it works step by step
- Computes a time-based fee that ramps from START_FEE_BPS down to FINAL_FEE_BPS over RAMP_DURATION
- Exposes feeBpsAt(timestamp) and currentFeeBps() so the current fee can be read
- Gates swaps behind an owner-enabled trading flag and an opensAt timestamp
- Routes a configurable share of the fee (opsShareBps) to an ops address using take()
- Uses before and after swap return deltas to adjust the amounts in each swap
- Owner is set via Ownable2Step with ops, fee and token-address setters
- Swap behaviour
- beforeSwap computes the current decaying fee and enforces the trading-open gate; afterSwap and the return-delta hooks take the ops share of the swap amount via take().
- Liquidity behaviour
- beforeAddLiquidity, beforeRemoveLiquidity, afterAddLiquidity and afterRemoveLiquidity are present as callbacks but are not in the enabled hook permissions, so they are not invoked. Donation callbacks are likewise not enabled. No liquidity callbacks are active.
- Fee behaviour
- A time-decaying fee schedule: feeBpsAt(timestamp) and currentFeeBps() return a fee that starts at START_FEE_BPS and ramps down to FINAL_FEE_BPS over RAMP_DURATION, bounded by MAX_FEE_BPS. Part of the fee (opsShareBps, capped by MAX_OPS_SHARE_BPS) appears to be routed to an ops address via take() calls, the remainder staying with the pool.
- Owner & admin controls
- Owner (Ownable2Step: transferOwnership, acceptOwnership, renounceOwnership) can set the ops address (setOps), set the ops share in bps (uint16 setter at slot 1 offset 23), set the fee in bps (uint24 setter at slot 1 offset 20), set the token/pool-related address at slot 3 via the 0x845bb323 setter, and enable trading once via enableTrading (sets bool flag at slot 4).
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap: applies the time-dependent fee and gates trading before it is enabled. afterSwap: accounts for the swap and takes the ops share of the fee. beforeSwapReturnDelta: lets the hook return a delta to adjust the swap amounts, which is how it takes its fee. afterSwapReturnDelta: lets the hook return a post-swap delta, used to take the ops portion of the swap.
Security & trust assessment
Risk level: medium (decoded bytecode, medium confidence).
Who controls it: The owner controls the ops recipient address, the fee ops share, the fee-related parameters and the token address setter. An owner can redirect the ops share to any address and raise the ops share up to the cap, and can enable trading but there is no shown way to disable it once enabled. Ownership transfer is two-step, which reduces accidental loss.
Risk to user funds: The hook holds no funds itself but takes a portion of swap amounts through return deltas and sends them to the ops address. Users can be charged up to the capped fee and ops share, and the owner can change those parameters without a delay.
Security findings
- [info] Hook takes swap currency via return deltas: The hook uses beforeSwapReturnDelta and afterSwapReturnDelta and calls take(), so it moves pool currency to the ops address on every swap.
- [info] Trading gated until enabled: Trading is gated by a flag that is set by enableTrading and an opensAt timestamp; swaps revert with TradingClosed before opening.
- [medium] Owner can redirect and adjust swap fee share: The owner can change the ops recipient and the ops share (bounded by MAX_OPS_SHARE_BPS) and the fee setter (bounded by MAX_FEE_BPS), which can change how much of each swap the owner's ops address receives.
- [low] No timelock on parameter changes: The ops recipient, fee level and ops share are set by the owner key, and the bytecode contains no timelock or pause that is visible in the decoded selectors.
Contract details
- Verified source
- No
- Bytecode size
- 6,358 bytes
- Upgradeable proxy
- No
- Detected patterns
- moves-currency, ownable, return-delta
Pools using Dynamic fee hook
- USDG / PRINTER (0.30% fee) — 24h volume $2.07K, TVL $86.29K, 17 swaps today