RwaRamp on Arc
Uniswap v4 Hook Contract 0x3722d2840bfa4e9610d265da08078d178bf46080 on Arc · Dynamic fee · Verified contract
- 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
The hook charges traders session-based fees, with the highest fees at the US market open that ease to a lower overnight or closed rate, a closing-hold ramp before the close, optional directional premiums and a mid-block surcharge on sharp intra-block price moves, so swaps during the opening window and in the premium direction pay more while overnight swaps pay less.
This read was written for the hook 0x98c8…2080 on BNB Chain 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
- Autonomous fee policy for RWA (US-equity) pools keyed to an on-chain US market-session calendar with open, overnight and closed fee floors
- Charges a higher fee during the opening window that descends to the open floor, and a configurable closing-hold ramp near the close
- Optional mid-block surcharge computed by an immutable math companion when price moves sharply within a single block, capped by the pool max fee
- Pool-level directional asymmetry premium added to the base fee for one swap direction
- Acts as an LP ledger: deposits and withdrawals are routed through the pool manager, with fee growth tracked per range and an optional claim fee skimmed to a treasury
- Owner-configurable pause (hook-wide and per pool) that blocks swaps and ledger operations
- Swap behaviour
- Every swap is priced through beforeSwap at the calendar-derived base fee for the current timestamp (plus any directional premium and any mid-block surcharge), overridden as the LP fee for that swap. Swaps in the opening window pay the highest fee, decaying to the open floor; overnight and closed sessions pay the configured overnight or closed floors, and the closing-hold ramp raises fees near the close. Swaps in the premium direction pay more and swaps in the opposite direction pay the base fee. Swaps revert while the hook or the pool is paused.
- Liquidity behaviour
- Liquidity is not added through the normal v4 liquidity callbacks; the hook's own deposit and withdraw functions call the pool manager, mint ERC-6909 shares per range, and settle principal tokens from the depositor or to the recipient. Deposits and withdrawals revert while paused. Accrued LP fees are collected per range, the claim fee portion is recorded for the treasury, and the rest is credited to share holders.
- Fee behaviour
- Fees are set dynamically each swap from the RWA session calendar: the base fee is the session-dependent floor curve (with an opening descent from a spike peak and a closing ramp), plus an optional directional premium and an optional mid-block surcharge, all capped at the pool maximum fee. A poke mechanism can override directional fees within a floor and cap for a limited time, and the 50% execution-time guard keeps the poke-based fee from dropping below half the autonomous fee. Separately, a claim fee (up to 20% of LP fees, set by the owner) is skimmed from LP earnings into a claim-fee balance that the treasury can sweep.
- Owner & admin controls
- Access is governed by an OpenZeppelin AccessManager authority (restricted functions). Authorized roles can: configure pool fee floors, caps and calendar parameters (session hours, DST mode, day overrides, early closes); set directional asymmetry and mid-block configuration; set and change poke fees and clear them; pause the whole hook (up to 7 days per call) or individual pools; set the claim fee rate and the protocol treasury recipient; and sweep accrued claim fees. The calendar component is owned by the hook and only the hook can drive it. The contract is not an upgradeable proxy. Authority changes are controlled by the AccessManager.
Enabled Uniswap v4 callbacks
beforeInitialize, beforeSwap
beforeInitialize: rejects non-dynamic-fee pools and validates the pool key so only correctly configured pools are initialized. beforeSwap: enforces the pause, optionally records a mid-block price observation, and returns the computed dynamic LP fee with the override flag. All other hook callbacks are disabled and revert.
Security & trust assessment
Risk level: medium (verified source, high confidence).
Who controls it: A privileged key holder (through the AccessManager authority) can pause swaps and withdrawals for up to 7 days per call, raise fees up to the absolute cap, redirect fees and claim-fee balances to a chosen treasury, and change the calendar and fee schedule, which could harm traders or LPs.
Risk to user funds: The hook custodies LP principal and accrued fees through the pool manager and transfers tokens in on deposit and out on withdrawal and claim. A pause or admin action can block withdrawals, and a configured claim fee reduces LP fee earnings, but the code does not show a direct path for an admin to seize principal.
Security findings
- [medium] Owner-controlled pause can halt swaps and withdrawals: setPaused and pausePool (restricted) set a pause up to 7 days that makes beforeSwap and the withdraw paths revert via _requireLive, so an admin can freeze exits for LPs and trading for a pool.
- [medium] Admin can change fees and calendar rules at will: Restricted functions can change floors, caps, directional premium, poke fees, session hours, holidays and early closes, so an admin can raise swap fees up to the absolute maximum fee cap (LP-visible pricing change) or reshape the schedule without user consent.
- [low] Protocol claim fee skims LP earnings: setClaimFee/setClaimFeeBps (restricted, up to 20%) take a share of LP fee income into claimFeeOwed, which sweepClaimFee pays to claimFeeRecipient; rate increases apply to historical backlogs only through the minimum rate rule.
- [info] Hook takes tokens from depositors and pays out withdrawals: The hook holds principal and fee balances via the pool manager and pulls tokens with safeTransferFrom on deposit, so user funds are custodied by the contract while in a range.
- [info] Fee resolution and surcharge depend on external immutable helpers: Fee logic delegates to MidBlockFeeMath and FeePolicyMath deployed in the constructor; a surcharge failure falls back to the base fee rather than reverting, which is a deliberate design choice.
Contract details
- Verified source
- Yes (RwaRamp)
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Bytecode size
- 24,565 bytes
- Upgradeable proxy
- No
- Detected patterns
- dynamic-fee, erc20, fee-sharing, moves-currency, pausable, self-unlock
Pools using RwaRamp
- tUSD / tSTOCK (Dynamic fee) — 24h volume $0, TVL $0, 0 swaps today