WstETHCLRSOracle
Gets the exchange rate between the underlying asset and the peg asset by using: wstETH Oracle price in combination with rate from Chainlink price feeds (or Redstone as fallback), hopping the 2 rates into 1 rate. e.g. when going from wstETH to USDT: wstETH -> stETH wstETH Oracle, stETH -> ETH Chainlink feed, ETH -> USDT Chainlink feed.
constructor
constructor(string infoName_, contract IWstETH wstETH_, uint8 mainSource_, struct ChainlinkStructs.ChainlinkConstructorParams chainlinkParams_, struct RedstoneStructs.RedstoneOracleData redstoneOracle_) public
sets the wstETH address, main source, Chainlink Oracle and Redstone Oracle data.
Parameters
Name | Type | Description |
---|---|---|
infoName_ | string | Oracle identify helper name. |
wstETH_ | contract IWstETH | address of the wstETH contract |
mainSource_ | uint8 | which oracle to use as main source: 1 = Chainlink, 2 = Redstone (other one is fallback). |
chainlinkParams_ | struct ChainlinkStructs.ChainlinkConstructorParams | chainlink Oracle constructor params struct. |
redstoneOracle_ | struct RedstoneStructs.RedstoneOracleData | Redstone Oracle data. (address can be set to zero address if using Chainlink only) |
getExchangeRateOperate
function getExchangeRateOperate() public view returns (uint256 exchangeRate_)
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for operates
getExchangeRateLiquidate
function getExchangeRateLiquidate() external view returns (uint256 exchangeRate_)
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for liquidations
getExchangeRate
function getExchangeRate() external view returns (uint256 exchangeRate_)
Deprecated. Use getExchangeRateOperate()
and getExchangeRateLiquidate()
instead. Only implemented for
backwards compatibility.
FALLBACK_ORACLE_MAIN_SOURCE
function FALLBACK_ORACLE_MAIN_SOURCE() public view returns (uint8)
which oracle to use as main source: - 1 = Chainlink ONLY (no fallback) - 2 = Chainlink with Redstone Fallback - 3 = Redstone with Chainlink Fallback