Oracle details

WBTC, WETH, DOT, USDT and USDC oracle

ChainAddress
Mainnet0xdee629af973ebf5bf261ace12ffd1900ac715f5e
Testnet0xc756bd338a97c1d2faab4f13b5444a08a1566917

tBTC, WETH, and vDOT oracle

ChainAddress
Mainnet0x48ae7803cd09c48434e3fc5629f15fb76f0b5ce5
Testnet0x5d8320f3ced9575d8e25b6f437e610fc6a03bf52

Oracle configuration

Pricing MethodologyVWAP
Deviation (%) & Refresh Frequency0.5% and 120 seconds
Heartbeat24h

Asset feeds

Mainnet

Asset TickerAdapter AddressAsset Markets
WBTC0xeDD9A7C47A9F91a0F2db93978A88844167B4a04fWBTC markets
WETH0x8aEAE0bBf623B0E70732086B8D48A6090C311596WETH markets
DOT0xFBCa0A6dC5B74C042DF23025D99ef0F1fcAC6702DOT markets
USDT0x8b0DDfB8F56690eAde9ECa23a7d90E153C268d5BUSDT markets
USDC0x17711BE5D63B2Fe8A2C379725DE720773158b954USDC markets
tBTC0xe5AcDfB0d5EC5cE34F7448B41ef4a97c4e83D9c1tBTC markets
Aave0x9E85d33FD87342762710FB4a1471df1Dc7bb5f8CAave markets
vDOT0xF89728554C61B7AA08bf94823D1017697047c0fEvDOT markets

Testnet

Asset TickerAdapter AddressAsset Markets
WBTC0xC9cCBe99bdD9538871f9756Ca5Ea64C2267cb0a7WBTC markets
WETH0xBd763043861CAF4E7e4E7Ffe951A03dF2Ea7E5ACWETH markets
DOT0x422E745797EC0Ef399c17cE3E2348394F2944727DOT markets
USDT0xb4aC9f0E6E207D5d81B756F8aF6efe3fe7B0E72cUSDT markets
USDC0xEE7aFb45c094DC9fA404D6A86A7d795d4aA33D28USDC markets
tBTC0x9f7abE73e656DB45F56B1d3755940CB3fc82FcaatBTC markets
Aave0xC9E1415Eb64281aD449f50C454873d92F312d6fEAave markets
vDOT0x234F96059d628Da80B76A40c0E50a9D16a8F3191vDOT markets

How to access data

Accessing the oracle on-chain (Solidity)

To consume price data, you’ll need to invoke the getValue method on the oracle contract which you can access through the DIA Oracle library or the interface.

Below is an example of a contract consuming data from the oracle on Hydration testnet using the IDIAOracleV2 interface. If you pass BTC/USD as the key, it will return the most recent price of BTC in USD with 8 decimal places (e.g. 9601458065403 is $96,014.58065403) along with the Unix timestamp of the last price update.

pragma solidity ^0.8.13;

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

contract DIAOracleV2Consumer{

    address immutable ORACLE = 0xc756bd338a97c1d2faab4f13b5444a08a1566917;

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

See the full example here.

Adapter contracts

To consume price data from our oracle, you can use the adapter smart contract located at the adapter address for each asset. This will allow you to access the same methods on the AggregatorV3Interface such as getRoundData & latestRoundData. You can learn more here.

Support

For developer assistance, connect with the DIA team directly on Discord or Telegram.

Developers seeking other specialized, production-grade oracle with tailored price feeds and configurations can initiate the request by contacting the DIA BD Team via Telegram.