Oracles
I am currently using Chainlink. How difficult is it to change to Chronicle?β
If you are using Chainlink, you would only have to change the address of your oracle to the Chronicle equivalent. This is because Scribe is partially Chainlink compatible, implementing the most widely, and not deprecated, used functions of the IChainlinkAggregatorV3
interface such as latestRoundData()
, decimals()
, and latestAnswer()
.
One thing to keep an eye on is the number of decimals. Chronicle always uses 18 decimals, whereas Chainlink uses different decimals for different oracles. However, if implemented correctly, one can check the decimals and scale them up or down accordingly. Please conduct integration tests and feel free to reach out if there are any issues.
How do I check if an Oracle becomes inactive/ gets deprecated?β
In the event that an Oracle gets deprecated, we will notify all whitelisted customers before offboarding it.
From a technical point of view, if an oracle becomes inactive, the price is set to 0
, and the validators (also known as feeds), are removed from the contract. Therefore, the read()
function will revert with 0
, the tryRead()
function will return (false, 0)
, and the latestRoundData()
will return 0
as well.
What do I need to do to read from a Chronicle Oracle?β
Chronicle Oracles are read-protected by a whitelist. To read from an Oracle, the calling address must be tolled (whitelisted).
On testnet networks, the whitelisting mechanism is permissionless, anyone can whitelist an address using the SelfKisser.
On mainnet, the whitelisting mechanism is permissioned. To request access, open a ticket on Discord in the πο½support channel.
What happens if I try to read from an address that is not whitelisted?β
If you try to read from and address that is not tolled (whitelisted), the transaction reverts.
How can I check the validators of an Oracle?β
You can use cast, a CLI tool designed by the Foundry team to streamline the interaction with the EVM.
$ cast call $contract 'feeds()(address[])' --rpc-url $rpc
Returns an array with the validators.
Alternatively, if you prefer to check on Etherscan, navigate to the Read Contract
section of the Oracle you want to check, and run the feeds()
function. The result will list all the validator addresses that are authorized to sign a price update.
How can I check if an address is whitelisted to read data?β
$ cast call $oracle "tolled(address)(bool)" <your address> --rpc-url $rpc
Returns either true
or false
.
How can I check how many validators have signed a price message?β
On Etherscan, navigate to the Read Contract
section of the Oracle you want to check, and run the bar()
function. This returns the number of signatures required for an Oracle update.
What types of Oracles does Chronicle use for asset prices?β
On Ethereum Mainnet (L1), where computation is expensive, Chronicle uses its ScribeOptimistic Oracles, enabling additional gas saving. On L2 chains, Chronicle uses Scribe Oracles.
What are the main operational differences between ScribeOptimistic and Scribe Oracles?β
Scribe Oracle have instant updates. This means that as soon as a new price is published, it becomes available. ScribeOptimistic Oracles have a buffer. An incoming price is not finalized until the challenge period has concluded. You can think of it as a delayed oracle. The lower the challenge period is, the less phase shifted the oracle is. At the moment, the challenge period is set to 20 mins for Chronicle Oracles, but this value is customizable. At the end of the challenge period, the price will be the optimistic price, even if the market price has changed.
How can I check the challenge period for a ScribeOptimistic oracle?β
To check the current challenge period, you can check the opChallengePeriod
βs value using opChallengePeriod()
which returns a value in seconds.
How can I cross-check the asset pair corresponding to a given Chronicle address on a block explorer like Etherscan?β
To cross-check the asset pair associated with a Chronicle Oracle address on a block explorer, follow these steps:
- Navigate to the
Read Contract
section underContract
on Etherscan. - Locate the
wat
function at the bottom of the list. - Query the
wat
function to retrieve a bytes32 value. - Use a bytes32 to string converter, such as this tool, to decode the bytes32 value and get the name of the asset pair.
What is the update threshold for the Oracles?β
A new aggregation round is triggered after a specified amount of time since the latest update, or if the new offchain value deviates more than a pre-defined threshold for the onchain value, whichever of these conditions occurs first. If the data values stay within the Deviation Threshold, an update will only be triggered every X minutes / hours.
Can the update threshold parameters be modified?β
Yes, the update parameters, including the update and deviation thresholds, can be modified. For the most up-to-date parameters, please check the specific Oracle on the Dashboard. If you'd like to request different parameters, please get in touch.