Skip to content
Lattice

IRedstonePriceFeedsAdapter

Git Source

Title: IRedstonePriceFeedsAdapter

Author: Vendored minimal subset of RedStone (https://github.com/redstone-finance/redstone-oracles-monorepo).

Upstream license: unknown (no matching file in the linked monorepo, whose root license is BUSL-1.1).

Minimal interface for a RedStone Push PriceFeedsAdapter contract.

Vendored subset — do not add a redstone dependency. RedStone's Push model stores signed values on-chain (updated in batches); a consumer reads the stored value for a dataFeedId and the timestamps of the latest update. Values are reported with 8 decimals; dataTimestamp is in milliseconds (the off-chain data time) while blockTimestamp is in seconds (the on-chain update time used for staleness).

Functions

getValueForDataFeed

Returns the latest stored value for a RedStone data feed.

function getValueForDataFeed(bytes32 dataFeedId) external view returns (uint256 value);

Parameters

NameTypeDescription
dataFeedIdbytes32The RedStone data-feed id (e.g. bytes32("ETH")).

Returns

NameTypeDescription
valueuint256The stored value, scaled to 8 decimals.

getTimestampsFromLatestUpdate

Returns the timestamps of the latest batch update.

function getTimestampsFromLatestUpdate() external view returns (uint128 dataTimestamp, uint128 blockTimestamp);

Returns

NameTypeDescription
dataTimestampuint128The off-chain data timestamp, in milliseconds.
blockTimestampuint128The on-chain update timestamp, in seconds.