EquifoldV4Hook on Robinhood Chain
Uniswap v4 Hook Contract 0xfb2a13e978d88eebc75227c0857b8b65772940c0 on Robinhood Chain · Dynamic fee · Verified contract
- Volume (24h)
- $2.00K
- Value locked (TVL)
- $9.10K
- All-time volume
- $3.01M
- Pools using this hook
- 1
- Swaps (24h)
- 24 (19 traders)
- Total swaps
- 16,783
What it does
A Uniswap v4 hook that charges a swap fee which falls as the token's market cap rises, plus a flat protocol add-on, and accrues the creator's share of each swap's fee for later payout.
How it works step by step
- Derives market cap in quote units from the pool sqrt price and the token's total supply.
- Maps market cap to a creator fee tier on a six-step curve from 0.95% down to 0.05%.
- Adds an owner-set flat protocol fee of up to 3% on top of the creator tier.
- Applies the total fee as a v4 LP-fee override in beforeSwap.
- Caches the tier in transient storage and accrues the creator's exact quote-side fee in afterSwap.
- Lets only the registered adapter consume accrued creator fees for payout.
- Swap behaviour
- beforeSwap computes the token's market cap from the pool price and total supply, derives the creator tier fee from a fixed curve, adds protocolFlatPips and applies the total as a dynamic LP fee override. afterSwap accrues the creator's exact quote-side share of the realised input into creatorOwedQuote.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- Total swap fee equals a market-cap-tiered creator fee (up to 9500 pips, stepping down to 500 pips as market cap rises) plus an owner-adjustable flat protocol add-on (protocolFlatPips, capped at 30000). The total is applied as a v4 LP-fee override in beforeSwap and must not exceed the LP fee maximum or the swap reverts. The creator's quote-side slice of each swap's realised fee is accrued in afterSwap into creatorOwedQuote and later paid out by the adapter.
- Owner & admin controls
- Owner (Ownable2Step) can set the one-time adapter address via setAdapter (cannot be changed once set), and can retune protocolFlatPips at any time up to a hard cap of 30000 pips (3%). Ownership can be transferred in two steps or renounced. No pause function and no upgrade mechanism found.
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap
beforeSwap: computes market cap from the pool sqrt price and token supply, sets the dynamic fee override and caches the creator tier in transient storage. afterSwap: reads back the cached tier and accrues the creator's exact quote-side fee into creatorOwedQuote. All other hook callbacks revert with HookNotImplemented.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: The owner can raise the protocol flat add-on up to 3% on every swap, instantly increasing fees paid by traders on all registered pools. The owner also controls the one-time adapter binding, which is the only address allowed to register pools and consume accrued creator fees, so a malicious or compromised owner could set the adapter before it is intended to be set. Ownership transfer is two-step and renounceable.
Risk to user funds: The hook does not hold or transfer user or pool tokens in its callbacks and returns zero deltas, so principal is not directly custodied by the hook. Exposure is indirect: the owner can raise the total fee on swaps up to the configured cap, and the adapter controls creator fee payouts from accrued bookkeeping.
Security findings
- [medium] Owner can raise swap fees instantly: setProtocolFlatPips lets the owner change the flat fee add-on at any time, up to 30000 pips (3%), with immediate effect on all swaps in all registered pools.
- [medium] Single adapter trust point: setAdapter can be called once by the owner and only accepts a contract address with code. Whichever adapter is set gains exclusive rights to registerPool and consumeCreatorOwed, so the choice of adapter is a single point of trust.
- [low] Swaps revert for unregistered pools: Creator fee accrual depends on afterSwap bookkeeping and transient storage keyed by pool; the afterSwap path deliberately avoids reverting. Pool registration is required before swaps, otherwise beforeSwap reverts, which can block trading for unregistered pools but cannot trap funds.
- [info] No token custody by the hook: The contract enables beforeSwap and afterSwap only and does not take custody of pool tokens; fees are handled through v4 LP-fee override and accounting, so the hook itself holds no user balances.
Contract details
- Verified source
- Yes (EquifoldV4Hook)
- Compiler
- solc 0.8.24+commit.e11b9ed9
- Bytecode size
- 8,088 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc20, ownable
Pools using EquifoldV4Hook
- WETH / EQUI (Dynamic fee) — 24h volume $2.00K, TVL $9.10K, 24 swaps today