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

Aleph Zero

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

PreviousChain-specific GuideNextAlephium

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

Oracle configuration

Pricing Methodology

Deviation (%) & Refresh Frequency

0.5% and 120 seconds

Heartbeat

24h

Asset feeds

Asset Ticker
getValue(key)
Asset Markets

USDT

USDT/USD

USDC

USDC/USD

BTC

BTC/USD

ETH

ETH/USD

stETH

stETH/USD

AZERO

AZERO/USD

ARB

ARB/USD

How to access data

Below is an example of a contract consuming data from our oracle on Aleph Zero mainnet. 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 = 0x4845890f8d7b4A0b29759271929B0FCF672aEED6;

    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
0x4845890f8d7b4A0b29759271929B0FCF672aEED6
VWAP
USDT markets
USDC markets
BTC markets
ETH markets
stETH markets
AZERO markets
ARB markets
DIA Oracle library
interface