Oracle details
Chain | Address |
---|---|
Mainnet | 0xbA0E0750A56e995506CA458b2BdD752754CF39C4 |
Testnet | 0x9206296ea3aee3e6bdc07f7aaef14dfcf33d865d |
Oracle configuration
Pricing Methodology | MAIR |
Deviation (%) & Refresh Frequency | 0.5% and 120 seconds |
Heartbeat | 24h |
Asset feeds
Mainnet
Testnet
How to access data
getValue Method
To consume price data, you’ll need to invoke thegetValue
method on the oracle contract which you can access through the DIA Oracle library or the 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.
Adapter contracts
To consume price data from our oracle, you can use the adapter smart contract located at the adapter address for each asset. This will allow you to access the same methods on theAggregatorV3Interface
such as getRoundData
& latestRoundData
. You can learn more here.
This is a sample contract for consuming the $SOMI
price feed:
Lumina Stack Feeds
Demo oracles are available for testing the new fully verifiable & decentralized Lumina stack on Somnia testnet.Oracle Details
Chain | Contract | Address |
---|---|---|
Testnet | Push Oracle | 0xFb1462A649A92654482F8E048C754333ad85e5C0 |
Testnet | Pull Oracle | 0x4E0BD1602f2FeC717E751F24f4e8178bfb9f5dc6 |
Oracle Configuration
Pricing Methodology | Median |
Deviation (%) & Refresh Frequency | 1% and 120 seconds |
Heartbeat | 24h |
Asset Feeds
Asset Ticker | updates(key) | Asset Markets |
---|---|---|
ETH | ETH/USD | ETH Markets |
BTC | BTC/USD | BTC Markets |
DIA | DIA/USD | DIA Markets |
USDC | USDC/USD | USDC Markets |
Additional Details
You can find the contract addresses for the Somnia bridge’s components on testnet below:How to Access Data
To consume price data, select the method required for your dapp. Theupdates
method is available for Push-based oracles and request
method for Pull-based oracles.
The price updates are stored in both methods in an updates
mapping. When accessing the updates
mapping through the key BTC/USD
, 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.
Below are sample contracts that consume the BTC/USD
price feed through both methods:
updates Method
request Method
Oracle Grants Program
The DIA Oracle Grants Program provides zero-cost oracle access for up to 1 year, covering deployment and update costs to accelerate dApp development on Somnia. Learn more about the grant here:DIA Oracle Grants Program | Apply Now
Request a Custom Oracle
DIA offers highly customizable oracles that are individually tailored to each dApp’s needs. Each oracle can be customized in the following ways, including:- Data Sources & Asset Feeds
- Pricing Methodologies
- Update Triggers (Frequency, Deviation, Heartbeat, …etc)