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
  • Oracle configuration
  • Asset feeds
  • How to access data
  • Support
Export as PDF
  1. How-to Guides
  2. Fetch Price Data
  3. Chain-specific Guide

Edu Chain

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

PreviousAlephiumNextHydration

Last updated 1 month ago

is a cross-chain oracle provider that sources granular market data from diverse exchanges, including CEXs and DEXs. 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.

Oracle details

Chain
Address

Mainnet

Testnet

Oracle configuration

Pricing Methodology

Deviation (%) & Refresh Frequency

0.5% and 120 seconds

Heartbeat

24h

Asset feeds

Asset Ticker
getValue(key)
Asset Markets

EDU

EDU/USD

ETH

ETH/USD

WBTC

WBTC/USD

USDC

USDC/USD

USDT

USDT/USD

DAI

DAI/USD

ARB

ARB/USD

wstETH

wstETH/USD

GRAIL

GRAIL/USD

How to access data

Below is an example of a contract consuming data from the oracle on EduChain testnet using the IDIAOracleV2 interface. If you pass WBTC/USD as the key, it will return the most recent price of BTC in USD with 8 decimal places (e.g. 8258705325665 is $82,587.05325665) 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 = 0x6626f442ebc679f7e35bc62e36e3c1e8820c81c9;

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

Support

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 .

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 .

DIA
here
Discord
Telegram
contacting the DIA BD Team via Telegram
0x56BddAc934157c213c37864e3443E5196b47a1d1
0x6626f442ebc679f7e35bc62e36e3c1e8820c81c9
MAIR
EDU markets
ETH markets
WBTC markets
USDC markets
USDT markets
DAI markets
ARB markets
wstETH markets
GRAIL markets
DIA Oracle library
interface