Skip to main content

CompositeOracle

Reads two oracles and returns their product

Functions

constructor

function constructor(
address _core,
contract IOracle _oracleA,
contract IOracle _oracleB
) public

CompositeOracle constructor

Parameters

NameTypeDescription
_coreaddress
_oracleAcontract IOraclefirst referenced oracle
_oracleBcontract IOraclesecond referenced oracle

update

function update() external

updates the oracle price

isOutdated

function isOutdated() external returns (bool)

determine if read value is stale

Return Values

NameTypeDescription
[0]booltrue if read value is stale

read

function read() external returns (struct Decimal.D256, bool)

read the oracle price

Return Values

NameTypeDescription
[0]struct Decimal.D256oracle price
[1]booltrue if price is valid