FallbackCLRSOracleL2

Gets the exchange rate between the underlying asset and the peg asset by using: 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.

CLRSConstructorParams

struct CLRSConstructorParams {
  uint8 mainSource;
  struct ChainlinkStructs.ChainlinkConstructorParams chainlinkParams;
  struct RedstoneStructs.RedstoneOracleData redstoneOracle;
}

constructor

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

sets the main source, Chainlink Oracle and Redstone Oracle data.

Parameters

NameTypeDescription
infoName_stringOracle identify helper name.
cLRSParams_struct FallbackCLRSOracleL2.CLRSConstructorParamsCLRS Fallback Oracle data
sequencerUptimeFeed_addressL2 sequencer uptime Chainlink feed

getExchangeRateOperate

function getExchangeRateOperate() public view virtual returns (uint256 exchangeRate_)

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

getExchangeRateLiquidate

function getExchangeRateLiquidate() public view virtual returns (uint256 exchangeRate_)

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

getExchangeRate

function getExchangeRate() public view virtual returns (uint256 exchangeRate_)

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