an overview of oracles used on handle.fi
An Oracle refers to a smart contract that provides readable data on-chain.
handle.fi uses both chainlink oracles and our own high speed oracles. each meeting differing protocol requirements
the protocol uses the official Chainlink data feeds for pricing CDP collateral and mint value of fxTokens. (arbitrum oracles can be found here). For perpetual trading, handle uses the H2SO (handle high speed oracles) system which allows the end user to update the price directly on an oracle aggregator contract by submitting a trusted signature along with the quoted price.
Chainlink is a popular protocol (and also product) that develops oracle smart contracts and workflows. The reason Chainlink is both a protocol and also a product/service, is that someone could use Chainlink's open source oracle smart contracts with a self-managed infrastructure, rather than relying on Chainlink's official feeds or operators.
The aggregator smart contract is one of Chainlink's oracle contracts. It is usually structured the following way:
- 1.There is an Aggregator Interface contract, also called an Aggregator Proxy, which reads data from the Aggregator contract. DApps read the price from the Aggregator Interface, so that the Aggregator Interface could at any time change which Aggregator contract it points to without breaking the DApps.
- 2.The Aggregator contract is the actual contract with the oracle data submission logic. The example linked is the Flux Aggregator contract, which aggregates data from the oracle operators on-chain. There are newer oracle architectures which aggregate all oracle answers off-chain, submitting a single transaction on-chain and are therefore more gas efficient. The point is that this is the implementation contract, and different architectures are available, but they usually follow the same interface for interoperability.
- 3.Oracle operators, which are either individuals or organisations, run software that checks the value of an asset, off-chain, using their own data sources, and submit to the Aggregator contract, either on a schedule or when requested by the oracle system.
For perpetual trading, handle uses the H2SO (handle high speed oracles) system which allows the end user to update the price directly on an oracle aggregator contract by submitting a trusted signature along with the quoted price.
a diagram of the h2SO flow is as follows;