WstETHCLRSOracle

Git Source

Inherits:FluidOracle, WstETHOracleImpl, FallbackOracleImpl

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.

Functions

constructor

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

constructor(
    IWstETH wstETH_,
    uint8 mainSource_,
    ChainlinkConstructorParams memory chainlinkParams_,
    RedstoneOracleData memory redstoneOracle_
) WstETHOracleImpl(wstETH_) FallbackOracleImpl(mainSource_, chainlinkParams_, redstoneOracle_);

Parameters

NameTypeDescription
wstETH_IWstETHaddress of the wstETH contract
mainSource_uint8which oracle to use as main source: 1 = Chainlink, 2 = Redstone (other one is fallback).
chainlinkParams_ChainlinkConstructorParamschainlink Oracle constructor params struct.
redstoneOracle_RedstoneOracleDataRedstone Oracle data. (address can be set to zero address if using Chainlink only)

getExchangeRate

function getExchangeRate() external view override returns (uint256 exchangeRate_);

FALLBACK_ORACLE_MAIN_SOURCE

which oracle to use as main source:

  • 1 = Chainlink ONLY (no fallback)
  • 2 = Chainlink with Redstone Fallback
  • 3 = Redstone with Chainlink Fallback
function FALLBACK_ORACLE_MAIN_SOURCE() public view returns (uint8);