Using Price Feeds
Get all supported price feeds and their addresses
Sample result:
Get latest result and update time
Sample result for "Flow/USD" price feed:
Note that:
The data is updated whichever condition is met first:
Deviation is beyond certain threshold (by default 0.5%)
A fixed window of time has passed (by default 2000 blocks)
Users of the PublicPriceOracle need to check the latest update time and handle the extreme condition if this data is too old.
We recommend to use blockHeight, as the block timestamp is not accurate or not always retrievable: the number of recent blocks cached and servicable are depending on execution nodes.
DEX-based TWAP Price Oracle
Check examples here.
Last updated