WstEthSpotOracle
Inherits: SpotOracle
The wstETH spot oracle.
State Variables
ST_ETH_TO_ETH_CHAINLINK
IChainlink public immutable ST_ETH_TO_ETH_CHAINLINK;
WST_ETH
IWstEth public immutable WST_ETH;
Functions
constructor
Creates a new WstEthSpotOracle
instance.
constructor(
uint256 _ltv,
address _reserveOracle,
address _stEthToEthChainlink,
address _wstETH
)
SpotOracle(_ltv, _reserveOracle);
Parameters
Name
Type
Description
_ltv
uint256
The loan to value ratio for wstETH.
_reserveOracle
address
The associated reserve oracle.
_stEthToEthChainlink
address
The chainlink price feed for stETH/ETH.
_wstETH
address
The wstETH contract address.
getPrice
Gets the price of wstETH in terms of ETH.
Because the collateral amount in the core contract is denominated in amount of wstETH tokens, spot needs to equal (stETH/wstETH) * (ETH/stETH) liquidationThreshold. If the beaconchain reserve decreases, the wstETH to stEth conversion will be directly impacted, but the stEth to Eth conversion will simply be determined by the chainlink price oracle.
function getPrice() public view override returns (uint256 ethPerWstEth);
Returns
Name
Type
Description
ethPerWstEth
uint256
price of wstETH in ETH. [WAD]