# Oracles

Oracles are an integral part of decentralized exchanges, including all perpetual futures exchanges, since a price feed is required to track the price of the underlying asset for which the futures contracts can be traded.

Oracle-based system uses a Dual Oracle system, which combines Chainlink oracles with Pyth oracles to improve performance, security, and reduce trading fees. The reason that the two oracles are needed is that they serve two distinct functions, one that uses a push model, and the other that uses a pull model.

On the one hand, the Chainlink oracle is a perpetual oracle that uses the push model. It gets automatically updated based on a few requirements, whether it be time or upon a certain percentage of price movement achieved. The consistency of data from a push model oracle allows for the visualization of time graphs and the automatic updates of the price facilitate liquidation and circuit breaker mechanics, but fall short on the market clearing price due to latency at the time of trade execution.

On the other hand, the Pyth oracle uses a pull model, where a price gets updated on-chain upon execution of the trade on the blockchain, which then provides the trade with the most recent price, significantly reducing the amount of latency in the price. This means that traders transact at a more exact market clearing price, it removes the possibility of oracle latency arbitrage, and it allows for lower fees due to the prices being more accurate. Pull models are great at the time of transactions, but because the only time a new data point is recorded onto the blockchain is during a transaction, it does not produce a reliable and consistent price feed unless it is updated manually on-chain at regular intervals, which can be a costly endeavor.

Therefore, the system takes the two oracle models and combines them in a dual oracle system. With both push and pull models working together, it allows for the best of both worlds.

Most people are already familiar with Chainlink oracles. If there’s interest in learning more about Pyth oracles, please check out the following:

* [Introduction video](https://www.youtube.com/watch?v=7k5gh-1JT3c)
* [Pyth Documentation](https://docs.pyth.network/documentation)


---

# 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://docs.xpanse.trade/oracle-based-system/trading-on-oracle-based-system/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.
