Skip to main content
DIA 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

ChainAddress
Mainnet0x47A04f0a1FA94c14f9FcB4EA0dC63aDdbC9Ecbe5
Testnet0x57e70667575c50c26D60BE6Db56e54B579d8CC22

Oracle configuration

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

Asset feeds

Mainnet

Asset TickerAdapter AddressAsset Markets
BTC0x34E793Bed54bcd6a7EE9479D8E7fDdD957ACd252BTC markets
ETH0x1145b9bad680089c8724Df0FAB1E68c7871E12a8ETH markets
SOL0x07CEb7db57759EB6D0b68CAb0cF49a08A52B06bdSOL markets
BNB0x512a846569442a9E69E595A3f030898A1cc052EcBNB markets
USDC0x9A581384B1A54D0863E20fa7bC6aafd68eB070B3USDC markets
USDT0x29047678110de15199AEb74332EDeCC4C3F83599USDT markets
POL0x9c42bcc40Ba59F87047434eC5fd9E3960A9d133CPOL markets
XRP0x3f3C850720A2838905cc1Dd50f4A3F5e03F84E92XRP markets
WCO0x58f903ec136c589447fA8db5d22210919c5bc51fWCO markets

Testnet

Asset TickerAdapter AddressAsset Markets
BTC0x9D0134e6fbB244dDa210189A5Dfe29BB85FF1E94BTC markets
ETH0x6cD4023d7da60c305F1BD2a361DAa7dEeCc8d336ETH markets
SOL0xef07fB27696597e9b248Ee7B265D715a8e130f36SOL markets
BNB0x5cb4129280cf34bd3D4c3127D910948896752877BNB markets
USDC0xc305427D51eBf5555Df717A562729F1853645e7cUSDC markets
USDT0x30eFF71073F6ba6E46bF15A417CdB301009c2d69USDT markets
POL0xa8c64239F9939530bf84357D7A9e281986781AdePOL markets
XRP0xBc22d07df5baf273d55eCD7027BdaA70EbCa3076XRP markets
WCO0x9a242f634A324f3621813A7f197206f6AC407b86WCO markets

How to access data

getValue Method

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 our oracle on W Chain 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 = 0x47A04f0a1FA94c14f9FcB4EA0dC63aDdbC9Ecbe5;

    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. This is a sample contract for consuming the BTC/USD price feed on W Chain mainnet:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface DiaAssetSpecificCallingConvention {
    function latestRoundData() external view returns (
        uint80 roundId,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    );
}

contract DIAOracleSample {
    address btcAdapter = 0x34E793Bed54bcd6a7EE9479D8E7fDdD957ACd252;

    function getBTCLatestPrice() external view returns (
        uint128 latestPrice,
        uint128 timestampOflatestPrice
    ) {
        // Call the Chainlink adapter's latestRoundData function
        (, int256 answer, , uint256 updatedAt, ) =
            DiaAssetSpecificCallingConvention(btcAdapter).latestRoundData();

        latestPrice = uint128(uint256(answer));
        timestampOflatestPrice = uint128(updatedAt);

        return (latestPrice, timestampOflatestPrice);
    }
}

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.
I