Skip to content
Lattice

ITellor

Git Source

Title: ITellor

Author: Vendored minimal subset of Tellor (https://github.com/tellor-io).

Upstream license: MIT.

Minimal interface for the Tellor oracle (TellorFlex).

Vendored subset — do not add a usingtellor dependency. Tellor is a dispute-based oracle: reporters post data permissionlessly and bad values are removed by dispute. Best practice is to read data at least a dispute buffer old (e.g. 15-20 min) via getDataBefore so disputed values are removed first. SpotPrice value is abi.encode(uint256) at 18 decimals (WAD). Tellor is a SINGLE global oracle contract per chain.

Functions

getDataBefore

Returns the latest data before timestamp for queryId.

Reading data with a dispute buffer (block.timestamp - buffer) leaves time for disputed values to be removed before they are consumed.

function getDataBefore(bytes32 queryId, uint256 timestamp)
        external
        view
        returns (bool found, bytes memory value, uint256 timestampRetrieved);

Parameters

NameTypeDescription
queryIdbytes32The Tellor query id (keccak256(queryData)).
timestampuint256The exclusive upper-bound timestamp to read before.

Returns

NameTypeDescription
foundboolTrue if a value was retrieved.
valuebytesThe reported value bytes (SpotPrice is abi.encode(uint256) at 18 decimals).
timestampRetrieveduint256The timestamp the returned value was reported.