Key Features
Here are some of the core features push oracles offers:- Dedicated contract per feed: Each price feed has its own dedicated contract with a unique address for easy querying and integration.
- Trusted multi-signature verification: Ensures data integrity by requiring a majority approval from trusted oracle nodes.
- Upgradable architecture: Built using the UUPS proxy pattern for seamless updates.
- Industry standard interface: Implements standard oracle functions like
latestAnswer
andgetRoundData
, compatible with widely used oracle solutions.
Contract Overview
ChaosPushOracle is a smart contract that serves as an oracle for price updates. Rather than depending on a centralized authority, it leverages a decentralized network of node operators to manage and push price updates on-chain. Price updates are triggered based on two key parameters configured per feed:- Heartbeat: The maximum allowed time between updates (e.g., 1 hour).
- Deviation Threshold: The minimum price change required to trigger a new update (e.g., 1%).
- Heartbeat: 1 hour
- Deviation Threshold: 1%
- If the price changes by 1% or more from the previously recorded value (deviation met), or
- If 1 hour has passed since the last update (heartbeat met) — even if price remains the same.
Functions
latestAnswer() → int256
: Returns the most recent price posted to the oracle.
Solidity
latestTimestamp() → uint256
: Returns the UNIX timestamp of the most recent price update.
Solidity
latestRoundData() → (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
: Returns detailed information about the latest round of price updates.
Solidity
decimals() → uint8
: A read-only function that returns the number of decimal places used when interpreting the price.
Solidity
description() → string
: A read-only function that returns the human-readable name of the feed.
Solidity