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