Dynamic fee hook on Robinhood Chain
Uniswap v4 Hook Contract 0xf5353eaedeca56177aa8e64c8d3b05969d8870cc on Robinhood Chain · Dynamic fee
- Volume (24h)
- $0
- Value locked (TVL)
- $0
- All-time volume
- $0
- Pools using this hook
- 1
- Swaps (24h)
- 0 (0 traders)
- Total swaps
- 0
What it does
This hook sets a dynamic, per-pool meme fee on swaps and takes part of each trade as accrued protocol and LP-side fees, though the exact direction-dependent pricing could not be confirmed from the decoded bytecode.
How it works step by step
- Sets a per-pool meme fee (memeFeeBips) that is applied through the dynamic fee mechanism when swaps run
- Takes a share of swap fees into accrued balances (accrued, accruedProtocol, pendingFees) that are later paid out or distributed
- Splits accrued fees between a protocol recipient and LP-side accounting using PROTOCOL_SHARE_BIPS
- Enforces a total fee cap (TOTAL_FEE_BIPS, MAX_MEME_FEE_BIPS, MIN_MEME_FEE_BIPS) and a dynamic fee threshold
- Uses return deltas in beforeSwap and afterSwap so it can take currency from swaps before the pool settles
- Tracks pool creation via notifyPoolCreated and pool timestamps, and can unlock the pool manager to move funds (unlockCallback, payout, distribute)
- Swap behaviour
- beforeSwap and afterSwap run on every swap. The hook sets a dynamic fee for the pool and uses return deltas to take a portion of the swap amount as fees, which are recorded as accrued balances. Exact direction-dependent pricing could not be confirmed from the decoded bytecode, so it is not stated here.
- Liquidity behaviour
- beforeAddLiquidity, afterAddLiquidity, beforeRemoveLiquidity and afterRemoveLiquidity are present as views in the dispatch table, but the decoded bytecode gives no clear evidence that they change state or charge fees; treat their effect as unclear.
- Fee behaviour
- The fee is set per pool via memeFeeBips and baseFeeBips with a time-dependent schedule (feeBipsAt, poolTimestamps), bounded by MIN_MEME_FEE_BIPS and MAX_MEME_FEE_BIPS and a TOTAL_FEE_BIPS cap. Part of the collected fee goes to the protocol recipient according to PROTOCOL_SHARE_BIPS, and the remainder is accrued for distribution.
- Owner & admin controls
- Owner (transferOwnership, acceptOwnership, renounceOwnership) can change the protocol recipient, vault and controller (setProtocolRecipient, setVault, setController). The controller is gated by NotController checks and can notify pool creation. reinitialize and initialize set core addresses and parameters; the owner-only gating of reinitialize could not be confirmed from the bytecode.
Enabled Uniswap v4 callbacks
beforeInitialize, afterInitialize, beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeInitialize and afterInitialize record pool setup and validate the pool key (InvalidPoolPair, InvalidPoolFee). beforeSwap sets the dynamic fee and may take currency via return delta. afterSwap settles fee accrual and may take currency via return delta.
Security & trust assessment
Risk level: medium, estimated (decoded bytecode, low confidence).
Who controls it: The owner can change the protocol recipient, vault and controller, and the controller can notify pool creation. Through the upgradeable proxy the owner or proxy admin could change fee logic or fund handling for all pools using this hook.
Risk to user funds: The hook holds accrued fee balances and moves currency through return deltas and payout/distribute paths. Users' swap amounts are affected by the fees taken. Whether the hook can block swaps was not determined from the decoded bytecode.
Security findings
- [medium] Hook takes currency via return deltas: beforeSwapReturnDelta and afterSwapReturnDelta are enabled, so the hook can take a portion of every swap's input or output. The size is set by the fee parameters, which the owner or controller can influence.
- [medium] Owner-controlled recipient and vault: setProtocolRecipient, setVault and setController are callable by privileged accounts, so an owner key could redirect accrued fees or swap the vault that holds funds.
- [medium] Upgradeable proxy: The hook is a proxy delegating to implementation 0x30a4ed66de8e55be2b4d606bc744b0b08dfdb0cc. The implementation can be changed by whoever controls the proxy admin, which can change all of the above behaviour.
- [info] Fund movement via unlock callback: unlockCallback, payout and distribute move accrued balances through the pool manager (unlock, take). Access control on these paths could not be confirmed from the decoded bytecode.
Contract details
- Verified source
- No
- Bytecode size
- 793 bytes
- Upgradeable proxy
- Yes
- Detected patterns
- dynamic-fee, liquidity-management, moves-currency, ownable, return-delta, self-unlock, upgradeable