Oracles
Overview
Carbon native oracle smart contracts allow enable EVM developers to query real-world or external data, without using a third-party like Chainlink or Band Protocol.
Each oracle created from Carbon Core automatically deploys a corresponding EVM smart contract that contains latest data of the oracle.
Smart contract authors can make use of the same oracles that power Carbon Core's perpetual markets and CDP module to develop their own unique dApps such as binary options, gaming, DCA strategies etc.
Usage
Oracle contracts possess a few simple methods for querying:
Decimals Returns the the number of decimal places that the data contains. Different contract may implement a different number of decimals and incorrect conversion will result in erroneous data.
Creator Users should verify that the contract deployed by Carbon's Oracle module by checking the creator's address originate from Carbon Core's Oracle Module. List of modules address are listed here.
GetLatestData Returns the latest results from the oracle which contains the latest price and the the timestamp of the data. The price data contains a specified number of decimals and need to be appropriately converted for usage.
GetLastUpdateTime Returns the unix timestamp of which the contract was last updated. This method allows the callers of the contract to ensure that the contract is still lively and active.
Developers should always verify the validity of the oracle results using the above methods and timestamps provided.
List of Oracle Addresses
The latest list of available Oracle Ids and their corresponding smart contracts can be found here.
For API usage, the results and parameters of the oracle can be queried using this endpoint with the specified Oracle Id.
Last updated