ChainlinkOracle
Inherits: IOracleOperator
State Variables
priceFeeds
mapping(string => IAggregatorV3) public priceFeeds;
baseUnits
mapping(string => uint256) public baseUnits;
DECIMALS
uint8 public constant DECIMALS = 18;
Functions
constructor
constructor(string[] memory symbols_, IAggregatorV3[] memory feeds_, uint256[] memory baseUnits_);
getPrice
Get the price of a mToken asset
function getPrice(address mToken) external view override returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
mToken | address | The mToken to get the price of |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable. |
getUnderlyingPrice
Get the underlying price of a mToken asset
function getUnderlyingPrice(address mToken) external view override returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
mToken | address | The mToken to get the underlying price of |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The underlying asset price mantissa (scaled by 1e18). Zero means the price is unavailable. |
_getLatestPrice
function _getLatestPrice(string memory symbol) internal view returns (uint256, uint256);
Errors
ChainlinkOracle_NoPriceFeed
error ChainlinkOracle_NoPriceFeed();
ChainlinkOracle_ZeroPrice
error ChainlinkOracle_ZeroPrice();