WstETHCLRS2UniV3CheckCLRSOracle

Gets the exchange rate between the underlying asset and the peg asset by using: 1. wstETH Oracle price in combination with rate from Chainlink price feeds (or Redstone as fallback). combining those two into one rate resulting in wstETH <> someToken 2. result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2 e.g. when going from wstETH to USDC: 1. wstETH -> stETH wstETH Oracle, stETH -> ETH Chainlink feed. 2. ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.

WstETHCLRS2ConstructorParams

struct WstETHCLRS2ConstructorParams {
  contract IWstETH wstETH;
  uint8 fallbackMainSource;
  struct ChainlinkStructs.ChainlinkConstructorParams chainlinkParams;
  struct RedstoneStructs.RedstoneOracleData redstoneOracle;
}

constructor

constructor(string infoName_, struct WstETHCLRS2UniV3CheckCLRSOracle.WstETHCLRS2ConstructorParams wstETHCLRS2Params_, struct UniV3CheckCLRSOracle.UniV3CheckCLRSConstructorParams uniV3CheckCLRSParams_) public

constructs a WstETHCLRS2UniV3CheckCLRSOracle with all inherited contracts

Parameters

NameTypeDescription
infoName_stringOracle identify helper name.
wstETHCLRS2Params_struct WstETHCLRS2UniV3CheckCLRSOracle.WstETHCLRS2ConstructorParamsWstETHCLRS2ConstructorParams for wstETH <> CLRS Token2 conversion
uniV3CheckCLRSParams_struct UniV3CheckCLRSOracle.UniV3CheckCLRSConstructorParamsUniV3CheckCLRSOracle constructor params

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