# DIA Oracle

DIA is a decentralized oracle platform supporting thousands of assets across 50+ blockchains. For satUSD, DIA delivers high-frequency, deviation-based price updates using their battle-tested DIAOracleV2 and AggregatorV3Interface-compatible adapters, ensuring compatibility with most DeFi protocols and aggregators.

## Oracle Configuration

The satUSD price feed uses the following configuration across all chains:

<table><thead><tr><th width="272.80078125">Parameter</th><th>Value</th><th data-hidden></th></tr></thead><tbody><tr><td>Pricing Method</td><td>MAIR (Moving Average with Interquartile Range)</td><td></td></tr><tr><td>Deviation Trigger</td><td>0.5%</td><td></td></tr><tr><td>Refresh Frequency</td><td>120 seconds</td><td></td></tr><tr><td>Heartbeat</td><td>24 hours</td><td></td></tr></tbody></table>

## How to Access On-Chain

### 1. DIAOracleV2

#### Contract Addresses

These are the main contracts to call for direct access to price data.

<table><thead><tr><th width="200.45703125">Chain</th><th>Contract Address</th><th data-hidden></th></tr></thead><tbody><tr><td>Ethereum</td><td><a href="https://etherscan.io/address/0xaca485dd4299090251422617f5938d324c85191b"><code>0xACa485Dd4299090251422617f5938d324C85191B</code></a></td><td></td></tr><tr><td>BNB Chain</td><td><a href="https://bscscan.com/address/0xbea082c15417716541d3169e7a48e4a53a19b5d1"><code>0xbea082c15417716541D3169e7a48e4A53A19B5D1</code></a></td><td></td></tr><tr><td>Base</td><td><a href="https://basescan.org/address/0x12B0B8bCd48ee30905DB5B0e181368Dda90eaF0B"><code>0x12B0B8bCd48ee30905DB5B0e181368Dda90eaF0B</code></a></td><td></td></tr><tr><td>Arbitrum</td><td><a href="https://arbiscan.io/address/0x009e01c47609dbff978cc76f40aebe8724492fe9"><code>0x009E01c47609dbFF978cc76F40aEBE8724492Fe9</code></a></td><td></td></tr><tr><td>BOB</td><td><a href="https://explorer.gobob.xyz/address/0xD8ba4Bf8d2b8Aa639fD0affd6fDF180D503ed458"><code>0xD8ba4Bf8d2b8Aa639fD0affd6fDF180D503ed458</code></a></td><td></td></tr></tbody></table>

#### Solidity: Using `getValue` from DIAOracleV2

```solidity
pragma solidity 0.8.29;

interface IDIAOracleV2 {
    function getValue(string memory key) external view returns (uint128, uint128);
}

contract OracleConsumer {

    address immutable ORACLE = 0xbea082c15417716541D3169e7a48e4A53A19B5D1; // BNB Chain

    function getSatUSDPrice() external view returns (uint128 price, uint128 timestamp) {
        (price, timestamp) = IDIAOracleV2(ORACLE).getValue("satUSD/USD");
        // Note: `price` has 8 decimals (e.g., 99882732 = $0.99882732)
    }
}
```

### 2. Adapter Contracts (Chainlink-Compatible)

For protocols expecting a Chainlink-style interface via AggregatorV3Interface.

#### Contract Addresses

<table><thead><tr><th width="200.45703125">Chain</th><th>Contract Address</th><th data-hidden></th></tr></thead><tbody><tr><td>Ethereum</td><td><a href="https://etherscan.io/address/0x02eabd9c59fca5b38e5a415e6172f93bf30fb2af"><code>0x02eaBD9c59fCa5B38E5A415e6172F93BF30fB2af</code></a></td><td></td></tr><tr><td>BNB Chain</td><td><a href="https://bscscan.com/address/0x1082679a55fB34B967a006080204b597CfA0605C"><code>0x1082679a55fB34B967a006080204b597CfA0605C</code></a></td><td></td></tr><tr><td>Base</td><td><a href="https://basescan.org/address/0x4ae9a0a4c02ec4ffb7f231717df85d755192884a"><code>0x4aE9A0a4c02Ec4ffb7F231717DF85D755192884A</code></a></td><td></td></tr><tr><td>Arbitrum</td><td><a href="https://arbiscan.io/address/0x6f076AddEf5e393F23988B0f61b02d0297022fa4"><code>0x6f076AddEf5e393F23988B0f61b02d0297022fa4</code></a></td><td></td></tr><tr><td>BOB</td><td><a href="https://explorer.gobob.xyz/address/0x230057c84fACFC5358C500E5348E16D4D7Dc60f8"><code>0x230057c84fACFC5358C500E5348E16D4D7Dc60f8</code></a></td><td></td></tr></tbody></table>

#### Solidity: Use DIA’s adapter contracts via the `AggregatorV3Interface` interface:

```solidity
interface AggregatorV3Interface {
    function latestRoundData() external view returns (
        uint80 roundID,
        int256 answer,
        uint256 startedAt,
        uint256 updatedAt,
        uint80 answeredInRound
    );
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.river.inc/outro/satusd-oracle/dia-oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
