DIA
More details on DIA Oracles
Oracles Implementation
Contracts
The contracts fetch datas from:
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.
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.
Data Sources
How the Oracle Works
The fair value oracle aggregates the fair USDp price from several blockchains and derives a chain-specific sUSDp/USD value from it. The detailed data flow looks like this:
Each of the chains from which the aggregated USDp feed is comprised is queried for its current fair redemption value based on its backing assets and on the amount of USDp minted on that chain.
After collecting the chain-specific USDp redemption values and volumes, the average USDp redemption value (or price) is calculated by weighting the individual data points by the respective on-chain volume.
This aggregated USDp/USD value is then written into each deployed oracle and can be retrieved by calling the
getValue()
function with USDp/USD as parameter.The aggregated USDp/USD value can also be retrieved using the chainlink-compatible adapter smart contract for USDp/USD.
The chain-local sUSDp/USD price (i.e. the redemption value of sUSDp on the chain where the query happens, based on the aggregated USDp price) can be queried by calling the
getSusdpPrice()
function.
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 USDp/USD: Returns the global USDp price (aggregated fair value from all chains) in USD.
For sUSDp/USD: Returns the chain-specific sUSDp price in USD using the specific chain's vault exchange rate based on the global USDp price (equivalent to calling
getSusdpPrice()
).
Parameters:
key (string)
: the exchange pair identifier (`USDp/USD` or `sUSDp/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 sUSDp price using the global USDp price across all chains and the specific chain's vault exchange rate. This is automatically called when using getValue("sUSDp/USD")
.
Return Value (uint256)
: The chain-specific sUSDp price in 18 decimals.
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
Was this helpful?