Horizon Academy
English V2
Search
K

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.
Horizon Futures, a perpetual futures DEX, 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, Horizon Futures 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: