# Oracles

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.

## Why Horizon Protocol Use Oracles

![](/files/hDebWD8uZSPiOCcGrzfg)

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.

![](/files/Lh3UI919ZP3v72Px14MF)

Different oracle providers such as [@chainlink](https://twitter.com/chainlink) and [@Phoenix\_Chain](https://twitter.com/Phoenix_Chain) represent unlimited access to any type of asset and enforce the security and safety of the price feeds to:

* crypto
* stocks
* indices
* commodities
* NFTs
* and more!

## Oracle Refresh Rate

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.

The Heartbeat and Variance is potentially different for each zAsset. Learn more about this in [Exchange Fees](broken://pages/xNZms9MdoGVroMYe6vKr#fbee). And check out [Chainlink Docs](https://docs.chain.link/docs/bnb-chain-addresses/) for Heartbeat and Variance for each oracle data feed that we use (click into a particular data feed to see the specifics).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://academy.horizonprotocol.com/english-v2/exchange/trading-on-exchange/oracles.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
