Push Based Oracles
The Push Oracle model enables contracts to receive real-time updates based on predefined criteria such as fixed intervals, specific price deviations, or a combination of both. This design provides flexibility and efficiency for decentralized applications needing accurate and timely data.
Usage
The Oracle maintains updates as a mapping, where each key maps to a Data struct containing the latest timestamp and value.
The updates
mapping is a key-value store where:
-
Key: A unique identifier, typically a string, representing the asset or data type (e.g., DIA/USD, BTC/USD).
-
Value: A Data struct containing:
-
key: The identifier of the data entry (redundant for reference but useful for integrity checks).
-
timestamp: The timestamp of the latest update.
-
value: The most recent value associated with the key.
-
E.g. PriceConsumer contract
You can find demo oracles here. If you want to access the oracle on Ethereum Sepolia for example, you’ll pass the Push Oracle address: 0x76a4BA6e4A40Bc613821e2a468a1e94FcCa4CE83 to the constructor above.