# 预言机

{% hint style="danger" %}
此版本的 Horizon Academy 已不建议使用！要查找最新版本，请访问：[English V2](https://academy.horizonprotocol.com/) （目前只有英文版本可用）
{% endhint %}

预言机是被设计成输入到智能合约中的数据源或数据提供者。预言机通常是第三方服务，它允许区块链连接并从其生态系统之外接收外部数据。

预言机最常见的用例涉及实时数据的访问，通常是以不同资产的实时价格提供形式出现。&#x20;

预言机为加密货币和DeFi生态系统提供了一种方法，使得区块链生态系统之间和与现实世界之间能够相互连接，并提供安全功能以确保数据保密。

## Horizon Protocol 为什么使用预言机？

![](/files/hDebWD8uZSPiOCcGrzfg)

预言机是地Horizon Protocol 的关键组成部分，是必要的，因为预言机负责提供价格，确定地平线交易所上列出的资产的价格。

![](/files/Lh3UI919ZP3v72Px14MF)

&#x20;像 @chainlink 和 @Phoenix\_Chain 这样的不同预言机提供者代表着对任何类型的资产的无限访问（如下），并强制执行价格提供的安全性和安全性：

* 加密货币&#x20;
* 股票&#x20;
* 指数&#x20;
* 大宗商品&#x20;
* NFT
* 以及更多！

## 预言机刷新率

Horizon Protocol 合成资产 (zAssets) 需要在链上定期的价格反馈来更新它们在 Horizon交易所上显示的价格。&#x20;

重要的是要注意，每次刷新价格都需要向提供价格的预言机付款，这使得持续的价格检查在财务上不可行。 为了解决这个问题，Horizon Protocol 使用的预言机根据两个变量刷新价格：

* 心跳 - 一个预设的时间周期（例如每4小时）&#x20;
* 方差 - 一个预设的价格阈值（例如价格变化0.2%）
*

如果这些变量中的任何一个返回true，预言机将刷新价格。&#x20;

心跳和方差对于每个zAsset可能是不同的。在[交易费用](/chinese/horizon-exchange/trading-on-exchange/exchange-fees.md#fbee)中了解更多信息。并查看[Chainlink文档](https://docs.chain.link/docs/bnb-chain-addresses/)以获取我们使用的每个预言机数据源的心跳和方差（点击特定数据源以查看详细信息）。


---

# 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/chinese/horizon-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.
