Oracle Provider¶
In several places in the Mero protocol there is a need for on chain price oracles. Most notably for token swaps to get an appropriate minAmountOut
value for slippage protection. Instead of implementing this oracle logic in several places, the Oracle Provider is a contract to expose some useful views for use in the rest of the protocol.
There are two main views exposed by the Oracle Provider:
-
OracleProvider.
getPriceETH
(address baseAsset) external view returns (uint256)¶ Quotes the ETH price of
baseAsset
.baseAsset
: The asset of which the price is to be quoted.
-
OracleProvider.
getPriceUSD
(address baseAsset) external view returns (uint256)¶ Quotes the USD price of
baseAsset
.baseAsset
: The asset of which the price is to be quoted.