Skip to main content
Explore these demo oracles to see how DIA works. For production deployments, request a custom oracle and unlock the full power of tailored data feeds for your dApp.

Demo Oracles

Oracle Contracts

Testnet

Oracle Configuration

Pricing MethodologyMAIR
Deviation (%) & Refresh Frequency2% and 120 seconds
Heartbeat12h

Available Asset Feeds

Asset Tickerupdates(key)Asset Markets
ETHETH/USDETH Markets
BTCBTC/USDBTC Markets
DIADIA/USDDIA Markets
USDCUSDC/USDUSDC Markets

How to Access Data

To consume price data, use the updates method for Push-based oracles. The price updates are stored in both methods in an updates mapping. When accessing the updates mapping through the key BTC/USD, 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. Below is a sample contract that consumes the BTC/USD price feed:

updates Method

pragma solidity ^0.8.13;

import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";

contract DIAOracleSample {

    PushOracleReceiver public diaOracle;
    string public key = "BTC/USD";

    constructor(address _oracle) {
        diaOracle = PushOracleReceiver(payable(_oracle));
    }

    function getPrice()
    external
    view
    returns (
        uint128 timestampOflatestPrice,
        uint128 latestPrice
    ) {
        (timestampOflatestPrice, latestPrice) =
                 diaOracle.updates(key);
    }
}

Additional Details

You can find the contract addresses for the Ethereum bridge’s components on testnet below:
Learn more about DIA’s cross-chain messaging layer here.

Request a Custom Oracle

DIA offers highly customizable oracles that are individually tailored to each dApp’s needs. Each oracle can be customized in the following ways, including:
  • Data Sources & Asset Feeds
  • Pricing Methodologies
  • Update Triggers (Frequency, Deviation, Heartbeat, …etc)
Get a tailored oracle for your dApp, request one below:

Support

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