CLRS2UniV3CheckCLRSOracleL2 ​
Inherits:FluidOracleL2, FallbackOracleImpl2, UniV3CheckCLRSOracleL2
Gets the exchange rate between the underlying asset and the peg asset by using:
- rate from Chainlink price feeds (or Redstone as fallback).
- result from 1. combined with a uniV3CheckCLRSOracle to get from someToken <> someToken2 e.g. when going from wstETH to USDC:
- wstETH -> stETH -> ETH Chainlink feed.
- ETH -> USDC via UniV3 ETH <> USDC pool checked against ETH -> USDC Chainlink feed.
Functions ​
constructor ​
constructs a CLRS2UniV3CheckCLRSOracleL2 with all inherited contracts
solidity
constructor(
string memory infoName_,
CLRS2ConstructorParams memory cLRS2Params_,
UniV3CheckCLRSConstructorParams memory uniV3CheckCLRSParams_,
address sequencerUptimeFeed_
)
FallbackOracleImpl2(cLRS2Params_.fallbackMainSource, cLRS2Params_.chainlinkParams, cLRS2Params_.redstoneOracle)
UniV3CheckCLRSOracleL2(infoName_, uniV3CheckCLRSParams_, sequencerUptimeFeed_);
Parameters
Name | Type | Description |
---|---|---|
infoName_ | string | Oracle identify helper name. |
cLRS2Params_ | CLRS2ConstructorParams | CLRS2ConstructorParams for wstETH <> CLRS Token2 conversion |
uniV3CheckCLRSParams_ | UniV3CheckCLRSConstructorParams | UniV3CheckCLRSOracle constructor params |
sequencerUptimeFeed_ | address | L2 sequencer uptime Chainlink feed |
getExchangeRateOperate ​
solidity
function getExchangeRateOperate()
public
view
override(FluidOracleL2, UniV3CheckCLRSOracleL2)
returns (uint256 exchangeRate_);
getExchangeRateLiquidate ​
solidity
function getExchangeRateLiquidate()
public
view
override(FluidOracleL2, UniV3CheckCLRSOracleL2)
returns (uint256 exchangeRate_);
getExchangeRate ​
solidity
function getExchangeRate()
public
view
override(FluidOracleL2, UniV3CheckCLRSOracleL2)
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 ​
CLRS2ConstructorParams ​
solidity
struct CLRS2ConstructorParams {
uint8 fallbackMainSource;
ChainlinkConstructorParams chainlinkParams;
RedstoneOracleData redstoneOracle;
}