Hatom Price Oracle Infrastructure
as of 02/01/2025
Last updated
Was this helpful?
as of 02/01/2025
Last updated
Was this helpful?
The Hatom Price Oracle is a robust infrastructure composed of that feed prices into a , similar to the Chainlink Oracle system. This smart contract makes prices available on-chain, enabling the Lending to provide reliable pricing when users interact with the.
Oracle Bots are autonomous, containerized entities responsible for submitting prices to the . Each bot has a unique private key, and the corresponding public key is granted Oracle status on the whitelist, allowing it to introduce new prices. Each bot is linked to a specific set of price providers, which may overlap with others.
The Oracle Bots execute two key tasks:
Heartbeat Task: Runs less frequently, according to the round time of the , to ensure regular price submissions.
Threshold Task: Runs more frequently, fetching prices from sources like , , , , and . It compares new prices to previously submitted prices and resubmits them if they exceed a predefined threshold.
The Price Aggregator compiles price submissions from whitelisted that pull data from reputable exchanges. Once a certain number of submissions are received (fewer than the total number of ), the calculates a new median price and announces it. Similar to Chainlink’s price feeds, these submit prices in "rounds," typically occurring every 30 minutes to an hour. However, if a price change surpasses a set Threshold, oracles must resubmit a price, regardless of the last submission time.
The supplies prices to the Controller Smart Contract to ensure all assets are represented in a common unit (typically EGLD). It sources information from:
Price Feeds and Price Feeds, which include current and time-weighted average prices (the Safe Price) of specific assets.
Feeds, which aggregate data from multiple sources such as , , , , , and .
When the receives a price request, it compares the Safe Price from with the price from the . If the difference is within an acceptable range, the value is deemed valid and sent to the Controller Smart Contract. If the difference exceeds a predefined limit:
If the initial tolerance is surpassed: The price is marked invalid, and the issues an alert to the community. The most recent valid price is sent to the Controller Smart Contract. Future calls to will revert unless the prices fall within the tolerance range.
If the final tolerance is surpassed: The price is marked invalid, an alert is issued, and sends the most recent valid price to the Controller Smart Contract. The is then suspended, and subsequent price requests will fail until a Guardian manually intervenes to unpause the .