You can query for assets by calling the read function getValue() with parameters such as “PEAS/USD”. It will return two values:
The price of the asset queried with 8 decimals
The unix timestamp of the last update
You can see Solidity and Vyper code integration examples here or use a dedicated DIA oracles integration library described in detail here.
Funding
Each deployed oracle contract has a separate gas wallet which is the only entity allowed to update oracle values based on selected parameters. To find out more information on how it works, visit the following link.
Please make sure to top up the gas wallet, as we only put in some gas to deploy and start the oracle.
The gas wallet is used for pushing data to your contracts. To ensure uninterrupted oracle operation, please maintain sufficient funds in the gas wallet. You can monitor the wallets below to ensure they remain adequately funded at all times.
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.
If you pass PEAS/USD as the key, it will return the most recent price of PEAS in USD with 8 decimal places (e.g. 321700808 is $3.21700808) along with the Unix timestamp of the last price update.