Ratio2xFallbackCLRSOracleL2

Gets the exchange rate between the underlying asset and the peg asset by using: 1. the price from a Chainlink price feed or a Redstone Oracle with one of them being used as main source and the other one acting as a fallback if the main source fails for any reason. Reverts if fetched rate is 0. 2. set into ratio with another price fetched the same way. I.e. it is possible to do Chainlink Oracle / Chainlink Oracle. E.g. wstETH per 1 weETH on a L2 via CL feeds.

constructor

constructor(string infoName_, struct FallbackCLRSOracleL2.CLRSConstructorParams cLRSParams1_, struct FallbackCLRSOracleL2.CLRSConstructorParams cLRSParams2_, address sequencerUptimeFeed_) public

sets the two CLRS oracle configs

Parameters

NameTypeDescription
infoName_stringOracle identify helper name.
cLRSParams1_struct FallbackCLRSOracleL2.CLRSConstructorParamsCLRS Fallback Oracle data for ratio dividend
cLRSParams2_struct FallbackCLRSOracleL2.CLRSConstructorParamsCLRS Fallback Oracle data for ratio divisor
sequencerUptimeFeed_addressL2 sequencer uptime Chainlink feed

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() public view returns (uint256 exchangeRate_)

Get the exchangeRate_ between the underlying asset and the peg asset in 1e27 for liquidations

getExchangeRate

function getExchangeRate() public view returns (uint256 exchangeRate_)

Deprecated. Use getExchangeRateOperate() and getExchangeRateLiquidate() instead. Only implemented for backwards compatibility.

FALLBACK_ORACLE2_MAIN_SOURCE

function FALLBACK_ORACLE2_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