Oracles require a constant stream of updates, thus gas costs reimbursement for updates is needed. To achieve this, all oracles deployed by DIA have a dedicated wallet which calls oracle contracts for updates. This is referred to as the “gas wallet”.
GET
https://api.diadata.org/v1/assetUpdates/:blockchain/:address/:deviation/:updateFreq
The endpoint returns information on the asset deviation and updates count if it was used in the oracle. It takes price change (deviation) and oracle’s ticker frequency as the main parameters to determine estimated updates count based on historical data.
Example: https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120
By default it will return data for the last 24h but you can configure the timeframe with starttime and endtime parameters. See example below: https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120?starttime=1661736336&endtime=1661761536
Name | Type | Description |
---|---|---|
blockchain* | String | A valid blockchain from GET /v1/blockchains, e.g., Bitcoin. |
address* | String | A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC. |
deviation* | Integer | Deviation measure in per mille, e.g. 20 will result in 2% deviation |
updateFreq* | Integer | Oracle’s price feed ticker frequency in seconds, e.g. 120 will calculate asset price in 2 minute trade blocks |
starttime | Integer | Unix timestamp setting the start of the return array |
endtime | Integer | Unix timestamp setting the end of the return array |