RealmHookAnyPair on Robinhood Chain
Uniswap v4 Hook Contract 0x24d9308561c322a603370a0c3bead39e05da00cc on Robinhood Chain · Launchpad · Verified contract
- Volume (24h)
- $116.24K
- Value locked (TVL)
- $126.00K
- All-time volume
- $5.07M
- Pools using this hook
- 184
- Swaps (24h)
- 711 (266 traders)
- Total swaps
- 18,600
What it does
A fee and graduation hook for Realm launchpad tokens quoted in an ERC20 instead of ETH: it charges the protocol LP fee and creator tax on the quote side of each swap and books them for later redemption, and it blocks trading until the token has graduated.
How it works step by step
- Resolves which side of a pool is the Realm token on the first swap by checking that the token reports this pool manager as its pair and lists the other side among its registered quotes, then caches the result per pool id.
- Blocks all swaps on a Realm token's pool until the token reports graduated(), reverting with NoSwapsBeforeGraduation otherwise.
- Reads the LP fee and tax rates from the token's getSwapFees(isBuy) and reverts with FeeTooHigh if their sum exceeds 20% on a leg.
- Withholds the fee on the quote leg through a beforeSwap return delta for exact-input buys and exact-output sells, and through an afterSwap return delta for the other two legs.
- Books each fee as an ERC-6909 claim on the pool manager and records it in the pendingLpFees and pendingTaxes ledgers rather than taking currency during the swap.
- Redeems the ledgers through permissionless settleFees: LP fees go to the fee router and taxes go to the token's accrueFees, with a treasury fallback if either call reverts.
- Swap behaviour
- beforeSwap resolves the pool, enforces graduation, and on exact-input buys and exact-output sells computes the fee from the token's current rates, claims it, and returns it as a beforeSwap delta on the quote currency (grossing up the output on exact-output sells). afterSwap emits RealmPoolState and, on exact-output buys and exact-input sells, claims the fee from the actual quote amount and returns it as an afterSwap delta. Each leg emits RealmQuoteSwapBuy or RealmQuoteSwapSell.
- Liquidity behaviour
- No liquidity callbacks.
- Fee behaviour
- The fee is a per-token LP fee plus tax on the quote leg, with rates read from the token contract at each swap and capped at 20% combined. The fee is booked to pendingLpFees and pendingTaxes and redeemed later by settleFees. Fees are split between the fee router (LP share) and the token (tax share), with the treasury as fallback. The pool's static fee is not used for these charges.
- Owner & admin controls
- No owner, pause, upgrade or parameter-setter functions appear in the ABI or source. FEE_ROUTER and TREASURY are immutable and set in the constructor. Fee rates are controlled by each Realm token's getSwapFees, and graduation is controlled by each token's graduated().
Enabled Uniswap v4 callbacks
beforeSwap, afterSwap, beforeSwapReturnDelta, afterSwapReturnDelta
beforeSwap: enforces graduation, resolves pool identity, and withholds the quote-side fee on exact-input buys and exact-output sells. afterSwap: emits pool state, settles the fee on the other two legs, and returns the afterSwap delta. beforeSwapReturnDelta: lets beforeSwap take the fee through its returned delta. afterSwapReturnDelta: lets afterSwap take the fee through its returned delta.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: No privileged key is present in the source. Protocol control is exercised through the immutable treasury and router addresses and through the Realm token contracts that set fee rates and graduation status, so a compromised token contract could change fees within the cap or block trading on its pool.
Risk to user funds: The hook holds ERC-6909 claims and, after settleFees, transient quote balances, and it takes fees from swap amounts through return deltas, capped at 20% per leg. It does not custody user principal. Swaps can revert via graduation gating, FeeTooHigh, NotARealmPool or token call failures. settleFees is permissionless but sends funds only to the fixed router, token and treasury destinations.
Security findings
- [medium] Fee rates and graduation controlled by external token contracts: beforeSwap calls the token's graduated() and getSwapFees(), and the token's own rates set the fee up to the 20% cap on each leg. A token that reverts on these calls blocks swaps on its own pool, and the source gives no separate bound on the tax rate the token sets within that cap.
- [low] Pool identity relies on self-reported token metadata: _isRealmTokenQuotedIn trusts a candidate's pair() and quoteCount()/quotes() return values to decide whether the hook takes fees on a pool. The check depends on the token contracts reporting honestly, so a token that falsely lists a quote would have fees charged on that pool. The result is cached per pool id after the first swap.
- [info] Immutable hook with no admin, pause or upgrade path: The contract has no owner, pause or upgrade functions and its router and treasury addresses are immutable. Any defect in the hook cannot be patched in place, and the source notes that the fallback paths are irreversible.
- [low] Fee-on-transfer quotes break redemption: The source states that settleFees forwards nominal amounts, so a quote token that delivers less than it sends reverts the redemption for that token. The fee stays booked in the ledger until a supported quote is used or the code is changed, and the hook cannot be upgraded to fix it.
- [info] Transient swap cache depends on no reentrant calls: _cachedLpFee, _cachedTax, _cachedToken and _cachedPoolId are shared across pools and assume that nothing between beforeSwap and afterSwap starts another swap. The source documents this assumption and notes that _resolve's external calls happen before the cache is written.
Contract details
- Verified source
- Yes (RealmHookAnyPair)
- Compiler
- solc 0.8.28+commit.7893614a
- Bytecode size
- 11,481 bytes
- Upgradeable proxy
- No
- Detected patterns
- erc6909-claims, launchpad, moves-currency, return-delta, self-unlock, tax
Pools using RealmHookAnyPair
- REALM / USDG (1.00% fee) — 24h volume $74.57K, TVL $39.72K, 194 swaps today
- NVDA / AIKOLS (1.00% fee) — 24h volume $27.44K, TVL $12.39K, 177 swaps today
- HOOD1X / USDG (0.20% fee) — 24h volume $8.03K, TVL $22.30K, 64 swaps today
- USDG / ANTHROPIC (0.20% fee) — 24h volume $3.38K, TVL $24.61K, 38 swaps today
- USDG / OPENAI (0.20% fee) — 24h volume $2.69K, TVL $24.83K, 14 swaps today
- SPCX / XSHOP (1.00% fee) — 24h volume $101, TVL $0.50, 3 swaps today
- USDG / REALM (1.00% fee) — 24h volume $20, TVL $1.25K, 4 swaps today
- USDG / HAMMER (1.00% fee) — 24h volume $6.65, TVL $24, 2 swaps today
- NVDA / CHIPS (1.00% fee) — 24h volume $3.66, TVL $0.58, 1 swaps today
- RCAT / USDG (1.00% fee) — 24h volume $0.30, TVL $169, 1 swaps today
- SPCX / GROKLET (1.00% fee) — 24h volume $0.05, TVL $82, 1 swaps today
- VIH / pHOOD3x (1.00% fee) — 24h volume $0, TVL $56, 175 swaps today
- HOOD1X / VIH (1.00% fee) — 24h volume $0, TVL $0, 25 swaps today
- FTR / SPCX (1.00% fee) — 24h volume $0, TVL $4.26, 6 swaps today
- FTR / TSLA (1.00% fee) — 24h volume $0, TVL $0, 3 swaps today
- SALUTEFACE / NVDA (1.00% fee) — 24h volume $0, TVL $0.28, 2 swaps today
- CHIPS / MU (1.00% fee) — 24h volume $0, TVL $3.59, 1 swaps today
- USDG / REALM (1.00% fee) — 24h volume $0, TVL $134, 0 swaps today
- MSFT / SIFT (1.00% fee) — 24h volume $0, TVL $74, 0 swaps today
- Realmcat / USDG (1.00% fee) — 24h volume $0, TVL $1.39, 0 swaps today