For the complete documentation index, see llms.txt. This page is also available as Markdown.

RWA Calendar and Fee Curve

RWA pools adjust their autonomous base fee to a configured market calendar. A session label changes the fee policy; CLOSED is not a trading pause. Trading still depends on liquidity, valid configuration and the separate Hook pause state.

Sessions and fee shape

Session
Base behavior

OPEN

An opening peak descends toward openFloor over descentWindow. An opening after a fully closed local date can use a different peak.

OVERNIGHT

Uses overnightFloor, subject to an overlapping closing envelope.

CLOSED

Uses closedFloor, subject to an overlapping closing envelope. The closed rate is not inherently the highest rate.

The closing envelope and session base combine using max, not addition. Then the directional premium, ordinary keeper/cap rules and optional Mid-block policy apply. For production quoting, prefer the on-chain policy reads over duplicating calendar logic.

One worked curve

Example configuration: floors 100 / 300 / 700 pips, spikeMult=3, closedSpike=1200, descentWindow=600 seconds, closeFloor=800, closeBefore=600 and closeAfter=300. No directional premium or keeper is applied here.

Point in time
Base fee (pips)
Percent

Normal Tuesday opening

900

0.09%

Tuesday, 5 minutes after opening

500

0.05%

Tuesday, 10 minutes after opening

100

0.01%

Monday opening after fully closed Sunday

1200

0.12%

Monday, 5 minutes after opening

650

0.065%

5 minutes before close

450

0.045%

At close

800

0.08%

Friday, first 5 minutes after close

800

0.08%

Friday, exactly 5 minutes after close

700

0.07%

Fees do not guarantee executable liquidity while the underlying market is closed. The token issuer defines any asset rights or redemption process; the pool calendar does not establish them.

Exact calendar and curve reference

The Hook's immutable marketCalendar computes poolFeeAt(poolId, block.timestamp). Its public calendar getters are also forwarded through RwaRamp. For most integrations, sample autonomousFee and refresh rather than maintaining a second production calendar implementation. The following rules specify an exact local reproduction when needed.

Local time, day classification and overrides

DstMode: AUTO=0, FIXED_EST=1, FIXED_EDT=2. EST subtracts 18,000 seconds from UTC; EDT subtracts 14,400. AUTO uses EDT from 00:00 UTC on the second Sunday of March, inclusive, until 00:00 UTC on the first Sunday of November, exclusive. This matches the source and differs from a standard US/Eastern 02:00 wall-clock transition. Setting a fixed mode is authorized only if its offset agrees with AUTO at the setting transaction's time; once set, evaluation uses that fixed mode.

Reject timestamps smaller than the selected offset (InvalidTimestamp); zero is not shorthand for now. Compute local day index and second of day from timestamp - offset, using Gregorian dates and Sunday=0 weekdays.

Default session hours are 09:30:00 (34200) to 16:00:00 (57600) in that local time. Configured hours are per pool. An early-close override replaces close only if open < early <= close and early - open >= 10800. Recheck this at evaluation time: a later hours change can make an old override stale and ignored.

A date is fullyClosed if marked FORCE_CLOSED, or is a weekend or a holiday, unless FORCE_OPEN overrides it. The monthly override is a uint64 with two bits per local day: (packed >> (2*(day-1))) & 3, NONE=0, FORCE_CLOSED=1, FORCE_OPEN=2; 3 is invalid. Friday's post-close classification is separate:

Consequently FORCE_OPEN removes full-day weekend/holiday closure but does not remove the Friday post-close rule. FORCE_CLOSED affects that entire local date. Only the pinned built-in holiday table for 2026–2030 is consulted; outside those years there is no built-in holiday match. Weekends and explicit overrides continue to apply. Do not infer new holidays or automatic half days from an external calendar. The exact built-in dates are listed below.

Year
Month-day entries

2026

01-01, 01-19, 02-16, 04-03, 05-25, 06-19, 07-03, 09-07, 11-26, 12-25

2027

01-01, 01-18, 02-15, 03-26, 05-31, 06-18, 07-05, 09-06, 11-25, 12-24

2028

01-17, 02-21, 04-14, 05-29, 06-19, 07-04, 09-04, 11-23, 12-25

2029

01-01, 01-15, 02-19, 03-30, 05-28, 06-19, 07-04, 09-03, 11-22, 12-25

2030

01-01, 01-21, 02-18, 04-19, 05-27, 06-19, 07-04, 09-02, 11-28, 12-25

Curve fields and exact operation order

FloorConfig = (openFloor, overnightFloor, closedFloor, spikeMult, closedSpike, descentWindow, closeFloor, closeBefore, closeAfter).

For valid nonnegative elapsed times, define:

First choose the session base:

Then apply the independent closing envelope on a date that is not fully closed, provided closeFloor != 0 and second >= open:

The ramp and opening curve may overlap; use max, not sum or replacement. Friday after close is CLOSED but its closing hold can still dominate closedFloor. The instant second == close belongs to the ramp if it has a nonzero window; the hold's upper endpoint is exclusive. At second == close + closeAfter, the hold no longer applies. At the end of the opening descent window, the opening curve equals openFloor.

After this calendar base, add the directional premium and apply ordinary cap/keeper resolution, followed by Mid-block policy. Do not cap the raw curve before adding the directional premium, and do not reject a valid high raw peak.

Configuration constraints relevant to interpreting data: the three session floors are at least 100 and no greater than the pool cap; spikeMult <= 20; descent/close windows are at most 6 hours. If descentWindow=0, spikeMult and closedSpike must both be zero. Otherwise both opening peak choices must exceed openFloor. A nonzero closeFloor lies between openFloor and cap and requires at least one nonzero close window. Authorized writes validate these relationships; readers should not silently fabricate defaults for missing configuration.

SDK integration

Use the client from Quickstart with a registered rwa-ramp pool. These examples follow SDK 1.0.1, main@b5fc5ba; browsing needs no wallet.

Reuse the returned block for related reads. getFeeBreakdown and previewFeeAt require the configured RampReader; getCurrentFees reads both directions without a Reader. Sessions are "open", "overnight", "closed"; non-RWA session reads return null. closed is a fee period, not a trading pause. zeroForOne=true means currency0 → currency1; derive buy/sell with getMarketSwapDirection and explicit base/quote assets.

Use Unix seconds as bigint; 0n is literal zero, not now. For example, BigInt(Date.parse("2026-10-23T13:30:00Z") / 1000) denotes an explicit UTC instant. A single session preview is getSession(poolId, { ...block, timestamp }). Let the contract evaluate DST, holidays and overrides.

For charts, baseFeePips is the raw calendar curve (bigint); cappedAutonomousFeePips adds premium and cap, while finalFeePips also resolves the temporary override (both number). 100 pips = 0.01%; do not mix pips with claim/distribution bps.

Every curve point uses the selected block's configuration. It does not restore historical configuration or guarantee future execution fees. The frontend owns sampling density and refresh; keep RPC concurrency bounded and surface unavailable data rather than zero fees. getCurrentFees and finalFeePips exclude the one-block Mid-block surcharge: obtain a fresh quoteSwap for trading and keep the user's minimum output/maximum input and deadline.

Calendar administration uses permission-aware getManagementAuthorization / prepareManagement direct, schedule and execute flows through RwaRamp. Relevant actions are setRwaPoolConfig, setSessionHours, setDayOverrides, setDstMode, setEarlyClose. The mainnet preset has management disabled; enabling it requires independent review and an authorized wallet. marketDaysInMonth / packMarketDayOverrides validate/encode dates rather than calculate curves; monthly overrides replace the full month, at most ten dates, and empty days clears it.

Last updated

Was this helpful?