Oracle Heartbeat Explained
An
oracle heartbeat is a secondary aggregation parameter used in decentralized oracle networks, such as Chainlink and Pyth, to ensure that data feeds remain fresh and are updated on-chain even if the asset's price does not fluctuate significantly
1.
The heartbeat functions as a countdown timer that triggers a price update when it reaches zero
12.
Function and Purpose
The oracle heartbeat serves as a backup mechanism to the primary update trigger, which is the
deviation threshold 12.
- Deviation Threshold (Primary Trigger): This is the main parameter that dictates when a price feed updates. An update is triggered when the off-chain price deviates by a specified percentage (e.g., 0.5%) from the current on-chain trusted price 12.
- Heartbeat (Secondary Trigger): If an asset experiences very low price volatility, it may not reach the deviation threshold often enough to trigger an update 1. The heartbeat ensures that the price is updated on-chain at regular, fixed intervals, regardless of price movement, thereby guaranteeing the data feed's freshness 12.
For example, some price feeds on the Pyth Network use a heartbeat of
3 seconds or
15 seconds combined with a
0.5% price deviation threshold
3. Similarly, X Layer oracle feeds for assets like WBTC/USD and WETH/USD use a heartbeat of
3600 seconds (1 hour) and a
0.5% deviation threshold
2.
Heartbeat in Reputation Systems
In some decentralized networks, the concept of a "heartbeat" is also used to measure the activity and reliability of data providers. For instance, in the Swan Network's reputation system, a
Heartbeat Score is calculated based on a provider's recent (weekly and daily) heartbeat activity
4.
The Heartbeat Score is a component of the overall
Bidding Score, which affects the probability of a provider receiving deals
4. The Total Heartbeat Score is weighted as 70% daily activity and 30% weekly activity, and it gradually increases as the heartbeat rate increases
4.