EthXSpotOracle
Inherits: SpotOracle
The ETHx spot oracle.
State Variables
REDSTONE_ETHX_PRICE_FEED
IRedstonePriceFeed public immutable REDSTONE_ETHX_PRICE_FEED;
USD_PER_ETH_CHAINLINK
IChainlink public immutable USD_PER_ETH_CHAINLINK;
Functions
constructor
Creates a new EthXSpotOracle
instance.
constructor(
uint256 _ltv,
address _reserveOracle,
address _redstoneEthXPriceFeed,
address _usdPerEthChainlink
)
SpotOracle(_ltv, _reserveOracle);
Parameters
Name
Type
Description
_ltv
uint256
The loan to value ratio for ETHX.
_reserveOracle
address
The associated reserve oracle.
_redstoneEthXPriceFeed
address
The redstone price feed for ETHx/USD.
_usdPerEthChainlink
address
The chainlink price feed for ETH/USD.
getPrice
Gets the price of ETHx in ETH.
Redstone oracle returns dollar value per ETHx with 6 decimals. This needs to be converted to a WAD and to ETH denomination.
function getPrice() public view override returns (uint256 ethPerEthX);
Returns
Name
Type
Description
ethPerEthX
uint256
price of ETHx in ETH. [WAD]