Skip to content

FluidUsEquityMarketHoursAdmin ​

Git Source

Inherits:BasicAuth, Helpers, Events, OracleError

Governance + auth week-schedule writes.

Functions ​

_authClass ​

solidity
function _authClass(address auth_) internal view override returns (uint256);

_setAuthClass ​

solidity
function _setAuthClass(address auth_, uint256 authClass_) internal override;

updateWeekSessions ​

Replace the week-ahead session list (typically once on Saturday). Clears previous entries.

Expected writer shape for a weekend rewrite:

  1. Last completed REGULAR (e.g. Friday) with sessionStart ≤ block.timestamp
  2. Ongoing weekend HOLIDAY whose full window (session + extended) contains block.timestamp (extended usually covers Monday pre-market)
  3. Next week Mon–Fri REGULAR (+ optional next weekend HOLIDAY), covering forward (≤ MAX_SESSIONS = 8 total) Sanity checks (all required):
  • 1 ≤ length ≤ MAX_SESSIONS (8)
  • each entry: non-zero start/duration; durations ≤ MAX_DURATION_MINUTES (8191); REGULAR duration ≤ MAX_REGULAR_DURATION_MINUTES (24h); type ∈
  • contiguous: next.sessionStart == prev.entryEnd (no gaps, no overlaps)
  • sum of all (durationMinutes + extendedDurationMinutes) ≥ MIN_SCHEDULE_DURATION_MINUTES (7 days)
  • sum of REGULAR durations ≤ MAX_REGULAR_DURATION_MINUTES * 5 (5 trading days; REGULAR skips the clamp)
  • some entry contains now — avoid writing a schedule that is immediately UNKNOWN
  • some REGULAR has sessionStart ≤ now — preserve a cash-session anchor for extended-hours caps
  • every entry starting before now + PINNED_SESSION_LOOKAHEAD matches a stored one — no retroactive anchor moves (skipped on the first write and for governance / AUTH_CLASS_SCHEDULE_OVERRIDE)
solidity
function updateWeekSessions(Session[] calldata sessions_) external onlyAuthClassAbove(AUTH_CLASS_SCHEDULE);

_pinnedSessionsWindow ​

Stored words + timestamp up to which sessions are pinned (0 = nothing pinned, starts are non-zero).

solidity
function _pinnedSessionsWindow() internal view returns (uint256 data0_, uint256 data1_, uint256 pinnedUntil_);

_validateSession ​

Validates fields + contiguity; returns full entry end (seconds) and duration sum (minutes).

solidity
function _validateSession(Session calldata s_, uint256 prevEntryEnd_, bool isFirst_)
    internal
    pure
    returns (uint256 entryEnd_, uint256 entryMinutes_);