DeviatedOracle
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
Name | Type | Description |
---|---|---|
_symbol | string | The symbol of the oracle |
_oracleRelayer | address | The address of the oracle relayer contract |
_deviation | uint256 | The 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);