DeviatedOracle

Git Source

Inherits: IBaseOracle

This oracle is used to simulate a price source that returns a price deviated from the redemption price

State Variables

deviation

The proportional deviation from the redemption price [wad %]

uint256 public deviation;

symbol

Symbol of the quote: token / baseToken (e.g. 'ETH / USD')

string public symbol;

oracleRelayer

The oracle relayer contract

IOracleRelayer public oracleRelayer;

Functions

constructor

constructor(string memory _symbol, address _oracleRelayer, uint256 _deviation);

Parameters

NameTypeDescription
_symbolstringThe symbol of the oracle
_oracleRelayeraddressThe address of the oracle relayer contract
_deviationuint256The proportional deviation from the redemption price [wad %]

getResultWithValidity

Fetch the latest oracle result and whether it is valid or not

This method should never revert

function getResultWithValidity() external view returns (uint256 _price, bool _validity);

read

Fetch the latest oracle result

Will revert if is the price feed is invalid

function read() external view returns (uint256 _price);