SpotOracle
The SpotOracle
is supposed to reflect the current market price of a collateral asset. It is used by IonPool
to determine the health factor of a vault as a user is opening or closing a position. NOTE: The price data provided by this contract is not used by the liquidation module at all. The spot price will also always be bounded by the collateral's corresponding reserve oracle price to ensure that a user can never open position that is directly liquidatable.
State Variables
LTV
RESERVE_ORACLE
Functions
constructor
Creates a new SpotOracle
instance.
Parameters
_ltv
uint256
Loan to value ratio for the collateral.
_reserveOracle
address
Address for the associated reserve oracle.
getPrice
Gets the price of the collateral asset in ETH.
Overridden by collateral specific spot oracle contracts.
Returns
price
uint256
of the asset in ETH. [WAD]
getSpot
Gets the risk-adjusted market price.
Returns
spot
uint256
The risk-adjusted market price.