Skip to main content

DIA Price Oracles

Ecosystem Price Oracles, powered by DIA

Introduction to DIA

DIA is a cross-chain oracle provider that sources granular market data from diverse exchanges, including CEXs, DEXs, and NFT marketplaces. Its data sourcing is thorough, enabling unparalleled transparency and customizability for resilient price feeds for 20,000+ assets. Its versatile data processing and delivery ensures adaptability and reliability for any decentralized application.

Usage of DIA Oracles on Telos

The DIA oracle on Telos EVM is free of use. dApps built on Telos EVM can leverage the oracles to access up-to-date asset price information. These oracles are designed for production environments and comes with a predefined list of feeds and settings. For dApps requiring a custom oracle with a different set of assets and configurations, they should contact DIA on Telegram.

Oracle migration

DIA migrated the Telos Mainnet oracle to a new contract. Update integrations to 0x0B4d6f1a81488F780196907688C74E078c93eec9.

The previous address (0xf774801c9f1b11e70966CE65EC7f95d7730F380d) is legacy. The new contract uses the same getValue(string) interface and the same 0.2% / 24h update parameters, but returns prices with 18 decimals (the legacy contract used 8).

Deployed contracts

Access the oracles in the smart contracts below:

Included price feeds + data sources

The current Telos oracle includes the following price feeds:

Asset TickerQuery keyAsset Markets Overview
USDTUSDT/USDUSDT Asset Information
USDCUSDC/USDUSDC Asset Information
ETHETH/USDETH Asset Information
BTCBTC/USDBTC Asset Information
BNBBNB/USDBNB Asset Information
TLOSTLOS/USDTLOS Asset Information

Oracle configuration settings

Oracle specifications:

Methodology: VWAPIR

The final price point for each asset is calculated by computing the assets' trade information across multiple DEXs and CEXs. This is done using a Volume Weighted Average Price with Interquartile Range (VWAPIR) methodology. Learn more about VWAPIR.

Update frequency: 0.2% deviation threshold, and 24 hour heartbeat.

The oracle operates a trade collection window of 2 minutes, distinct from the heartbeat mechanism. This period is used to aggregate trades for calculating the price point. Specifically, it gathers trade data within 120-second intervals and then evaluates if a 0.2% price deviation has occurred, triggering an update if such deviation is detected.

How to access DIA oracles?

Here is an example of how to access a price value on the current DIA oracle:

  1. Access the current oracle contract on Telos: 0x0B4d6f1a81488F780196907688C74E078c93eec9.
  2. Call getValue(pair_name) with pair_name being the full pair name such as TLOS/USD or USDT/USD. You can use the "Read" section on the explorer to execute this call.
  3. The response of the call contains two values:
    1. The current asset price in USD with 18 decimals (for example, 999050000000000000 is $0.99905).
    2. The UNIX timestamp of the last oracle update.
pragma solidity 0.8.29;

interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}

contract DIAOracleV2Consumer {
address immutable ORACLE = 0x0B4d6f1a81488F780196907688C74E078c93eec9;

function getPrice(string memory key)
external
view
returns (uint128 latestPrice, uint128 timestampOfLatestPrice)
{
(latestPrice, timestampOfLatestPrice) = IDIAOracleV2(ORACLE).getValue(key);
}
}

You can view the complete integration guide on Telos here.

Request a Custom Oracle

For assets not currently available or dApps requiring specific configurations, DIA deploys production-grade custom oracles tailored to your requirements with configurable data sources, pricing methodologies, update triggers, and coverage for any of 20,000+ supported assets.

Request a Custom Oracle

Resources