MixedPriceOracleV3
Inherits: IOracleOperator
State Variables
STALENESS_PERIOD
uint256 public immutable STALENESS_PERIOD;
configs
mapping(string => IDefaultAdapter.PriceConfig) public configs;
stalenessPerSymbol
mapping(string => uint256) public stalenessPerSymbol;
roles
IRoles public immutable roles;
Functions
constructor
constructor(
string[] memory symbols_,
IDefaultAdapter.PriceConfig[] memory configs_,
address roles_,
uint256 stalenessPeriod_
);
setStaleness
function setStaleness(string memory symbol, uint256 val) external;
setConfig
function setConfig(string memory symbol, IDefaultAdapter.PriceConfig memory config) external;
getPrice
function getPrice(address mToken) public view returns (uint256);
getUnderlyingPrice
function getUnderlyingPrice(address mToken) external view override returns (uint256);
_getPriceUSD
function _getPriceUSD(string memory symbol) internal view returns (uint256);
_getLatestPrice
function _getLatestPrice(string memory symbol, IDefaultAdapter.PriceConfig memory config)
internal
view
returns (uint256, uint256);
_getStaleness
function _getStaleness(string memory symbol) internal view returns (uint256);
Events
ConfigSet
event ConfigSet(string symbol, IDefaultAdapter.PriceConfig config);
StalenessUpdated
event StalenessUpdated(string symbol, uint256 val);
Errors
MixedPriceOracle_Unauthorized
error MixedPriceOracle_Unauthorized();
MixedPriceOracle_StalePrice
error MixedPriceOracle_StalePrice();
MixedPriceOracle_InvalidPrice
error MixedPriceOracle_InvalidPrice();
MixedPriceOracle_InvalidRound
error MixedPriceOracle_InvalidRound();
MixedPriceOracle_InvalidConfig
error MixedPriceOracle_InvalidConfig();