SpotOracle

Git Source

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

uint256 public immutable LTV;

RESERVE_ORACLE

ReserveOracle public immutable RESERVE_ORACLE;

Functions

constructor

Creates a new SpotOracle instance.

constructor(uint256 _ltv, address _reserveOracle);

Parameters

getPrice

Gets the price of the collateral asset in ETH.

Overridden by collateral specific spot oracle contracts.

function getPrice() public view virtual returns (uint256 price);

Returns

getSpot

Gets the risk-adjusted market price.

function getSpot() external view returns (uint256 spot);

Returns

Errors

InvalidLtv

error InvalidLtv(uint256 ltv);

InvalidReserveOracle

error InvalidReserveOracle();