Deep Dive
SimplePriceOracleTemplate1 contract
This contract implements the SimplePriceOracle interface.
The system can enable support for only one price oracle per currency-underlying pair.
References:
Note: The price obtained from the oracle is expected to be the underlying price per currency. For example, to support DAI-ETH pair, an oracle built with this interface can use MakerDao’s Medianizer as its price feed to return ETH price per DAI.
Developers can submit their own price oracle contracts as long as the contracts contain the following functions:
Function | Params | Description | Return type |
---|---|---|---|
get_price | - | Update the current price of underlying per currency from the price feed. Return the updated price. | uint256 |
owner | - | Get the owner of the oracle contract. | address |
currency | - | Get the currency token address. | address |
underlying | - | Get the underlying token address. | address |
feed_address | - | Get the price feed address. | address |
current_price | - | Return the last updated price. | address |