Oracles are data sources or data feeds that are designed to be fed into a smart contract. Oracles are typically third-party services that allows a blockchain to connect with and receive external data from outside of their ecosystem.
Most common use case for oracles involves the access of real-time data, most often in the form of real-time price feeds of different assets.
Oracles give the crypto and defi ecosystem a method to connect blockchain ecosystems between each other and to the real world as well, while providing security features to ensure data confidentiality.
Oracles are a critical part to Horizon Protocol and are necessary because oracles are responsible for providing the price feeds that determine the prices of assets listed in the Horizon Exchange.
- and more!
Horizon Protocol Synthetic Assets (zAssets) need regular on-chain price feeds to update their price shown on the Horizon Exchange.
It is important to note that each refresh of a price requires a payment to the oracle providing the price, making constant price checks financially unfeasible. To solve this, oracles used by Horizon Protocol refresh prices based on two variables:
- Heartbeat — a predetermined time period (e.g. every 4 hours)
- Variance — a predetermined price threshold (e.g. 0.2% change in price)
Should either of these variables return true, the oracle will refresh the price.