WstETHCLRS2UniV3CheckCLRSOracle ​
Inherits:FluidOracle, WstETHOracleImpl, FallbackOracleImpl2, UniV3CheckCLRSOracle
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). combining those two into one rate resulting in wstETH <> someToken
- result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2 e.g. when going from wstETH to USDC:
- wstETH -> stETH wstETH Oracle, stETH -> ETH Chainlink feed.
- ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.
Functions ​
constructor ​
constructs a WstETHCLRS2UniV3CheckCLRSOracle with all inherited contracts
solidity
constructor(
string memory infoName_,
WstETHCLRS2ConstructorParams memory wstETHCLRS2Params_,
UniV3CheckCLRSConstructorParams memory uniV3CheckCLRSParams_
)
WstETHOracleImpl(wstETHCLRS2Params_.wstETH)
FallbackOracleImpl2(
wstETHCLRS2Params_.fallbackMainSource,
wstETHCLRS2Params_.chainlinkParams,
wstETHCLRS2Params_.redstoneOracle
)
UniV3CheckCLRSOracle(infoName_, uniV3CheckCLRSParams_);
Parameters
Name | Type | Description |
---|---|---|
infoName_ | string | Oracle identify helper name. |
wstETHCLRS2Params_ | WstETHCLRS2ConstructorParams | WstETHCLRS2ConstructorParams for wstETH <> CLRS Token2 conversion |
uniV3CheckCLRSParams_ | UniV3CheckCLRSConstructorParams | UniV3CheckCLRSOracle constructor params |
getExchangeRateOperate ​
solidity
function getExchangeRateOperate()
public
view
override(FluidOracle, UniV3CheckCLRSOracle)
returns (uint256 exchangeRate_);
getExchangeRateLiquidate ​
solidity
function getExchangeRateLiquidate()
public
view
override(FluidOracle, UniV3CheckCLRSOracle)
returns (uint256 exchangeRate_);
getExchangeRate ​
solidity
function getExchangeRate() public view override(FluidOracle, UniV3CheckCLRSOracle) returns (uint256 exchangeRate_);
FALLBACK_ORACLE2_MAIN_SOURCE ​
which oracle to use as main source:
- 1 = Chainlink ONLY (no fallback)
- 2 = Chainlink with Redstone Fallback
- 3 = Redstone with Chainlink Fallback
solidity
function FALLBACK_ORACLE2_MAIN_SOURCE() public view returns (uint8);
Structs ​
WstETHCLRS2ConstructorParams ​
solidity
struct WstETHCLRS2ConstructorParams {
IWstETH wstETH;
uint8 fallbackMainSource;
ChainlinkConstructorParams chainlinkParams;
RedstoneOracleData redstoneOracle;
}