Skip to content

FluidUsEquityMarketHours ​

Git Source

Inherits:FluidUsEquityMarketHoursAdmin, IFluidUsEquityMarketHours

Title: FluidUsEquityMarketHours

Week-ahead US equity session schedule for Chainlink 24/5 stock oracles.

Deploy behind FluidUsEquityMarketHoursProxy (ERC1967). UUPS upgrades are onlyGovernance (governance of constructor-bound Liquidity). Off-chain sync is complementary — missing/undefined schedule returns UNKNOWN (fail-open).

Functions ​

constructor ​

Note: oz-upgrades-unsafe-allow: constructor

solidity
constructor(address liquidity_) Variables(liquidity_);

Parameters

NameTypeDescription
liquidity_addressLiquidity proxy whose EIP-1967 admin is governance for this contract.

getSessions ​

Full week-ahead session schedule currently stored.

solidity
function getSessions() external view returns (Session[] memory sessions_);

getCurrentSessionType ​

Session type at block.timestamp.

solidity
function getCurrentSessionType() external view returns (uint256 sessionType_);

getSessionType ​

Session type at timestamp_.

solidity
function getSessionType(uint256 timestamp_) public view returns (uint256 sessionType_);

getLatestRegularHoursWindow ​

Most recent REGULAR session window at or before timestamp_.

latestRegularHoursStart_ == 0 if none found.

solidity
function getLatestRegularHoursWindow(uint256 timestamp_)
    external
    view
    returns (uint32 latestRegularHoursStart_, uint32 latestRegularHoursEnd_);

getSessionInfo ​

Session type at timestamp_, plus the latest REGULAR-hours window at or before that time.

latestRegularHoursStart_ == 0 if no REGULAR window found.

solidity
function getSessionInfo(uint256 timestamp_)
    public
    view
    returns (uint256 sessionType_, uint32 latestRegularHoursStart_, uint32 latestRegularHoursEnd_);

getCurrentSession ​

Like getSessionInfo(block.timestamp), advancing the schedule cursor.

latestRegularHoursStart_ == 0 if no REGULAR window found.

solidity
function getCurrentSession()
    external
    returns (uint256 sessionType_, uint32 latestRegularHoursStart_, uint32 latestRegularHoursEnd_);

_regularWindowBack ​

Walks down from fromIndex_ for the latest REGULAR with sessionStart <= timestamp_. Returns (data1_, data1Loaded_, latestRegularHoursStart_, latestRegularHoursEnd_); latestRegularHoursStart_ == 0 means none found.

solidity
function _regularWindowBack(
    uint256 timestamp_,
    uint256 data0_,
    uint256 data1_,
    bool data1Loaded_,
    uint256 fromIndex_
) internal view returns (uint256, bool, uint32, uint32);

_regularSessionEnd ​

Regular-hours end (exclusive) for a packed REGULAR entry. Durations ≤ 8191.

solidity
function _regularSessionEnd(Session memory s_) internal pure returns (uint32);

_getSessionTypeWithinSession ​

Classifies timestamp_ inside one entry. sessionTypeIdentified_ == false means before start or after entry end.

solidity
function _getSessionTypeWithinSession(
    uint256 sessionStart_,
    uint256 durationMinutes_,
    uint256 extendedDurationMinutes_,
    uint256 storedSessionType_,
    uint256 timestamp_
) internal pure returns (uint256 sessionType_, bool sessionTypeIdentified_);

_resolve ​

Bidirectional walk from stored currentIndex. Sloads _sessionData1 only when a session in slots 4..7 is read. When needRegularWindow_: covering REGULAR entry supplies the window directly; HOLIDAY / UNKNOWN resolve via _regularWindowBack. latestRegularHoursStart_ == 0 means none found (also before-coverage / empty).

solidity
function _resolve(uint256 timestamp_, bool needRegularWindow_)
    internal
    view
    returns (uint256 sessionType_, uint32 latestRegularHoursStart_, uint32 latestRegularHoursEnd_, uint256 index_);