DIA

More details on DIA Oracles

Oracles Implementation

Contracts

The contracts fetch datas from:

Blockchain
Contract Address

Gas Wallets

Gas wallets are used to push data to oracle contracts. To ensure uninterrupted oracle operation, Cooper Labs is maintaining sufficient gas in them. Anyone can monitor the wallets below to ensure they remain adequately funded at all times.

Blockchain
Contract Address

Oracles Configuration

Settings that dictate how the oracle computes and updates data.

Pricing Methodology

Volume Weighted Average Price with Interquartile Range Filter (more details here)

Deviation (%) & Refresh Frequency

0.5% & 120 Seconds

Heartbeat

12 Hours

Assets Data

Available assets on the oracles and the Chainlink AggregatorV3Interface compatible contracts for each asset feed.

Blockchain
Price Feed
Contract Address
Type
Deviation (%) & Refresh Frequency
Hearbeat

Sei

USDr/USD

Fundamental

0.5% & 120 Seconds

12 hours

Sei

sUSDr/USD

Fundamental

0.5% & 120 Seconds

12 hours

The pricing methodology fetches the fair redemption price of the USDr. In order to maximize security, this pricing methodology is deliberately pessimistic to ensure that no manipulation is possible. This means that the price of the USDr reported by the oracle may be slightly below its actual price.

Data Sources

Blockchain
Data Source
Contract Address

How the Oracle Works

The fair value oracle aggregates the fair USDr price from where the Rocketizer & Savings Modules are deployed and derives a chain-specific USDr/USD & sUSDr/USD value from it. The detailed data flow looks like this:

  1. Each of the chains from which the aggregated USDr feed is comprised is queried for its current fair redemption value based on its backing assets and on the amount of USDr minted on that chain.

  2. After collecting the chain-specific USDr redemption values and volumes, the average USDr redemption value (or price) is calculated by weighting the individual data points by the respective on-chain volume.

  3. This aggregated USDr/USD value is then written into each deployed oracle and can be retrieved by calling the getValue() function with USDr/USD as parameter.

  4. The aggregated USDr/USD value can also be retrieved using the chainlink-compatible adapter smart contract for USDr/USD.

  5. The chain-local sUSDr/USD price (i.e. the redemption value of sUSDr on the chain where the query happens, based on the aggregated USDr price) can be queried by calling the getSusdrPrice() function.

The sUSDr/USD value can also be retrieved using the chainlink-compatible adapter smart contract for sUSDr/USD.

How to Access Data

DIAParallelOracle (Solidity)

The following is the list of available methods on the DIAParallelOracle contract.

getValue()

function getValue(string memory key) public view returns (uint128 price, uint128 timestamp)
  • For USDr/USD: Returns the global USDr price (aggregated fair value from all chains) in USD.

  • For sUSDr/USD: Returns the chain-specific sUSDr price in USD using the specific chain's vault exchange rate based on the global USDr price (equivalent to calling getSusdpPrice()).

Parameters:

  • key (string): the exchange pair identifier (`USDr/USD` or `sUSDr/USD`)

Return Values:

  • price (uint128): The asset price in 18 decimals.

  • timestamp (uint128): Unix timestamp of the latest price update.

getSusdpPrice()

function getSusdpPrice() public view returns (uint256)

Calculates the chain-specific sUSDr price using the global USDr price across all chains and the specific chain's vault exchange rate. This is automatically called when using getValue("sUSDr/USD").

Return Value (uint256): The chain-specific sUSDr price in 18 decimals.

The function name may suggests that the price obtained could be for USDp rather than USDr. The contract was forked from Parallel, which uses exactly the same codebase as Rocky. DIA deployed the contract without changing the function name, however the function does return the price of USDr.

Adapter Contracts

To consume price data from oracles, you can use the adapter smart contracts. This allows to access the same methods on the AggregatorV3Interface such as getRoundData & latestRoundData.

Last updated