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

Available Asset Feeds

Asset Price FeedAsset Markets
BTCBTC Markets
USDCUSDC Markets
DIADIA Markets

How to Access Data

Call the read_oracle_value function on the oracle contract with the Query Symbol (e.g., “BTC/USD”). The function returns the asset price with 8 decimal precision and the timestamp of the last update. Below is the oracle contract code in Soroban:
use soroban_sdk::{Env, String};

use crate::storage_types::{DataKey, OracleValue, VALUE_BUMP_AMOUNT, VALUE_LIFETIME_THRESHOLD};

pub fn read_oracle_value(e: &Env, key: String) -> OracleValue {
    let store_key = DataKey::Value(key);

    if let Some(value) = e
        .storage()
        .temporary()
        .get::<DataKey, OracleValue>(&store_key)
    {
        e.storage()
            .temporary()
            .extend_ttl(&store_key, VALUE_LIFETIME_THRESHOLD, VALUE_BUMP_AMOUNT);
        value
    } else {
        OracleValue::default()
    }
}

pub fn write_oracle_value(e: &Env, key: String, value: &OracleValue) {
    let store_key = DataKey::Value(key);
    e.storage().temporary().set(&store_key, value);
    e.storage()
        .temporary()
        .extend_ttl(&store_key, VALUE_LIFETIME_THRESHOLD, VALUE_BUMP_AMOUNT);
}

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:

Request Custom Oracle

Support

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