Skip to content
Lattice

IDIAOracleV2

Git Source

Title: IDIAOracleV2

Author: Vendored minimal subset of DIA (https://github.com/diadata-org).

Upstream license: GPL-3.0 (repository license; the upstream file has no SPDX tag).

Minimal interface for a DIA OracleV2 contract.

Vendored subset — do not add a DIA dependency. A single DIA oracle contract serves many string-keyed feeds (e.g. "ETH/USD"); value is reported with 8 decimals and timestamp is the off-chain update time the consumer validates for staleness.

Functions

getValue

Reads the current value and update timestamp for the given key.

function getValue(string memory key) external view returns (uint128 value, uint128 timestamp);

Parameters

NameTypeDescription
keystringThe DIA price key string (e.g. "ETH/USD").

Returns

NameTypeDescription
valueuint128The price value, scaled to 1e8 (8 decimals).
timestampuint128The timestamp the value was last updated off-chain.