DIA Nexus Documentation
  • Nexus Overview
  • Intro to Nexus
    • How it works
    • Nexus vs. Lumina
    • Integrated Chains
  • Data products
    • Token Price Feeds
    • RWA Price Feeds
    • Randomness
    • Fair-value Feeds
  • How-to Guides
    • Fetch Price Data
      • Solidity
      • Vyper
      • Demo Oracles
      • Chain-specific Guide
        • Aleph Zero
        • Alephium
        • Edu Chain
        • Hydration
        • Kadena
        • LUKSO
        • Somnia
        • Stacks
        • Superseed
        • XRP Ledger (XRPL)
    • Generate Randomness
      • Solidity
      • WASM
      • Demo Oracles
      • Chain-specific Guide
        • Alephium
    • Migrate to DIA
    • Fund the Oracle
    • Build a Scraper
      • Development Cluster Stack
      • DIA Test‐Space with Docker Compose
      • DIA Test‐Space with Minikube
      • Add a new exchange scraper
      • Add a new foreign scraper
      • Add a new liquidity scraper
      • Additional notes
  • Request a Custom Oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • APIs
      • Token prices
        • RestAPI
          • Request Samples
        • GraphQL
          • Request Samples
      • RWA prices
    • Pricing Methodologies
      • IR: Interquartile Range Filter
      • MAIR: Moving Average with Interquartile Range Filter
      • VWAP: Volume Weighted Average Price
      • VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
      • LST fair price
    • Data Sources
      • CEXes Data
      • DEXes Data
    • Smart Contracts
      • DIAOracleV2.sol
      • DIARandomOracle.sol
    • Randomness Protocol
  • Resources
    • Audits
    • Community & Support
    • Security Bounty Program
    • Research
      • Return Rates in Crypto Farming
      • Crypto Volatility Index
      • Compounded Rates
      • Polkadot Medianizer
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • Oracle details
  • WBTC, WETH, DOT, USDT and USDC oracle
  • tBTC, WETH, and vDOT oracle
  • Oracle configuration
  • Asset feeds
  • Mainnet
  • Testnet
  • How to access data
  • Accessing the oracle on-chain (Solidity)
  • Adapter contracts
  • Support
Export as PDF
  1. How-to Guides
  2. Fetch Price Data
  3. Chain-specific Guide

Hydration

dApps built on Hydration can leverage DIA oracles to access up-to-date asset price information.

Oracle details

WBTC, WETH, DOT, USDT and USDC oracle

Chain
Address

Mainnet

Testnet

0xc756bd338a97c1d2faab4f13b5444a08a1566917

tBTC, WETH, and vDOT oracle

Chain
Address

Mainnet

Testnet

0x5d8320f3ced9575d8e25b6f437e610fc6a03bf52

Oracle configuration

Pricing Methodology

Deviation (%) & Refresh Frequency

0.5% and 120 seconds

Heartbeat

24h

Asset feeds

Mainnet

Asset Ticker
Adapter address
Asset Markets

WBTC

WETH

DOT

USDT

USDC

tBTC

Aave

vDOT

Testnet

Asset Ticker
Adapter address
Asset Markets

WBTC

0xC9cCBe99bdD9538871f9756Ca5Ea64C2267cb0a7

WETH

0xBd763043861CAF4E7e4E7Ffe951A03dF2Ea7E5AC

DOT

0x422E745797EC0Ef399c17cE3E2348394F2944727

USDT

0xb4aC9f0E6E207D5d81B756F8aF6efe3fe7B0E72c

USDC

0xEE7aFb45c094DC9fA404D6A86A7d795d4aA33D28

tBTC

0x9f7abE73e656DB45F56B1d3755940CB3fc82Fcaa

Aave

0xC9E1415Eb64281aD449f50C454873d92F312d6fE

vDOT

0x234F96059d628Da80B76A40c0E50a9D16a8F3191

How to access data

Accessing the oracle on-chain (Solidity)

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); 
    }
}

Adapter contracts

Support

PreviousEdu ChainNextKadena

Last updated 1 month ago

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

See the full example .

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

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

Developers seeking other specialized, production-grade oracle with tailored price feeds and configurations can initiate the request by .

here
Discord
Telegram
contacting the DIA BD Team via Telegram
here
adapter address
0xdee629af973ebf5bf261ace12ffd1900ac715f5e
0x48ae7803cd09c48434e3fc5629f15fb76f0b5ce5
VWAP
0xeDD9A7C47A9F91a0F2db93978A88844167B4a04f
WBTC markets
0x8aEAE0bBf623B0E70732086B8D48A6090C311596
WETH markets
0xFBCa0A6dC5B74C042DF23025D99ef0F1fcAC6702
DOT markets
0x8b0DDfB8F56690eAde9ECa23a7d90E153C268d5B
USDT markets
0x17711BE5D63B2Fe8A2C379725DE720773158b954
USDC markets
0xe5AcDfB0d5EC5cE34F7448B41ef4a97c4e83D9c1
tBTC markets
0x9E85d33FD87342762710FB4a1471df1Dc7bb5f8C
Aave markets
0xF89728554C61B7AA08bf94823D1017697047c0fE
vDOT markets
WBTC markets
WETH markets
DOT markets
USDT markets
USDC markets
tBTC markets
Aave markets
vDOT markets
DIA Oracle library
interface