Skip to content
Lattice

IStdReference

Git Source

Title: IStdReference

Author: Vendored minimal subset of Band Protocol (https://github.com/bandprotocol/contract-tools/blob/master/spec/StdReference.sol).

Upstream license: unknown (the linked upstream repository is not publicly reachable).

Minimal interface for the Band Protocol standard reference (StdReferenceProxy) oracle.

Vendored subset — do not add a Band contracts dependency. Band uses a SINGLE global reference contract per chain; feeds are keyed by a (base, quote) symbol pair (e.g. ("ETH","USD")). rate is already 18-decimals (WAD), and lastUpdatedBase / lastUpdatedQuote are the unix timestamps the consumer validates for staleness.

Functions

getReferenceData

Returns the reference data for the base/quote symbol pair.

function getReferenceData(string memory base, string memory quote)
        external
        view
        returns (ReferenceData memory referenceData);

Parameters

NameTypeDescription
basestringThe base symbol (e.g. "ETH").
quotestringThe quote symbol (e.g. "USD").

Returns

NameTypeDescription
referenceDataReferenceDataThe (rate, lastUpdatedBase, lastUpdatedQuote) result.

Structs

ReferenceData

A Band reference-data result for a (base, quote) symbol pair.

struct ReferenceData {
        uint256 rate;
        uint256 lastUpdatedBase;
        uint256 lastUpdatedQuote;
    }

Properties

NameTypeDescription
rateuint256The base/quote exchange rate, scaled to 1e18 (18 decimals).
lastUpdatedBaseuint256The unix timestamp the base symbol was last updated.
lastUpdatedQuoteuint256The unix timestamp the quote symbol was last updated.