Links

Oracle Documentation

Oracles are smart contract interfaces that bring data from an external source into a smart contract. Smart contracts run in an isolated environment in a virtual machine and can not "measure" any outside information by themselves. The only way to get external data into a smart contract is by executing a transaction with the external data as a payload. With that data, a smart contract can perform calculations and operations that depend on this data, such as calculating an interest based on the reference interest rates published by a central bank.
DIA is capable of publishing financial data with such an oracle so that any smart contract can read and use it from within the largest blockchain networks. By generating verifiable oracle data, any user can use financial data in smart contracts. For each of our asset classes, there is an example data set available in the oracle.
In the following page you can find out all available data feeds for oracle integration:
To learn how to interact with DIA oracle smart contracts, visit the following page:
DIA offers custom oracles set-up for specific use-cases, learn more on how to submit the request for custom data delivery via oracle:

Multi-chain delivery

DIA operates oracles on 25+ blockchains. To enable developers to test DIA's oracle services, DIA provides Development Oracles for each supported chain. These Development Oracle contracts are smart contracts that provide a selected range of asset prices on various blockchains for live testing on a respective Mainnet and Testnet.
Get an overview on the deployed demo oracles for all available chains in the following page:

Data Categories

Price feeds

You can find all available assets for price feeds on DIA xStream

Randomness

DIA provides randomness as a guest oracle using the distributed random beacon provided by drand.love.

NFT data

DIA provides oracles for NFT Data. The oracle contains information about price quotations of NFTs sourced directly from on-chain activity.

DIA Oracles Structure

Example DApp: ETH price feed via Oracle Smart Contract

As an example application, we implemented and deployed a simple smart contract that sends ETH and other assets price updates every 24h
Call getValue() with a crypto asset pair name as argument in order to request the current crypto asset price from our oracle. For this specific example ETH/USD is the correct key to use for retrieving the last updated ETH price.
In the above link, you can use the "Read Contract" tab for easy web access. The rate is displayed in a fix comma format with eight decimal digits. The source code of that example contract can be found at the "Code" tab. This shows how easy it is to integrate our oracle into any application: compile your application against the oracle interface and set the address where the oracle is deployed afterwards. Ideally, this should be done in a way that allows updates if the oracle address changes at any time in the future.

Solidity DIA Oracles Integration Library

DIA has a dedicated library for Solidity developers to facilitate your integration journey.
Below is a sample function that allows to quote Asset Price from any of the DIA's oracles
import {DIAOracleLib} from "./libraries/DIAOracleLib.sol";
function exampleGetPrice(string memory key) external returns (uint128){
return DIAOracleLib.getPrice(ORACLE, key);
}
Find out full documentation here.