“Someone’s sitting in the shade today because someone planted a tree a long time ago.”Warren Buffet
Introducing IPOR Oracle. Besides providing IPOR rate to the blockchain community, IPOR Oracle is responsible for computing some simple yet important metrics that can be used by other smart contracts:
- exponential moving variance (EMVar)
- exponential moving average (EMA)
- IBT (Interest Bearing Token) - a measure of interest rate over time
Oracle structure consists of 2 contracts and an off-chain component.
- 1.Rate calculation contract: https://etherscan.io/address/0x9D4BD8CB9DA419A9cA1343A5340eD4Ce07E85140This stateless contract fetches the data from all the protocols supported by IPOR Index and runs all the calculations to compute IPOR Rate.
- 2.Oracle contract This contract keeps the state of the IPOR rate and calculates all additional params - EMA, EMVar, and IBT. Oracle contract allows for permissionless update of the IPOR rate (as long as requested is willing to cover the gas costs associated with the rate calculation) by invoking updateIndex(asset Address) function.
- 3.Rate publication off-chain oracle service. This service reads the value calculated in the rate calculation contract are publishes it to the IPOR Oracle contract. This is mainly done due to gas optimization reasons.