UniV3CheckCLRSOracleL2
Gets the exchange rate between the underlying asset and the peg asset by using: the price from a UniV3 pool (compared against 3 TWAPs) and (optionally) comparing it against a Chainlink or Redstone price (one of Chainlink or Redstone being the main source and the other one the fallback source). Alternatively it can also use Chainlink / Redstone as main price and use UniV3 as check price.
The process for getting the aggregate oracle price is: 1. Fetch the UniV3 TWAPS, the latest interval is used as the current price 2. Verify this price is within an acceptable DELTA from the Uniswap TWAPS e.g.: a. 240 to 60s b. 60 to 15s c. 15 to 1s (last block) d. 1 to 0s (current) 3. (unless UniV3 only mode): Verify this price is within an acceptable DELTA from the Chainlink / Redstone Oracle 4. If it passes all checks, return the price. Otherwise use fallbacks, usually to Chainlink. In extreme edge-cases revert. For UniV3 with check mode, if fetching the check price fails, the UniV3 rate is used directly.
constructor
constructor(string infoName_, struct UniV3CheckCLRSOracle.UniV3CheckCLRSConstructorParams params_, address sequencerUptimeFeed_) public
getExchangeRateOperate
function getExchangeRateOperate() public view virtual returns (uint256 exchangeRate_)
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for operates
getExchangeRateLiquidate
function getExchangeRateLiquidate() public view virtual returns (uint256 exchangeRate_)
Get the exchangeRate_
between the underlying asset and the peg asset in 1e27 for liquidations
getExchangeRate
function getExchangeRate() public view virtual returns (uint256 exchangeRate_)
Deprecated. Use getExchangeRateOperate()
and getExchangeRateLiquidate()
instead. Only implemented for
backwards compatibility.