> ## Documentation Index
> Fetch the complete documentation index at: https://www.diadata.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Somnia

> dApps built on Somnia can leverage DIA oracles to access up-to-date asset price information

[DIA](https://diadata.org/) is a cross-chain oracle provider that sources granular market data from diverse exchanges, including CEXs and DEXs. Its data sourcing is thorough, enabling unparalleled transparency and customizability for resilient price feeds for 20,000+ assets. Its versatile data processing and delivery ensures adaptability and reliability for any decentralized application.

## Oracle details

| Chain   | Address                                                                                                                                  |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| Mainnet | [0xbA0E0750A56e995506CA458b2BdD752754CF39C4](https://shannon-explorer.somnia.network/address/0x9206296Ea3aEE3E6bdC07F7AaeF14DfCf33d865D) |
| Testnet | [0x9206296ea3aee3e6bdc07f7aaef14dfcf33d865d](https://shannon-explorer.somnia.network/address/0x9206296Ea3aEE3E6bdC07F7AaeF14DfCf33d865D) |

## Oracle configuration

|                                       |                                                                                                    |
| ------------------------------------- | -------------------------------------------------------------------------------------------------- |
| **Pricing Methodology**               | [MAIR](/docs/nexus/reference/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds                                                                               |
| **Heartbeat**                         | 24h                                                                                                |

## Asset feeds

### Mainnet

| Asset Ticker | Adapter address                                                                                                                   | Asset Markets                                                                                                |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| USDT         | [0x936C4F07fD4d01485849ee0EE2Cdcea2373ba267](https://mainnet.somnia.w3us.site/address/0x936C4F07fD4d01485849ee0EE2Cdcea2373ba267) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC         | [0x5D4266f4DD721c1cD8367FEb23E4940d17C83C93](https://mainnet.somnia.w3us.site/address/0x5D4266f4DD721c1cD8367FEb23E4940d17C83C93) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| BTC          | [0xb12e1d47b0022fA577c455E7df2Ca9943D0152bE](https://mainnet.somnia.w3us.site/address/0xb12e1d47b0022fA577c455E7df2Ca9943D0152bE) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/)   |
| ARB          | [0x6a96a0232402c2BC027a12C73f763b604c9F77a6](https://mainnet.somnia.w3us.site/address/0x6a96a0232402c2BC027a12C73f763b604c9F77a6) | [ARB markets](https://www.diadata.org/app/price/asset/Arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548/)  |
| SOL          | [0xa4a3a8B729939E2a79dCd9079cee7d84b0d96234](https://mainnet.somnia.w3us.site/address/0xa4a3a8B729939E2a79dCd9079cee7d84b0d96234) | [SOL markets](https://www.diadata.org/app/price/asset/Solana/0x0000000000000000000000000000000000000000/)    |

### Testnet

| Asset Ticker | Adapter address                                                                                                                          | Asset Markets                                                                                                |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| USDT         | [0x67d2c2a87a17b7267a6dbb1a59575c0e9a1d1c3e](https://shannon-explorer.somnia.network/address/0x67d2C2a87A17b7267a6DBb1A59575C0E9A1D1c3e) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC         | [0x235266D5ca6f19F134421C49834C108b32C2124e](https://shannon-explorer.somnia.network/address/0x235266D5ca6f19F134421C49834C108b32C2124e) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| BTC          | [0x4803db1ca3A1DA49c3DB991e1c390321c20e1f21](https://shannon-explorer.somnia.network/address/0x4803db1ca3A1DA49c3DB991e1c390321c20e1f21) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/)   |
| ARB          | [0x74952812B6a9e4f826b2969C6D189c4425CBc19B](https://shannon-explorer.somnia.network/address/0x74952812B6a9e4f826b2969C6D189c4425CBc19B) | [ARB markets](https://www.diadata.org/app/price/asset/Arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548/)  |
| SOL          | [0xD5Ea6C434582F827303423dA21729bEa4F87D519](https://shannon-explorer.somnia.network/address/0xD5Ea6C434582F827303423dA21729bEa4F87D519) | [SOL markets](https://www.diadata.org/app/price/asset/Solana/0x0000000000000000000000000000000000000000/)    |

## How to access data

### Accessing the oracle on-chain (Solidity)

To consume price data, you’ll need to invoke the `getValue` method on the oracle contract which you can access through the [DIA Oracle library](/docs/nexus/how-to-guides/fetch-price-data/solidity#solidity-library) or the [interface](/docs/nexus/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface). Below is an example of a contract consuming data from our oracle on Sepolia testnet. If you pass `BTC/USD` as the key, it will return the most recent price of BTC in USD with **8 decimal places** (e.g. 9601458065403 is \$96,014.58065403) along with the Unix timestamp of the last price update.

```solidity theme={"system"}
pragma solidity ^0.8.13;

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

contract DIAOracleV2Consumer{

    address immutable ORACLE = 0x9206296ea3aee3e6bdc07f7aaef14dfcf33d865d;

    function getPrice(string memory key)
    external
    view
    returns (
        uint128 latestPrice,
        uint128 timestampOflatestPrice
    ) {
        (latestPrice, timestampOflatestPrice) =
                 IDIAOracleV2(ORACLE).getValue(key);
    }
}
```

See the full example [here](/docs/nexus/how-to-guides/fetch-price-data/solidity).

### Adapter contracts

To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](/docs/nexus/how-to-guides/fetch-price-data/chain-specific-guide/somnia#asset-feeds) for each asset. This will allow you to access the same methods on the `AggregatorV3Interface` such as `getRoundData` & `latestRoundData`. You can learn more [here](/docs/nexus/how-to-guides/migrate-to-dia).

## Support

For developer assistance, connect with the DIA team directly on[ ](https://chat.openai.com/c/d2ca764b-00d6-4de7-8555-0cc30ac416b1#)[Discord](https://discord.gg/ZvGjVY5uvs) or [Telegram](https://t.me/diadata_org).

Developers seeking other specialized, production-grade oracle with tailored price feeds and configurations can initiate the request by [contacting the DIA BD Team via Telegram](https://t.me/diabdteam).
