description |
---|
How do I access CoinMarketCap quotations using the DIA oracle system? |
The oracle contains information about price quotations of crypto assets from CoinMarketCap. You can access quotations for the top 50 assets ranked by market capitalization.
You can execute an oracle call as follows:
- Access DIA's CoinMarketCap Oracle.
- Call
getValue(key)
wherekey
is the symbol for the asset in capital letters, for instanceBTC
for Bitcoin. You can use the "Read" section on Etherscan to execute this call. - The response of the call contains two values:
- The current asset price in USD with a fix-comma notation of five decimals.
- The UNIX timestamp of the last oracle update.