Astra DAO


Provable oracle contract is used for managing the automatically managed indices. Provable provide functionality to use APIs in your smart contract.
Oracle contract will provable to get the data using APIs which is set by owner. This API will return the JSON object which is process by provable library.
The interaction between Provable and an oracle smart contract is asynchronous. Any request for data is composed of two steps:
Firstly, a transaction executing a function of a smart contract is broadcasted by a owner. The function contains a special instruction with API details which manifest to Provable, who is constantly monitoring the Ethereum blockchain for such instruction, a request for data.
Secondly, according to the parameters of such request, Provable will fetch a result, build, sign and broadcast the transaction carrying the result. This transaction will execute the __callback function which is be placed in the oracle contract.
Oracle contract can be called at the time of creating/rebalance of index. Index can only be created by owner and rebalance can only be done by Indices contract once all the conditions are matched. Flashloan attack are not relevant for this contract.