DIA

Overview

DIA is a cross-chain oracle platform for Web3. It serves as an ecosystem for transparent financial data within a smart contract environment dedicated to finance. DIA's mission is to foster a collaborative environment among data analysts, providers, and consumers. Essentially, DIA offers a trustworthy and verifiable conduit linking external data from diverse origins to on-chain smart contracts, facilitating the creation of a myriad of financial decentralized applications. DIA is architected as a hybrid framework, integrating off-chain mechanisms for the storage and manipulation of extensive datasets, with on-chain elements that supply data to financial smart contracts.

DIA's API

Display the most transparent data to your users using DIA's API. Whether you're developing a financial service, a portfolio management tool, a new media platform, or anything else, DIA provides the most advanced and up-to-date data for your product.

API Access

The base URL for DIA is https://api.diadata.org/v1. All API paths are extensions of this base URL. Detailed documentation for our API endpoints can be found on the API documentation site.

DIA's Oracle

Here is an overview of the deployed oracle contracts on each supported chain.

DIA Development Oracle contracts are smart contracts that offer a selected range of asset prices for live testing on our Mainnet and Testnet. These contracts are regularly updated and replaced, not maintained indefinitely.

DIA Development Oracle contracts are not meant to be integrated into a dApp. DIA creates specific contracts for dApps. To request a dedicated oracle, please contact the team on their website Discord or the DIA DAO Forum.

Deployed Contracts

ParameterValue

Smart Contract

0x719108DC653CC3a9055ab8d9018c5D7924912631

Oracle Type

Seeds

"BTC/USD" "ORDI/USD"

Example (Solidity)

pragma solidity ^0.8.13;

interface IDIAOracleV2{
    function getValue(string memory) external returns (uint128, uint128);
}

contract IntegrationSample{

    address immutable ORACLE = 0x719108DC653CC3a9055ab8d9018c5D7924912631;
    uint128 public latestPrice; 
    uint128 public timestampOflatestPrice; 
   
    function getPriceInfo(string memory key) external {
        (latestPrice, timestampOflatestPrice) = IDIAOracleV2(ORACLE).getValue(key); 
    }
   
    function checkPriceAge(uint128 maxTimePassed) external view returns (bool inTime){
         if((block.timestamp - timestampOflatestPrice) < maxTimePassed){
             inTime = true;
         } else {
             inTime = false;
         }
    }
}

Result

Last updated