Hey there all who might still be paying attention, first a big thanks to all who have already contributed.
I know its been quite some time without much additional discussion, so apologies for being under a rock for the past months…
That said, I’ve just got a quick question regarding the intent of the EIP, and if agreed on the intent, what should seen as an acceptable minimum interface for a reported price.
Intent of the EIP
Is the intent just to have a quick one over in order to force future oracles to adopt a more rational standard for the actual price reported? (This alone has quite a lot of value to begin with)
Or is the intent to provide a picture of what is expected of an oracle’s interface more generally?
(I personally feel that EIP’s should not just be easy to comply with for current protocols, but should also govern what we believe is minimal expectations for protocols wrt security considerations.)
If the latter I would make one additional suggestion to the interface given it is already ubiquitous and should likely be recommended for those consuming prices.
What Should Be Returned?
The Price (duh)
Of course as already noted and provided an interface for, it seems absolutely necessary to standardize the format of pricing coming out of oracles (in order to avoid protocols building conversion tooling from scratch e.g. the Euler oracle toolkit / what I had recently build at Warlock).
A Timestamp?
However in order to securely consume prices, a protocol should likely attempt to validate the latency at which they are consuming the price from when it was reported. This sort of validation I would consider recommended, and furthermore is becoming more commonplace as protocols begin to apply numerous fallback oracle implementations.
This validation requires a timestamp, ideally being the block.timestamp
of the block it was pushed.
Backwards Compatibility:
Based on cursory searches / my memory, all or nearly all current oracles provide either a calculated or submitted timestamp alongside their reported price.
Chainlink:
smartcontractkit/chainlink/blob/develop/contracts/src/v0.8/shared/interfaces/AggregatorV3Interface.sol#L14
Redstone:
etherscan/address/0x0c2c7ded01ccdfab16f04aff82af766b23d6be0a#code (same as chainlink)
Pyth:
pyth-network/pyth-sdk-solidity/blob/main/PythStructs.sol#L21
Chronicle:
While Chronicle does offer a non-time reporting read, documentation directs developers to their read with a time reported – chronicleprotocol/chronicle-std/blob/main/src/IChronicle.sol#L23 | chroniclelabs/Developers/tutorials/Remix
API3:
api3dao/airnode-protocol-v1/blob/main/contracts/api3-server-v1/Api3ServerV1.sol#L33
Warlock:
I am currently no longer working at Warlock but I wrote them all myself and they offered both calculated and submitted timestamps.
Conclusion:
TL;DR: We should add a timestamp – everyone that matters already has one, everyone in the future should have one, and it should be implied that consuming protocols should validate one (by being required in the EIP)