# Table of Contents
- [DIA APIs - DIA Oracles](#dia-apis-dia-oracles)
- [RWA Prices - DIA Oracles](#rwa-prices-dia-oracles)
- [Commodities - DIA Oracles](#commodities-dia-oracles)
- [Forex - DIA Oracles](#forex-dia-oracles)
- [Token Prices - DIA Oracles](#token-prices-dia-oracles)
- [ETFs - DIA Oracles](#etfs-dia-oracles)
- [Home - DIA Oracles](#home-dia-oracles)
- [DIA Stack Overview - DIA Oracles](#dia-stack-overview-dia-oracles)
- [Quickstart - DIA Oracles](#quickstart-dia-oracles)
- [Fetch Price Data - DIA Oracles](#fetch-price-data-dia-oracles)
- [RestAPI - DIA Oracles](#restapi-dia-oracles)
- [Token Price Feeds - DIA Oracles](#token-price-feeds-dia-oracles)
- [Fund your Oracle - DIA Oracles](#fund-your-oracle-dia-oracles)
- [Real-World Asset Feeds - DIA Oracles](#real-world-asset-feeds-dia-oracles)
- [Migrate from Chainlink - DIA Oracles](#migrate-from-chainlink-dia-oracles)
- [Generate Randomness - DIA Oracles](#generate-randomness-dia-oracles)
- [Verifiable Randomness - DIA Oracles](#verifiable-randomness-dia-oracles)
- [Fundamental Feeds - DIA Oracles](#fundamental-feeds-dia-oracles)
- [Spectra (Cross-chain Messaging Layer) - DIA Oracles](#spectra-cross-chain-messaging-layer-dia-oracles)
- [Request a Custom Oracle - DIA Oracles](#request-a-custom-oracle-dia-oracles)
- [GraphQL - DIA Oracles](#graphql-dia-oracles)
- [Feeders (Sourcing Layer) - DIA Oracles](#feeders-sourcing-layer-dia-oracles)
- [Page Not Found](#page-not-found)
- [Architecture Overview - DIA Oracles](#architecture-overview-dia-oracles)
- [Oracle Grants - DIA Oracles](#oracle-grants-dia-oracles)
- [Community & Support - DIA Oracles](#community-support-dia-oracles)
- [DIA Deployments - DIA Oracles](#dia-deployments-dia-oracles)
- [Audits - DIA Oracles](#audits-dia-oracles)
- [Security Bounty Program - DIA Oracles](#security-bounty-program-dia-oracles)
- [DIA Staking - DIA Oracles](#dia-staking-dia-oracles)
- [DIAOracleV2.sol - DIA Oracles](#diaoraclev2-sol-dia-oracles)
- [Methodologies - DIA Oracles](#methodologies-dia-oracles)
- [Overview - DIA Oracles](#overview-dia-oracles)
- [Request a Custom Oracle - DIA Oracles](#request-a-custom-oracle-dia-oracles)
- [updates Method - DIA Oracles](#updates-method-dia-oracles)
- [getValue Method - DIA Oracles](#getvalue-method-dia-oracles)
- [request Method - DIA Oracles](#request-method-dia-oracles)
- [Solidity - DIA Oracles](#solidity-dia-oracles)
- [Data Sources - DIA Oracles](#data-sources-dia-oracles)
- [Distributed Randomness Beacon - DIA Oracles](#distributed-randomness-beacon-dia-oracles)
- [Update Triggers - DIA Oracles](#update-triggers-dia-oracles)
- [DIARandomOracle.sol - DIA Oracles](#diarandomoracle-sol-dia-oracles)
- [Trades Collection - DIA Oracles](#trades-collection-dia-oracles)
- [Run a Feeder - DIA Oracles](#run-a-feeder-dia-oracles)
- [Price Aggregation - DIA Oracles](#price-aggregation-dia-oracles)
- [OracleRequestRecipient.sol - DIA Oracles](#oraclerequestrecipient-sol-dia-oracles)
- [PushOracleReceiver.sol - DIA Oracles](#pushoraclereceiver-sol-dia-oracles)
- [Chain Information - DIA Oracles](#chain-information-dia-oracles)
- [MAIR: Moving Average with Interquartile Range Filter - DIA Oracles](#mair-moving-average-with-interquartile-range-filter-dia-oracles)
- [VWAP: Volume Weighted Average Price - DIA Oracles](#vwap-volume-weighted-average-price-dia-oracles)
- [VWAPIR: Volume Weighted Average Price with Interquartile Range Filter - DIA Oracles](#vwapir-volume-weighted-average-price-with-interquartile-range-filter-dia-oracles)
- [LST Fair Price - DIA Oracles](#lst-fair-price-dia-oracles)
- [IR: Interquartile Range Filter - DIA Oracles](#ir-interquartile-range-filter-dia-oracles)
- [Additional Notes - DIA Oracles](#additional-notes-dia-oracles)
- [Research - DIA Oracles](#research-dia-oracles)
- [Build a Scraper - DIA Oracles](#build-a-scraper-dia-oracles)
- [zkSync - DIA Oracles](#zksync-dia-oracles)
- [Alephium - DIA Oracles](#alephium-dia-oracles)
- [Arbitrum - DIA Oracles](#arbitrum-dia-oracles)
- [Astar - DIA Oracles](#astar-dia-oracles)
- [Avalanche - DIA Oracles](#avalanche-dia-oracles)
- [Aurora - DIA Oracles](#aurora-dia-oracles)
- [BNB Chain - DIA Oracles](#bnb-chain-dia-oracles)
- [BOB Build on Bitcoin - DIA Oracles](#bob-build-on-bitcoin-dia-oracles)
- [GEB Network - DIA Oracles](#geb-network-dia-oracles)
- [Boba Network - DIA Oracles](#boba-network-dia-oracles)
- [Celo - DIA Oracles](#celo-dia-oracles)
- [Clover - DIA Oracles](#clover-dia-oracles)
- [Evmos - DIA Oracles](#evmos-dia-oracles)
- [Fantom - DIA Oracles](#fantom-dia-oracles)
- [Fuse - DIA Oracles](#fuse-dia-oracles)
- [Gnosis Chain - DIA Oracles](#gnosis-chain-dia-oracles)
- [Base - DIA Oracles](#base-dia-oracles)
- [Nervos - DIA Oracles](#nervos-dia-oracles)
- [ETHPar - DIA Oracles](#ethpar-dia-oracles)
- [CrossFi - DIA Oracles](#crossfi-dia-oracles)
- [Metis - DIA Oracles](#metis-dia-oracles)
- [Moonriver - DIA Oracles](#moonriver-dia-oracles)
- [Plume - DIA Oracles](#plume-dia-oracles)
- [Moonbase - DIA Oracles](#moonbase-dia-oracles)
- [OKT Chain (OKX) - DIA Oracles](#okt-chain-okx-dia-oracles)
- [Edu Chain - DIA Oracles](#edu-chain-dia-oracles)
- [Moonbeam - DIA Oracles](#moonbeam-dia-oracles)
- [Linea - DIA Oracles](#linea-dia-oracles)
- [GOAT Network - DIA Oracles](#goat-network-dia-oracles)
- [Polygon - DIA Oracles](#polygon-dia-oracles)
- [Soroban - DIA Oracles](#soroban-dia-oracles)
- [Shiden - DIA Oracles](#shiden-dia-oracles)
- [Shido - DIA Oracles](#shido-dia-oracles)
- [Polygon zkEVM - DIA Oracles](#polygon-zkevm-dia-oracles)
- [Shibuya - DIA Oracles](#shibuya-dia-oracles)
- [Swell - DIA Oracles](#swell-dia-oracles)
- [Hydration - DIA Oracles](#hydration-dia-oracles)
- [Telos - DIA Oracles](#telos-dia-oracles)
- [Ethereum - DIA Oracles](#ethereum-dia-oracles)
- [Velas - DIA Oracles](#velas-dia-oracles)
- [Wanchain - DIA Oracles](#wanchain-dia-oracles)
- [XRP Ledger (XRPL) - DIA Oracles](#xrp-ledger-xrpl-dia-oracles)
- [Units Network - DIA Oracles](#units-network-dia-oracles)
- [LUKSO - DIA Oracles](#lukso-dia-oracles)
- [Optimism - DIA Oracles](#optimism-dia-oracles)
- [Superseed - DIA Oracles](#superseed-dia-oracles)
- [Sonic - DIA Oracles](#sonic-dia-oracles)
- [W Chain - DIA Oracles](#w-chain-dia-oracles)
- [Unichain - DIA Oracles](#unichain-dia-oracles)
- [Stacks - DIA Oracles](#stacks-dia-oracles)
- [Kadena - DIA Oracles](#kadena-dia-oracles)
- [Somnia - DIA Oracles](#somnia-dia-oracles)
- [Cross-chain Messaging - DIA Oracles](#cross-chain-messaging-dia-oracles)
- [CEXes Data - DIA Oracles](#cexes-data-dia-oracles)
- [DEXes Data - DIA Oracles](#dexes-data-dia-oracles)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Hardware Specs - DIA Oracles](#hardware-specs-dia-oracles)
- [Development Cluster Stack - DIA Oracles](#development-cluster-stack-dia-oracles)
- [DIA Test‐Space with Docker Compose - DIA Oracles](#dia-test-space-with-docker-compose-dia-oracles)
- [Setting Up the Node - DIA Oracles](#setting-up-the-node-dia-oracles)
- [Return Rates in Crypto Farming - DIA Oracles](#return-rates-in-crypto-farming-dia-oracles)
- [DIA Test‐Space with Minikube - DIA Oracles](#dia-test-space-with-minikube-dia-oracles)
- [Add a New Liquidity Scraper - DIA Oracles](#add-a-new-liquidity-scraper-dia-oracles)
- [Page Not Found](#page-not-found)
- [Add a New Foreign Scraper - DIA Oracles](#add-a-new-foreign-scraper-dia-oracles)
- [Crypto Volatility Index - DIA Oracles](#crypto-volatility-index-dia-oracles)
- [Add a New Exchange Scraper - DIA Oracles](#add-a-new-exchange-scraper-dia-oracles)
- [Compounded Rates - DIA Oracles](#compounded-rates-dia-oracles)
- [Page Not Found](#page-not-found)
- [Polkadot Medianizer - DIA Oracles](#polkadot-medianizer-dia-oracles)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Page Not Found](#page-not-found)
- [Data Delivery - DIA Oracles](#data-delivery-dia-oracles)
- [Pull Based Oracles - DIA Oracles](#pull-based-oracles-dia-oracles)
- [Architecture - DIA Oracles](#architecture-dia-oracles)
- [Docker Compose - DIA Oracles](#docker-compose-dia-oracles)
- [Kubernetes - DIA Oracles](#kubernetes-dia-oracles)
- [Docker Run - DIA Oracles](#docker-run-dia-oracles)
- [Terms & Conditions - DIA Oracles](#terms-conditions-dia-oracles)
- [Data Sourcing - DIA Oracles](#data-sourcing-dia-oracles)
- [Contributor Covenant Code of Conduct - DIA Oracles](#contributor-covenant-code-of-conduct-dia-oracles)
- [Licence Agreement - DIA Oracles](#licence-agreement-dia-oracles)
- [Disclaimer - DIA Oracles](#disclaimer-dia-oracles)
- [Data Computation - DIA Oracles](#data-computation-dia-oracles)
- [Disclaimer - DIA Oracles](#disclaimer-dia-oracles)
- [Licence Agreement - DIA Oracles](#licence-agreement-dia-oracles)
- [Contributor Covenant Code of Conduct - DIA Oracles](#contributor-covenant-code-of-conduct-dia-oracles)
- [Run a Feeder - DIA Oracles](#run-a-feeder-dia-oracles)
- [Contract Addresses - DIA Oracles](#contract-addresses-dia-oracles)
- [Hardware Specs - DIA Oracles](#hardware-specs-dia-oracles)
- [Token Price Feeds - DIA Oracles](#token-price-feeds-dia-oracles)
- [Setting Up the Node - DIA Oracles](#setting-up-the-node-dia-oracles)
- [Community & Support - DIA Oracles](#community-support-dia-oracles)
- [RWA Price Feeds - DIA Oracles](#rwa-price-feeds-dia-oracles)
- [Request a Custom Oracle - DIA Oracles](#request-a-custom-oracle-dia-oracles)
---
# DIA APIs - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
DIA APIs
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Overview](https://www.diadata.org/docs/reference/apis#overview)
* [API Access](https://www.diadata.org/docs/reference/apis#api-access)
* [Performance](https://www.diadata.org/docs/reference/apis#performance)
[](https://www.diadata.org/docs/reference/apis#overview)
**Overview**
-------------------------------------------------------------------------
**Find the right data for your needs** Show your users the most transparent data on the market with our API. Whether you’re building a financial service, a portfolio management tool, a new media offering, or more, we have the most advanced and updated data on the market for your product. **Backtest your strategies** Use the most efficient and transparent crypto data to run simulations and backtest your trading or investing strategies. With crowd-aggregated hundreds of exchanges, you can be sure that you’re getting the right picture every single time. **Run Experiments** Build your own models with our data, to further your interest or just for fun. With our flexible and powerful API, we provide you with a set of data that will help you draw insights and make conclusions.
[](https://www.diadata.org/docs/reference/apis#api-access)
API Access
-------------------------------------------------------------------------
The DIA base url is `https://api.diadata.org/v1`. All API paths are sub-paths of this base URL.
[](https://www.diadata.org/docs/reference/apis#performance)
Performance
---------------------------------------------------------------------------
We apply the highest performance standards for all our API feeds.
* 99.9% uptime
* <1 sec response times
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/reference/apis/token-prices)
⌘I
---
# RWA Prices - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/rwa-prices#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RWA Prices
RWA Prices
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Data is refreshed every 1-min
Was this page helpful?
YesNo
[Request Samples](https://www.diadata.org/docs/reference/apis/token-prices/graphql/request-samples)
[Forex](https://www.diadata.org/docs/reference/apis/forex)
⌘I
---
# Commodities - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/commodities#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RWA Prices
Commodities
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Commodities
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/Commodities/{CommoditySymbol}
Sample Response
Copy
Ask AI
{
"Ticker": "XAU-USD",
"Name": "Gold Spot / US Dollar",
"Price": 2925.88989,
"Timestamp": "2025-02-17T20:00:00Z"
}
GET
https://api.diadata.org
/
v1
/
rwa
/
Commodities
/
{CommoditySymbol}
Try it
Commodities
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/Commodities/{CommoditySymbol}
Sample Response
Copy
Ask AI
{
"Ticker": "XAU-USD",
"Name": "Gold Spot / US Dollar",
"Price": 2925.88989,
"Timestamp": "2025-02-17T20:00:00Z"
}
[](https://www.diadata.org/docs/reference/apis/commodities#path-parameter)
Path Parameter
---------------------------------------------------------------------------------------------
[](https://www.diadata.org/docs/reference/apis/commodities#param-commodity-symbol)
CommoditySymbol
string
required
Commodity symbol e.g. XAU-USD (Gold)
Available commodities
1. XAU/USD (Gold)
2. XAGG/USD (Silver)
3. XG/USD (Copper)
Sample Response
Copy
Ask AI
{
"Ticker": "XAU-USD",
"Name": "Gold Spot / US Dollar",
"Price": 2925.88989,
"Timestamp": "2025-02-17T20:00:00Z"
}
Was this page helpful?
YesNo
[Forex](https://www.diadata.org/docs/reference/apis/forex)
[ETFs](https://www.diadata.org/docs/reference/apis/etfs)
⌘I
---
# Forex - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/forex#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RWA Prices
Forex
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Forex
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/Fiat/{FiatQuote}
Sample Response
Copy
Ask AI
{
"Ticker": "EUR-USD",
"Price": 1.04512317205083,
"Timestamp": "2025-02-18T14:49:00Z"
}
GET
https://api.diadata.org
/
v1
/
rwa
/
Fiat
/
{FiatQuote}
Try it
Forex
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/Fiat/{FiatQuote}
Sample Response
Copy
Ask AI
{
"Ticker": "EUR-USD",
"Price": 1.04512317205083,
"Timestamp": "2025-02-18T14:49:00Z"
}
[](https://www.diadata.org/docs/reference/apis/forex#path-parameter)
Path Parameter
---------------------------------------------------------------------------------------
[](https://www.diadata.org/docs/reference/apis/forex#param-fiat-quote)
FiatQuote
string
required
Exchange pair, e.g. EUR-USD; GBP-USD
Available FX pairs
1. NGN/USD
2. EUR/USD
3. BRL/USD
4. JPY/USD
5. CHF/USD
6. GBP/USD
Sample Response
Copy
Ask AI
{
"Ticker": "EUR-USD",
"Price": 1.04512317205083,
"Timestamp": "2025-02-18T14:49:00Z"
}
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/reference/apis/rwa-prices)
[Commodities](https://www.diadata.org/docs/reference/apis/commodities)
⌘I
---
# Token Prices - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/token-prices#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Token Prices
Token Prices
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
You can learn more about the product [here](https://app.gitbook.com/o/-M1UhUdjMqTODILqXwkd/s/7BgHS2yasVJB3IUNwbdE/~/changes/1/data-products/token-price-feeds)
.
[RestAPI\
-------](https://www.diadata.org/docs/reference/apis/token-prices/api-endpoints)
[GraphQL\
-------](https://www.diadata.org/docs/reference/apis/token-prices/graphql)
Was this page helpful?
YesNo
[DIA APIs](https://www.diadata.org/docs/reference/apis)
[Overview](https://www.diadata.org/docs/reference/apis/token-prices/api-endpoints)
⌘I
---
# ETFs - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/etfs#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RWA Prices
ETFs
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
ETFs
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/ETF/{ETFSymbol}
Sample Response
Copy
Ask AI
{
"Ticker": "IVV",
"Name": "iShares Core S&P 500 ETF",
"Price": 612.97,
"Timestamp": "2025-02-18T14:30:00Z"
}
GET
https://api.diadata.org
/
v1
/
rwa
/
ETF
/
{ETFSymbol}
Try it
ETFs
cURL
Copy
Ask AI
curl --request GET \
--url https://api.diadata.org/v1/rwa/ETF/{ETFSymbol}
Sample Response
Copy
Ask AI
{
"Ticker": "IVV",
"Name": "iShares Core S&P 500 ETF",
"Price": 612.97,
"Timestamp": "2025-02-18T14:30:00Z"
}
[](https://www.diadata.org/docs/reference/apis/etfs#path-parameter)
Path Parameter
--------------------------------------------------------------------------------------
[](https://www.diadata.org/docs/reference/apis/etfs#param-etf-symbol)
ETFSymbol
string
required
ETF symbol e.g. IVV (iShares Core S&P 500 ETF)
Available ETFs
1. IVV (iShares Core S&P 500 ETF)
2. URTH (iShares MSCI World ETF)
3. EEM (iShares MSCI Emerging Markets ETF)
Sample Response
Copy
Ask AI
{
"Ticker": "IVV",
"Name": "iShares Core S&P 500 ETF",
"Price": 612.97,
"Timestamp": "2025-02-18T14:30:00Z"
}
To request custom data feeds, you can always refer to the following section:[Request a Custom Oracle\
-----------------------](https://www.diadata.org/docs/request-a-custom-oracle)
Was this page helpful?
YesNo
[Commodities](https://www.diadata.org/docs/reference/apis/commodities)
⌘I
---
# Home - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/home#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
DIA Oracles Docs
================
Build onchain with trustless oracles.
Ask about DIA…
What is DIA
-----------
Unlike traditional oracles that rely on opaque third-party data, DIA takes a novel approach, sourcing data directly from its origin. This ensures full transparency, complete customization, and support for any data type across ecosystems.
With integrations with 100+ data sources, support for 60+ blockchains, and powering over 200 dApps, DIA continues to scale its network while empowering Web3 ecosystems to thrive.
Quickstart
----------
[Fetch Price Data\
----------------\
\
Integrate token price feeds with Push or Pull oracles.](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
[Generate Randomness\
-------------------\
\
Add verifiable randomness to your smart contracts with xRandom.](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness)
[Fund your DIA Oracle\
--------------------\
\
Learn how to fund DIA’s gas wallet to enable oracle updates.](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle)
[Migrate from Chainlink\
----------------------\
\
Switch to DIA-compatible oracles with minimal code changes.](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia#migrate-to-dia)
Use DIA Products
----------------
[Token Price Feeds\
-----------------\
\
Get on-chain price feeds for 20,000+ digital assets.](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds)
[RWA Feeds\
---------\
\
Fetch data for stocks, FX rates, and other real-world assets.](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds)
[Randomness\
----------\
\
Integrate DIA xRandom for provably fair random numbers.](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
[Proof of Reserve\
----------------\
\
Feeds for on/off-chain assets that account for the collateral ratio.](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds)
Dive into Stack
---------------
[How DIA Oracles Work\
--------------------\
\
Understand the architecture and components of DIA oracles.](https://www.diadata.org/docs/dia-stack/how-it-works)
[Feeders (Sourcing Layer)\
------------------------\
\
Learn how DIA collects data from various sources.](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders)
[Lasernet (Aggregation Layer)\
----------------------------\
\
Explore how data is aggregated and validated.](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/overview)
[Spectra (Messaging Layer)\
-------------------------\
\
Discover how data is delivered across chains.](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
[API Reference\
-------------\
\
Access comprehensive API documentation.](https://www.diadata.org/docs/reference/apis)
Get Support
-----------
[Join Dev Discord\
----------------\
\
Ask questions & get help from the DIA community.](https://discord.gg/RjHBcZ9mEH)
[Join Telegram\
-------------\
\
Connect with the DIA community on Telegram.](https://t.me/DIAdata_org)
[Request Oracle\
--------------\
\
Request a custom oracle integration for your dApp or chain.](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
⌘I
---
# DIA Stack Overview - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/overview#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
DIA Stack Overview
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Introduction to DIA](https://www.diadata.org/docs/dia-stack/overview#introduction-to-dia)
* [Features](https://www.diadata.org/docs/dia-stack/overview#features)
* [Data Flow: From Source to Feed](https://www.diadata.org/docs/dia-stack/overview#data-flow%3A-from-source-to-feed)
[](https://www.diadata.org/docs/dia-stack/overview#introduction-to-dia)
Introduction to DIA
-----------------------------------------------------------------------------------------------
DIA’s architecture focuses on maximizing decentralization and trustless execution. It is composed of state-of-the-art modular components that use Lasernet, DIA’s native Ethereum layer-2 rollup, as its core settlement layer for critical data operations such as computation and verification. DIA tackles traditional blockchain oracles’ issues through its rollup-powered architecture:
* Independent nodes fetch data directly from sources (CEXs, DEXs, more)
* Data is submitted on-chain to DIA Lasernet – DIA’s ETH L2 rollup
* Processing and aggregation of data happen on-chain
* Transactions are settled on-chain transparently
[](https://www.diadata.org/docs/dia-stack/overview#features)
Features
-------------------------------------------------------------------------
Crypto-economic security
------------------------
Decentralized data sourcing by independent Feeder nodes, backed by staked assets.
Any asset from any chain
------------------------
DIA’s first-party data sourcing capabilities one of its core benefit, enabling unlimited asset coverage.
Deploy anywhere, fast
---------------------
Seamless data transmission to any chain significantly reduces time to market and friction in the developer UX.
Open and permissionless
-----------------------
Anyone can contribute to the system’s security or self-deploy and manage oracles contracts.
Full data transparency
----------------------
From granular data sourcing to immutable processing trails, the stack ensures that everything is fully traceable.
No trust assumptions
--------------------
Data computation happens on-chain via smart contracts, enabling full verifiability of the end-to-end process.
[](https://www.diadata.org/docs/dia-stack/overview#data-flow:-from-source-to-feed)
Data Flow: From Source to Feed
---------------------------------------------------------------------------------------------------------------------
DIA is composed of three main stages, each critical to ensuring the accuracy, reliability, and accessibility of your data.

DIA stack's components
| Component | Description | Learn more |
| --- | --- | --- |
| **Feeders (Sourcing Layer)** | Collect real-time data from decentralized exchanges (DEXs), centralized exchanges (CEXs), and other sources through **Feeders**. Learn how our decentralized network of nodes ensures that your data is accurate, timely, and sourced directly from the market. | [Feeders](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders) |
| **Lasernet (Aggregation Layer)** | Process and verify the collected data using **Pods** and **Aggregators** within the **LaserNet** infrastructure. Dive into how these components transform raw data into reliable and secure price feeds for your dApp. | [Lasernet](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/overview) |
| **Spectra (Messaging Layer)** | Deliver processed data across multiple blockchains using **Spectra**, our industry-leading cross-chain messaging protocol. Discover how LaserNet makes it easy to integrate DIA’s oracle data into any blockchain environment. | [Spectra](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra) |
For a breakdown of each process, read the [Architecture](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview)
section.
Was this page helpful?
YesNo
[Token Price Feeds](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds)
⌘I
---
# Quickstart - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/quickstart#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Quickstart
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Grants Program](https://www.diadata.org/docs/guides/quickstart#oracle-grants-program)
* [Getting Started](https://www.diadata.org/docs/guides/quickstart#getting-started)
These integration guides provide everything you need to start integrating DIA oracles into your dApp. You can also explore the methodologies we use, and other general guides such as running a feeder node. Here’s what you’ll find:
[How-to Guides\
-------------\
\
Learn how to fetch price data, generate randomness, fund oracles, and migrate from other providers.](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
[Chain-Specific Guides\
---------------------\
\
Step-by-step instructions for each supported blockchain, including contract addresses, oracle configurations, and code examples in Solidity and other languages.](https://www.diadata.org/docs/guides/chain-guides-overview)
[Methodologies\
-------------\
\
Explore pricing methodologies (MAIR, VWAPIR, etc.), data sourcing process, & update triggers.](https://www.diadata.org/docs/guides/methodologies-overview)
[General Guides\
--------------\
\
Access smart contracts, learn how to run a feeder, build custom scrapers, & how DIA staking works.](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diaoraclev2.sol)
###
[](https://www.diadata.org/docs/guides/quickstart#oracle-grants-program)
Oracle Grants Program
Get **zero-cost oracle access** for up to 1 year across all supported chains. Learn more about the program below:[Apply for DIA Oracle Grants\
---------------------------](https://www.diadata.org/docs/guides/oracle-grants)
###
[](https://www.diadata.org/docs/guides/quickstart#getting-started)
Getting Started
Choose your blockchain from the [list of supported networks](https://www.diadata.org/docs/guides/chain-guides-overview)
, or explore our [how-to guides](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
to understand DIA’s oracles integration process.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
⌘I
---
# Fetch Price Data - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Fetch Price Data
Fetch Price Data
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Access Methods](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data#oracle-access-methods)
* [When to Use Each Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data#when-to-use-each-method)
DIA offers multiple ways to access price data from oracles. The methods differ based on the oracle type (Push or Pull) and whether you’re consuming the oracle through the Nexus or Lumina stack.
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data#oracle-access-methods)
Oracle Access Methods
----------------------------------------------------------------------------------------------------------------------
The how-to guides are specifically for EVM-compatible chains. For non-EVM chains (like Stacks, Alephium, etc.), Please refer to the [chain-specific guides](https://www.diadata.org/docs/guides/chain-guides-overview)
for chain-specific implementation details.
[updates Method\
--------------\
\
Access Push-based oracles through the Lumina Stack that automatically update price feeds at fixed intervals or when price deviations exceed thresholds.](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
[request Method\
--------------\
\
Access Pull-based oracles through the Lumina Stack that fetch price data on-demand when your contract requests it.](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
[getValue Method\
---------------\
\
Direct value retrieval using the standard DIA oracle interface through the Nexus Stack. Simple method for getting current price values.](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data#when-to-use-each-method)
When to Use Each Method
--------------------------------------------------------------------------------------------------------------------------
The method to use depends on the deployed oracle contract you’re planning to consume on each chain through the available stacks (Nexus or Lumina). We specify the methods available for each chain in their dedicated [chain-specific guide](https://www.diadata.org/docs/guides/chain-guides-overview)
.
Was this page helpful?
YesNo
[Quickstart](https://www.diadata.org/docs/guides/quickstart)
[getValue Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
⌘I
---
# RestAPI - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/token-prices/api-endpoints#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RestAPI
RestAPI
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/reference/apis/token-prices)
[Token Price Quotation (by address)](https://www.diadata.org/docs/reference/apis/token-prices/api-endpoints/token-price-quotation-by-address)
⌘I
---
# Token Price Feeds - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Products
Token Price Feeds
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [xMarket Overview](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#xmarket-overview)
* [How It Works](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#how-it-works)
* [Learn More](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#learn-more)
[](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#xmarket-overview)
xMarket Overview
----------------------------------------------------------------------------------------------------------------
DIA xMarket feeds provide smart contracts **real-time price information of 3,000+ cryptocurrencies**, transparently sourced from 100+ trusted, high-volume DEXs and CEXs. The feeds facilitate the development of DeFi use cases such as money markets, lending/borrowing, synthetic asset issuance, options, derivatives and futures markets, and many more. Browse all tokens that DIA’s data library currently supports via the link below. New assets can also be supported on demand.[\
\
Token Price Feeds|DIA App\
-------------------------](https://www.diadata.org/app/price/)
You can also check the list of data sources on the app.[\
\
Data Sources|DIA App\
--------------------](https://www.diadata.org/app/source/defi/)
[](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#how-it-works)
How It Works
--------------------------------------------------------------------------------------------------------

Price Feed Flow
Each [feeder](https://www.diadata.org/docs/reference/architecture/data-sourcing#feeder)
in the Decentralized Feeder Network runs scrapers that collect real-time trade data from CEXes and DEXes for specific trading pairs (e.g., BTC-USDT) that are then forwarded to the Collector which bundles them into atomic tradeblocks (grouped by market and exchange). The Processor then performs a two-step aggregation: first aggregating trades within each atomic tradeblock into a single value, then combining these values into a final price, which is submitted to the designated Pod (feeder contract) on-chain. This enables your dApp to access first-party and verifiable data delivered from our decentralized feeder network!
[](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds#learn-more)
Learn More
----------------------------------------------------------------------------------------------------
[Request a custom oracle\
-----------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[Fetch Price Data\
----------------](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
[Methodologies\
-------------](https://www.diadata.org/docs/guides/methodologies-overview)
[Token Price APIs\
----------------](https://www.diadata.org/docs/reference/apis/token-prices)
[Data Sources\
------------](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview)
Was this page helpful?
YesNo
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview)
[Real-World Asset Feeds](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds)
⌘I
---
# Fund your Oracle - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
How-to Guides
Fund your Oracle
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How it works](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#how-it-works)
* [Estimate Updates Count for Oracles](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#estimate-updates-count-for-oracles)
* [Get historical Oracle updates count](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#get-historical-oracle-updates-count)
* [Path Parameters](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#path-parameters)
[](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#how-it-works)
How it works
---------------------------------------------------------------------------------------------------
Each oracle deployed by DIA has a gas wallet, which is the only entity capable of calling for an oracle update. The wallet initiates the transaction to import a new value into the oracle smart contract, based on the [data feed’s update parameters](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers)
(that have been previously configured). For the gas wallet to perform new oracle contract updates, it must have a sufficient balance of the blockchain’s native token to cover the transaction’s gas costs. The gas wallet can be funded with a one-time lump sum, allowing it to keep updating for a while. However, monitoring the gas wallet’s balance is necessary to ensure continuity in the oracle’s operations. DIA has set up internal gas wallet balance trackers. We recommend protocols to actively monitor them to ensure that the wallet balance remains sufficient for pushing new oracle updates.
[](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#estimate-updates-count-for-oracles)
Estimate Updates Count for Oracles
-----------------------------------------------------------------------------------------------------------------------------------------------
DIA has a dedicated endpoint for asset historical updates count to help you estimate the number of oracle updates. This allows to foresee potential gas costs that would be required for running the oracle.
[](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#get-historical-oracle-updates-count)
Get historical Oracle updates count
-------------------------------------------------------------------------------------------------------------------------------------------------
`GET` `https://api.diadata.org/v1/assetUpdates/:blockchain/:address/:deviation/:updateFreq` The endpoint returns information on the asset deviation and updates count if it was used in the oracle. It takes price change (deviation) and oracle’s ticker frequency as the main parameters to determine estimated updates count based on historical data. _Example:_ [_https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120_](https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120)
By default it will return data for the last 24h but you can configure the timeframe with starttime and endtime parameters. See example below: [https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120?starttime=1661736336&endtime=1661761536](https://api.diadata.org/v1/assetUpdates/Ethereum/0x0000000000000000000000000000000000000000/20/120?starttime=1661736336&endtime=1661761536)
####
[](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle#path-parameters)
Path Parameters
| Name | Type | Description |
| --- | --- | --- |
| blockchain\* | String | A valid blockchain from GET /v1/blockchains, e.g., Bitcoin. |
| address\* | String | A valid asset address from GET /v1/token/:symbol, e.g., 0x000000000000000000000000000000000000000 for BTC. |
| deviation\* | Integer | Deviation measure in per mille, e.g. 20 will result in 2% deviation |
| updateFreq\* | Integer | Oracle’s price feed ticker frequency in seconds, e.g. 120 will calculate asset price in 2 minute trade blocks |
| starttime | Integer | Unix timestamp setting the start of the return array |
| endtime | Integer | Unix timestamp setting the end of the return array |
Was this page helpful?
YesNo
[Solidity](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity)
[Migrate from Chainlink](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
⌘I
---
# Real-World Asset Feeds - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Products
Real-World Asset Feeds
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Overview](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds#overview)
* [Learn More](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds#learn-more)
[](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds#overview)
Overview
----------------------------------------------------------------------------------------------
DIA xReal is designed for Real-World Asset (RWA) applications, bringing hundreds of data feeds for stocks, commodities, FX rates, and more on-chain. It consists of two core components:
xReal Price Feeds
-----------------
Secure, transparent price oracles for RWA-powered dApps (options, futures, tokenized index funds & more)
xReal Custom Solutions
----------------------
On-demand oracles for tokenized assets, bond yields, FX rates, & real-world financial metrics
You can access all the available RWA data feeds & integration options below:[\
\
Real-World Asset (RWA) Price Feed Oracles | DIA App\
---------------------------------------------------](https://www.diadata.org/app/rwa/)
[](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds#learn-more)
Learn More
--------------------------------------------------------------------------------------------------
[Request a Custom Oracle\
-----------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[RWA Price APIs\
--------------](https://www.diadata.org/docs/reference/apis/rwa-prices)
[Methodologies\
-------------](https://www.diadata.org/docs/guides/methodologies-overview)
[Fetch Price Data\
----------------](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
[Supported Networks\
------------------](https://www.diadata.org/docs/guides/chain-guides-overview)
Was this page helpful?
YesNo
[Token Price Feeds](https://www.diadata.org/docs/dia-stack/data-products/token-price-feeds)
[Verifiable Randomness](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
⌘I
---
# Migrate from Chainlink - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
How-to Guides
Migrate from Chainlink
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
[Chainlink Adapter\
-----------------](https://github.com/diadata-org/AssetSpecificCallingConvention/blob/main/contracts/DiaAssetSpecificCallingConvention.sol)
Was this page helpful?
YesNo
[Fund your Oracle](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle)
[Request a Custom Oracle](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
⌘I
---
# Generate Randomness - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Generate Randomness
Generate Randomness
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Learn more](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness#learn-more)
You can find deployed Randomness oracle contracts for each chain [here](https://www.diadata.org/docs/guides/chain-guides-overview)
. For EVM chains, follow the instructions in the Solidity guide:[Solidity Guide\
--------------](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity)
[](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness#learn-more)
Learn more
---------------------------------------------------------------------------------------------------
[Verifiable Randomness\
---------------------](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
[Distributed Randomness Beacon\
-----------------------------](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness)
Was this page helpful?
YesNo
[request Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
[Solidity](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity)
⌘I
---
# Verifiable Randomness - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Products
Verifiable Randomness
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [xRandom Overview](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness#xrandom-overview)
* [Learn More](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness#learn-more)
[](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness#xrandom-overview)
xRandom Overview
--------------------------------------------------------------------------------------------------------------------
DIA xRandom leverages [drand](https://drand.love/)
’s distributed randomness beacon, enabling verifiable, unpredictable and unbiased random numbers. Currently, the randomness is updated every 30 seconds and is expected to upgrade soon. The randomness oracle enables the creation of on-chain applications including but not limited to on-chain gaming, lotteries, prediction markets, and NFT launches. Browse the latest randomness rounds in the DIA App:[\
\
Randomness|DIA App\
------------------](https://www.diadata.org/app/randomness/)
[](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness#learn-more)
Learn More
--------------------------------------------------------------------------------------------------------
[Request a Custom Oracle\
-----------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[Integrate DIA xRandom\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness)
[What is Randomness?\
-------------------](https://www.youtube.com/watch?v=7HALDJr8V3g)
[Challenges of on-chain randomness\
---------------------------------](https://youtu.be/32d7QvFXoIk?feature=shared)
[Distributed Randomness Beacon\
-----------------------------](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness)
[Oracle Contract\
---------------](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diarandomoracle.sol)
Was this page helpful?
YesNo
[Real-World Asset Feeds](https://www.diadata.org/docs/dia-stack/data-products/rwa-price-feeds)
[Fundamental Feeds](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds)
⌘I
---
# Fundamental Feeds - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Products
Fundamental Feeds
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Features](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#features)
* [Methodologies](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#methodologies)
* [Contract Exchange Rate](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#contract-exchange-rate)
* [Reserve-Backing](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#reserve-backing)
* [Net Asset Value (NAV)](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#net-asset-value-nav)
* [Redemption Value](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#redemption-value)
* [Proof of Reserves](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#proof-of-reserves)
* [Architecture Flow Overview](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#architecture-flow-overview)
* [Use Cases](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#use-cases)
* [Developer Notes](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#developer-notes)
Fundamental Feeds provide an alternative to market-based pricing by calculating an asset’s value directly from its fundamentals. Instead of relying on exchange trades or liquidity-driven mechanisms, these feeds derive price from objective on-chain or off-chain proofs of collateral, redemption logic, and reserve holdings. This makes them particularly relevant for synthetic assets, stablecoins, yield-bearing tokens, and structured vaults.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#features)
Features
================================================================================================
* Independent of market volatility or liquidity distortions.
* Transparent methodology based on verifiable reserves, liabilities, and contract logic.
* Applicable across DeFi instruments ranging from liquid staking tokens to stablecoins and vaults.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#methodologies)
Methodologies
==========================================================================================================
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#contract-exchange-rate)
Contract Exchange Rate
----------------------------------------------------------------------------------------------------------------------------
For tokens with built-in exchange logic (e.g. stETH, aUSDC, cDAI), price is calculated from the ratio of underlying assets to total shares: exchangeRate\=totalUnderlying/totalSharesexchangeRate = totalUnderlying / totalSharesexchangeRate\=totalUnderlying/totalShares
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#reserve-backing)
Reserve-Backing
--------------------------------------------------------------------------------------------------------------
For collateral-backed assets, reserves are divided by circulating supply to produce a backing-based fundamental value: fundamentalPrice\=reserves/supplyfundamentalPrice = reserves / supplyfundamentalPrice\=reserves/supply Reserves may consist of multiple assets held across wallets.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#net-asset-value-nav)
Net Asset Value (NAV)
------------------------------------------------------------------------------------------------------------------------
For vault-based tokens, price equals the value of assets minus liabilities, divided by outstanding tokens: fundamentalPrice\=(assets−liabilities)/totalSupplyfundamentalPrice = (assets - liabilities) / totalSupplyfundamentalPrice\=(assets−liabilities)/totalSupply
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#redemption-value)
Redemption Value
----------------------------------------------------------------------------------------------------------------
For mint/burn models, the fundamental value corresponds to the amount of underlying assets received when redeeming one token. This is typically retrievable directly from the redemption contract.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#proof-of-reserves)
Proof of Reserves
------------------------------------------------------------------------------------------------------------------
For custodial or synthetic assets, feeds can publish the total value of reserves as reported by verified custodians or proof-of-reserve attestations: reserveValue\=∑i\=1n(reservesi×pricei)reserveValue = \\sum\_{i=1}^{n} (reserves\_i \\times price\_i)reserveValue\=i\=1∑n(reservesi×pricei)
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#architecture-flow-overview)
Architecture Flow Overview
====================================================================================================================================

Fundamental Feed Flow
* Each feeder is pulling balance sheets (reserves, supply).
* Lasernet is the ledger where all feeders submit their reports.
* The aggregator contract is consolidating those reports into one official number.
* The messaging layer is delivering that number to every chain where it’s needed.
* Protocols then rely on this official number to decide risk and operations.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#use-cases)
Use Cases
==================================================================================================
* **Stablecoins**: Validate peg integrity by comparing market price to backing-based fundamental value.
* **Yield-bearing Tokens (LSTs, aTokens, cTokens)**: Track accruing value through exchange rates.
* **Vaults and Structured Products**: Monitor NAV in real time to ensure accurate token pricing.
* **Synthetic Assets**: Ensure collateralization ratios remain healthy through reserve-backed valuations.
[](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds#developer-notes)
Developer Notes
==============================================================================================================
Fundamental Feeds can operate alongside traditional market price feeds. Protocols can consume both sources to implement safeguards such as:
* Depeg monitoring (triggering alerts if fundamental value diverges from market price).
* Fallback mechanisms to fundamental pricing when market feeds become unreliable.
* Enhanced transparency by exposing raw inputs such as reserve addresses or contract state.
If you’re interested in integrating Fundamental Feeds into your project, request a custom oracle below:
[Request a Custom Oracle\
-----------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
Was this page helpful?
YesNo
[Verifiable Randomness](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
[Overview](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview)
⌘I
---
# Spectra (Cross-chain Messaging Layer) - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Core Components
Spectra (Cross-chain Messaging Layer)
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Data Delivery Methods](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#data-delivery-methods)
* [Pull Model](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#pull-model)
* [Push Model](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#push-model)
* [Fees](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#fees)
* [Key Benefits:](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#key-benefits%3A)
DIA Lumina achieves full interoperability, delivering oracle data to any blockchain with minimal friction through the Spectra protocol, a message passing layer powering both the push and pull oracle models.
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#data-delivery-methods)
**Data Delivery Methods**
-----------------------------------------------------------------------------------------------------------------------------------
Spectra is an interchain message passing protocol formed by a network of nodes, running a custom instance of Hyperlane, an open interoperability framework. It facilitates secure and rapid transmission of oracle data to any blockchain, without the need for chain-specific integrations. The Spectra validators observe messages on the mailboxes of the destination and origin chains. The messages are then checked through the ISM (Interchain Security Module) and delivered to these components:
* RequestOracle (Pull oracle)
* PushOracleReceiver (Push oracle)
The gas for processing messages are funded by imposing a fee for calling `request()` on _RequestOracle_, or `handle()` on the _PushOracleReceiver_ contracts. The fees are transferred to the ProtocolFeeHook – an instance of Hyperlane’s [Post-Dispatch](https://docs.hyperlane.xyz/docs/protocol/core/post-dispatch-hooks-overview#post-dispatch-hooks-overview)
hooks - that are then withdrawn manually to the Spectra gas wallet. Let’s explore how Spectra contributes to the flow of messages in the Push and Pull oracle models and how that translates to the data you receive on the destination chain.
###
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#pull-model)
Pull Model

* User initiates a request to the RequestOracle contract and pays a fee.
* RequestOracle processes the request on the origin chain (e.g. Ethereum), creates a message containing the request details (destination chain id, OracleRequestRecipient address, exchange pair, …etc), then dispatches it through the Mailbox.
* The validators observes the mailbox and picks up the request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain (DIA lasernet).
* OracleRequestRecipient receives and validates the message through the ISM, and passes it forward to OracleTrigger that fetches the values from the [Aggregator](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/overview#aggregator)
or meta-contract. It then creates a message with the latest price, and dispatches it back to Lasernet’s mailbox.
* Message is picked up by Spectra protocol and sent back to the RequestOracle which then checks for data freshness and adds the value to the `updates`mapping.
###
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#push-model)
Push Model

* Go feeder service initiates a price update based on certain parameters (such as deviation, heartbeat, & refresh frequency) on the origin chain (DIA’s lasernet).
* OracleTrigger processes the update request, reads the latest price from the meta-contract, creates a message, & dispatches it through the Mailbox.
* The validators observes the mailbox and picks up the update request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain.
* PushOracleReceiver receives the update, validates the message through the ISM, checks for the data freshness, the adds the value to the `updates`mapping.
###
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#fees)
Fees
Cost of updating data on the destination chain is calculated as follows:
Copy
Ask AI
uint256 gasUsedPerTx = 97440; // Fixed gas amount
uint256 gasPrice = tx.gasprice; // Current network gas price
uint256 cost = gasUsedPerTx * gasPrice; // Total fee
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra#key-benefits:)
Key Benefits:
---------------------------------------------------------------------------------------------------------------
Deploy Anywhere, Fast
---------------------
Cross-chain data delivery is made simple through Spectra, dramatically reducing time to market for developers, and allowing data to be transmitted across blockchains with minimal friction and no chain-specific setup.
Was this page helpful?
YesNo
[DIA Chain Information](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/chain-information)
[Overview](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview)
⌘I
---
# Request a Custom Oracle - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
How-to Guides
Request a Custom Oracle
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Get in touch with us:
[](https://t.me/DIAOracles_Support_Bot)
[](https://t.me/DIAOracles_Support_Bot)
[Integrations team\
-----------------](https://t.me/DIAOracles_Support_Bot)
[For a consultation with the DIA team, get in touch via Telegram. The team will gather the requirements and create a solution proposal for you.](https://t.me/DIAOracles_Support_Bot)
[Contact Us](https://t.me/DIABDteam)
[](https://forum.diadata.org/)
[](https://forum.diadata.org/)
[Forum request\
-------------](https://forum.diadata.org/)
[If you already have a specific implementation in mind, you can directly and autonomously submit a request via the DIA Forum.](https://forum.diadata.org/)
[Submit a CDR](https://forum.diadata.org/)
Was this page helpful?
YesNo
[Migrate from Chainlink](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
[Overview](https://www.diadata.org/docs/guides/chain-guides-overview)
⌘I
---
# GraphQL - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/apis/token-prices/graphql#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
GraphQL
GraphQL
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Query parameters rundown](https://www.diadata.org/docs/reference/apis/token-prices/graphql#query-parameters-rundown)
* [FeedSelection filtering options](https://www.diadata.org/docs/reference/apis/token-prices/graphql#feedselection-filtering-options)
* [Response fields](https://www.diadata.org/docs/reference/apis/token-prices/graphql#response-fields)
You can use the following link to send GraphQL requests: [`https://api.diadata.org/graphql/query`](https://api.diadata.org/graphql/query)
Also you can use a dedicated front-end to try out queries: [`https://api.diadata.org/graphql/`](https://api.diadata.org/graphql/)
Currently only tokens price feed data is available on GraphQL. Example of schema that can be used for quoting data:
Sample Schema
Copy
Ask AI
query {
GetFeed(
Filter: "mair",
BlockSizeSeconds: 480,
BlockShiftSeconds: 480,
StartTime: 1690449575,
EndTime: 1690535975,
FeedSelection: [\
{\
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",\
Blockchain:"Ethereum",\
Exchangepairs:[],\
},\
],
)
{
Name
Time
Value
Pools
Pairs
}
}
The schema will return the moving average price of ETH calculated every 5min (300 sec) by counting 2min trade blocks.
[](https://www.diadata.org/docs/reference/apis/token-prices/graphql#query-parameters-rundown)
Query parameters rundown
--------------------------------------------------------------------------------------------------------------------------
| Parameter | Description |
| --- | --- |
| `filter` | Select trades processing methodology (e.g. `VWAP`, `MAIR`, find out all available filters here) |
| `BlockSizeSeconds` | Determine the window for trades inclusion in seconds (e.g. `120` will include all trades into price calculation that happened during the last 2 minutes) |
| `BlockShiftSeconds` | Determine the frequency of price updates in seconds during the selected timeframe (e.g. `600` will return price for every 5min during the selected period) |
| `StartTime` | The start time of the preferred period for price calculation in timestamp format (e.g. `1655084380` will start calculating price from 13.06.2022 01:39:40 GMT time) |
| `EndTime` | The end time of the preferred period for price calculation in timestamp format (e.g. `1655090649` will calculate price until 13.06.2022 03:24:09 GMT time) |
| `FeedSelection` | This is the main module of the query which is responsible for parametrizing asset(s) for which the price data should be retrieved. Available parameters for `FeedSelection` are described in detail below. |
###
[](https://www.diadata.org/docs/reference/apis/token-prices/graphql#feedselection-filtering-options)
`FeedSelection` filtering options
There are a number of ways to filter out exchanges with DIA’s GraphQL endpoints. First of all, you should define the desired asset. DIA uses blockchain-address asset identification methodology. You can search for available assets and find out blockchain/address information in the [DIA APP asset explorer](https://www.diadata.org/app/price/)
. Here’s an example how to define FeedSelection query to return a price for a given range with all sources included:
Copy
Ask AI
FeedSelection: [\
{\
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",\
Blockchain:"Ethereum",\
Exchangepairs:[],\
},\
]
There are number of ways to filter desired sources from the entire sources library for a given asset. We’ll go over examples of these filters. To select specific exchanges you can use the following format:
Copy
Ask AI
FeedSelection: [\
{\
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",\
Blockchain:"Ethereum",\
Exchangepairs:[{Exchange:"CoinBase"},{Exchange:"UniswapV3"}],\
},\
]
It is also possible to select specific pairs from a given exchange. The query would look as follows:
Copy
Ask AI
FeedSelection: [\
{\
Address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",\
Blockchain:"Ethereum",\
Exchangepairs:[\
{\
Exchange: "CoinBase",\
Pairs:["DAI-USD"],\
},\
{\
Exchange: "UniswapV3",\
Pairs:["0x60594a405d53811d3BC4766596EFD80fd545A270","0x6f48ECa74B38d2936B02ab603FF4e36A6C0E3A77"],\
},\
]\
\
\
Another filtering option is to include sources based on available liquidity in the pool. For example if you select a liquidity threshold of 5000000,theresponsewillcalculatethepriceofanassetonlybyincludingliquiditypoolsfromDEXeswhichhavehigherthan5 000 000, the response will calculate the price of an asset only by including liquidity pools from DEXes which have higher than 5000000,theresponsewillcalculatethepriceofanassetonlybyincludingliquiditypoolsfromDEXeswhichhavehigherthan5 000 000 liquidity. The query looks as follows:\
\
Copy\
\
Ask AI\
\
FeedSelection: [\
{\
Address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",\
Blockchain:"Ethereum",\
LiquidityThreshold:5000000.0\
Exchangepairs: [],\
},\
]\
\
\
It is also possible to merge pairs selection with `LiquidityThreshold`, which would result in such query:\
\
Copy\
\
Ask AI\
\
FeedSelection: [\
{\
Address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",\
Blockchain:"Ethereum",\
Exchangepairs:[\
{\
Exchange: "CoinBase",\
Pairs:["DAI-USD"],\
},\
]\
},\
{\
Address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",\
Blockchain:"Ethereum",\
LiquidityThreshold:5000000.0\
Exchangepairs: [],\
},\
],\
\
\
One more option is to use two different assets to calculate one unified price. It might be useful for cross-chain assets, e.g. DAI on ETH mainnet & DAI on Arbitrum One. The query which can be used for such cases would look as follows:\
\
Copy\
\
Ask AI\
\
FeedSelection: [\
{\
Address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",\
Blockchain:"Ethereum",\
Exchangepairs:[]\
},\
{\
Address: "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1",\
Blockchain:"Arbitrum",\
Exchangepairs:[]\
},\
],\
\
\
[](https://www.diadata.org/docs/reference/apis/token-prices/graphql#response-fields)\
\
Response fields\
--------------------------------------------------------------------------------------------------------\
\
In the table below you can find the description of response fields:\
\
| Field | Description |\
| --- | --- |\
| Time | Time at which the value was generated |\
| Value | Price of an asset at a give time |\
| Pools | Pools which had a trade during the block time period and were involved in the price calculation |\
| Pairs | CEX pairs which had a trade during the block time period and were involved in the price calculation |\
| Blockchain | Blockchain of an asset |\
| Address | Address of an asset |\
\
Was this page helpful?\
\
YesNo\
\
[Request Samples](https://www.diadata.org/docs/reference/apis/token-prices/api-endpoints/request-samples)\
[Request Samples](https://www.diadata.org/docs/reference/apis/token-prices/graphql/request-samples)\
\
⌘I
---
# Feeders (Sourcing Layer) - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Core Components
Feeders (Sourcing Layer)
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Key components](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#key-components)
* [Feeder](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#feeder)
* [Scrapers](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#scrapers)
* [Collector](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#collector)
* [Processor](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#processor)
* [Pods](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#pods)
* [Staking Incentives](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#staking-incentives)
At the heart of Lumina is a decentralized data collection system composed of feeder nodes operating within the Distributed Feeder Network, responsible for sourcing data and feeding it into the Lasernet chain.

Data sourcing flow in oracle feeders
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#key-components)
Key components
-----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#feeder)
**Feeder**
**A Feeder** is a single node in a Distributed Feeder Network that fetches granular market data directly from decentralized exchanges (DEXs), centralized exchanges (CEXs), and third-party data sources. Feeders are responsible for sourcing trade ticks and pushing them to Pods—smart contracts running on DIA’s Lasernet—at configurable intervals (e.g. 30 seconds). There are four main elements that make up a feeder:
[Scrapers\
--------](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#scrapers)
[Collector\
---------](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#collector)
[Processor\
---------](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#processor)
[Pods\
----](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#pods)
####
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#scrapers)
Scrapers
The expected input for a scraper is a set of pair tickers such as `BTC-USDT`. Tickers are always capitalized and symbols separated by a hyphen. It’s the role of the scraper to format the pair ticker such that it can subscribe to the corresponding (websocket) stream.
####
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#collector)
Collector
The collector gathers trades from all running scrapers. As soon as it receives a signal through a trigger channel it bundles trades in _atomic tradesblocks_. An atomic tradesblock is a set of trades restricted to one market on one exchange, for instance `BTC-USDT` trades on Binance exchange. These tradesblocks are sent to the `Processor`.
####
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#processor)
Processor
The processor is a 2-step aggregation procedure:
1
Step 1
Aggregate trades from an atomic tradesblock. The type of aggregation can be selected through an environment variable (see Feeder/main). The only assumption on the aggregation implementation is that it returns a `float64`.
2
Step 2
Aggregate filter values obtained in step 1. The selection of aggregation method and assumptions are identical to Step 1. The obtained scalar value is sent to the Oracle feeder.
####
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#pods)
Pods
Pods (or feeder contracts) are a simple key-value oracle contracts assigned to each feeder node. They store the value obtained from the Processor. It is worth mentioning that the trigger mechanism for starting a new cycle of the data collection flow can be implemented on-chain using the feeder contract. Find out more about the feeder structure and how to run your own feeder [here](https://www.diadata.org/docs/guides/general-guides/run-a-feeder)
.
[](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders#staking-incentives)
Staking Incentives
-------------------------------------------------------------------------------------------------------------------------
To encourage honest behavior, oracle feeders will be rewarded for successful operations and penalized for harmful actions. These incentives ensure that dishonest behavior is punished and becomes economically unviable. Rewards and penalties will primarily be based on uptime and accuracy, measured by the timeliness of updates and the accuracy of prices compared to other feeders. Initially, feeders will gather the last traded price for assets from centralized exchanges (CEXs). For decentralized exchanges (DEXs), we will use trade simulation-based price estimation, which simulates trades to obtain current exchange rates. This approach ensures more accurate pricing, particularly for assets that are infrequently traded.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview)
[Overview](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/overview)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/dia-stack/how-it-works#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview#)
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
[Somnia](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#lumina-stack-feeds)
⌘I
---
# Architecture Overview - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Core Components
Architecture Overview
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
The data flow is broken down into the following phases:
[Feeders (Sourcing Layer)\
------------------------](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders)
[Lasernet (Aggregation Layer)\
----------------------------](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/overview)
[Spectra (Cross-chain Messaging Layer)\
-------------------------------------](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
Explore the data sources that are used to power the Lumina oracle:
[Data Sources\
------------](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview)
Was this page helpful?
YesNo
[Fundamental Feeds](https://www.diadata.org/docs/dia-stack/data-products/fundamental-feeds)
[Feeders (Sourcing Layer)](https://www.diadata.org/docs/dia-stack/architecture/core-components/feeders)
⌘I
---
# Oracle Grants - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/oracle-grants#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Chain-specific Guides
Oracle Grants
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Who is eligible?](https://www.diadata.org/docs/guides/oracle-grants#who-is-eligible)
Zero-cost oracle access
-----------------------
Developers get subsidies for DIA oracle usage up to 1 year, covering deployment and update costs. Removes costs so dApps can go live.
Builders ship – Chains thrive
-----------------------------
Chains attract more builders and TVL by eliminating oracle costs. DIA oracles gain adoption across more ecosystems.
[](https://www.diadata.org/docs/guides/oracle-grants#who-is-eligible)
Who is eligible?
------------------------------------------------------------------------------------------
Any developer building an oracle-dependent dApp on any of the chains participating in the grant.[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
Was this page helpful?
YesNo
[zkSync](https://www.diadata.org/docs/guides/chain-specific-guide/zksync)
[DIA Deployments](https://www.diadata.org/docs/guides/dia-deployments)
⌘I
---
# Community & Support - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/community-and-support#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Resources
Community & Support
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
You can connect with us and find support through the following channels:
[Forum\
-----](https://forum.diadata.org/)
[Twitter/X\
---------](https://x.com/DIAdata_org)
[Discord\
-------](https://discord.com/invite/ZvGjVY5uvs)
[Github\
------](https://github.com/diadata-org/)
Was this page helpful?
YesNo
[Audits](https://www.diadata.org/docs/guides/resources/audits)
[Security Bounty Program](https://www.diadata.org/docs/guides/resources/security-bounty-program)
⌘I
---
# DIA Deployments - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/dia-deployments#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Chain-specific Guides
DIA Deployments
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Token Price Feeds](https://www.diadata.org/docs/guides/dia-deployments#token-price-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/dia-deployments#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/dia-deployments#testnet)
* [RWA Price Feeds](https://www.diadata.org/docs/guides/dia-deployments#rwa-price-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/dia-deployments#mainnet-2)
* [Learn More:](https://www.diadata.org/docs/guides/dia-deployments#learn-more%3A)
Explore the deloyments for the Lumina components on DIA Lasernet. If you’re unfamiliar with Lumina stack’s infrastructure, read the [Lumina Core Components](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview)
page to learn more.
[](https://www.diadata.org/docs/guides/dia-deployments#token-price-feeds)
Token Price Feeds
-----------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/dia-deployments#mainnet)
Mainnet
| Contract | Address |
| --- | --- |
| MailBox | [0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392](https://explorer.diadata.org/address/0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392) |
| OracleRequestRecipient | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://explorer.diadata.org/address/0xA42217338614B7e67D022C52D1CD38e02D619bb0) |
| DIAOracleMetaV2 | [0x5eeB8c00CD8F189f62c9BAD352C0C474429F8A27](https://explorer.diadata.org/address/0x5eeB8c00CD8F189f62c9BAD352C0C474429F8A27) |
| OracleTrigger | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://explorer.diadata.org/address/0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://explorer.diadata.org/address/0xE74B7D236A97eED9026926073cBb436638266888) |
###
[](https://www.diadata.org/docs/guides/dia-deployments#testnet)
Testnet
| Contract | Address |
| --- | --- |
| MailBox | [0x16cD72271498bcaD5aeB9f2D785bA82dC5AfA5E2](https://testnet-explorer.diadata.org/address/0x16cD72271498bcaD5aeB9f2D785bA82dC5AfA5E2) |
| OracleRequestRecipient | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://testnet-explorer.diadata.org/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| DIAOracleMetaV2 | [0x0087342f5f4c7AB23a37c045c3EF710749527c88](https://testnet-explorer.diadata.org/address/0x0087342f5f4c7AB23a37c045c3EF710749527c88) |
| OracleTrigger | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://testnet-explorer.diadata.org/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e) |
| ISM | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://testnet-explorer.diadata.org/address/0x61D217a26D0Bff1D2b4c6f5880e621071326aadC) |
[](https://www.diadata.org/docs/guides/dia-deployments#rwa-price-feeds)
RWA Price Feeds
-------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/dia-deployments#mainnet-2)
Mainnet
| Contract | Address |
| --- | --- |
| MailBox | [0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392](https://explorer.diadata.org/address/0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392) |
| OracleRequestRecipient | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://explorer.diadata.org/address/0xA42217338614B7e67D022C52D1CD38e02D619bb0) |
| DIAOracleMetaV2 | [0x30F5A368a1426851C23E90467F6dCc688116194A](https://explorer.diadata.org/address/0x30F5A368a1426851C23E90467F6dCc688116194A) |
| OracleTrigger | [0x8ed69fd34A1e29b6c6012e89C555b83b5DC7Dad5](https://explorer.diadata.org/address/0x8ed69fd34A1e29b6c6012e89C555b83b5DC7Dad5) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://explorer.diadata.org/address/0xE74B7D236A97eED9026926073cBb436638266888) |
[](https://www.diadata.org/docs/guides/dia-deployments#learn-more:)
Learn More:
-----------------------------------------------------------------------------------
[Lumina Core Components\
----------------------](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview)
[DIA Chain Information\
---------------------](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/chain-information)
Was this page helpful?
YesNo
[Oracle Grants](https://www.diadata.org/docs/guides/oracle-grants)
[Overview](https://www.diadata.org/docs/guides/methodologies-overview)
⌘I
---
# Audits - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/audits#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Resources
Audits
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Lumina Stack Audits](https://www.diadata.org/docs/guides/resources/audits#lumina-stack-audits)
* [Spectra Cross-chain Messaging Layer](https://www.diadata.org/docs/guides/resources/audits#spectra-cross-chain-messaging-layer)
* [Lumina Staking](https://www.diadata.org/docs/guides/resources/audits#lumina-staking)
* [Nexus Stack Audits](https://www.diadata.org/docs/guides/resources/audits#nexus-stack-audits)
* [DIAOracleV2 contract](https://www.diadata.org/docs/guides/resources/audits#diaoraclev2-contract)
[](https://www.diadata.org/docs/guides/resources/audits#lumina-stack-audits)
Lumina Stack Audits
----------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/resources/audits#spectra-cross-chain-messaging-layer)
Spectra Cross-chain Messaging Layer
[DIA Multi Scope Security Audit Report.pdf | MixBytes\
----------------------------------------------------](https://github.com/mixbytes/audits_public/blob/master/DIA/Multi%20Scope/DIA%20Multi%20Scope%20Security%20Audit%20Report.pdf)
###
[](https://www.diadata.org/docs/guides/resources/audits#lumina-staking)
Lumina Staking
[DIA Lumina Staking Security Audit Report.pdf | MixBytes\
-------------------------------------------------------](https://github.com/mixbytes/audits_public/blob/master/DIA/Lumina%20Staking/DIA%20Lumina%20Staking%20Security%20Audit%20Report.pdf)
[](https://www.diadata.org/docs/guides/resources/audits#nexus-stack-audits)
Nexus Stack Audits
--------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/resources/audits#diaoraclev2-contract)
DIAOracleV2 contract
[02\_Smart Contract Audit\_DIA\_Oracle\_v2.pdf | Chainsulting\
------------------------------------------------------------](https://content.gitbook.com/content/7BgHS2yasVJB3IUNwbdE/blobs/IB3aeLtX0zoB7evp6Fi4/02_Smart%20Contract%20Audit_DIA_Oracle_v2.pdf)
Was this page helpful?
YesNo
[Additional Notes](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes)
[Community & Support](https://www.diadata.org/docs/guides/resources/community-and-support)
⌘I
---
# Security Bounty Program - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/security-bounty-program#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Resources
Security Bounty Program
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
1. Make sure you can describe the security issue you found in a concise and reproducible way.
2. Contact us first. If you use or publish the vulnerability you will not be eligible for a bounty payout. Our contact address is [\[email protected\]](https://www.diadata.org/cdn-cgi/l/email-protection#5c2f393f292e3528251c38353d383d283d72332e3b)
.
3. Give us time to assess and address the issue. Sometimes behaviour can be perceived as security issue.
We will grade severity of reported issues and use the CVSS scale as a guideline. The ultimate decision about the severity we consider to be achieved remains in our discretion.
| | |
| --- | --- |
| Severity | Payout |
| Low | 500 - 2500 USDC |
| Medium | 2500 - 5000 USDC |
| High | 5000 - 7500 USDC |
Payouts will be conducted in an established ERC20 stablecoin like USDC. Please make sure to be able to receive ERC20 tokens.
Was this page helpful?
YesNo
[Community & Support](https://www.diadata.org/docs/guides/resources/community-and-support)
[Overview](https://www.diadata.org/docs/guides/resources/research)
⌘I
---
# DIA Staking - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/dia-staking#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
General Guides
DIA Staking
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [$DIA Staking Overview](https://www.diadata.org/docs/guides/general-guides/dia-staking#%24dia-staking-overview)
* [How It Works](https://www.diadata.org/docs/guides/general-guides/dia-staking#how-it-works)
* [Staking](https://www.diadata.org/docs/guides/general-guides/dia-staking#staking)
* [Un-staking](https://www.diadata.org/docs/guides/general-guides/dia-staking#un-staking)
* [Audit](https://www.diadata.org/docs/guides/general-guides/dia-staking#audit)
[](https://www.diadata.org/docs/guides/general-guides/dia-staking#$dia-staking-overview)
$DIA Staking Overview
------------------------------------------------------------------------------------------------------------------
Staking in DIA Lumina is the security layer. Stakers (token holders and [Feeders](https://www.diadata.org/blog/post/dia-distributed-feeder-network/)
) lock up [**$DIA**](https://www.diadata.org/token/)
to secure oracle operations. Feeders are responsible for submitting accurate and timely data onchain and are incentivized to act reliably to earn rewards. In this system, staking directly underpins the economic and security model of DIA oracles. Over time, Feeders and delegators will earn performance-based rewards; delivering inaccurate data can lead to penalties. This will evolve into a slashing and delegation framework, where token holders can back feeders of their choice and get rewarded for supporting network reliability. Learn more about the Staking layer:[The Staking Layer Behind Trustless Oracle Updates | DIA Blog\
------------------------------------------------------------](https://www.diadata.org/blog/post/dia-oracle-staking-layer/)
[](https://www.diadata.org/docs/guides/general-guides/dia-staking#how-it-works)
How It Works
------------------------------------------------------------------------------------------------
Follow [this video tutorial](https://youtu.be/ufJqdPrAb8Q)
or the following instructions below. If you have any questions, get in touch with us via [Telegram](https://t.me/diadata_org)
.
Staking is currently unavailable to residents of the UK, US, or Canada due to local regulatory requirements.
###
[](https://www.diadata.org/docs/guides/general-guides/dia-staking#staking)
Staking
1
Head to the staking page
[https://www.diadata.org/app/staking/](https://www.diadata.org/app/staking/)
Check if there are available staking opportunities. If so, connect your wallet on DIA Lasernet to get started.To add Lasernet to your wallet, go to the [Chain Information page](https://www.diadata.org/docs/resources/chain-information)
.
2
Wrap your DIA tokens
[https://www.diadata.org/app/staking/wrap/](https://www.diadata.org/app/staking/wrap/)
Enter the DIA amount you want to exchange for wDIA, review the transaction details, and hit “Wrap”.
3
Stake your wDIA tokens
[https://www.diadata.org/app/staking/](https://www.diadata.org/app/staking/)
Select an amount of wDIA tokens (min. 1 wDIA), check the transaction preview and if everything looks great, hit “Stake”.Staking takes place on DIA Lasernet Mainnet and requires gas fees to be paid for the transactions (in DIA).
4
Review your portfolio
Review your portfolio to see your staked wDIA tokens, APR, and accrued rewards. Below are the stake statuses:
* `x Staking`: total amount of wDIA tokens staked
* `x Unstaking`: total amount of wDIA tokens unstaking
* `x Available`: total amount of wDIA & DIA tokens available to stake
* `x Claimable`: total amount of wDIA tokens claimable after the unstaking period
###
[](https://www.diadata.org/docs/guides/general-guides/dia-staking#un-staking)
Un-staking
1
Head to your portfolio
[https://www.diadata.org/app/staking/](https://www.diadata.org/app/staking/)
Review your stakes under “Staked pools” section.
2
Make a request to unstake
Click on the “Unstake” button next to the stake that you want to unstake. This will change the status of your stake to `Unstaking`.By doing this, you’re initiating the unstaking process which will take 7 days to complete. Once the cooldown period is over, you can claim your prinicpal along with the rewards.
3
Withdraw your stake and claim rewards
Once the cooldown period is over, you can click on the “Claim” button to withdraw your stake and claim rewards.Your stake and rewards will be available in your wallet as wDIA tokens.
4
(Optional) Un-wrap your wDIA tokens
[https://www.diadata.org/app/staking/wrap/](https://www.diadata.org/app/staking/wrap/)
You can un-wrap your rewards to DIA tokens by entering an amount of wDIA tokens and clicking “Unwrap”.
[](https://www.diadata.org/docs/guides/general-guides/dia-staking#audit)
Audit
----------------------------------------------------------------------------------
The staking smart contract has been audited by Mixbytes. The full audit report can be found here:[DIA Lumina Staking Security Audit Report.pdf\
--------------------------------------------](https://github.com/mixbytes/audits_public/tree/master/DIA/Lumina%20Staking)
Was this page helpful?
YesNo
[Kubernetes](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node/kubernetes)
[Overview](https://www.diadata.org/docs/guides/general-guides/tutorials)
⌘I
---
# DIAOracleV2.sol - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diaoraclev2.sol#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Smart Contracts
DIAOracleV2.sol
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Copy
Ask AI
pragma solidity 0.7.4;
contract DIAOracleV2 {
mapping (string => uint256) public values;
address oracleUpdater;
event OracleUpdate(string key, uint128 value, uint128 timestamp);
event UpdaterAddressChange(address newUpdater);
constructor() {
oracleUpdater = msg.sender;
}
function setValue(string memory key, uint128 value, uint128 timestamp) public {
require(msg.sender == oracleUpdater);
uint256 cValue = (((uint256)(value)) << 128) + timestamp;
values[key] = cValue;
emit OracleUpdate(key, value, timestamp);
}
function getValue(string memory key) external view returns (uint128, uint128) {
uint256 cValue = values[key];
uint128 timestamp = (uint128)(cValue % 2**128);
uint128 value = (uint128)(cValue >> 128);
return (value, timestamp);
}
function updateOracleUpdaterAddress(address newOracleUpdaterAddress) public {
require(msg.sender == oracleUpdater);
oracleUpdater = newOracleUpdaterAddress;
emit UpdaterAddressChange(newOracleUpdaterAddress);
}
}
Was this page helpful?
YesNo
[LST Fair Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/lst-fair-price)
[DIARandomOracle.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diarandomoracle.sol)
⌘I
---
# Methodologies - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies-overview#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Methodologies
Methodologies
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Data Processing](https://www.diadata.org/docs/guides/methodologies-overview#data-processing)
* [Pricing Methodologies](https://www.diadata.org/docs/guides/methodologies-overview#pricing-methodologies)
[](https://www.diadata.org/docs/guides/methodologies-overview#data-processing)
Data Processing
--------------------------------------------------------------------------------------------------
[Trades Collection\
-----------------](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection)
[Price Aggregation\
-----------------](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation)
[Update Triggers\
---------------](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers)
[](https://www.diadata.org/docs/guides/methodologies-overview#pricing-methodologies)
Pricing Methodologies
--------------------------------------------------------------------------------------------------------------
[IR - Interquartile Range Filter\
-------------------------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
[MAIR - Moving Average with Interquartile Range\
----------------------------------------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter)
[VWAP - Volume Weighted Average Price\
------------------------------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price)
[VWAPIR - Volume Weighted Average Price with Interquartile Range\
---------------------------------------------------------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter)
[LSD Fair Price\
--------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/lst-fair-price)
Was this page helpful?
YesNo
[DIA Deployments](https://www.diadata.org/docs/guides/dia-deployments)
[Trades Collection](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection)
⌘I
---
# Overview - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-guides-overview#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Overview
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
[Bring DIA Oracles to Your Blockchain Network](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[Alephium\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/alephium)
[Arbitrum\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum)
[Astar\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/astar)
[Aurora\
------](https://www.diadata.org/docs/guides/chain-specific-guide/aurora)
[Avalanche\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche)
[Base\
----](https://www.diadata.org/docs/guides/chain-specific-guide/base)
[GEB Network\
-----------](https://www.diadata.org/docs/guides/chain-specific-guide/bevm)
[BNB Chain\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain)
[Boba Network\
------------](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network)
[BOB Build on Bitcoin\
--------------------](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin)
[Celo\
----](https://www.diadata.org/docs/guides/chain-specific-guide/celo)
[Clover\
------](https://www.diadata.org/docs/guides/chain-specific-guide/clover)
[Cross Finance (CrossFi)\
-----------------------](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi)
[Edu Chain\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain)
[Ethereum\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum)
[ETHPar\
------](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar)
[Evmos\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/evmos)
[Fantom\
------](https://www.diadata.org/docs/guides/chain-specific-guide/fantom)
[Fuse\
----](https://www.diadata.org/docs/guides/chain-specific-guide/fuse)
[Gnosis Chain\
------------](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain)
[GOAT Network\
------------](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network)
[Hydration\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/hydration)
[Kadena\
------](https://www.diadata.org/docs/guides/chain-specific-guide/kadena)
[Linea\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/linea)
[LUKSO\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/lukso)
[Metis\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/metis)
[Moonbase\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase)
[Moonbeam\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam)
[Moonriver\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver)
[Nervos\
------](https://www.diadata.org/docs/guides/chain-specific-guide/nervos)
[OKT Chain (OKX)\
---------------](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain)
[Optimism\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/optimism)
[Plume\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/plume)
[Polygon\
-------](https://www.diadata.org/docs/guides/chain-specific-guide/polygon)
[Polygon zkEVM\
-------------](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm)
[Shiden\
------](https://www.diadata.org/docs/guides/chain-specific-guide/shiden)
[Shibuya\
-------](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya)
[Shido\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/shido)
[Somnia\
------](https://www.diadata.org/docs/guides/chain-specific-guide/somnia)
[Sonic\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/sonic)
[Soroban\
-------](https://www.diadata.org/docs/guides/chain-specific-guide/soroban)
[Stacks\
------](https://www.diadata.org/docs/guides/chain-specific-guide/stacks)
[Superseed\
---------](https://www.diadata.org/docs/guides/chain-specific-guide/superseed)
[Swell\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/swell)
[Telos\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/telos)
[Unichain\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/unichain)
[Units Network\
-------------](https://www.diadata.org/docs/guides/chain-specific-guide/units-network)
[Velas\
-----](https://www.diadata.org/docs/guides/chain-specific-guide/velas)
[W Chain\
-------](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain)
[Wanchain\
--------](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain)
[XRPL\
----](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl)
[zkSync\
------](https://www.diadata.org/docs/guides/chain-specific-guide/zksync)
Was this page helpful?
YesNo
[Request a Custom Oracle](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[Alephium](https://www.diadata.org/docs/guides/chain-specific-guide/alephium)
⌘I
---
# Request a Custom Oracle - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/request-a-custom-oracle#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Request a Custom Oracle
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
DApps can get in touch with DIA in two ways:
Integrations Team
For a consultation with the DIA integrations team, reach out via Telegram or Discord.
The team will gather your requirements and provide a tailored solution proposal.
Once approved, deployment begins.👉 [Contact us on Telegram](https://t.me/DIABDteam)
Forum Request
If you already know what you need, you can directly submit a “Custom Delivery Request” on the DIA Forum.
The oracle will be deployed based on your specifications.📝 [Submit a CDR](https://forum.diadata.org/t/how-to-submit-a-dia-cdr-in-5-minutes/484)
Was this page helpful?
YesNo
⌘I
---
# updates Method - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Fetch Price Data
updates Method
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Usage](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles#usage)
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles#usage)
Usage
The Oracle maintains updates as a mapping, where each key maps to a Data struct containing the latest timestamp and value. The `updates` mapping is a key-value store where:
* Key: A unique identifier, typically a string, representing the asset or data type (e.g., DIA/USD, BTC/USD).
* Value: A Data struct containing:
* key: The identifier of the data entry (redundant for reference but useful for integrity checks).
* timestamp: The timestamp of the latest update.
* value: The most recent value associated with the key.
Here’s an example of a `DIAOracleSample` contract that consumes the `BTC/USD` price feed:
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
To deploy the contract, provide the oracle address for the destination chain you’re reading from. You can find the contract addresses in the [chain-specific guides](https://www.diadata.org/docs/guides/chain-guides-overview)
. As an example, if you want to access the oracle on Ethereum Sepolia, you’ll pass the Push Oracle address: [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0)
to the constructor above. You can also change the key to any of the supported assets (e.g. `DIA/USD`).
Was this page helpful?
YesNo
[getValue Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
[request Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
⌘I
---
# getValue Method - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Fetch Price Data
getValue Method
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Using DIAOracleV2 Interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-diaoraclev2-interface)
* [Using Solidity Library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-solidity-library)
* [Access the library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#access-the-library)
* [Methods](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#methods)
* [getPrice](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#getprice)
* [getPriceIfNotOlderThan](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#getpriceifnotolderthan)
* [Sample contract](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#sample-contract)
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-diaoraclev2-interface)
Using DIAOracleV2 Interface
-------------------------------------------------------------------------------------------------------------------------------------------
The following is an example of how to retrieve price value from a standard DIA oracle. For the purpose of this example, we will be using the following demo oracle on Ethereum: [0xCD5F…f3cB](https://sepolia.etherscan.io/address/0xcd5f78206ca1ff96ff4c043c61a2299b2febf3cb)
.
1
Access any DIA oracle smart contract.
2
Call `getValue(pair_name)` with `pair_name` being the full pair name such as `BTC/USD`. You can use the “Read” section on Etherscan to execute this call.
3
The response of the call contains four values:
1. The current asset’s price in USD with a fix-comma notation of 8 decimals.
2. The [UNIX timestamp](https://www.unixtimestamp.com/)
of the last oracle update.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128,
uint128);
}
contract DIAOracleSample {
address diaOracle;
constructor(address _oracle) {
diaOracle = _oracle;
}
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(diaOracle).getValue(key);
}
}
Find the detailed description of the functions and how to run tests on our GitHub page:
[GitHub - diadata-org/DIA-integration-sample\
-------------------------------------------](https://github.com/diadata-org/DIA-integration-sample)
Solidity integration example
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-solidity-library)
Using Solidity Library
---------------------------------------------------------------------------------------------------------------------------------
DIA has a dedicated Solidity library to facilitate the integration of DIA oracles in your own contracts. The library consists of two functions, `getPrice` and `getPriceIfNotOlderThan`.
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#access-the-library)
Access the library
Copy
Ask AI
import { DIAOracleLib } from "./libraries/DIAOracleLib.sol";
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#methods)
Methods
####
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#getprice)
getPrice
Copy
Ask AI
function getPrice(
address oracle,
string memory key
)
public
view
returns (uint128 latestPrice, uint128 timestampOflatestPrice);
Returns the price of a specified asset along with the update timestamp. Parameters:
| Name | Type | Description |
| --- | --- | --- |
| oracle | address | Address of the oracle that we want to use |
| key | string | The asset that we want to use e.g. “ETH/USD” |
Return Values:
| Name | Type | Description |
| --- | --- | --- |
| latestPrice | uint128 | Price of the specified asset returned by the DIAOracle |
| timestampOflatestPrice | uint128 | The update timestamp of the latest price |
####
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#getpriceifnotolderthan)
getPriceIfNotOlderThan
Copy
Ask AI
function getPriceIfNotOlderThan(
address oracle,
string memory key,
uint128 maxTimePassed
)
public
view
returns (uint128 price, bool inTime)
{
Checks if the oracle price is older than `maxTimePassed` Parameters:
| Name | Type | Description |
| --- | --- | --- |
| oracle | address | Address of the oracle that we want to use |
| key | string | The asset that we want to use e.g. “ETH/USD” |
| maxTimePassed | uint128 | The maximum acceptable time passed in seconds since the the price was updated |
Return Values:
| Name | Type | Description |
| --- | --- | --- |
| price | uint128 | Price of the specified asset returned by the DIAOracle |
| inTime | bool | A boolian that is `true` if the price was updated at most maxTimePassed seconds ago, otherwise `false` |
Find a detailed integration example and how to run a test on our GitHub page:[GitHub - diadata-org/DIAOracleLib\
---------------------------------](https://github.com/diadata-org/DIAOracleLib)
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#sample-contract)
Sample contract
Copy
Ask AI
pragma solidity ^0.8.13;
import { DIAOracleLib } from "./libraries/DIAOracleLib.sol";
contract DIAOracleSample {
error PriceTooOld();
address diaOracle;
constructor(address _oracle) {
diaOracle = _oracle;
}
function getPrice(
string memory key
) external view returns (uint128 latestPrice) {
(latestPrice, ) = DIAOracleLib.getPrice(diaOracle, key);
}
function checkPriceAge(
string memory key,
uint128 maxTimePassed
) external view returns (uint128 price) {
bool inTime;
(price, inTime) = DIAOracleLib.getPriceIfNotOlderThan(
diaOracle,
key,
maxTimePassed
);
if (!inTime) revert PriceTooOld();
}
}
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
[updates Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
⌘I
---
# request Method - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Fetch Price Data
request Method
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How It Works](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#how-it-works)
* [Request Creation](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#request-creation)
* [Message Delivery Process](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#message-delivery-process)
* [Response and Callback](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#response-and-callback)
* [Making a Price Request](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#making-a-price-request)
* [Solidity](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#solidity)
* [JavaScript](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#javascript)
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#how-it-works)
How It Works
-----------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#request-creation)
Request Creation
A request is made from the source chain for an asset symbol whose price is required (e.g. ETH/USD) which then passes through the chain’s mailbox to be then delivered to the destination chain. You can check the available contract address on testnet based on the destination chain you’re reading from [here](https://www.diadata.org/docs/guides/chain-guides-overview)
. The request body is formatted as follows in JavaScript:
Copy
Ask AI
const key = "ETH/USD"; // Assuming key is an address or a bytes32 value
const requestBody = abiCoder.encode(
["string"], // Types of the parameters
[key] // Values to encode
);
And this is how it is formatted in Solidity:
Copy
Ask AI
bytes memory requestBody = abi.encode("WBTC/USD");
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#message-delivery-process)
Message Delivery Process
Once a request is created, it is transmitted to the Hyperlane mailbox. The message is then relayed to the `OracleRequestRecipient` contract , where the price data is fetched from the Oracle Metadata Contract.
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#response-and-callback)
Response and Callback
Upon receiving the request, the DIA chain initiates a transaction to deliver the message back to the end contract on the source chain. The recipient contract on the source chain must implement the IMessageRecipient interface, which includes a handle function that will receive the price quotation.
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#making-a-price-request)
Making a Price Request
-------------------------------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#solidity)
Solidity
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // DIA testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // DIA testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles#javascript)
JavaScript
In this example, we’ll be sending an ETH/USD price request from Base Sepolia to DIA Lasernet. Start by cloning the `Spectra Interoperability` repository to your local machine and switching to the `deploy`branch:[GitHub - diadata-org/Spectra-interoperability\
---------------------------------------------](https://github.com/diadata-org/Spectra-interoperability)
Copy
Ask AI
git clone https://github.com/diadata-org/Spectra-interoperability.git
git checkout deploy
Then install the node packages and compile the contracts using hardhat:
Copy
Ask AI
npm install
npx hardhat compile
Next, `cd contracts` folder, and export your wallet’s private key in your terminal as follows:
Copy
Ask AI
export PRIVATE_KEY=[paste_here]
Now, the `sendMessage.mjs` script will trigger a `request` transaction to fetch the latest price of ETH/USD from DIA lasernet. To run the script:
Copy
Ask AI
npx hardhat run scripts/sendMessage.mjs --network base_sepolia
You can also run the script on other networks by changing the value passed to the `--network` flag (e.g. `--network sepolia`). Once the price update takes place on the destination chain, which you can track from the [hyperlane explorer](https://www.diadata.org/docs/reference/cross-chain-messaging)
, you can check the txn logs for the `ReceivedMessage`event on the pull oracle contract or call the `updates`function.

The price returned is around 2,718$!
Was this page helpful?
YesNo
[updates Method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
[Overview](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness)
⌘I
---
# Solidity - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Generate Randomness
Solidity
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Example: Dice Game](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity#example%3A-dice-game)
Copy
Ask AI
{
"round": 1597683,
"randomness": "24138936fcbf7fc3951c928158be6998cee3af622142d0790333608d17a5c5f6",
"signature": "8c04905c0adf34f1fb007915d9ccc7d07b97305fc63952726f9367c87f36ab687c5e190c151f6ac4d760a9e009fc54230adb8513885449d649a229bc727be9ff347bdbce1c609cebf993b6ae57133fbcf23f96b15dbd3510cb5f2ade6b30b647",
"previous_signature": "ada42197a2db89866da4c44348f77f7868e41e961ec32e636b912d43c625386afae9e54944ac573047dbd227ee495b52059586c8d8cd0edfe18cc15ca0666a66651da1d62b12af2d0fac19735bed9298690a593571965c3ad7c7b11947e76ec0"
}
The DIA randomness smart contract is structured as follows
Copy
Ask AI
pragma solidity ^0.8.0;
contract DIARandomOracle {
struct Random {
string randomness;
string signature;
string previousSignature;
}
mapping (uint256 => Random) public values;
uint256 public lastRound = 0;
address public oracleUpdater;
event OracleUpdate(string key, uint128 value, uint128 timestamp);
event UpdaterAddressChange(address newUpdater);
constructor() {
oracleUpdater = msg.sender;
}
function setRandomValue(uint256 _round, string memory _randomness, string memory _signature, string memory _previousSignature) public {
require(msg.sender == oracleUpdater,"not a updater");
require(lastRound<_round, "old round");
lastRound = _round;
values[_round] = Random(_randomness, _signature, _previousSignature);
}
function getValue(uint256 _round) external view returns (Random memory) {
return values[_round];
}
function updateOracleUpdaterAddress(address newOracleUpdaterAddress) public {
require(msg.sender == oracleUpdater,"not a updater");
oracleUpdater = newOracleUpdaterAddress;
emit UpdaterAddressChange(newOracleUpdaterAddress);
}
function getRandomValueFromRound(uint256 _round) external view returns (string memory) {
return values[_round].randomness;
}
function getRandomValueFromRoundWithSignature(uint256 _round) external view returns (Random memory) {
return values[_round];
}
function getLastRound() public view returns(uint256) {
return lastRound;
}
}
Users can call `getLastRound()`to obtain the ID of the latest published round. To obtain the randomness of a certain round, users can call `getRandomValueFromRound(uint256 _round)`using the obtaines round ID. The signature can also be requested by calling `getRandomValueFromRoundWithSignature(uint256 _round)`. Please be aware that you should always let all inputs commit before any randomness is used in a later round. For example, if you build a lottery, only call randomness after the last participant has committed their stake. To show this in an example, we will build a simple dice game.
[](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity#example:-dice-game)
Example: Dice Game
----------------------------------------------------------------------------------------------------------------------------
Imagine a simple game where two players play against each other. Both throw a dice and the user with the higher rolled number wins. In case of a draw, nobody wins. Both players need to “seed” the game with an initial number between 1 and 6, that will be added to the randomness (modulo 6). It is a fair game where everyone has a 50% chance of winning.
Copy
Ask AI
pragma solidity ^0.8.0;
import "../DIARandomOracle.sol";
contract DiceGame {
address public randomOracle;
uint256 seed1 = 0;
uint256 seed2 = 0;
uint256 latestRoundId = 0;
constructor(address oracle) {
randomOracle = oracle;
}
function getRandomValue(uint256 _round) public view returns (string memory) {
return DIARandomOracle(randomOracle).getRandomValueFromRound(_round);
}
function commitPlayer1(uint256 seed) external {
require(seed > 0, "Seed must be between 1 and 6");
require(seed < 7, "Seed must be between 1 and 6");
seed1 = seed;
latestRoundId = DIARandomOracle(randomOracle).getLastRound();
}
function commitPlayer2(uint256 seed) external {
require(seed > 0, "Seed must be between 1 and 6");
require(seed < 7, "Seed must be between 1 and 6");
seed2 = seed;
latestRoundId = DIARandomOracle(randomOracle).getLastRound();
}
function rollDice() public view returns (uint) {
require(seed1 > 0, "Player 1 needs to commit their seed!");
require(seed2 > 0, "Player 2 needs to commit their seed!");
uint _round = latestRoundId + 10;
require(DIARandomOracle(randomOracle).getLastRound() >= _round, "Wait for the randmoness round to roll your dice.");
string memory rand = getRandomValue(_round);
uint256 player1result = (uint256(keccak256(abi.encodePacked(rand))) + seed1) % 6;
uint256 player2result = (uint256(keccak256(abi.encodePacked(rand))) + seed2) % 6;
seed1 = 0;
seed2 = 0;
if (player1result > player2result) {
return 1;
} else if (player2result > player1result) {
return 2;
} else {
return 0;
}
}
}
Both players need to commit their seeds. The latest published roundID is stored for the duration of the game. When both committed their values and the wait time of 10 rounds has passed, the dice can be rolled and the player ID of the winner is returned (or 0 in case of a draw).
Make sure to never directly query the latest randomness value, otherwise the miner and the randomness oracle can interfere with the result. Always commit values before the randomness is used in a later round.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness)
[Fund your Oracle](https://www.diadata.org/docs/guides/how-to-guides/fund-the-oracle)
⌘I
---
# Data Sources - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Sources
Data Sources
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Verifiable Randomness](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#verifiable-randomness)
* [Request a Custom Oracle](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#request-a-custom-oracle)
Every price point starts with raw trading data from cryptocurrency exchanges (CEXes, & DEXes). We go straight to the source, capturing and storing trade data with the highest precision possible. Explore the sources that power our token price feeds:
[CEXes data\
----------](https://www.diadata.org/docs/dia-stack/data-sources/cexes-data)
[DEXes data\
----------](https://www.diadata.org/docs/dia-stack/data-sources/dexes-data)
For an up-to-date list of data sources, visit:
[\
\
Data Sources | DIA App\
----------------------](https://www.diadata.org/app/source/defi/)
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#verifiable-randomness)
Verifiable Randomness
-----------------------------------------------------------------------------------------------------------------------------
Explore how DIA leverages drand’s distributed randomness beacon to provide verifiable, unbiased random numbers for on-chain applications like games, lotteries, and NFT drops:
[Distributed Randomness Beacon\
-----------------------------](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness)
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
Was this page helpful?
YesNo
[Spectra (Cross-chain Messaging Layer)](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
[CEXes Data](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data)
⌘I
---
# Distributed Randomness Beacon - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Sources
Distributed Randomness Beacon
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [What is randomness?](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#what-is-randomness)
* [Who needs randomness?](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#who-needs-randomness)
* [On-chain publishing process](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#on-chain-publishing-process)
* [Risk Mitigation](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#risk-mitigation)
To offer distributed and verifiable randomness on-chain, DIA leverages [drand](https://drand.love/)
’s distributed randomness beacon. The beacon is run by a group of independent actors called the League of Entropy. The [League of Entropy](https://www.cloudflare.com/leagueofentropy/)
is a collaborative project to provide a verifiable, decentralized randomness beacon. A decentralized randomness beacon combines randomness from multiple independent high entropy sources to generate a truly unbiased random number for anyone that may need a public source of randomness. Please visit the project site at [drand.love](https://drand.love/)
for the most up-to-date information on current operations. To learn how the how distributed randomness beacon is built please [visit this link](https://drand.love/docs/specification/)
.
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#what-is-randomness)
What is randomness?
--------------------------------------------------------------------------------------------------------------------------
Randomness is the property of lacking any sensible predictability. It is very difficult to create random events on-chain due to the deterministic nature of any EVM or EVM-like environment. Centralized randomness is susceptible for attacks by the randomness source, as a single non-random outcome cannot be distinguished from a random one. Thus, having a single RNG provide randomness via an oracle is not enough.
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#who-needs-randomness)
Who needs randomness?
------------------------------------------------------------------------------------------------------------------------------
Random numbers can be very relevant for on-chain applications such as games, lotteries, prediction markets, or NFT launches. Relying on pseudo-random values like the last blockhash can be manipulated by miners and is not advisable. Drand run distributed nodes to produce their randomness beacon. They use [Pedersen’s DKG (Distributed Key Generation) protocol](https://drand.love/docs/cryptography/#distributed-key-generation-dkg)
to create collective private/public key. Participants in their League of Entropy then generate randomness in rounds and broadcast it together with its signature.
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#on-chain-publishing-process)
On-chain publishing process
-------------------------------------------------------------------------------------------------------------------------------------------
From random number generation to on-chain distribution, DIA xRandom operates as follows:
1. **Drand randomness generation:** in every drand epoch (currently set at 30s for the existing LoE beacons, but [planned to be decreased](https://drand.love/blog/2022/02/21/multi-frequency-support-and-timelock-encryption-capabilities/)
on future “unchained” beacons) each of the nodes that form the drand network generates a partial signature, which it broadcasts to the rest of the nodes. Once any node has enough, i.e., a threshold number of signatures, it computes the new randomness beacon, which is the hash of the signature aggregate.
2. **Drand randomness propagation and consumption**: the new beacon is propagated through the network to all other nodes. Any node can verify and accept or reject the hash of the signature (i.e., beacon) that it received. Any client or application can consume randomness out of band (i.e., without needing to be part of the drand network) either through [the public HTTP APIs](https://drand.love/developer/http-api/)
or through [libp2p’s pubsub protocol](https://drand.love/developer/gossipsub/#public-endpoints)
, Gossipsub. Clients can also verify that the randomness they received is indeed the one produced by the drand network.
3. **DIA on-chain distribution:** the final randomness signature is shipped on-chain as an oracle smart contract. In order to effectively and securely execute these on-chain transactions, DIA has built a robust, decentralised node infrastructure — dubbed DIA xNode. DIA xNode is a network of third-party, decentralized node providers that grant DIA the blockchain infrastructure to push data on-chain ensuring high rate limits.
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness#risk-mitigation)
Risk Mitigation
-------------------------------------------------------------------------------------------------------------------
It is important to understand the risks of the randomness oracle before using it and to be able to mitigate them. An extensive risk evaluation of the underlying [drand.love](https://drand.love/)
protocol can be found [in their documentation](https://drand.love/docs/security-model/#notations)
. All risks listed there also affect the randomness guest oracle, as it serves as an underlying data provider. Additionally, there are new risks introduced by using the oracle.
| Risk | Possible Mitigation |
| --- | --- |
| Oracle stops serving data | Check that the oracle has recent updates in its history. |
| Specific Round is missed by the oracle | Have your dApp use the next round if a certain round is unavailable (but later ones exist). |
| Oracle serves compromised data | Check the associated BLS signature provided by drand (Note: Currently not availabe on most EVMs). |
Was this page helpful?
YesNo
[DEXes Data](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data)
⌘I
---
# Update Triggers - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Processing
Update Triggers
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Update triggers](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers#update-triggers)
This feed can be accessed off-chain using either RestAPI or DIA GraphQL, which allows for greater adaptability and direct modification of feed attributes. Off-chain **and on-chain delivery methods can be configured with custom** _**update triggers**_, enhancing the feed’s usability and reliability across various applications.
[](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers#update-triggers)
Update triggers
-------------------------------------------------------------------------------------------------------------------------
Update triggers are the rules that dictate how oracles refresh to mirror the most recent value of the data feed. These triggers are adaptable and can be tailored to optimally cater to particular scenarios, such as the price feeds of assets with low liquidity. Each oracle can be customized to push data feed updates live based on the following parameters:
| Trigger | Description | Example |
| --- | --- | --- |
| **Time-based (push)** | Updates are triggered in predefined time intervals (seconds, minutes or hours) | _15 minutes_ |
| **Deviation-based (push)** | Updates are triggered by a deviation from the last reported value. | _5% deviation_ |
| **Time + deviation (push)** | The oracle will update whenever any of the two conditions is met. | _5% deviation + 24h time_ |
Was this page helpful?
YesNo
[Price Aggregation](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation)
[IR: Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
⌘I
---
# DIARandomOracle.sol - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diarandomoracle.sol#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Smart Contracts
DIARandomOracle.sol
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Copy
Ask AI
pragma solidity ^0.8.0;
contract DIARandomOracle {
struct Random {
string randomness;
string signature;
string previousSignature;
}
mapping (uint256 => Random) public values;
uint256 public lastRound = 0;
address public oracleUpdater;
event OracleUpdate(string key, uint128 value, uint128 timestamp);
event UpdaterAddressChange(address newUpdater);
constructor() {
oracleUpdater = msg.sender;
}
function setRandomValue(uint256 _round, string memory _randomness,string memory _signature,string memory _previousSignature) public {
require(msg.sender == oracleUpdater,"not a updater");
require(lastRound<_round, "old round");
lastRound = _round;
values[_round] = Random(_randomness,_signature,_previousSignature);
}
function getValue(uint256 _round) external view returns ( Random memory) {
return values[_round];
}
function updateOracleUpdaterAddress(address newOracleUpdaterAddress) public {
require(msg.sender == oracleUpdater,"not a updater");
oracleUpdater = newOracleUpdaterAddress;
emit UpdaterAddressChange(newOracleUpdaterAddress);
}
function getRandomValueFromRound(uint256 _round ) external view returns (string memory){
return values[_round].randomness;
}
function getRandomValueFromRoundWithSignature(uint256 _round ) external view returns (Random memory){
return values[_round];
}
function getLastRound()public view returns(uint256){
return lastRound;
}
}
Was this page helpful?
YesNo
[DIAOracleV2.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diaoraclev2.sol)
[OracleRequestRecipient.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/OracleRequestRecipient.sol)
⌘I
---
# Trades Collection - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Processing
Trades Collection
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Granular trade data sourcing](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#granular-trade-data-sourcing)
* [Type of data sources and their aggregation](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#type-of-data-sources-and-their-aggregation)
* [On oracle feed manipulation and risk](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#on-oracle-feed-manipulation-and-risk)
[](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#granular-trade-data-sourcing)
Granular trade data sourcing
-----------------------------------------------------------------------------------------------------------------------------------------------------
By leveraging a network of WebSockets and decentralized node providers, DIA Nexus retrieves token trade ticks and metadata from exchanges. This, in turn, represents an enormous data availability (≈15bn trades/day) to, later on, enable DIA to capture the highest data precision and build flexible and customizable price feeds. Trades for every asset pair get recorded and collected into blocks of 120 seconds into the DIA Nexus platform. For each block, a range of filters are applied. These are functions to get a single price point from the collection of trades in a block. For example, the Moving Average filter returns the volume-weighted moving average of the trades block. Filters are calculated for each asset pair on each exchange individually, as well as for each asset on all exchanges combined. This combined filter result represents the result closest to the true “whole market” that can be determined by this system. Learn more about [token filters here](https://www.diadata.org/docs/guides/methodologies-overview)
.
[](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#type-of-data-sources-and-their-aggregation)
Type of data sources and their aggregation
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
DIA Nexus retrieves trading data from as close to the data source as possible in order to ensure the highest precision possible. The data retrieval is processed through a series of asset collectors:
* For **centralised exchanges** such as Coinbase, Kraken or Binance, DIA scrapers collect trades directly from the exchange’s databases. The data collection happens in retrieval periods from 1 to 7 seconds and varies from exchange to exchange. All trading data is retrieved through Rest APIs or WebSocket APIs, developed and maintained by the respective trading platform. More on [CEX trade data collection](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data)
.
* For **decentralised exchanges**, DIA collects data from decentralized exchanges on various blockchains by subscribing to swap events in the corresponding liquidity pools – LPs. In contrast to centralized exchanges, in decentralized exchanges, it is possible to retrieve trading data directly from the respective blockchain by subscribing to the corresponding pool events. Examples of sources are Uniswap, curve.finance or PancakeSwap. [More on DEX trade data collection](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data)
.
[](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection#on-oracle-feed-manipulation-and-risk)
On oracle feed manipulation and risk
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
One of the biggest risks for DeFi and Web3 applications is not having enough sources for its oracle and using a feed that relies on one single market. These single-source oracles, as explained in the beginning, are relatively easily exposed to price manipulations and man-in-the-middle attacks. DIA is designed to avoid these scenarios by leveraging multiple markets as sources, including CEXs and DEXs and enabling the customisation of methodologies and sources to cater best for the needs of specific use cases. So far in DeFi’s (short) history, a failure in the oracle node network has never been the reason for a loss of funds, but attacks on the markets that provide the price data to the sources. Take for instance the example of the Cream Finance attack in October 2021. DIA prioritises the transparency aspect of its data and oracle services and enables any dApp developer and user to know precisely how the data feeding the application is built, what data sources are been used, and what methodologies are been applied.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/methodologies-overview)
[Price Aggregation](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation)
⌘I
---
# Run a Feeder - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/run-a-feeder#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Run a Feeder
Run a Feeder
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Please refer to our [Wiki](https://github.com/diadata-org/decentral-feeder/wiki)
page and [GitHub](https://github.com/diadata-org/decentral-feeder)
repository for the latest documentation on feeder nodes and releases.
Start by reviewing the [hardware specifications](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs)
and proceed to [running the node](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node)
based on your preferred deployment method. If you’re interested in becoming an official feeder in DIA’s feeder network, please reach out to our team over our [dedicated communication channels](https://www.diadata.org/docs/guides/resources/community-and-support)
.
Was this page helpful?
YesNo
[PushOracleReceiver.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/PushOracleReceiver.sol)
[Hardware Specs](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs)
⌘I
---
# Price Aggregation - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Processing
Price Aggregation
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Step 1: Data cleaning and outlier detection](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation#step-1%3A-data-cleaning-and-outlier-detection)
* [Step 2: Price determination methodology application](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation#step-2%3A-price-determination-methodology-application)
[](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation#step-1:-data-cleaning-and-outlier-detection)
Step 1: Data cleaning and outlier detection
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The price estimation process needs to be resilient against trades with prices diverting from the current market price. Reasons for diverting trades can be market manipulation, errors or flash crashes on certain exchanges, among others. To avoid these irregularities, the first processing step involves data cleaning and outliers removal, to avoid building a feed using data that is completely away from the median. Detecting and excluding outliers is an important processing task, especially in low-volume and illiquid markets. Otherwise, a single low-volume trade can offset the price estimation and serve as a base token for other assets, leading to a chain reaction of misaligned price data. How does this look in practice? By applying an Interquartile Range (IR) filter, DIA excludes data points and entire sets that lie outside of an acceptable range relative to the interquartile range. The filter analyses all trades of a predefined time range and sorts them by their recorded price. After that, this range of prices is divided into four price blocks, the quartiles. The boundaries of the full price range determine the boundaries of the first and the last quartile. To clear out outliers, any trades falling into the first or the last quartile are filtered out and subsequently, only trades falling into the “middle” quartiles move forward into further processing.
[Learn more about outliers and market manipulation\
-------------------------------------------------](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
[](https://www.diadata.org/docs/guides/methodologies/data-processing/price-aggregation#step-2:-price-determination-methodology-application)
Step 2: Price determination methodology application
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Now that we understand how the process of clearing diverting trade data works, how is the final price actually calculated from all remaining data points? To retrieve a single USD price value for every asset, DIA uses trade-based price determination methodologies. These filters are functions to get a single price point from a collection of trades in a block. Filters are calculated for each asset on each exchange individually, as well as for each asset on all exchanges combined. This combined filter result represents the result closest to the true “whole market” that can be determined by this system. As each use case requires different data needs, DIA can provide multiple filters to best serve the requirements of each application. Let’s look at a couple of examples:
* **Volume Weighted Average Price (VWAP):** is a methodology for trade-based price determination that takes into account the different volumes of trades. All trades from the queried time range are collected and weighted by their volume. Weighting means that the (normalized) volume of the trade is multiplied by its executed price. This is done by accumulating the previously calculated volume-price-products of all trades and dividing them by the sum of all volumes combined.
* **Moving Average with Interquartile Range Filter (MAIR):** in this case, all the trades collected in the queried time range are ordered by timestamp. For each second in this time range, a block is created where trades are put into. As soon as the collection of all trades for each block is finalized, then it’s weighted against the volume for each data point and the weighted average price is taken to arrive at the final price
[See all pricing methodologies\
-----------------------------](https://www.diadata.org/docs/guides/methodologies-overview)
Additionally, DIA can always implement new on-demand methodologies as well as build new methodologies together with users.
Was this page helpful?
YesNo
[Trades Collection](https://www.diadata.org/docs/guides/methodologies/data-processing/trades-collection)
[Update Triggers](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers)
⌘I
---
# OracleRequestRecipient.sol - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/smart-contracts/OracleRequestRecipient.sol#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Smart Contracts
OracleRequestRecipient.sol
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Copy
Ask AI
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.29;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IMessageRecipient } from "./interfaces/IMessageRecipient.sol";
import { IOracleTrigger } from "./interfaces/oracle/IOracleTrigger.sol";
import { TypeCasts } from "./libs/TypeCasts.sol";
import { IInterchainSecurityModule, ISpecifiesInterchainSecurityModule } from "./interfaces/IInterchainSecurityModule.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
using TypeCasts for address;
contract OracleRequestRecipient is
Ownable,
IMessageRecipient,
ISpecifiesInterchainSecurityModule,
ReentrancyGuard
{
IInterchainSecurityModule public interchainSecurityModule;
mapping(uint32 => mapping(bytes32 => bool)) public whitelistedSenders;
address private oracleTriggerAddress;
event ReceivedCall(address indexed caller, string key);
event WhitelistUpdated(
uint32 indexed origin,
bytes32 indexed sender,
bool status
);
event OracleTriggerUpdated(
address indexed oldAddress,
address indexed newAddress
);
event InterchainSecurityModuleUpdated(
address indexed previousISM,
address indexed newISM
);
event TokensRecovered(address indexed recipient, uint256 amount);
error EmptyOracleRequestData();
error OracleTriggerNotSet();
error SenderNotWhitelisted(bytes32 sender, uint32 origin);
error UnauthorizedCaller(address caller);
error InvalidSenderAddress();
error AlreadyWhitelisted(bytes32 sender, uint32 origin);
error InvalidISMAddress();
error InvalidOracleTriggerAddress();
error InvalidReceiver();
error NoBalanceToWithdraw();
error TransferFailed();
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _data
) external payable virtual override nonReentrant {
if (_data.length == 0) revert EmptyOracleRequestData();
if (oracleTriggerAddress == address(0)) revert OracleTriggerNotSet();
if (!whitelistedSenders[_origin][_sender])
revert SenderNotWhitelisted(_sender, _origin);
address sender = address(uint160(uint256(_sender)));
if (msg.sender != IOracleTrigger(oracleTriggerAddress).getMailBox()) {
revert UnauthorizedCaller(msg.sender);
}
string memory key = abi.decode(_data, (string));
emit ReceivedCall(sender, key);
IOracleTrigger(oracleTriggerAddress).dispatch{ value: msg.value }(
_origin,
sender,
key
);
}
function addToWhitelist(
uint32 _origin,
bytes32 _sender
) external onlyOwner {
if (_sender == bytes32(0)) {
revert InvalidSenderAddress();
}
if (whitelistedSenders[_origin][_sender]) {
revert AlreadyWhitelisted(_sender, _origin);
}
whitelistedSenders[_origin][_sender] = true;
emit WhitelistUpdated(_origin, _sender, true);
}
function removeFromWhitelist(
uint32 _origin,
bytes32 _sender
) external onlyOwner {
if (_sender == bytes32(0)) {
revert InvalidSenderAddress();
}
whitelistedSenders[_origin][_sender] = false;
emit WhitelistUpdated(_origin, _sender, false);
}
function setInterchainSecurityModule(address _ism) external onlyOwner {
if (_ism == address(0)) {
revert InvalidISMAddress();
}
emit InterchainSecurityModuleUpdated(
address(interchainSecurityModule),
_ism
);
interchainSecurityModule = IInterchainSecurityModule(_ism);
}
function setOracleTriggerAddress(
address _oracleTrigger
) external onlyOwner {
if (_oracleTrigger == address(0)) {
revert InvalidOracleTriggerAddress();
}
emit OracleTriggerUpdated(oracleTriggerAddress, _oracleTrigger);
oracleTriggerAddress = _oracleTrigger;
}
receive() external payable {}
function retrieveLostTokens(address receiver) external onlyOwner {
if (receiver == address(0)) {
revert InvalidReceiver();
}
uint256 balance = address(this).balance;
if (balance == 0) {
revert NoBalanceToWithdraw();
}
(bool success, ) = payable(receiver).call{ value: balance }("");
if (!success) {
revert TransferFailed();
}
emit TokensRecovered(receiver, balance);
}
function getOracleTriggerAddress() external view returns (address) {
return oracleTriggerAddress;
}
}
Was this page helpful?
YesNo
[DIARandomOracle.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diarandomoracle.sol)
[PushOracleReceiver.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/PushOracleReceiver.sol)
⌘I
---
# PushOracleReceiver.sol - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/smart-contracts/PushOracleReceiver.sol#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Smart Contracts
PushOracleReceiver.sol
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Copy
Ask AI
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.29;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { IPushOracleReceiver } from "./interfaces/oracle/IPushOracleReceiver.sol";
import { IInterchainSecurityModule } from "./interfaces/IInterchainSecurityModule.sol";
import { ProtocolFeeHook } from "./ProtocolFeeHook.sol";
import { TypeCasts } from "./libs/TypeCasts.sol";
contract PushOracleReceiver is IPushOracleReceiver, Ownable {
using TypeCasts for address;
IInterchainSecurityModule public interchainSecurityModule;
address payable public paymentHook;
address public trustedMailBox;
mapping(string => Data) public updates;
error InvalidISMAddress();
modifier validateAddress(address _address) {
if (_address == address(0)) revert InvalidAddress();
_;
}
function handle(
uint32 _origin,
bytes32 _sender,
bytes calldata _data
) external payable override validateAddress(paymentHook) {
if (msg.sender != trustedMailBox) revert UnauthorizedMailbox();
if (address(interchainSecurityModule) == address(0))
revert InvalidISMAddress();
(string memory key, uint128 timestamp, uint128 value) = abi.decode(
_data,
(string, uint128, uint128)
);
if (updates[key].timestamp >= timestamp) {
return;
}
Data memory newData = Data({ timestamp: timestamp, value: value });
updates[key] = newData;
emit ReceivedMessage(key, timestamp, value);
uint256 gasPrice = tx.gasprice;
uint256 fee = ProtocolFeeHook(payable(paymentHook)).gasUsedPerTx() *
gasPrice;
bool success;
{
(success, ) = paymentHook.call{ value: fee }("");
}
if (!success) revert AmountTransferFailed();
}
function setInterchainSecurityModule(
address _ism
) external onlyOwner validateAddress(_ism) {
emit InterchainSecurityModuleUpdated(
address(interchainSecurityModule),
_ism
);
interchainSecurityModule = IInterchainSecurityModule(_ism);
}
function setPaymentHook(
address payable _paymentHook
) external onlyOwner validateAddress(_paymentHook) {
emit PaymentHookUpdated(paymentHook, _paymentHook);
paymentHook = _paymentHook;
}
function setTrustedMailBox(
address _mailbox
) external onlyOwner validateAddress(_mailbox) {
emit TrustedMailBoxUpdated(trustedMailBox, _mailbox);
trustedMailBox = _mailbox;
}
function retrieveLostTokens(
address receiver
) external onlyOwner validateAddress(receiver) {
uint256 balance = address(this).balance;
if (balance == 0) revert NoBalanceToWithdraw();
(bool success, ) = payable(receiver).call{ value: balance }("");
if (!success) revert AmountTransferFailed();
emit TokensRecovered(receiver, balance);
}
receive() external payable {}
fallback() external payable {}
}
Was this page helpful?
YesNo
[OracleRequestRecipient.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/OracleRequestRecipient.sol)
[Overview](https://www.diadata.org/docs/guides/general-guides/run-a-feeder)
⌘I
---
# Chain Information - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/resources/chain-information#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Chain Information
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Mainnet](https://www.diadata.org/docs/resources/chain-information#mainnet)
* [Testnet](https://www.diadata.org/docs/resources/chain-information#testnet)
[](https://www.diadata.org/docs/resources/chain-information#mainnet)
Mainnet
--------------------------------------------------------------------------------
| | |
| --- | --- |
| **Chain name** | DIA Lasernet |
| **Chain ID** | 1050 |
| **Block explorer** | [https://explorer.diadata.org/](https://explorer.diadata.org/) |
| **RPC URL** | [https://rpc.diadata.org/](https://rpc.diadata.org/) |
| **Websocket** | wss://rpc.diadata.org |
| **Gas token** | [DIA on ETH](https://etherscan.io/address/0x84ca8bc7997272c7cfb4d0cd3d55cd942b3c9419) |
[](https://www.diadata.org/docs/resources/chain-information#testnet)
Testnet
--------------------------------------------------------------------------------
| | |
| --- | --- |
| **Chain name** | DIA Lasernet Testnet |
| **Chain ID** | 100640 |
| **Block explorer** | [https://testnet-explorer.diadata.org](https://testnet-explorer.diadata.org/) |
| **RPC URL** | [https://testnet-rpc.diadata.org](https://testnet-rpc.diadata.org/) |
| **Websocket** | wss://testnet-rpc.diadata.org |
| **Gas token** | [DIA on ETH Sepolia](https://sepolia.etherscan.io/address/0xa35a89390FcA5dB148859114DADe875280250Bd1) |
| **Faucet** | [https://faucet.diadata.org/](https://faucet.diadata.org/) |
Was this page helpful?
YesNo
⌘I
---
# MAIR: Moving Average with Interquartile Range Filter - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pricing Methodologies
MAIR: Moving Average with Interquartile Range Filter
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Trade Collection](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#trade-collection)
* [Price Calculation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#price-calculation)
* [Filter Application](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#filter-application)
* [Implementation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#implementation)
The MAIR (Moving Average with Interquartile Range Clearing) filter is the application of the Moving Average filter to data that was previously cleared by the [Interquartile Range](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
filtering system.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#trade-collection)
Trade Collection
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
All trades from the queried time range are ordered by timestamp. For each second in the time range, there exists a “slot” where trades are put into.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#price-calculation)
Price Calculation
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
As soon as all trades in the block have been finalized (usually 120 seconds per block), for each 1 second slot the closing price is taken. These slots are then weighted against the volume for each data point and the weighted average price is taken to arrive at the final price. The result is then returned as the result of the filter operation.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#filter-application)
Filter Application
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The MAIR filter is used in DIA’s price determination. Our price quotations are the latest MAIR-120 filter values, i.e., the filter results from a 120 second interval of all recorded trades for an asset.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter#implementation)
Implementation
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
The filter is implemented as part of the FiltersBlockService [in this file in our Github repository](https://github.com/diadata-org/diadata/blob/master/internal/pkg/filtersBlockService/FilterMA.go)
.
Was this page helpful?
YesNo
[IR: Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
[VWAP: Volume Weighted Average Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price)
⌘I
---
# VWAP: Volume Weighted Average Price - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pricing Methodologies
VWAP: Volume Weighted Average Price
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Trade Collection](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#trade-collection)
* [Price Calculation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#price-calculation)
* [Filter Application](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#filter-application)
* [Implementation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#implementation)
VWAP (Volume Weighted Average Price) is a methodology for trade-based price determination that takes into account the different volumes of trades.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#trade-collection)
Trade Collection
----------------------------------------------------------------------------------------------------------------------------------------------------
All trades from the queried time range are collected and weighted by their volume. Weighting means that the (normalized) volume of the trade is multiplied by its executed price.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#price-calculation)
Price Calculation
------------------------------------------------------------------------------------------------------------------------------------------------------
As soon as the block has been finalized, the VWAP price of these prices is calculated. This is done by accumulating the previously calculated volume-price-products of all trades and dividing them by the sum of all volumes combined. The result is then returned as the result of the filter operation.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#filter-application)
Filter Application
--------------------------------------------------------------------------------------------------------------------------------------------------------
The VWAP filter is used in DIA’s price determination. Our API can display the latest VWAP filter values, i.e., the filter results from a 120 second interval of all recorded trades for an asset.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price#implementation)
Implementation
------------------------------------------------------------------------------------------------------------------------------------------------
The filter is implemented as part of the FiltersBlockService in [this file in our Github repository](https://github.com/diadata-org/diadata/blob/master/internal/pkg/filtersBlockService/FilterVWAP.go)
.
Was this page helpful?
YesNo
[MAIR: Moving Average with Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter)
[VWAPIR: Volume Weighted Average Price with Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter)
⌘I
---
# VWAPIR: Volume Weighted Average Price with Interquartile Range Filter - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pricing Methodologies
VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Filter Application](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter#filter-application)
* [Implementation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter#implementation)
The VWAPIR (Volume Weighted Average Price with Interquartile Range Clearing) filter is the application of the [Volume Weighted Average Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price)
filter to data that was previously cleared by the [Interquartile Range](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter)
filtering system.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter#filter-application)
Filter Application
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The VWAPIR filter is used in DIA’s price determination. Our API can display the latest MEDIR-120 filter values, i.e., the filter results from a 120 second interval of all recorded trades for an asset.
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter#implementation)
Implementation
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The filter is implemented as part of the FiltersBlockService in [this file in our Github repository](https://github.com/diadata-org/diadata/blob/master/internal/pkg/filtersBlockService/FilterVWAPIR.go)
.
Was this page helpful?
YesNo
[VWAP: Volume Weighted Average Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwap-volume-weighted-average-price)
[LST Fair Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/lst-fair-price)
⌘I
---
# LST Fair Price - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/lst-fair-price#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pricing Methodologies
LST Fair Price
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
The usual structure for calculating fair price of Liquid Staked Tokens (LST) is as follows: LSTfairprice\=BaseAssetPrice×(LockedBaseAsset/IssuedLST)LST\_{fairprice} = BaseAssetPrice \\times (LockedBaseAsset / IssuedLST)LSTfairprice\=BaseAssetPrice×(LockedBaseAsset/IssuedLST) The main components of the formula are:
1. _BaseAssetPrice_ - price of the non-staked asset which is locked against LST (e.g. for stETH, ETH acts as a base asset)
2. _LockedBaseAsset_ - number of base assets locked in the LST smart contract (e.g. for stETH, quantity of ETH locked in stETH smart contract)
3. _IssuedLST_ - amount of LST tokens issued (e.g. for stETH, total supply of stETH represents it)
This is the standard methodology and the data is queried directly from the Smart Contract of the LST issuer. It allows sudden devaluation in case malicious actor manages to mint a large amount of LST tokens and ensures that the issuer is keeping the funds safe. Depending on the contract type we apply the following logic for valuation:
* If the assets can be redeemed 1:1 (e.g. stETH), price will always be the same as the base asset, even though the collateralization rate is higher (if collateralization ratio is lower, the price will be adjusted to negative side)
* If the LST asset increases in value against the base asset because rewards are not paid out directly but rather represent a share of the total pool, the pricing will be dynamic depending on the reewards accrued in the pool (e.g. rETH)
These are the standard methodologies applied to the feeds but some assets might require custom methodologies.
Was this page helpful?
YesNo
[VWAPIR: Volume Weighted Average Price with Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter)
[DIAOracleV2.sol](https://www.diadata.org/docs/guides/general-guides/smart-contracts/diaoraclev2.sol)
⌘I
---
# IR: Interquartile Range Filter - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pricing Methodologies
IR: Interquartile Range Filter
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Outliers and Market Manipulation](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#outliers-and-market-manipulation)
* [Data Preprocessing](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#data-preprocessing)
* [Advanced Filtering](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#advanced-filtering)
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#outliers-and-market-manipulation)
Outliers and Market Manipulation
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
The price estimation process needs to be robust against trades with prices that are diverting from the current market price of an asset pair. Reasons for diverting trades can be market manipulation, errors, flash crashes on certain exchanges, or other market irregularities. Detecting and excluding outliers and market manipulation is an important data processing task, especially in small and (somewhat) intransparent markets. Otherwise, a single low-volume trade can offset the price estimation and serve as a base token for other assets, leading to a chain reaction of misaligned price data. We calculate our cryptocurrency spot-prices using 120-second moving average (SMA) with a weighting of trade volumes (VWAP). Small volume trades have a proportionally smaller influence on the determined price than bigger volume trades. In order to create reliable pricing, we also exclude data points and sets entirely that lie outside of an [acceptable range](https://en.wikipedia.org/wiki/Interquartile_range#Outliers)
relative to the [interquartile range](https://en.wikipedia.org/wiki/Interquartile_range)
of all data points.
###
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#data-preprocessing)
Data Preprocessing
The Interquartile Range filter in DIA examined all trades in a trades block (i.e. all trades in the predefined time range) and sorts them by their recorded price. After that, this range of prices is divided into four price blocks, the _Quartiles_. The boundaries of the full price range also determine the boundaries of the first and the last quartile. To clear out outliers, any trades falling into the first or the last quartile are filtered out and subsequently, only trades falling into the “middle” quartiles are returned to the caller.
###
[](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/ir-interquartile-range-filter#advanced-filtering)
Advanced Filtering
After this clearing process is finished, the data is ready to be processed further in other filters like the [Moving Average](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter)
or [Volume Weighted Average Price](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter)
filter.
Was this page helpful?
YesNo
[Update Triggers](https://www.diadata.org/docs/guides/methodologies/data-processing/update-triggers)
[MAIR: Moving Average with Interquartile Range Filter](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter)
⌘I
---
# Additional Notes - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Additional Notes
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Access data endpoints and UIs](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#access-data-endpoints-and-uis)
* [Kubernetes Dashboard](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#kubernetes-dashboard)
* [Data stores](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#data-stores)
* [Other routes available after forward:](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#other-routes-available-after-forward%3A)
* [Contribute to DIA main package](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#contribute-to-dia-main-package)
* [Debug Influx writes](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#debug-influx-writes)
* [Use a custom pre-populated image data](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#use-a-custom-pre-populated-image-data)
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#access-data-endpoints-and-uis)
Access data endpoints and UIs
-------------------------------------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#kubernetes-dashboard)
Kubernetes Dashboard
To start the Kubernetes Dashboard, use the following command:
Copy
Ask AI
minikube dashboard --url=true --port=8083
Once the dashboard service is ready, you can visit the web interface in your browser.
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#data-stores)
Data stores
Forward the ports of the data stores services to localhost:
* PostgreSQL Database: `kubectl port-forward deployment/postgres 5432:5432`
* Redis Cache: `kubectl port-forward deployment/redis 6379:6379`
* InfluxDB Database: `kubectl port-forward deployment/influx 8086:8086`
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#other-routes-available-after-forward:)
Other routes available after forward:
* REST Server: port 8081
* GraphQL: port 1111, and [Web UI](http://localhost:1111/)
* Kafka: port 8080, and [AKHQ Web UI](http://localhost:8080/)
* Grafana: port 3000, and [Web UI](http://localhost:3000/)
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#contribute-to-dia-main-package)
Contribute to DIA main package
---------------------------------------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
go mod edit -replace github.com/diadata-org/diadata=/mnt/env-context
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#debug-influx-writes)
Debug Influx writes
-----------------------------------------------------------------------------------------------------------------------------
To debug InfluxDB writes, just change points in batch to see more frequent writes to influx (`pkg/model/db.go`):
Copy
Ask AI
influxMaxPointsInBatch = 10
[](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes#use-a-custom-pre-populated-image-data)
Use a custom pre-populated image data
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
A `.testenv.local` file at root folder is required to pull private images from Docker:
Copy
Ask AI
data_docker_registry=docker.io
data_docker_username=my_user
data_docker_password="my_password"
data_docker_email=my_email@domain.com
Change image of pre-populated data from [`deployments/k8s-yaml/data-postgres-prepopulated.yaml`](https://github.com/diadata-org/diadata/blob/74070895a72a0add703c8268e31870a7f63d3e4b/deployments/k8s-yaml/data-postgres-prepopulated.yaml#L20)
file
Was this page helpful?
YesNo
[Add a New Liquidity Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper)
[Audits](https://www.diadata.org/docs/guides/resources/audits)
⌘I
---
# Research - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/research#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Research
Research
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Here are some examples of our work:
[Return Rates in Crypto Farming\
------------------------------](https://www.diadata.org/docs/resources/research/return-rates-in-crypto-farming)
[Crypto Volatility Index\
-----------------------](https://www.diadata.org/docs/resources/research/cvi)
DIA research is dedicated for expanding the oracles ecosystem with novel solutions. Treat these as indicative of our work and feel free to contact us if you’d like to develop something new & exciting!
Was this page helpful?
YesNo
[Security Bounty Program](https://www.diadata.org/docs/guides/resources/security-bounty-program)
[Return Rates in Crypto Farming](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming)
⌘I
---
# Build a Scraper - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Build a Scraper
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
DIA has a dedicated infrastructure for testing various integrations into the system. In the following pages you can learn how it works. Start here:
[Development Cluster Stack\
-------------------------](https://www.diadata.org/docs/guides/how-to-guides/tutorials/development-cluster-stack)
Or proceed directly to the scraper integration tutorials:
[Add a new exchange scraper\
--------------------------](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-exchange-scraper)
[Add a new foreign scraper\
-------------------------](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-foreign-scraper)
[Add a new liquidity scraper\
---------------------------](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-liquidity-scraper)
Was this page helpful?
YesNo
[DIA Staking](https://www.diadata.org/docs/guides/general-guides/dia-staking)
[Development Cluster Stack](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack)
⌘I
---
# zkSync - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
zkSync
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/zksync#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[XRP Ledger (XRPL)](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl)
[Oracle Grants](https://www.diadata.org/docs/guides/oracle-grants)
⌘I
---
# Alephium - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Alephium
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Token Price Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#token-price-feeds)
* [Oracle details](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-details)
* [Oracle configuration](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-configuration)
* [Asset feeds](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#asset-feeds)
* [How to access data](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#how-to-access-data)
* [Verifiable Randomness](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#verifiable-randomness)
* [Oracle details](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-details-2)
* [Oracle configuration](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-configuration-2)
* [How to access data](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#how-to-access-data-2)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#token-price-feeds)
Token Price Feeds
=============================================================================================================
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-details)
Oracle details
-------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [285zrkZTPpUCpjKg9E3z238VmpUBQEAbESGsJT6yX7Rod](https://explorer.alephium.org/addresses/285zrkZTPpUCpjKg9E3z238VmpUBQEAbESGsJT6yX7Rod) |
| Testnet | [216wgM3Xi5uBFYwwiw2T7iZoCy9vozPJ4XjToW74nQjbV](https://testnet.alephium.org/addresses/216wgM3Xi5uBFYwwiw2T7iZoCy9vozPJ4XjToW74nQjbV) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-configuration)
Oracle configuration
-------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.2% and 120 seconds |
| **Heartbeat** | 10mins |
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#asset-feeds)
Asset feeds
-------------------------------------------------------------------------------------------------
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| BTC | BTC/USD | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| USDC | USDC/USD | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| ETH | ETH/USD | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| WBTC | WBTC/USD | [WBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| USDT | USDT/USD | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| ALPH | ALPH/USD | [ALPH markets](https://www.diadata.org/app/price/asset/Alephium/tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq/) |
| AYIN | AYIN/USD | [AYIN markets](https://www.diadata.org/app/price/asset/Alephium/vT49PY8ksoUL6NcXiZ1t2wAmC7tTPRfFfER8n3UCLvXy/) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#how-to-access-data)
How to access data
---------------------------------------------------------------------------------------------------------------
Locate one of the deployed contracts (either testnet or mainnet) and call the `getValue` function. This function expects one parameter, which is the symbols of the asset you want to retrieve and a “/USD”, so for example for the Bitcoin price the parameter must be “BTC/USD”. This will return two values:
1. The price of the asset, with 8 decimals.
2. The timestamp of the last update in Unix time format, in UTC timezone.
Below is the `DIAOracle` contract implementation in [Ralph](https://docs.alephium.org/ralph/)
:
Copy
Ask AI
Contract DIAOracle(
mut admin: Address
) extends DIAOracleBase(admin) implements IDIAOracle {
mapping[ByteVec, DIAOracleValue] onchainValues
event OracleUpdate(key: ByteVec, value: U256, timestamp: U256)
const MaxBatchSize = 10
enum ErrorCodes {
InvalidBatchSize = 1
InvalidKey = 2
}
pub fn getValue(key: ByteVec) -> DIAOracleValue {
if (!onchainValues.contains!(key)) {
panic!(ErrorCodes.InvalidKey)
}
return onchainValues[key]
}
@using(preapprovedAssets = true)
pub fn setValue(key: ByteVec, value: U256, timestamp: U256) -> () {
checkAdmin(callerAddress!())
updateValue{admin -> ALPH: mapEntryDeposit!()}(key, value, timestamp)
}
@using(preapprovedAssets = true)
pub fn setMultipleValues(
keys: [ByteVec; 10],
values: [U256; 10],
timestamps: [U256; 10],
batchSize: U256
) -> () {
checkAdmin(callerAddress!())
assert!(batchSize <= MaxBatchSize, ErrorCodes.InvalidBatchSize)
for (let mut i = 0; i < batchSize; i = i + 1) {
updateValue{admin -> ALPH: mapEntryDeposit!()}(
keys[i],
values[i],
timestamps[i]
)
}
}
@using(preapprovedAssets = true)
fn updateValue(key: ByteVec, value: U256, timestamp: U256) -> () {
if (!onchainValues.contains!(key)) {
onchainValues.insert!(admin, key, DIAOracleValue{value, timestamp})
} else {
onchainValues[key] = DIAOracleValue{value, timestamp}
}
emit OracleUpdate(key, value, timestamp)
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#verifiable-randomness)
Verifiable Randomness
=====================================================================================================================
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-details-2)
Oracle details
---------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Alephium Mainnet | [v1v4cBXP9L7M9ryZZCx7tuXuNb9pnDLGb3JJkPBpbR1Z](https://explorer.alephium.org/addresses/v1v4cBXP9L7M9ryZZCx7tuXuNb9pnDLGb3JJkPBpbR1Z) |
| Alephium Testnet | [217k7FMPgahEQWCfSA1BN5TaxPsFovjPagpujkyxKDvS3](https://testnet.alephium.org/addresses/217k7FMPgahEQWCfSA1BN5TaxPsFovjPagpujkyxKDvS3) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-configuration-2)
Oracle configuration
---------------------------------------------------------------------------------------------------------------------
The oracle uses [drand](https://drand.love/)
randomness from the quicknet mainnet to provide randomness on Alephium.
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#how-to-access-data-2)
How to access data
-----------------------------------------------------------------------------------------------------------------
To consume randomness data, you’ll need to invoke the `getLastRound` method on the oracle contract. It will return the round ID of the latest update. Using this round ID, you can call `getRandomValue` and will receive a return value of that randomness, the round ID and the BLS signature from the drand API. Note that round IDs are used round-robin and will repeat after 1000 iterations. Below is the `DIARandomOracle` contract implementation in [Ralph](https://docs.alephium.org/ralph/)
:
Copy
Ask AI
Contract DIARandomOracle(
mut admin: Address,
mut lastRound: U256
) extends DIAOracleBase(admin) implements IDIARandomOracle {
mapping[U256, DIARandomValue] randomValues
event OracleUpdate(
round: U256,
randomness: ByteVec,
signature: ByteVec
)
const MaxSlot = 1000
enum ErrorCodes {
InvalidRound = 1
RoundKeyNotExist = 2
RoundIsExpired = 3
}
pub fn getLastRound() -> U256 {
return lastRound
}
pub fn getRandomValue(realRound: U256) -> DIARandomValue {
let roundKey = realRound % MaxSlot
assert!(randomValues.contains!(roundKey), ErrorCodes.RoundKeyNotExist)
let randomValue = randomValues[roundKey]
assert!(randomValue.round == realRound, ErrorCodes.RoundIsExpired)
return randomValue
}
@using(preapprovedAssets = true, updateFields = true)
pub fn setRandomValue(value: DIARandomValue) -> () {
checkAdmin(callerAddress!())
assert!(value.round > lastRound, ErrorCodes.InvalidRound)
let roundKey = value.round % MaxSlot
lastRound = value.round
if (randomValues.contains!(roundKey)) {
randomValues[roundKey] = value
} else {
randomValues.insert!(admin, roundKey, value)
}
emit OracleUpdate(value.round, value.randomness, value.signature)
}
}
You can learn more [here](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#oracle-grants-program)
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 Alephium. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/alephium#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/chain-guides-overview)
[Arbitrum](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum)
⌘I
---
# Arbitrum - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Arbitrum
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#demo-oracles)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#additional-details)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#demo-oracles)
Demo Oracles
---------------------------------------------------------------------------------------------------
Demo oracles are available for testing the new fully verifiable & decentralized [Lumina stack](https://www.diadata.org/docs/dia-stack/overview)
on Arbitrum Mainnet & Testnet:
Token Price Feeds
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-contracts)
Oracle Contracts
##### Mainnet
| Chain | Oracle Type | Address |
| --- | --- | --- |
| Mainnet | Push Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://arbiscan.io/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| Mainnet | Pull Oracle | [0xE74B7D236A97eED9026926073cBb436638266888](https://arbiscan.io/address/0xe74b7d236a97eed9026926073cbb436638266888) |
##### Testnet
| Chain | Oracle Type | Address |
| --- | --- | --- |
| Sepolia | Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.arbiscan.io/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| Sepolia | Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.arbiscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
RWA Price Feeds
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-contracts-2)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#mainnet)
Mainnet
| Chain | Oracle Type | Address |
| --- | --- | --- |
| Mainnet | Push Oracle | [0xEB3b12FB37090ACc6773B59619799941536FA198](https://arbiscan.io/address/0xEB3b12FB37090ACc6773B59619799941536FA198) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-configuration-2)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 1% and 120 seconds |
| **Heartbeat** | 24h |
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#available-asset-feeds-2)
Available Asset Feeds
* APPL
* XAU/USD
* USD/EUR
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#additional-details)
Additional Details
---------------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Arbitrum bridge’s components on mainnet and testnet below:
Mainnet
* [MailBox Contract](https://arbiscan.io/address/0x979ca5202784112f4738403dbec5d0f3b9daabb9)
* [ISM Contract](https://arbiscan.io/address/0x92f0f4c9f769ed83609cd2ccd1acce224bbc8cbf)
* [Protocol Fee Hook Contract](https://arbiscan.io/address/0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB)
Testnet
* [MailBox Contract](https://sepolia.arbiscan.io/address/0x598face78a4302f11e3de0bee1894da0b2cb71f8)
* [ISM Contract](https://sepolia.arbiscan.io/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e)
* [Protocol Fee Hook Contract](https://sepolia.arbiscan.io/address/0x611c8b288c642336136a436d7125ac49fa71468b)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#oracle-grants-program)
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 Arbitrum. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Alephium](https://www.diadata.org/docs/guides/chain-specific-guide/alephium)
[Astar](https://www.diadata.org/docs/guides/chain-specific-guide/astar)
⌘I
---
# Astar - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/astar#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Astar
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/astar#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/astar#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/astar#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/astar#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/astar#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/astar#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Arbitrum](https://www.diadata.org/docs/guides/chain-specific-guide/arbitrum)
[Aurora](https://www.diadata.org/docs/guides/chain-specific-guide/aurora)
⌘I
---
# Avalanche - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Avalanche
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#oracle-grants-program)
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 Avalanche. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Aurora](https://www.diadata.org/docs/guides/chain-specific-guide/aurora)
[Base](https://www.diadata.org/docs/guides/chain-specific-guide/base)
⌘I
---
# Aurora - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Aurora
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-contracts)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#getvalue-method)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#demo-oracles)
Demo Oracles
-------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-contracts)
Oracle Contracts
| Chain | Address |
| --- | --- |
| Mainnet | [0xf4e9C0697c6B35fbDe5a17DB93196Afd7aDFe84f](https://explorer.aurora.dev/address/0xf4e9C0697c6B35fbDe5a17DB93196Afd7aDFe84f) |
| Testnet | [0xf4e9C0697c6B35fbDe5a17DB93196Afd7aDFe84f](https://explorer.testnet.aurora.dev/address/0xf4e9C0697c6B35fbDe5a17DB93196Afd7aDFe84f) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 30 minutes |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| BTC | BTC/USD | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| USDC | USDC/USD | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| DIA | DIA/USD | [DIA markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on Aurora mainnet. 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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0xf4e9C0697c6B35fbDe5a17DB93196Afd7aDFe84f;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#oracle-grants-program)
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 Aurora. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/aurora#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Astar](https://www.diadata.org/docs/guides/chain-specific-guide/astar)
[Avalanche](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche)
⌘I
---
# BNB Chain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
BNB Chain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#oracle-grants-program)
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 BNB Chain. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[GEB Network](https://www.diadata.org/docs/guides/chain-specific-guide/bevm)
[Boba Network](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network)
⌘I
---
# BOB Build on Bitcoin - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
BOB Build on Bitcoin
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#oracle-grants-program)
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 BOB Build on Bitcoin. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin#support)
Support
-----------------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Boba Network](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network)
[Celo](https://www.diadata.org/docs/guides/chain-specific-guide/celo)
⌘I
---
# GEB Network - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
GEB Network
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#how-to-access-data)
How to Access Data
-----------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#oracle-grants-program)
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 BNB Chain. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/bevm#support)
Support
-------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Base](https://www.diadata.org/docs/guides/chain-specific-guide/base)
[BNB Chain](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain)
⌘I
---
# Boba Network - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Boba Network
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/boba-network#support)
Support
---------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[BNB Chain](https://www.diadata.org/docs/guides/chain-specific-guide/bnb-chain)
[BOB Build on Bitcoin](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin)
⌘I
---
# Celo - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/celo#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Celo
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/celo#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/celo#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/celo#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/celo#how-to-access-data)
How to Access Data
-----------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/celo#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/celo#support)
Support
-------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[BOB Build on Bitcoin](https://www.diadata.org/docs/guides/chain-specific-guide/bob-build-on-bitcoin)
[Clover](https://www.diadata.org/docs/guides/chain-specific-guide/clover)
⌘I
---
# Clover - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/clover#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Clover
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/clover#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/clover#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/clover#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/clover#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/clover#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/clover#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Celo](https://www.diadata.org/docs/guides/chain-specific-guide/celo)
[CrossFi](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi)
⌘I
---
# Evmos - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Evmos
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/evmos#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[ETHPar](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar)
[Fantom](https://www.diadata.org/docs/guides/chain-specific-guide/fantom)
⌘I
---
# Fantom - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Fantom
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/fantom#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Evmos](https://www.diadata.org/docs/guides/chain-specific-guide/evmos)
[Fuse](https://www.diadata.org/docs/guides/chain-specific-guide/fuse)
⌘I
---
# Fuse - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Fuse
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#how-to-access-data)
How to Access Data
-----------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/fuse#support)
Support
-------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Fantom](https://www.diadata.org/docs/guides/chain-specific-guide/fantom)
[Gnosis Chain](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain)
⌘I
---
# Gnosis Chain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Gnosis Chain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain#support)
Support
---------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Fuse](https://www.diadata.org/docs/guides/chain-specific-guide/fuse)
[GOAT Network](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network)
⌘I
---
# Base - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/base#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Base
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/base#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/base#oracle-contracts)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/base#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/base#testnet)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/base#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/base#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/base#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/base#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/base#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/base#additional-details)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/base#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/base#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/base#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#demo-oracles)
Demo Oracles
-----------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#oracle-contracts)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#mainnet)
Mainnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://basescan.org/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| Pull Oracle | [0xE74B7D236A97eED9026926073cBb436638266888](https://arbiscan.io/address/0xe74b7d236a97eed9026926073cbb436638266888) |
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#testnet)
Testnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.basescan.org/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.basescan.org/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#how-to-access-data)
How to Access Data
-----------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // DIA testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // DIA testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#additional-details)
Additional Details
-----------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Base bridge’s components on mainnet and testnet below:
Mainnet
* [MailBox Contract](https://arbiscan.io/address/0x979ca5202784112f4738403dbec5d0f3b9daabb9)
* [ISM Contract](https://arbiscan.io/address/0x92f0f4c9f769ed83609cd2ccd1acce224bbc8cbf)
* [Protocol Fee Hook Contract](https://arbiscan.io/address/0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB)
Testnet
* [MailBox Contract](https://sepolia.basescan.org/address/0x6966b0e55883d49bfb24539356a2f8a673e02039)
* [ISM Contract](https://sepolia.basescan.org/address/0xb869617a3cfcda07a4cc230d996120074e7c817e)
* [Protocol Fee Hook Contract](https://sepolia.basescan.org/address/0x611C8b288c642336136a436d7125AC49FA71468B)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/base#support)
Support
-------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Avalanche](https://www.diadata.org/docs/guides/chain-specific-guide/avalanche)
[GEB Network](https://www.diadata.org/docs/guides/chain-specific-guide/bevm)
⌘I
---
# Nervos - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Nervos
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
To consume price data, invoke a read function on the oracle contract that takes an asset key as a parameter. For example, 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/nervos#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Moonriver](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver)
[OKT Chain (OKX)](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain)
⌘I
---
# ETHPar - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
ETHPar
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#getvalue-method)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#oracle-details)
Oracle Details
-----------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0xA3014376A788b55450c5C1F2bA2A8694a79f0b97](https://dora.ethpar.net/address/0xA3014376A788b55450c5C1F2bA2A8694a79f0b97) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#oracle-configuration)
Oracle Configuration
-----------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#available-asset-feeds)
Available Asset Feeds
-------------------------------------------------------------------------------------------------------------------
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| WBTC | WBTC/USD | [WBTC Markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| WETH | WETH/USD | [WETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on ETHPar mainnet. If you pass `WBTC/USD` as the key, it will return the most recent price of WBTC in USD with **8 decimal places** (e.g. 9601458065403 is $96,014.58065403) along with the Unix timestamp of the last price update.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0xA3014376A788b55450c5C1F2bA2A8694a79f0b97;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Ethereum](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum)
[Evmos](https://www.diadata.org/docs/guides/chain-specific-guide/evmos)
⌘I
---
# CrossFi - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
CrossFi
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Token Price Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#token-price-feeds)
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#testnet)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#getvalue-method)
* [Verifiable Randomness](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#verifiable-randomness)
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-details-2)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-configuration-2)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#how-to-access-data-2)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#support)
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#token-price-feeds)
Token Price Feeds
============================================================================================================
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-details)
Oracle Details
------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0x33df80cdf0c9ff686261b11263d9f4a3ccc3d07f](https://xfiscan.com/address/0x859e221ada7cebdf5d4040bf6a2b8959c05a4233) |
| Testnet | [0x859e221ada7cebdf5d4040bf6a2b8959c05a4233](https://test.xfiscan.com/address/0x33df80cdf0c9ff686261b11263d9f4a3ccc3d07f) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-configuration)
Oracle Configuration
------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#available-asset-feeds)
Available Asset Feeds
--------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#mainnet)
Mainnet
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| USDT | USDT/USD | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| XFI | XFI/USD | [XFI Markets](https://www.diadata.org/app/price/asset/Ethereum/0xC8CeED65E236F7d6fB378b8715f9e6912e486A54/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#testnet)
Testnet
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| WETH | WETH/USD | [WETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
| WBTC | WBTC/USD | [WBTC Markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| USDT | USDT/USD | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| DAI | DAI/USD | [DAI Markets](https://www.diadata.org/app/price/asset/Ethereum/0x6B175474E89094C44Da98b954EedeAC495271d0F/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| FRAX | FRAX/USD | [FRAX Markets](https://www.diadata.org/app/price/asset/Ethereum/0x853d955aCEf822Db058eb8505911ED77F175b99e/) |
| LINK | LINK/USD | [LINK Markets](https://www.diadata.org/app/price/asset/Ethereum/0x514910771AF9Ca656af840dff83E8264EcF986CA/) |
| WBNB | WBNB/USD | [WBNB Markets](https://www.diadata.org/app/price/asset/BinanceSmartChain/0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c/) |
| EUR | EUR/USD | [EUR Markets](https://www.diadata.org/app/price/asset/Fiat/978/) |
| XFI | XFI/USD | [XFI Markets](https://www.diadata.org/app/price/asset/Ethereum/0xC8CeED65E236F7d6fB378b8715f9e6912e486A54/) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on CrossFi Testnet. If you pass `WBTC/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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0x859e221ada7cebdf5d4040bf6a2b8959c05a4233;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#verifiable-randomness)
Verifiable Randomness
====================================================================================================================
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-details-2)
Oracle Details
| Chain | Address |
| --- | --- |
| Testnet | [0xad19b5b3a0bf2bacf028ed6cc9e3fc153cb405b6](https://test.xfiscan.com/address/0xad19b5b3a0bf2bacf028ed6cc9e3fc153cb405b6) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#oracle-configuration-2)
Oracle Configuration
The oracle uses [drand](https://drand.love/)
randomness from quicknet to provide randomness on CrossFi.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#how-to-access-data-2)
How to Access Data
To consume randomness data, you’ll need to invoke the `getLastRound` method on the oracle contract. It will return the round ID of the latest update. Using this round ID, you can call `getRandomValue` and will receive a return value of that randomness, the round ID and the BLS signature from the drand API. Note that round IDs are used round-robin and will repeat after 1000 iterations. Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/generate-randomness/solidity)
for detailed steps on fetching random values from the oracle in your contract. You can learn more about the randomness protocol [here](https://www.diadata.org/docs/dia-stack/data-products/verifiable-randomness)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi#support)
Support
----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Clover](https://www.diadata.org/docs/guides/chain-specific-guide/clover)
[Edu Chain](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain)
⌘I
---
# Metis - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/metis#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Metis
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/metis#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/metis#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/metis#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/metis#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/metis#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/metis#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[LUKSO](https://www.diadata.org/docs/guides/chain-specific-guide/lukso)
[Moonbase](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase)
⌘I
---
# Moonriver - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Moonriver
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Moonbeam](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam)
[Nervos](https://www.diadata.org/docs/guides/chain-specific-guide/nervos)
⌘I
---
# Plume - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/plume#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Plume
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/plume#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/plume#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/plume#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/plume#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/plume#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/plume#oracle-grants-program)
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 Plume. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/plume#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/plume#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Optimism](https://www.diadata.org/docs/guides/chain-specific-guide/optimism)
[Polygon](https://www.diadata.org/docs/guides/chain-specific-guide/polygon)
⌘I
---
# Moonbase - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Moonbase
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Metis](https://www.diadata.org/docs/guides/chain-specific-guide/metis)
[Moonbeam](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam)
⌘I
---
# OKT Chain (OKX) - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
OKT Chain (OKX)
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Nervos](https://www.diadata.org/docs/guides/chain-specific-guide/nervos)
[Optimism](https://www.diadata.org/docs/guides/chain-specific-guide/optimism)
⌘I
---
# Edu Chain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Edu Chain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#getvalue-method)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#oracle-details)
Oracle Details
--------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0x56BddAc934157c213c37864e3443E5196b47a1d1](https://educhain.blockscout.com/address/0x56BddAc934157c213c37864e3443E5196b47a1d1) |
| Testnet | [0x6626f442ebc679f7e35bc62e36e3c1e8820c81c9](https://edu-chain-testnet.blockscout.com/address/0x6626f442eBc679f7e35bC62E36E3c1e8820C81C9) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#oracle-configuration)
Oracle Configuration
--------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#available-asset-feeds)
Available Asset Feeds
----------------------------------------------------------------------------------------------------------------------
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| EDU | EDU/USD | [EDU markets](https://www.diadata.org/app/price/asset/BinanceSmartChain/0xBdEAe1cA48894A1759A8374D63925f21f2Ee2639/) |
| ETH | ETH/USD | [ETH markets](http://diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| WBTC | WBTC/USD | [WBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| USDC | USDC/USD | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | USDT/USD | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| DAI | DAI/USD | [DAI markets](https://www.diadata.org/app/price/asset/Ethereum/0x6B175474E89094C44Da98b954EedeAC495271d0F/) |
| ARB | ARB/USD | [ARB markets](https://www.diadata.org/app/price/asset/Arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548/) |
| wstETH | wstETH/USD | [wstETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0/) |
| GRAIL | GRAIL/USD | [GRAIL markets](https://www.diadata.org/app/price/asset/Arbitrum/0x3d9907F9a368ad0a51Be60f7Da3b97cf940982D8/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#getvalue-method)
getValue Method
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](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#access-the-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from the oracle on EduChain testnet using the **IDIAOracleV2** interface. If you pass `WBTC/USD` as the key, it will return the most recent price of BTC in USD with **8 decimal places** (e.g. 8258705325665 is $82,587.05325665) along with the Unix timestamp of the last price update.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer {
address immutable ORACLE = 0x6626f442ebc679f7e35bc62e36e3c1e8820c81c9;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[CrossFi](https://www.diadata.org/docs/guides/chain-specific-guide/crossfi)
[Ethereum](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum)
⌘I
---
# Moonbeam - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Moonbeam
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/moonbeam#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Moonbase](https://www.diadata.org/docs/guides/chain-specific-guide/moonbase)
[Moonriver](https://www.diadata.org/docs/guides/chain-specific-guide/moonriver)
⌘I
---
# Linea - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/linea#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Linea
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/linea#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/linea#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/linea#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/linea#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/linea#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/linea#oracle-grants-program)
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 Linea. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/linea#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/linea#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Kadena](https://www.diadata.org/docs/guides/chain-specific-guide/kadena)
[LUKSO](https://www.diadata.org/docs/guides/chain-specific-guide/lukso)
⌘I
---
# GOAT Network - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
GOAT Network
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#mainnet)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#getvalue-method)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-details)
Oracle Details
-----------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| GOAT Alpha Mainnet | [0x458DAfFcB1507835AAB0C8F2722d1196E9a4fFaB](https://explorer.goat.network/address/0x458DAfFcB1507835AAB0C8F2722d1196E9a4fFaB) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-configuration)
Oracle Configuration
-----------------------------------------------------------------------------------------------------------------------
| Parameter | Value |
| --- | --- |
| Pricing Methodology | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| Deviation (%) & Refresh Frequency | 0.5% and 120 seconds |
| Heartbeat | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#available-asset-feeds)
Available Asset Feeds
-------------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#mainnet)
Mainnet
| Asset Ticker | getValue(**key**) | Asset Markets |
| --- | --- | --- |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| USDT | USDT/USD | [USDT Markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| DOGE | DOGE/USD | [DOGE Markets](https://www.diadata.org/app/price/asset/Dogechain/0x0000000000000000000000000000000000000000/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on GOAT Network mainnet. 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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0x458DAfFcB1507835AAB0C8F2722d1196E9a4fFaB;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#oracle-grants-program)
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 GOAT Network. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network#support)
Support
---------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Gnosis Chain](https://www.diadata.org/docs/guides/chain-specific-guide/gnosis-chain)
[Hydration](https://www.diadata.org/docs/guides/chain-specific-guide/hydration)
⌘I
---
# Polygon - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Polygon
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#oracle-grants-program)
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 Polygon. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon#support)
Support
----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Plume](https://www.diadata.org/docs/guides/chain-specific-guide/plume)
[Polygon zkEVM](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm)
⌘I
---
# Soroban - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Soroban
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------
To consume price data, invoke a read function on the oracle contract that takes an asset key as a parameter. For example, 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/soroban#support)
Support
----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Sonic](https://www.diadata.org/docs/guides/chain-specific-guide/sonic)
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks)
⌘I
---
# Shiden - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Shiden
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/shiden#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Polygon zkEVM](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm)
[Shibuya](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya)
⌘I
---
# Shido - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/shido#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Shido
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/shido#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/shido#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/shido#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shido#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shido#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/shido#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Shibuya](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya)
[Somnia](https://www.diadata.org/docs/guides/chain-specific-guide/somnia)
⌘I
---
# Polygon zkEVM - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Polygon zkEVM
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/polygon-zkevm#support)
Support
----------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Polygon](https://www.diadata.org/docs/guides/chain-specific-guide/polygon)
[Shiden](https://www.diadata.org/docs/guides/chain-specific-guide/shiden)
⌘I
---
# Shibuya - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Shibuya
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/shibuya#support)
Support
----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Shiden](https://www.diadata.org/docs/guides/chain-specific-guide/shiden)
[Shido](https://www.diadata.org/docs/guides/chain-specific-guide/shido)
⌘I
---
# Swell - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/swell#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Swell
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/swell#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/swell#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/swell#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/swell#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/swell#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/swell#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Superseed](https://www.diadata.org/docs/guides/chain-specific-guide/superseed)
[Telos](https://www.diadata.org/docs/guides/chain-specific-guide/telos)
⌘I
---
# Hydration - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Hydration
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#oracle-details)
* [WBTC, DOT, USDT and USDC oracle](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#wbtc%2C-dot%2C-usdt-and-usdc-oracle)
* [tBTC, Aave, ETH, wstETH, sUSDs, & sUSDe oracle](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#tbtc%2C-aave%2C-eth%2C-wsteth%2C-susds%2C-%26-susde-oracle)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#testnet)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#getvalue-method)
* [Adapter Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#adapter-contracts)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#support)
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#oracle-details)
Oracle Details
--------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#wbtc,-dot,-usdt-and-usdc-oracle)
WBTC, DOT, USDT and USDC oracle
| Chain | Address |
| --- | --- |
| Mainnet | [0xdee629af973ebf5bf261ace12ffd1900ac715f5e](https://explorer.evm.hydration.cloud/address/0xdEe629af973ebF5bf261aCe12ffD1900ac715f5e) |
| Testnet | [0xc756bd338a97c1d2faab4f13b5444a08a1566917](https://explorer.evm.hydration.cloud/address/0xc756bd338a97c1d2faab4f13b5444a08a1566917) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#tbtc,-aave,-eth,-wsteth,-susds,-&-susde-oracle)
tBTC, Aave, ETH, wstETH, sUSDs, & sUSDe oracle
| Chain | Address |
| --- | --- |
| Mainnet | [0x48ae7803cd09c48434e3fc5629f15fb76f0b5ce5](https://explorer.evm.hydration.cloud/address/0x48Ae7803Cd09c48434E3FC5629F15fb76f0b5cE5) |
| Testnet | [0x5d8320f3ced9575d8e25b6f437e610fc6a03bf52](https://explorer.evm.hydration.cloud/address/0x5d8320f3ced9575d8e25b6f437e610fc6a03bf52) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#oracle-configuration)
Oracle Configuration
--------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#available-asset-feeds)
Available Asset Feeds
----------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#mainnet)
Mainnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| WBTC | [0xeDD9A7C47A9F91a0F2db93978A88844167B4a04f](https://explorer.evm.hydration.cloud/address/0xeDD9A7C47A9F91a0F2db93978A88844167B4a04f) | [WBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| DOT | [0xFBCa0A6dC5B74C042DF23025D99ef0F1fcAC6702](https://explorer.evm.hydration.cloud/address/0xFBCa0A6dC5B74C042DF23025D99ef0F1fcAC6702) | [DOT markets](https://www.diadata.org/app/price/asset/Polkadot/0x0000000000000000000000000000000000000000/) |
| USDT | [0x8b0DDfB8F56690eAde9ECa23a7d90E153C268d5B](https://explorer.evm.hydration.cloud/address/0x8b0DDfB8F56690eAde9ECa23a7d90E153C268d5B) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC | [0x17711BE5D63B2Fe8A2C379725DE720773158b954](https://explorer.evm.hydration.cloud/address/0x17711BE5D63B2Fe8A2C379725DE720773158b954) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| tBTC | [0xe5AcDfB0d5EC5cE34F7448B41ef4a97c4e83D9c1](https://explorer.evm.hydration.cloud/address/0xe5AcDfB0d5EC5cE34F7448B41ef4a97c4e83D9c1) | [tBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x18084fbA666a33d37592fA2633fD49a74DD93a88/) |
| Aave | [0x9E85d33FD87342762710FB4a1471df1Dc7bb5f8C](https://explorer.evm.hydration.cloud/address/0x9E85d33FD87342762710FB4a1471df1Dc7bb5f8C) | [Aave markets](https://www.diadata.org/app/price/asset/Ethereum/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/) |
| ETH | [0x1AF549Fe19A9B73D094173C41e18BF7F357F594b](https://explorer.evm.hydration.cloud/address/0x1AF549Fe19A9B73D094173C41e18BF7F357F594b) | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| wstETH | [0x52bBB0BC38C42D60b24EBF0C617E8218D2aB6d36](https://explorer.evm.hydration.cloud/address/0x52bBB0BC38C42D60b24EBF0C617E8218D2aB6d36) | [wstETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0/) |
| sUSDs | [0x4b32bfFC6aCD751446E79e8687ef3815fD7924FD](https://explorer.evm.hydration.cloud/address/0x4b32bfFC6aCD751446E79e8687ef3815fD7924FD) | [sUSDs markets](https://www.diadata.org/app/price/asset/Ethereum/0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD/) |
| sUSDe | [0x22CDEa305Cee63D082E79F8C5Db939EEcD0265D0](https://explorer.evm.hydration.cloud/address/0x22CDEa305Cee63D082E79F8C5Db939EEcD0265D0) | [sUSDe markets](https://www.diadata.org/app/price/asset/Ethereum/0x9D39A5DE30e57443BfF2A8307A4256c8797A3497/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#testnet)
Testnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| WBTC | 0xC9cCBe99bdD9538871f9756Ca5Ea64C2267cb0a7 | [WBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| DOT | 0x422E745797EC0Ef399c17cE3E2348394F2944727 | [DOT markets](https://www.diadata.org/app/price/asset/Polkadot/0x0000000000000000000000000000000000000000/) |
| USDT | 0xb4aC9f0E6E207D5d81B756F8aF6efe3fe7B0E72c | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC | 0xEE7aFb45c094DC9fA404D6A86A7d795d4aA33D28 | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| tBTC | 0x9f7abE73e656DB45F56B1d3755940CB3fc82Fcaa | [tBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x18084fbA666a33d37592fA2633fD49a74DD93a88/) |
| Aave | 0xC9E1415Eb64281aD449f50C454873d92F312d6fE | [Aave markets](https://www.diadata.org/app/price/asset/Ethereum/0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#getvalue-method)
getValue Method
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](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from the oracle on Hydration testnet using the IDIAOracleV2 interface. 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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0xc756bd338a97c1d2faab4f13b5444a08a1566917;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#adapter-contracts)
Adapter Contracts
To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#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](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
. This is a sample contract for consuming the `WBTC/USD` price feed on Hydration mainnet:
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface DiaAssetSpecificCallingConvention {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DIAOracleSample {
address wbtcAdapter = 0xeDD9A7C47A9F91a0F2db93978A88844167B4a04f;
function getWBTCLatestPrice() external view returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
// Call the Chainlink adapter's latestRoundData function
(, int256 answer, , uint256 updatedAt, ) =
DiaAssetSpecificCallingConvention(wbtcAdapter).latestRoundData();
latestPrice = uint128(uint256(answer));
timestampOflatestPrice = uint128(updatedAt);
return (latestPrice, timestampOflatestPrice);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/hydration#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[GOAT Network](https://www.diadata.org/docs/guides/chain-specific-guide/goat-network)
[Kadena](https://www.diadata.org/docs/guides/chain-specific-guide/kadena)
⌘I
---
# Telos - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/telos#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Telos
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/telos#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/telos#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/telos#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/telos#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/telos#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/telos#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Swell](https://www.diadata.org/docs/guides/chain-specific-guide/swell)
[Units Network](https://www.diadata.org/docs/guides/chain-specific-guide/units-network)
⌘I
---
# Ethereum - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Ethereum
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#oracle-contracts)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#testnet)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#additional-details)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#demo-oracles)
Demo Oracles
---------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#oracle-contracts)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#testnet)
Testnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.etherscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // DIA testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // DIA testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#additional-details)
Additional Details
---------------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Ethereum bridge’s components on testnet below:
Testnet
* [MailBox Contract](https://sepolia.etherscan.io/address/0xffaef09b3cd11d9b20d1a19becca54eec2884766)
* [ISM Contract](https://sepolia.etherscan.io/address/0xb869617a3cfcda07a4cc230d996120074e7c817e)
* [Protocol Fee Hook Contract](https://sepolia.etherscan.io/address/0x611c8b288c642336136a436d7125ac49fa71468b)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/ethereum#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Edu Chain](https://www.diadata.org/docs/guides/chain-specific-guide/edu-chain)
[ETHPar](https://www.diadata.org/docs/guides/chain-specific-guide/ethpar)
⌘I
---
# Velas - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/velas#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Velas
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/velas#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/velas#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/velas#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/velas#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/velas#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/velas#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Unichain](https://www.diadata.org/docs/guides/chain-specific-guide/unichain)
[W Chain](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain)
⌘I
---
# Wanchain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Wanchain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
Refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data)
for detailed steps on fetching price data from the oracle in your contract. 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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[W Chain](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain)
[XRP Ledger (XRPL)](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl)
⌘I
---
# XRP Ledger (XRPL) - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
XRP Ledger (XRPL)
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#oracle-configuration)
* [Gas Wallets](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#gas-wallets)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#how-to-access-data)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#oracle-details)
Oracle Details
--------------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | **Provider:** diadata (hex. 64696164617461)
**Oracle Document ID:** 42 |
| Testnet | **Provider:** diadata (hex: 64696164617461)
**Oracle Document ID:** 1 |
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#oracle-configuration)
Oracle Configuration
--------------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| Pricing Methodology | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| Deviation (%) & Refresh Frequency | 1% and 120 seconds |
| Heartbeat | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#gas-wallets)
Gas Wallets
--------------------------------------------------------------------------------------------------------
The gas wallets used to push updates to the oracle are the following:
| Chain | Address |
| --- | --- |
| Mainnet | [rP24Lp7bcUHvEW7T7c8xkxtQKKd9fZyra7](https://livenet.xrpl.org/accounts/rP24Lp7bcUHvEW7T7c8xkxtQKKd9fZyra7) |
| Testnet | [r3U1mL5u2SCPr4mApqYyF96nvwvKoGf7aH](https://testnet.xrpl.org/accounts/r3U1mL5u2SCPr4mApqYyF96nvwvKoGf7aH) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#available-asset-feeds)
Available Asset Feeds
----------------------------------------------------------------------------------------------------------------------------
| Asset Ticker | Asset Ticker (Hex) | Asset Markets |
| --- | --- | --- |
| BTC | 4254430000000000000000000000000000000000 | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| ETH | 4554480000000000000000000000000000000000 | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| XRP | 5852500000000000000000000000000000000000 | [XRP markets](https://www.diadata.org/app/price/asset/XRPL/0x0000000000000000000000000000000000000000/) |
| RLUSD | 524C555344000000000000000000000000000000 | [RLUSD markets](https://www.diadata.org/app/price/asset/XRPL/rMxCKbEDwqr76QuheSUMdEGf4B9xJ8m5De/) |
| USDC | 5553444300000000000000000000000000000000 | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | 5553445400000000000000000000000000000000 | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| EUROP | 4555524F50000000000000000000000000000000 | [EUROP markets](https://www.diadata.org/app/price/asset/Ethereum/0x888883b5F5D21fb10Dfeb70e8f9722B9FB0E5E51/) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------------
The DIA oracle object can be retrieved with the [ledger\_entry API](https://xrpl.org/resources/dev-tools/websocket-api-tool#ledger_entry-oracle)
call by specifying the account and oracle\_document\_id. This is the Request JSON for mainnet:
Copy
Ask AI
{
"id": "example_get_oracle",
"command": "ledger_entry",
"oracle": {
"account": "rP24Lp7bcUHvEW7T7c8xkxtQKKd9fZyra7",
"oracle_document_id": 42
},
"ledger_index": "validated"
}
It will return the current price of all the assets in hexadecimal format, which can then be converted to decimal and scaled to obtain the actual price with 8 decimal places.
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/xrp-ledger-xrpl#support)
Support
------------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Wanchain](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain)
[zkSync](https://www.diadata.org/docs/guides/chain-specific-guide/zksync)
⌘I
---
# Units Network - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Units Network
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#getvalue-method)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#oracle-details)
Oracle Details
------------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0xc9783a5BaBE78D979B7EB5AD43Ea3B57Acb17034](https://explorer.unit0.dev/address/0xc9783a5BaBE78D979B7EB5AD43Ea3B57Acb17034) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#oracle-configuration)
Oracle Configuration
------------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#available-asset-feeds)
Available Asset Feeds
--------------------------------------------------------------------------------------------------------------------------
| Asset Ticker | getValue(key) | Asset Markets |
| --- | --- | --- |
| WETH | WETH/USD | [WETH markets](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
| WBTC | WBTC/USD | [WBTC markets](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| USDC | USDC/USD | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | USDT/USD | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#how-to-access-data)
How to Access Data
--------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#getvalue-method)
getValue Method
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](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#access-the-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on Units Network. If you pass `WBTC/USD` as the key, it will return the most recent price of WBTC in USD with 8 decimal places (e.g.11796077504693 is $117,960.77504693) along with the Unix timestamp of the last price update.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0xc9783a5BaBE78D979B7EB5AD43Ea3B57Acb17034;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/units-network#support)
Support
----------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Telos](https://www.diadata.org/docs/guides/chain-specific-guide/telos)
[Unichain](https://www.diadata.org/docs/guides/chain-specific-guide/unichain)
⌘I
---
# LUKSO - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
LUKSO
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#getvalue-method)
* [Adapter Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#adapter-contracts)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-details)
Oracle Details
----------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0x245ad685F4D89D30fD1a14682C030c6128d08d17](https://explorer.execution.mainnet.lukso.network/address/0x245ad685F4D89D30fD1a14682C030c6128d08d17) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-configuration)
Oracle Configuration
----------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#available-asset-feeds)
Available Asset Feeds
------------------------------------------------------------------------------------------------------------------
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| EUR | [0xbCfD839664B5Ad4D0C0C58db0c716D7a28dCd15E](https://explorer.execution.mainnet.lukso.network/address/0xbCfD839664B5Ad4D0C0C58db0c716D7a28dCd15E) | [EUR markets](https://www.diadata.org/app/price/asset/Fiat/978/) |
| LYX | [0x3153e4d03Cf97B230fc9c9d0ECCE5b2F0834d130](https://explorer.execution.mainnet.lukso.network/address/0x3153e4d03Cf97B230fc9c9d0ECCE5b2F0834d130) | [LYX markets](https://www.diadata.org/app/price/asset/Lukso/0x0000000000000000000000000000000000000000/) |
| GBP | [0x7EA5b4bb2D89B1EfEF00FCC95E139B77Da27d460](https://explorer.execution.mainnet.lukso.network/address/0x7EA5b4bb2D89B1EfEF00FCC95E139B77Da27d460) | [GBP markets](https://www.diadata.org/app/price/asset/Fiat/826/) |
| BTC | [0xD19856Bd3Dbd9Cb00BaC76Fc90603FA3bB05aCEA](https://explorer.execution.mainnet.lukso.network/address/0xD19856Bd3Dbd9Cb00BaC76Fc90603FA3bB05aCEA) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| ETH | [0xc7f3aceBe05482eeCD668df1FCF1B59e6d14f77b](https://explorer.execution.mainnet.lukso.network/address/0xc7f3aceBe05482eeCD668df1FCF1B59e6d14f77b) | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| wstETH | [0x18f2182B37d46deC1dc236Cf3Aad3a02981796cB](https://explorer.execution.mainnet.lukso.network/address/0x18f2182B37d46deC1dc236Cf3Aad3a02981796cB) | [wstETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0/) |
| DAI | [0x1bB6c1A90c9449A14C184Dd141D2c7d7b788a679](https://explorer.execution.mainnet.lukso.network/address/0x1bB6c1A90c9449A14C184Dd141D2c7d7b788a679) | [DAI markets](https://www.diadata.org/app/price/asset/Ethereum/0x6B175474E89094C44Da98b954EedeAC495271d0F/) |
| USDC | [0xc675A8d220E1ba6d14a77C9FbcFDd5f9474BD07A](https://explorer.execution.mainnet.lukso.network/address/0xc675A8d220E1ba6d14a77C9FbcFDd5f9474BD07A) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | [0xC00c10499DEF24352475Ae873C51FaFcFC894f03](https://explorer.execution.mainnet.lukso.network/address/0xC00c10499DEF24352475Ae873C51FaFcFC894f03) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| stETH | [0x2b94002cfFA638B37E4DDe54EDfcF6Efdcb29E6A](https://explorer.execution.mainnet.lukso.network/address/0x2b94002cfFA638B37E4DDe54EDfcF6Efdcb29E6A) | [stETH markets](https://www.diadata.org/app/price/asset/Ethereum/0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on LUKSO mainnet. 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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0x245ad685F4D89D30fD1a14682C030c6128d08d17;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#adapter-contracts)
Adapter Contracts
To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#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](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
. This is a sample contract for consuming the `BTC/USD` price feed:
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface DiaAssetSpecificCallingConvention {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DIAOracleSample {
address btcAdapter = 0xD19856Bd3Dbd9Cb00BaC76Fc90603FA3bB05aCEA;
function getBTCLatestPrice() external view returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
// Call the Chainlink adapter's latestRoundData function
(, int256 answer, , uint256 updatedAt, ) =
DiaAssetSpecificCallingConvention(btcAdapter).latestRoundData();
latestPrice = uint128(uint256(answer));
timestampOflatestPrice = uint128(updatedAt);
return (latestPrice, timestampOflatestPrice);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#oracle-grants-program)
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 LUKSO. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/lukso#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Linea](https://www.diadata.org/docs/guides/chain-specific-guide/linea)
[Metis](https://www.diadata.org/docs/guides/chain-specific-guide/metis)
⌘I
---
# Optimism - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Optimism
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#oracle-contracts)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#testnet)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#additional-details)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#demo-oracles)
Demo Oracles
---------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#oracle-contracts)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#mainnet)
Mainnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://optimistic.etherscan.io/address/0x048050547eb6e68cb37fb21eeafead40cf2cbdbb) |
| Pull Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://optimistic.etherscan.io/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#testnet)
Testnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia-optimism.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia-optimism.etherscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
* * *
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#additional-details)
Additional Details
---------------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Optimism bridge’s components on mainnet and testnet below:
Mainnet
* [MailBox Contract](https://optimistic.etherscan.io/address/0xd4C1905BB1D26BC93DAC913e13CaCC278CdCC80D)
* [ISM Contract](https://optimistic.etherscan.io/address/0xe74b7d236a97eed9026926073cbb436638266888)
* [Protocol Fee Hook Contract](https://optimistic.etherscan.io/address/0x0ec9C62333E29243B04C934bC924c169c1255027)
Testnet
* [MailBox Contract](https://sepolia-optimism.etherscan.io/address/0x6966b0E55883d49BFB24539356a2f8A673E02039)
* [ISM Contract](https://sepolia-optimism.etherscan.io/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e)
* [Protocol Fee Hook Contract](https://sepolia-optimism.etherscan.io/address/0x611C8b288c642336136a436d7125AC49FA71468B)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/optimism#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[OKT Chain (OKX)](https://www.diadata.org/docs/guides/chain-specific-guide/okt-chain)
[Plume](https://www.diadata.org/docs/guides/chain-specific-guide/plume)
⌘I
---
# Superseed - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Superseed
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#testnet)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#getvalue-method)
* [Adapter contracts](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#adapter-contracts)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-details)
Oracle Details
--------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0xF526dC0D2B73488d32b58E55C17Cef5a53AD002A](https://explorer.superseed.xyz/address/0xF526dC0D2B73488d32b58E55C17Cef5a53AD002A) |
| Testnet | [0x6f021bF081840F96bdd90fd756b700072C7E68A5](https://sepolia-explorer.superseed.xyz/address/0x6f021bF081840F96bdd90fd756b700072C7E68A5) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-configuration)
Oracle Configuration
--------------------------------------------------------------------------------------------------------------------
| Parameter | Value |
| --- | --- |
| Pricing Methodology | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| Deviation (%) & Refresh Frequency | 0.5% and 120 seconds |
| Heartbeat | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#available-asset-feeds)
Available Asset Feeds
----------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#mainnet)
Mainnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| WETH | [0xAdEfc2264c21A05D3f83bf7694438F81E119620B](https://explorer.superseed.xyz/address/0xAdEfc2264c21A05D3f83bf7694438F81E119620B) | [WETH markets](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
| cbBTC | [0x7F760344c9Cde8DD342120FA0F908CE0Cd42B1E6](https://explorer.superseed.xyz/address/0x7F760344c9Cde8DD342120FA0F908CE0Cd42B1E6) | [cbBTC markets](https://www.diadata.org/app/price/asset/Base/0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#testnet)
Testnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| WETH | [0xA09A4e4297a06e284a4ACdf2Ca1F9998d5280F6e](https://sepolia-explorer.superseed.xyz/address/0xA09A4e4297a06e284a4ACdf2Ca1F9998d5280F6e) | [WETH markets](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
| cbBTC | [0x61790e8F9bf02E4272E273F2615eD4fc7d8F95D9](https://sepolia-explorer.superseed.xyz/address/0x61790e8F9bf02E4272E273F2615eD4fc7d8F95D9) | [cbBTC markets](https://www.diadata.org/app/price/asset/Base/0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#how-to-access-data)
How to Access Data
----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#getvalue-method)
getValue Method
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](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#access-the-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on Superseed mainnet using the IDIAOracleV2 interface. If you pass `WETH/USD` as the key, it will return the most recent price of WETH in USD with 8 decimal places (e.g. 177101990135 is $1,771.01990135) along with the Unix timestamp of the last price update.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128,
uint128);
}
contract DIAOracleSample {
address immutable ORACLE = 0xF526dC0D2B73488d32b58E55C17Cef5a53AD002A;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#adapter-contracts)
Adapter contracts
To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#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](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
. This is a sample contract for consuming the `WETH/USD` price feed on Superseed mainnet:
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface DiaAssetSpecificCallingConvention {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DIAOracleSample {
address wethAdapter = 0xF526dC0D2B73488d32b58E55C17Cef5a53AD002A;
function getWETHLatestPrice() external view returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
// Call the Chainlink adapter's latestRoundData function
(, int256 answer, , uint256 updatedAt, ) =
DiaAssetSpecificCallingConvention(wethAdapter).latestRoundData();
latestPrice = uint128(uint256(answer));
timestampOflatestPrice = uint128(updatedAt);
return (latestPrice, timestampOflatestPrice);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#oracle-grants-program)
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 Superseed. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/superseed#support)
Support
------------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks)
[Swell](https://www.diadata.org/docs/guides/chain-specific-guide/swell)
⌘I
---
# Sonic - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Sonic
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-contracts)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#mainnet)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#additional-details)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#demo-oracles)
Demo Oracles
------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-contracts)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#mainnet)
Mainnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://sonicscan.org/address/0x048050547eb6e68cb37fb21eeafead40cf2cbdbb) |
| Pull Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://sonicscan.org/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
* * *
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#how-to-access-data)
How to Access Data
------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#additional-details)
Additional Details
------------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Sonic bridge’s components on mainnet below:
Mainnet
* [MailBox Contract](https://sonicscan.org/address/0x3a464f746D23Ab22155710f44dB16dcA53e0775E)
* [ISM Contract](https://sonicscan.org/address/0xE74B7D236A97eED9026926073cBb436638266888)
* [Protocol Fee Hook Contract](https://sonicscan.org/address/0x0ec9C62333E29243B04C934bC924c169c1255027)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#oracle-grants-program)
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 Sonic. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/sonic#support)
Support
--------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Somnia](https://www.diadata.org/docs/guides/chain-specific-guide/somnia)
[Soroban](https://www.diadata.org/docs/guides/chain-specific-guide/soroban)
⌘I
---
# W Chain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
W Chain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#testnet)
* [How to access data](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#getvalue-method)
* [Adapter contracts](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#adapter-contracts)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#oracle-details)
Oracle Details
------------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0x47A04f0a1FA94c14f9FcB4EA0dC63aDdbC9Ecbe5](https://scan.w-chain.com/address/0x47A04f0a1FA94c14f9FcB4EA0dC63aDdbC9Ecbe5) |
| Testnet | [0x57e70667575c50c26D60BE6Db56e54B579d8CC22](https://scan-testnet.w-chain.com/address/0x57e70667575c50c26D60BE6Db56e54B579d8CC22) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#oracle-configuration)
Oracle Configuration
------------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#available-asset-feeds)
Available Asset Feeds
--------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#mainnet)
Mainnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| BTC | [0x34E793Bed54bcd6a7EE9479D8E7fDdD957ACd252](https://scan.w-chain.com/address/0x34E793Bed54bcd6a7EE9479D8E7fDdD957ACd252) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| ETH | [0x1145b9bad680089c8724Df0FAB1E68c7871E12a8](https://scan.w-chain.com/address/0x1145b9bad680089c8724Df0FAB1E68c7871E12a8) | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| SOL | [0x07CEb7db57759EB6D0b68CAb0cF49a08A52B06bd](https://scan.w-chain.com/address/0x07CEb7db57759EB6D0b68CAb0cF49a08A52B06bd) | [SOL markets](https://www.diadata.org/app/price/asset/Solana/0x0000000000000000000000000000000000000000/) |
| BNB | [0x512a846569442a9E69E595A3f030898A1cc052Ec](https://scan.w-chain.com/address/0x512a846569442a9E69E595A3f030898A1cc052Ec) | [BNB markets](https://www.diadata.org/app/price/asset/BinanceSmartChain/0x0000000000000000000000000000000000000000/) |
| USDC | [0x9A581384B1A54D0863E20fa7bC6aafd68eB070B3](https://scan.w-chain.com/address/0x9A581384B1A54D0863E20fa7bC6aafd68eB070B3) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | [0x29047678110de15199AEb74332EDeCC4C3F83599](https://scan.w-chain.com/address/0x29047678110de15199AEb74332EDeCC4C3F83599) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| POL | [0x9c42bcc40Ba59F87047434eC5fd9E3960A9d133C](https://scan.w-chain.com/address/0x9c42bcc40Ba59F87047434eC5fd9E3960A9d133C) | [POL markets](https://www.diadata.org/app/price/asset/Ethereum/0x455e53908C49407DDe25B8293c72529b80b9b605/) |
| XRP | [0x3f3C850720A2838905cc1Dd50f4A3F5e03F84E92](https://scan.w-chain.com/address/0x3f3C850720A2838905cc1Dd50f4A3F5e03F84E92) | [XRP markets](https://www.diadata.org/app/price/asset/Ripple/0x0000000000000000000000000000000000000000/) |
| WCO | [0x58f903ec136c589447fA8db5d22210919c5bc51f](https://scan.w-chain.com/address/0x58f903ec136c589447fA8db5d22210919c5bc51f) | [WCO markets](https://www.diadata.org/app/price/asset/WChain/0x0000000000000000000000000000000000000000/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#testnet)
Testnet
| Asset Ticker | Adapter Address | Asset Markets |
| --- | --- | --- |
| BTC | [0x9D0134e6fbB244dDa210189A5Dfe29BB85FF1E94](https://scan-testnet.w-chain.com/address/0x9D0134e6fbB244dDa210189A5Dfe29BB85FF1E94) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| ETH | [0x6cD4023d7da60c305F1BD2a361DAa7dEeCc8d336](https://scan-testnet.w-chain.com/address/0x6cD4023d7da60c305F1BD2a361DAa7dEeCc8d336) | [ETH markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| SOL | [0xef07fB27696597e9b248Ee7B265D715a8e130f36](https://scan-testnet.w-chain.com/address/0xef07fB27696597e9b248Ee7B265D715a8e130f36) | [SOL markets](https://www.diadata.org/app/price/asset/Solana/0x0000000000000000000000000000000000000000/) |
| BNB | [0x5cb4129280cf34bd3D4c3127D910948896752877](https://scan-testnet.w-chain.com/address/0x5cb4129280cf34bd3D4c3127D910948896752877) | [BNB markets](https://www.diadata.org/app/price/asset/BinanceSmartChain/0x0000000000000000000000000000000000000000/) |
| USDC | [0xc305427D51eBf5555Df717A562729F1853645e7c](https://scan-testnet.w-chain.com/address/0xc305427D51eBf5555Df717A562729F1853645e7c) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| USDT | [0x30eFF71073F6ba6E46bF15A417CdB301009c2d69](https://scan-testnet.w-chain.com/address/0x30eFF71073F6ba6E46bF15A417CdB301009c2d69) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| POL | [0xa8c64239F9939530bf84357D7A9e281986781Ade](https://scan-testnet.w-chain.com/address/0xa8c64239F9939530bf84357D7A9e281986781Ade) | [POL markets](https://www.diadata.org/app/price/asset/Ethereum/0x455e53908C49407DDe25B8293c72529b80b9b605/) |
| XRP | [0xBc22d07df5baf273d55eCD7027BdaA70EbCa3076](https://scan-testnet.w-chain.com/address/0xBc22d07df5baf273d55eCD7027BdaA70EbCa3076) | [XRP markets](https://www.diadata.org/app/price/asset/Ripple/0x0000000000000000000000000000000000000000/) |
| WCO | [0x9a242f634A324f3621813A7f197206f6AC407b86](https://scan-testnet.w-chain.com/address/0x9a242f634A324f3621813A7f197206f6AC407b86) | [WCO markets](https://www.diadata.org/app/price/asset/WChain/0x0000000000000000000000000000000000000000/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#how-to-access-data)
How to access data
--------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#using-the-diaoraclev2-interface)
. Below is an example of a contract consuming data from our oracle on W Chain mainnet. 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.
Copy
Ask AI
pragma solidity ^0.8.13;
interface IDIAOracleV2 {
function getValue(string memory) external view returns (uint128, uint128);
}
contract DIAOracleV2Consumer{
address immutable ORACLE = 0x47A04f0a1FA94c14f9FcB4EA0dC63aDdbC9Ecbe5;
function getPrice(string memory key)
external
view
returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
(latestPrice, timestampOflatestPrice) =
IDIAOracleV2(ORACLE).getValue(key);
}
}
See the full example [here](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#adapter-contracts)
Adapter contracts
To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#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](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
. This is a sample contract for consuming the `BTC/USD` price feed on W Chain mainnet:
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface DiaAssetSpecificCallingConvention {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DIAOracleSample {
address btcAdapter = 0x34E793Bed54bcd6a7EE9479D8E7fDdD957ACd252;
function getBTCLatestPrice() external view returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
// Call the Chainlink adapter's latestRoundData function
(, int256 answer, , uint256 updatedAt, ) =
DiaAssetSpecificCallingConvention(btcAdapter).latestRoundData();
latestPrice = uint128(uint256(answer));
timestampOflatestPrice = uint128(updatedAt);
return (latestPrice, timestampOflatestPrice);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/w-chain#support)
Support
----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Velas](https://www.diadata.org/docs/guides/chain-specific-guide/velas)
[Wanchain](https://www.diadata.org/docs/guides/chain-specific-guide/wanchain)
⌘I
---
# Unichain - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Unichain
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Demo Oracles](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#demo-oracles)
* [Oracle Contracts](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#oracle-contracts)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#testnet)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#how-to-access-data)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#request-method)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#additional-details)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#support)
Explore these demo oracles to see how DIA works. For production deployments, [request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#demo-oracles)
Demo Oracles
---------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#oracle-contracts)
Oracle Contracts
####
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#testnet)
Testnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.uniscan.xyz/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.uniscan.xyz/address/0x61D217a26D0Bff1D2b4c6f5880e621071326aadC) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#oracle-configuration)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 2% and 120 seconds |
| **Heartbeat** | 12h |
* * *
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#available-asset-feeds)
Available Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#how-to-access-data)
How to Access Data
---------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#additional-details)
Additional Details
---------------------------------------------------------------------------------------------------------------
You can find the contract addresses for the Unichain bridge’s components on testnet below:
Testnet
* [MailBox Contract](https://sepolia.uniscan.xyz/address/0xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeD)
* [ISM Contract](https://sepolia.uniscan.xyz/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e)
* [Protocol Fee Hook Contract](https://sepolia.uniscan.xyz/address/0x611C8b288c642336136a436d7125AC49FA71468B)
Learn more about DIA’s cross-chain messaging layer [here](https://www.diadata.org/docs/dia-stack/architecture/core-components/spectra)
.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/unichain#support)
Support
-----------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Units Network](https://www.diadata.org/docs/guides/chain-specific-guide/units-network)
[Velas](https://www.diadata.org/docs/guides/chain-specific-guide/velas)
⌘I
---
# Stacks - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Stacks
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#available-asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-details)
Oracle Details
-----------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [SP1G48FZ4Y7JY8G2Z0N51QTCYGBQ6F4J43J77BQC0.dia-oracle](https://explorer.hiro.so/txid/SP1G48FZ4Y7JY8G2Z0N51QTCYGBQ6F4J43J77BQC0.dia-oracle?chain=mainnet) |
| Testnet | [ST1S5ZGRZV5K4S9205RWPRTX9RGS9JV40KQMR4G1J.dia-oracle](https://explorer.hiro.so/txid/ST1S5ZGRZV5K4S9205RWPRTX9RGS9JV40KQMR4G1J.dia-oracle?chain=testnet) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-configuration)
Oracle Configuration
-----------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 5% and 120 seconds |
| **Heartbeat** | 15 minutes |
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#available-asset-feeds)
Available Asset Feeds
-------------------------------------------------------------------------------------------------------------------
The Stacks oracle includes the following asset feeds:
| Asset Ticker | Asset Blockchain | Asset Address | Asset Sources |
| --- | --- | --- | --- |
| STX | Stacks | 0x0000000000000000000000000000000000000000 | [STX Market](https://www.diadata.org/app/price/asset/Stacks/0x0000000000000000000000000000000000000000/) |
| stSTX | Stacks | SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststx-token | [stSTX Market](https://www.diadata.org/app/price/asset/Stacks/SP4SZE494VC2YC5JYG7AYFQ44F5Q4PYV7DVMDPBG.ststx-token/) |
| DIKO | Stacks | SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.arkadiko-token | [DIKO Market](https://www.diadata.org/app/price/asset/Stacks/SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.arkadiko-token/) |
| WELSH | Stacks | SP3NE50GEXFG9SZGTT51P40X2CKYSZ5CC4ZTZ7A2G.welshcorgicoin-token | [WELSH Market](https://www.diadata.org/app/price/asset/Stacks/SP3NE50GEXFG9SZGTT51P40X2CKYSZ5CC4ZTZ7A2G.welshcorgicoin-token/) |
| VELAR | Stacks | SP1Y5YSTAHZ88XYK1VPDH24GY0HPX5J4JECTMY4A1.velar-token | [VELAR Market](https://www.diadata.org/app/price/asset/Stacks/SP1Y5YSTAHZ88XYK1VPDH24GY0HPX5J4JECTMY4A1.velar-token/) |
| ALEX | Stacks | SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.age000-governance-token | [ALEX Market](https://www.diadata.org/app/price/asset/Stacks/SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.age000-governance-token/) |
| sBTC | Stacks | SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token | [sBTC Market](https://www.diadata.org/app/price/asset/Stacks/SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token/) |
| aeUSDC | Stacks | SP3Y2ZSH8P7D50B0VBTSX11S7XSG24M1VB9YFQA4K.token-aeusdc | [aeUSDC Market](https://www.diadata.org/app/price/asset/Stacks/SP3Y2ZSH8P7D50B0VBTSX11S7XSG24M1VB9YFQA4K.token-aeusdc/) |
| USDh | Stacks | SPN5AKG35QZSK2M8GAMR4AFX45659RJHDW353HSG.usdh-token-v1 | [USDh Market](https://www.diadata.org/app/price/asset/Stacks/SPN5AKG35QZSK2M8GAMR4AFX45659RJHDW353HSG.usdh-token-v1/) |
| BTC | Bitcoin | 0x0000000000000000000000000000000000000000 | [BTC Market](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
You can query for assets like `"STX/USD"` or `"stSTX/USD"` in the `get-value()` read function. It returns two values:
1. The price of STX/USD with 8 decimals
2. The timestamp of the last update (UTC timezone)
Below is the DIA oracle contract implementation in [Clarity](https://docs.stacks.co/concepts/clarity)
:
Copy
Ask AI
(impl-trait .trait-dia-oracle.dia-oracle-trait)
(define-constant err-unauthorized (err u100))
(define-data-var oracle-updater principal tx-sender)
(define-map values
(string-ascii 32)
{ value: uint, timestamp: uint }
)
(define-public (set-value (key (string-ascii 32)) (value uint) (timestamp uint))
(begin
(try! (check-is-oracle-updater))
(update-value { key: key, value: value, timestamp: timestamp })
(ok true)
)
)
(define-public (set-multiple-values (entries (list 10 { key: (string-ascii 32), value: uint, timestamp: uint })))
(begin
(try! (check-is-oracle-updater))
(map update-value entries)
(ok true)
)
)
(define-public (change-oracle-updater (new-oracle-updater principal))
(begin
;; #[filter(new-oracle-updater)]
(try! (check-is-oracle-updater))
(var-set oracle-updater new-oracle-updater)
(print
{
action: "oracle-updater-changed",
data: { old-updater: tx-sender, new-updater: new-oracle-updater }
}
)
(ok true)
)
)
(define-read-only (get-oracle-updater)
(var-get oracle-updater)
)
(define-read-only (get-value (key (string-ascii 32)))
(ok (default-to { value: u0, timestamp: u0 } (map-get? values key)))
)
(define-private (check-is-oracle-updater)
(ok (asserts! (is-eq tx-sender (var-get oracle-updater)) err-unauthorized))
)
(define-private (update-value (entry { key: (string-ascii 32), value: uint, timestamp: uint }))
(begin
(map-set values
(get key entry)
{ value: (get value entry), timestamp: (get timestamp entry) }
)
(print { action: "updated", data: entry })
)
)
Learn more about DIA’s [data sourcing](https://www.diadata.org/docs/dia-stack/architecture/data-sourcing)
and [data computation](https://www.diadata.org/docs/dia-stack/architecture/data-computation)
architecture.
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#oracle-grants-program)
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 Stacks. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Soroban](https://www.diadata.org/docs/guides/chain-specific-guide/soroban)
[Superseed](https://www.diadata.org/docs/guides/chain-specific-guide/superseed)
⌘I
---
# Kadena - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Kadena
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-details)
* [Chainweb EVM Testnet 20](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#chainweb-evm-testnet-20)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-configuration)
* [Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#asset-feeds)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#how-to-access-data)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#support)
DIA Oracles on Kadena are open source, and their source code is available in [this repository](https://github.com/diadata-org/dia-kadena-oracles)
. dApps built on Kadena can leverage DIA oracles to access up-to-date asset price information. These deployed oracles are designed for production environments and come with a predefined list of supported assets and settings. If dApps require a custom oracle with different assets and configurations, please [contact DIA on Telegram](https://t.me/DIAOracles_Support_Bot)
.
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-details)
Oracle Details
-----------------------------------------------------------------------------------------------------
As Kadena allows for several chains in parallel, it is important to retrieve the price from the correct chain. Currently, DIA oracles are deployed on these chains:
| Network ID | Chain ID | DIA Contract Identifier |
| --- | --- | --- |
| mainnet01 | 1 | `n_bfb76eab37bf8c84359d6552a1d96a309e030b71.dia-oracle` |
| mainnet01 | 2 | `n_bfb76eab37bf8c84359d6552a1d96a309e030b71.dia-oracle` |
| mainnet01 | 4 | `n_bfb76eab37bf8c84359d6552a1d96a309e030b71.dia-oracle` |
| testnet04 | 4 | `n_bfb76eab37bf8c84359d6552a1d96a309e030b71.dia-oracle` |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#chainweb-evm-testnet-20)
Chainweb EVM Testnet 20
| Network ID | Chain ID | DIA Contract Address |
| --- | --- | --- |
| chain20 | 5920 | [`0x2e034f073ee95db83b5498b90a53dd9b26525355`](https://chain-20.evm-testnet-blockscout.chainweb.com/address/0x2E034F073eE95Db83B5498B90a53DD9B26525355) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-configuration)
Oracle Configuration
-----------------------------------------------------------------------------------------------------------------
| Parameter | Value |
| --- | --- |
| Pricing Methodology | [VWAPIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/vwapir-volume-weighted-average-price-with-interquartile-range-filter) |
| Deviation (%) & Refresh Frequency | 0.5% and 120 seconds |
| Heartbeat | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#asset-feeds)
Asset Feeds
-----------------------------------------------------------------------------------------------
The Kadena oracle includes the following price feeds. Use the Query Symbol as a parameter in the `get-value` (or `getValue` for chainweb EVM) function to receive the latest price information for any of these assets.
| Asset | Query Symbol | Sources Overview |
| --- | --- | --- |
| Bitcoin (BTC) | BTC/USD | [BTC Sources](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| USD Coin (USDC) | USDC/USD | [USDC Sources](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| Staked ETH (stETH) | STETH/USD | [stETH Sources](https://www.diadata.org/app/price/asset/Ethereum/0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84/) |
| Ether (ETH) | ETH/USD | [ETH Sources](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| Wrapped Bitcoin (WBTC) | WBTC/USD | [WBTC Sources](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
| Moonbeam (GLMR) | GLMR/USD | [GLMR Sources](https://www.diadata.org/app/price/asset/Moonbeam/0x0000000000000000000000000000000000000000/) |
| Optimism (OP) | OP/USD | [OP Sources](https://www.diadata.org/app/price/asset/Optimism/0x4200000000000000000000000000000000000042/) |
| DIA Token (DIA) | DIA/USD | [DIA Sources](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| Arbitrum (ARB) | ARB/USD | [ARB Sources](https://www.diadata.org/app/price/asset/Arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548/) |
| Binance Coin (BNB) | BNB/USD | [BNB Sources](https://www.diadata.org/app/price/asset/BinanceSmartChain/0x0000000000000000000000000000000000000000/) |
| Avalanche (AVAX) | AVAX/USD | [AVAX Sources](https://www.diadata.org/app/price/asset/Avalanche/0x0000000000000000000000000000000000000000/) |
| Celo Dollar (CUSD) | CUSD/USD | [CUSD Sources](https://www.diadata.org/app/price/asset/Celo/0x765DE816845861e75A25fCA122bb6898B8B1282a/) |
| Kadena (KDA) | KDA/USD | [KDA Sources](https://www.diadata.org/app/price/asset/Kadena/0x0000000000000000000000000000000000000000/) |
| Gnosis (GNO) | GNO/USD | [GNO Sources](https://www.diadata.org/app/price/asset/Ethereum/0x6810e776880C02933D47DB1b9fc05908e5386b96/) |
| Wrapped Ether (WETH) | WETH/USD | [WETH Sources](https://www.diadata.org/app/price/asset/Ethereum/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/) |
Learn more about DIA’s [data sourcing](https://www.diadata.org/docs/dia-stack/architecture/data-sourcing)
and [data computation](https://www.diadata.org/docs/dia-stack/architecture/data-computation)
architecture.
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
Locate one of the deployed contracts (either testnet or mainnet) and call the `get-value` (or `getValue` for chainweb EVM) function. This function expects one parameter, which is the symbols of the asset you want to retrieve and a “/USD”, so for example for the Bitcoin price the parameter must be “BTC/USD”. This will return two values:
1. The price of the asset, with 8 decimals.
2. The timestamp of the last update in Unix time format, in UTC timezone.
You can also refer to the [Solidity guide](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
for detailed steps on fetching price data from the oracle in your EVM contract.
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#oracle-grants-program)
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 Kadena. Learn more about the grant here:[DIA Oracle Grants Program | Apply Now\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/kadena#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Hydration](https://www.diadata.org/docs/guides/chain-specific-guide/hydration)
[Linea](https://www.diadata.org/docs/guides/chain-specific-guide/linea)
⌘I
---
# Somnia - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Supported Chains
Somnia
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-details)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-configuration)
* [Available Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#available-asset-feeds)
* [Mainnet](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#mainnet)
* [Testnet](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#testnet)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#how-to-access-data)
* [getValue Method](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#getvalue-method)
* [Adapter contracts](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#adapter-contracts)
* [Lumina Stack Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#lumina-stack-feeds)
* [Oracle Details](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-details-2)
* [Oracle Configuration](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-configuration-2)
* [Asset Feeds](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#asset-feeds)
* [Additional Details](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#additional-details)
* [How to Access Data](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#how-to-access-data-2)
* [updates Method](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#updates-method)
* [request Method](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#request-method)
* [Oracle Grants Program](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-grants-program)
* [Request a Custom Oracle](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#request-a-custom-oracle)
* [Support](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#support)
[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.
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-details)
Oracle Details
-----------------------------------------------------------------------------------------------------
| Chain | Address |
| --- | --- |
| Mainnet | [0xbA0E0750A56e995506CA458b2BdD752754CF39C4](https://shannon-explorer.somnia.network/address/0x9206296Ea3aEE3E6bdC07F7AaeF14DfCf33d865D) |
| Testnet | [0x9206296ea3aee3e6bdc07f7aaef14dfcf33d865d](https://shannon-explorer.somnia.network/address/0x9206296Ea3aEE3E6bdC07F7AaeF14DfCf33d865D) |
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-configuration)
Oracle Configuration
-----------------------------------------------------------------------------------------------------------------
| | |
| --- | --- |
| **Pricing Methodology** | [MAIR](https://www.diadata.org/docs/guides/methodologies/pricing-methodologies/mair-moving-average-with-interquartile-range-filter) |
| **Deviation (%) & Refresh Frequency** | 0.5% and 120 seconds |
| **Heartbeat** | 24h |
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#available-asset-feeds)
Available Asset Feeds
-------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#mainnet)
Mainnet
| Asset Ticker | Adapter address | Asset Markets |
| --- | --- | --- |
| USDT | [0x936C4F07fD4d01485849ee0EE2Cdcea2373ba267](https://explorer.somnia.network/address/0x936C4F07fD4d01485849ee0EE2Cdcea2373ba267) | [USDT markets](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
| USDC | [0x5D4266f4DD721c1cD8367FEb23E4940d17C83C93](https://explorer.somnia.network/address/0x5D4266f4DD721c1cD8367FEb23E4940d17C83C93) | [USDC markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
| BTC | [0xb12e1d47b0022fA577c455E7df2Ca9943D0152bE](https://explorer.somnia.network/address/0xb12e1d47b0022fA577c455E7df2Ca9943D0152bE) | [BTC markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| ARB | [0x6a96a0232402c2BC027a12C73f763b604c9F77a6](https://explorer.somnia.network/address/0x6a96a0232402c2BC027a12C73f763b604c9F77a6) | [ARB markets](https://www.diadata.org/app/price/asset/Arbitrum/0x912CE59144191C1204E64559FE8253a0e49E6548/) |
| SOL | [0xa4a3a8B729939E2a79dCd9079cee7d84b0d96234](https://explorer.somnia.network/address/0xa4a3a8B729939E2a79dCd9079cee7d84b0d96234) | [SOL markets](https://www.diadata.org/app/price/asset/Solana/0x0000000000000000000000000000000000000000/) |
| SOMI | [0x1f5f46B0DABEf8806a1f33772522ED683Ba64E27](https://explorer.somnia.network/address/0x1f5f46B0DABEf8806a1f33772522ED683Ba64E27) | [SOMI markets](https://www.diadata.org/app/price/asset/Somnia/0x0000000000000000000000000000000000000000/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#testnet)
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/) |
| SOMI | [0xaEAa92c38939775d3be39fFA832A92611f7D6aDe](https://shannon-explorer.somnia.network/address/0xaEAa92c38939775d3be39fFA832A92611f7D6aDe) | [SOMI markets](https://www.diadata.org/app/price/asset/Somnia/0x0000000000000000000000000000000000000000/) |
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#how-to-access-data)
How to Access Data
-------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#getvalue-method)
getValue Method
To consume price data, you’ll need to invoke the [`getValue` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
on the oracle contract which you can access through the [DIA Oracle library](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity#solidity-library)
or the [interface](https://www.diadata.org/docs/guides/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.
Copy
Ask AI
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](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/solidity)
.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#adapter-contracts)
Adapter contracts
To consume price data from our oracle, you can use the adapter smart contract located at the [adapter address](https://www.diadata.org/docs/guides/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](https://www.diadata.org/docs/guides/how-to-guides/migrate-to-dia)
. This is a sample contract for consuming the `$SOMI` price feed:
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface DiaAssetSpecificCallingConvention {
function latestRoundData() external view returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract DIAOracleSample {
address somiAdapter =
function getSOMILatestPrice() external view returns (
uint128 latestPrice,
uint128 timestampOflatestPrice
) {
// Call the Chainlink adapter's latestRoundData function
(, int256 answer, , uint256 updatedAt, ) =
DiaAssetSpecificCallingConvention(somiAdapter).latestRoundData();
latestPrice = uint128(uint256(answer));
timestampOflatestPrice = uint128(updatedAt);
return (latestPrice, timestampOflatestPrice);
} // SOMI:1.23125165
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#lumina-stack-feeds)
Lumina Stack Feeds
-------------------------------------------------------------------------------------------------------------
Explore these demo oracles to see how DIA Lumina Stack works. [Request a custom oracle](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#request-a-custom-oracle)
and unlock the full power of tailored data feeds for your dApp.
Demo oracles are available for testing the new fully verifiable & decentralized [Lumina stack](https://www.diadata.org/docs/dia-stack/overview)
on Somnia testnet.
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-details-2)
Oracle Details
| Chain | Contract | Address |
| --- | --- | --- |
| Testnet | Push Oracle | [0xFb1462A649A92654482F8E048C754333ad85e5C0](https://shannon-explorer.somnia.network/address/0xFb1462A649A92654482F8E048C754333ad85e5C0) |
| Testnet | Pull Oracle | [0x4E0BD1602f2FeC717E751F24f4e8178bfb9f5dc6](https://shannon-explorer.somnia.network/address/0x4E0BD1602f2FeC717E751F24f4e8178bfb9f5dc6) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-configuration-2)
Oracle Configuration
| | |
| --- | --- |
| **Pricing Methodology** | Median |
| **Deviation (%) & Refresh Frequency** | 1% and 120 seconds |
| **Heartbeat** | 24h |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#asset-feeds)
Asset Feeds
| Asset Ticker | updates(key) | Asset Markets |
| --- | --- | --- |
| ETH | ETH/USD | [ETH Markets](https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/) |
| BTC | BTC/USD | [BTC Markets](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
| DIA | DIA/USD | [DIA Markets](https://www.diadata.org/app/price/asset/Ethereum/0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419/) |
| USDC | USDC/USD | [USDC Markets](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#additional-details)
Additional Details
You can find the contract addresses for the Somnia bridge’s components on testnet below:
Testnet
* [MailBox Contract](https://shannon-explorer.somnia.network/address/0x7d498740A4572f2B5c6b0A1Ba9d1d9DbE207e89E)
* [ISM Contract](https://shannon-explorer.somnia.network/address/0xdBEf26113A6c84f2E1Ad13Bbb43898e4Ff4286dc)
* [Protocol Fee Hook Contract](https://shannon-explorer.somnia.network/address/0x67f4e6b2EE6535F9D3Eca74E63a665F8c888C2bc)
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#how-to-access-data-2)
How to Access Data
---------------------------------------------------------------------------------------------------------------
To consume price data, select the method required for your dapp. The [`updates` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/push-based-oracles)
is available for Push-based oracles and [`request` method](https://www.diadata.org/docs/guides/how-to-guides/fetch-price-data/pull-based-oracles)
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:
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#updates-method)
updates Method
Copy
Ask AI
pragma solidity ^0.8.13;
import { PushOracleReceiver } from "@dia-data/contracts-spectra/PushOracleReceiver.sol";
contract DIAOracleSample {
PushOracleReceiver public diaOracle;
string public key = "BTC/USD";
constructor(address _oracle) {
diaOracle = PushOracleReceiver(payable(_oracle));
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
###
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#request-method)
request Method
Copy
Ask AI
// SPDX-License-Identifier: MIT
pragma solidity 0.8.29;
import { RequestOracle } from "@dia-data/contracts-spectra/RequestOracle.sol";
contract PullOracleSample {
address public constant DIA_RECIPIENT = 0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0; // DIA testnet
uint32 public constant DESTINATION_DOMAIN = 100640; // DIA testnet chain id
RequestOracle public diaOracle;
string public key = "BTC/USD";
constructor(address _requestOracle) {
diaOracle = RequestOracle(payable(_requestOracle));
}
/*
* To calculate the request fee on each chain, you can check the script below:
* https://github.com/diadata-org/Spectra-interoperability/blob/main/contracts/scripts/sendTestMessage.mjs#L111
*/
function requestPrice(string memory key) external payable {
diaOracle.request{value: msg.value}(
DIA_RECIPIENT,
DESTINATION_DOMAIN,
abi.encode(key)
);
}
function getPrice()
external
view
returns (
uint128 timestampOflatestPrice,
uint128 latestPrice
) {
(timestampOflatestPrice, latestPrice) =
diaOracle.updates(key);
}
}
* * *
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#oracle-grants-program)
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\
-------------------------------------](https://www.diadata.org/blockchain-oracle-grant/)
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#request-a-custom-oracle)
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)
Get a tailored oracle for your dApp, request one below:
[Request Custom Oracle\
---------------------](https://www.diadata.org/docs/guides/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/guides/chain-specific-guide/somnia#support)
Support
---------------------------------------------------------------------------------------
For developer assistance, connect with the DIA team directly on [Discord](https://discord.gg/ZvGjVY5uvs)
or [Telegram](https://t.me/diadata_org)
.
Was this page helpful?
YesNo
[Shido](https://www.diadata.org/docs/guides/chain-specific-guide/shido)
[Sonic](https://www.diadata.org/docs/guides/chain-specific-guide/sonic)
⌘I
---
# Cross-chain Messaging - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/cross-chain-messaging#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Cross-chain Messaging
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Message Flow](https://www.diadata.org/docs/reference/cross-chain-messaging#message-flow)
DIA leverages the **Spectra** bridge (a custom instance of Hyperlane) for relaying cross-chain messages. Learn how it works [here](https://www.diadata.org/docs/reference/architecture/data-delivery)
and come back to see it in action in this section.
[](https://www.diadata.org/docs/reference/cross-chain-messaging#message-flow)
Message Flow
----------------------------------------------------------------------------------------------
After running the script on a chain of your choice in the [Pull based oracle guide](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles)
, you can take the txn hash from your terminal and paste it into the [Hyperlane explorer](https://explorer.hyperlane.xyz/)
, it will show you the status of the message sent from the source chain (e.g. Base Sepolia):

Message sent from Base Sepolia to DIA lasernet
Click on the message to see the status on the destination chain (Lasernet). You might receive an error message saying “No chain config found for domain 10640” similar to the one shown below:

Here’s how to fix it:
* Click on \`add metadata\` button on the Destination Transaction box
* Copy the content in the \`[hyperlane.explorer.yml](https://github.com/diadata-org/Spectra-interoperability/blob/main/hyperlane.explorer.yml)
\` file from the Spectra repo that you’ve cloned earlier
* Paste it inside the popup window and click on “+ Add chain”

Copy the txn hash from the Destination Transaction window which represents the response hash and paste it into the hyperlane explorer search bar to check the delivery status from DIA lasernet to Base Sepolia.
Was this page helpful?
YesNo
⌘I
---
# CEXes Data - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Sources
CEXes Data
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Centralized Cryptocurrency Exchanges](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data#centralized-cryptocurrency-exchanges)
###
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data#centralized-cryptocurrency-exchanges)
Centralized Cryptocurrency Exchanges
All trading data is retrieved through Rest APIs or websocket APIs, developed and maintained by the respective trading platform. See the below table for detailed information on all sources. We remark that by the very nature of a websocket API, there is no retrieval frequency, instead, trading data comes in continuously as it is produced.
| Exchange | API Link | See live data |
| --- | --- | --- |
|  [**Binance**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BinanceScraper.go) | [Binance Websocket Documentation](https://binance-docs.github.io/apidocs/spot/en/#trade-streams) | [https://www.diadata.org/app/source/defi/Binance/](https://www.diadata.org/app/source/defi/Binance/) |
|  [**Bitfinex**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitfinexScraper.go) | [Bitfinex Websocket Documentation](https://docs.bitfinex.com/docs/ws-general) | [https://www.diadata.org/app/source/defi/Bitfinex/](https://www.diadata.org/app/source/defi/Bitfinex/) |
|  [**BitMax**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitmaxScraper.go) | [Bitmax API Documentation](https://bitmax-exchange.github.io/bitmax-pro-api/#bitmax-pro-api-documentation) | [https://www.diadata.org/app/source/defi/Bitmax/](https://www.diadata.org/app/source/defi/Bitmax/) |
|  [**BitMart**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitMartScraper.go) | [BitMart API Documentation](https://www.bitmart.com/open-api-guide/en) | [https://www.diadata.org/app/source/defi/BitMart/](https://www.diadata.org/app/source/defi/BitMart/) |
|  [**BitMex**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitMexScraper.go) | [BitMex API Documentation](https://www.bitmex.com/app/apiOverview) | [https://www.diadata.org/app/source/defi/BitMex/](https://www.diadata.org/app/source/defi/BitMex/) |
|  **BitStamp** | [BitStamp API Documentation](https://www.bitstamp.net/api/) | [https://www.diadata.org/app/source/defi/Bitstamp/](https://www.diadata.org/app/source/defi/Bitstamp/) |
|  [**Bybit**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/ByBitScraper.go) | [Bybit API Documentation](https://bybit-exchange.github.io/docs/inverse/#t-introduction) | [https://www.diadata.org/app/source/defi/ByBit/](https://www.diadata.org/app/source/defi/ByBit/) |
|  [**Coinbase**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/CoinBaseScraper.go) | [Coinbase Websocket Documentation](https://docs.pro.coinbase.com/) | [https://www.diadata.org/app/source/defi/CoinBase/](https://www.diadata.org/app/source/defi/CoinBase/) |
|  [**Crypto.com**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/CryptoDotComScraper.go) | [Crypto.com API Documentation](https://exchange-docs.crypto.com/spot/index.html#introduction) | [https://www.diadata.org/app/source/defi/Crypto.com/](https://www.diadata.org/app/source/defi/Crypto.com/) |
|  [**GateIO**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/GateIOScraper.go) | [GateIO Websocket Documentation](https://www.gate.io/docs/websocket/index.html) | [https://www.diadata.org/app/source/defi/GateIO/](https://www.diadata.org/app/source/defi/GateIO/) |
|  [**Kraken**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/KrakenScraper.go) | [Kraken Rest API Documentation](https://www.kraken.com/features/api#public-market-data) | [https://www.diadata.org/app/source/defi/Kraken/](https://www.diadata.org/app/source/defi/Kraken/) |
|  [**KuCoin**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/KuCoinScraper.go) | [Kucoin API Documentation](https://docs.kucoin.com/#websocket-feed) | [https://www.diadata.org/app/source/defi/KuCoin/](https://www.diadata.org/app/source/defi/KuCoin/) |
|  [**MEXC**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/MEXCScraper.go) | [MEXC API Documentation](https://mxcdevelop.github.io/APIDoc/) | [https://www.diadata.org/app/source/defi/MEXC/](https://www.diadata.org/app/source/defi/MEXC/) |
|  [**OKEx**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/OKExScraper.go) | [OKEx Websocket Documentation](https://www.okex.com/docs/en/#ws_swap-README) | [https://www.diadata.org/app/source/defi/OKEx/](https://www.diadata.org/app/source/defi/OKEx/) |
|  [**Bitget**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitgetScraper.go) | [Bitget Websocket Documentation](https://www.bitget.com/api-doc/common/websocket-intro) | [https://www.diadata.org/app/source/defi/Bitget/](https://www.diadata.org/app/source/defi/Bitget/) |
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview)
[DEXes Data](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data)
⌘I
---
# DEXes Data - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Sources
DEXes Data
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Decentralized Cryptocurrency Exchanges (DEXes)](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data#decentralized-cryptocurrency-exchanges-dexes)
[](https://www.diadata.org/docs/dia-stack/architecture/data-sources/dexes-data#decentralized-cryptocurrency-exchanges-dexes)
Decentralized Cryptocurrency Exchanges (DEXes)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
In order to supply data to our community as quickly as possible, we retrieved the trading data for a few exchanges through Rest APIs (see table below). However, we remark that we are implementing data retrieval through the blockchain directly to reduce unnecessary dependencies. This concerns _all_ decentralized exchanges.
| Exchange | Blockchain | See live data |
| --- | --- | --- |
| [**AerodromeSlipstream**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go#L108) | Base | [https://www.diadata.org/app/source/defi/AerodromeSlipstream/](https://www.diadata.org/app/source/defi/AerodromeSlipstream/) |
| [**Aerodrome V1**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/VelodromeScraper.go#L70) | Base | [https://www.diadata.org/app/source/defi/AerodromeV1/](https://www.diadata.org/app/source/defi/AerodromeV1/) |
| [**ApeSwap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | BNB Chain | [https://www.diadata.org/app/source/defi/Apeswap/](https://www.diadata.org/app/source/defi/Apeswap/) |
| [**Arthswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Astar | [https://www.diadata.org/app/source/defi/Arthswap/](https://www.diadata.org/app/source/defi/Arthswap/) |
| [**Ayin**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/AyinScraper.go) | Alephium | [https://www.diadata.org/app/source/defi/Ayin/](https://www.diadata.org/app/source/defi/Ayin/) |
| [**Balancer v2**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BalancerV2Scraper.go) | \-Ethereum
\-Polygon
\-Arbitrum | [Ethereum](https://www.diadata.org/app/source/defi/BalancerV2/)
, [Polygon](https://www.diadata.org/app/source/defi/BalancerV2-Polygon/)
, [Arbitrum](https://www.diadata.org/app/source/defi/BalancerV2-Arbitrum/)
sources |
| [**Beets**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Fantom | [https://www.diadata.org/app/source/defi/Beets/](https://www.diadata.org/app/source/defi/Beets/) |
| [**Bifrost**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BifrostScraper.go) | Bifrost | [https://www.diadata.org/app/source/defi/Bifrost/](https://www.diadata.org/app/source/defi/Bifrost/) |
| [**Biswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | BNB Chain | [https://www.diadata.org/app/source/defi/Biswap/](https://www.diadata.org/app/source/defi/Biswap/) |
| [**Bitflow**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/BitflowScraper.go) | Stacks | [https://www.diadata.org/app/source/defi/Bitflow/](https://www.diadata.org/app/source/defi/Bitflow/) |
| [**Camelot**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go#L193) | Arbitrum | [https://www.diadata.org/app/source/defi/Camelot/](https://www.diadata.org/app/source/defi/Camelot/) |
| [**Camelot v3**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/camelotv3/camelotv3.go) | Arbitrum | [https://www.diadata.org/app/source/defi/CamelotV3/](https://www.diadata.org/app/source/defi/CamelotV3/) |
| [**Curve**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/CurvefiScraper.go) | \-Ethereum
\-Arbitrum
\-Fantom
\-Moonbeam
\-Polygon | [Ethereum](https://www.diadata.org/app/source/defi/Curvefi/)
, [Arbitrum](https://www.diadata.org/app/source/defi/Curvefi-Arbitrum/)
, [Fantom](https://www.diadata.org/app/source/defi/Curvefi-Fantom/)
, [Moonbeam](https://www.diadata.org/app/source/defi/Curvefi-Moonbeam/)
, [Polygon](https://www.diadata.org/app/source/defi/Curvefi-Polygon/)
sources |
| [**Dfyn**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Polygon | [https://www.diadata.org/app/source/defi/DFYN/](https://www.diadata.org/app/source/defi/DFYN/) |
| [**Diffusion**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | EVMOS | [https://www.diadata.org/app/source/defi/Diffusion/](https://www.diadata.org/app/source/defi/Diffusion/) |
| [**Hermes**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Metis | [https://www.diadata.org/app/source/defi/Hermes/](https://www.diadata.org/app/source/defi/Hermes/) |
| [**Huckleberry**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Moonriver | [https://www.diadata.org/app/source/defi/Huckleberry/](https://www.diadata.org/app/source/defi/Huckleberry/) |
| [**Hydration**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/HydrationScraper.go) | Hydration | [https://www.diadata.org/app/source/defi/Hydration/](https://www.diadata.org/app/source/defi/Hydration/) |
| [**Maverick**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/MaverickScraper.go) | Ethereum | [https://www.diadata.org/app/source/defi/Maverick/](https://www.diadata.org/app/source/defi/Maverick/) |
| [**Netswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Metis | [https://www.diadata.org/app/source/defi/Netswap/](https://www.diadata.org/app/source/defi/Netswap/) |
| [**NileV1**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go#L237) | Linea | [https://www.diadata.org/app/source/defi/NileV1/](https://www.diadata.org/app/source/defi/NileV1/) |
| [**NileV2**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go#L106) | Linea | [https://www.diadata.org/app/source/defi/NileV2/](https://www.diadata.org/app/source/defi/NileV2/) |
| [**OmniDEX**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Telos | [https://www.diadata.org/app/source/defi/OmniDex/](https://www.diadata.org/app/source/defi/OmniDex/) |
| [**Orca**](https://github.com/diadata-org/diadata/tree/master/pkg/dia/scraper/exchange-scrapers/orca) | Solana | [https://www.diadata.org/app/source/defi/Orca/](https://www.diadata.org/app/source/defi/Orca/) |
| [**Osmosis**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/OsmosisScraper.go) | Cosmos | [https://www.diadata.org/app/source/defi/Osmosis/](https://www.diadata.org/app/source/defi/Osmosis/) |
| [**PancakeSwap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Binance Smart Chain | [https://www.diadata.org/app/source/defi/PanCakeSwap/](https://www.diadata.org/app/source/defi/PanCakeSwap/) |
| [**PancakeSwapV3**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Binance Smart Chain | [https://www.diadata.org/app/source/defi/PanCakeSwapV3/](https://www.diadata.org/app/source/defi/PanCakeSwapV3/) |
| [**Pangolin**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Avalanche | [https://www.diadata.org/app/source/defi/Pangolin/](https://www.diadata.org/app/source/defi/Pangolin/) |
| [**Pearlfi**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go#L243) | Unreal | [https://www.diadata.org/app/source/defi/Pearlfi/](https://www.diadata.org/app/source/defi/Pearlfi/) |
| [**Quickswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Polygon | [https://www.diadata.org/app/source/defi/Quickswap/](https://www.diadata.org/app/source/defi/Quickswap/) |
| [**RamsesV1**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go#L239) | Arbitrum | [https://www.diadata.org/app/source/defi/RamsesV1/](https://www.diadata.org/app/source/defi/RamsesV1/) |
| [**RamsesV2**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go#L104) | Arbitrum | [https://www.diadata.org/app/source/defi/RamsesV2/](https://www.diadata.org/app/source/defi/RamsesV2/) |
|  [**Solarbeam**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Moonriver | [https://www.diadata.org/app/source/defi/Solarbeam/](https://www.diadata.org/app/source/defi/Solarbeam/) |
|  [**Spookyswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Fantom | [https://www.diadata.org/app/source/defi/Spookyswap/](https://www.diadata.org/app/source/defi/Spookyswap/) |
|  [**Stellaswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Moonbeam | [https://www.diadata.org/app/source/defi/Stellaswap/](https://www.diadata.org/app/source/defi/Stellaswap/) |
|  [**SushiSwap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | \-Ethereum
\-Arbitrum
\-Fantom
\-Polygon | [Ethereum](https://www.diadata.org/app/source/defi/SushiSwap/)
, [Arbitrum](https://www.diadata.org/app/source/defi/SushiSwap-arbitrum/)
, [Fantom](https://www.diadata.org/app/source/defi/SushiSwap-fantom/)
, [Polygon](https://www.diadata.org/app/source/defi/SushiSwap-polygon/)
sources |
|  [**Tethys**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Metis | [https://www.diadata.org/app/source/defi/Tethys/](https://www.diadata.org/app/source/defi/Tethys/) |
| [**Thena**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go#L241) | Binance Smart Chain | |
| [**ThenaV3**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go#L97) | Binance Smart Chain | |
|  [**Trader Joe**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Avalanche | [https://www.diadata.org/app/source/defi/TraderJoe/](https://www.diadata.org/app/source/defi/TraderJoe/) |
|  [**Trader Joe 2.1**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/traderjoe2.1/traderjoe.go) | Avalanche | [https://www.diadata.org/app/source/defi/TraderJoeV2.1-Arbitrum/](https://www.diadata.org/app/source/defi/TraderJoeV2.1-Arbitrum/) |
| [**Trader Joe 2.2**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/TraderJoeScraper.go#L112) | Avalanche | [https://www.diadata.org/app/source/defi/TraderJoeV2.2-Avalanche/](https://www.diadata.org/app/source/defi/TraderJoeV2.2-Avalanche/) |
|  [**Trisolaris**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Aurora | [https://www.diadata.org/app/source/defi/Trisolaris/](https://www.diadata.org/app/source/defi/Trisolaris/) |
|  [**Ubeswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Celo | [https://www.diadata.org/app/source/defi/Ubeswap/](https://www.diadata.org/app/source/defi/Ubeswap/) |
|  [**Uniswap V2**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Ethereum | [https://www.diadata.org/app/source/defi/Uniswap/](https://www.diadata.org/app/source/defi/Uniswap/) |
|  [**Uniswap V3**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV3Scraper.go) | \-Ethereum
\-Arbitrum
\-Polygon
\-Celo
\-Base | [Ethereum](https://www.diadata.org/app/source/defi/UniswapV3/)
, [Arbitrum](https://www.diadata.org/app/source/defi/UniswapV3-Arbitrum/)
, [Polygon](https://www.diadata.org/app/source/defi/UniswapV3-polygon/)
, [Celo](https://www.diadata.org/app/source/defi/UniswapV3-Celo/)
, [Base](https://www.diadata.org/app/source/defi/UniswapV3-Base/)
sources |
| [**Velar**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/VelarScraper.go) | Stacks | [https://www.diadata.org/app/source/defi/Velar/](https://www.diadata.org/app/source/defi/Velar/) |
|  [**Velodrome**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/velodrome/velodrome.go) | Optimism | [https://www.diadata.org/app/source/defi/Velodrome/](https://www.diadata.org/app/source/defi/Velodrome/) |
|  [**Wanswap**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/UniswapV2Scraper.go) | Wanchain | [https://www.diadata.org/app/source/defi/Wanswap/](https://www.diadata.org/app/source/defi/Wanswap/) |
|  [**Zenlink**](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/ZenlinkScraper.go) | \-Bifrost
\-Bifrost-Polkadot | [Bifrost](https://www.diadata.org/app/source/defi/Zenlink/)
, and [Bifrost-Polkadot](https://www.diadata.org/app/source/defi/Zenlink-bifrost-polkadot/)
sources |
Was this page helpful?
YesNo
[CEXes Data](https://www.diadata.org/docs/dia-stack/architecture/data-sources/cexes-data)
[Distributed Randomness Beacon](https://www.diadata.org/docs/dia-stack/architecture/data-sources/randomness)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-sources/dexes-data#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview#)
[Data Sources](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#data-sources)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/dia-stack/data-sources/cexes-data#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
[Data Sources](https://www.diadata.org/docs/dia-stack/architecture/data-sources/overview#data-sources)
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview#)
⌘I
---
# Hardware Specs - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Run a Feeder
Hardware Specs
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Cost Projections](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#cost-projections)
* [Standalone VM](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#standalone-vm)
* [Kubernetes Clusters](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#kubernetes-clusters)
* [Performance Metrics](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#performance-metrics)
| Hardware | Normal Usage | Peak Usage |
| --- | --- | --- |
| Memory | ~100 MiB | ~500 MiB |
| CPU | ~0.1 cores | ~0.3 cores |
| Storage | Minimal | N/A |
The storage is minimal because no historical data is stored on the nodes; only real-time data is pushed directly to smart contracts. These resource needs can be sufficiently met by a minimal, entry-level virtual machine from most cloud providers with the following specifications:
* 1 vCPU
* 1 GB RAM
* 10 GB Storage
[](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#cost-projections)
Cost Projections
------------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#standalone-vm)
**Standalone VM**
The cost of operating the decentral-feeder primarily depends on the infrastructure selected by the node operator. The following prices are estimates and may vary depending on factors such as region, additional services, network usage, and other considerations.
| Cloud Provider | Monthly Costs |
| --- | --- |
| Hetzner (CX22) | ~$4 |
| Amazon AWS (t2.micro) | ~$9 |
| DigitalOcean (Basic Droplet) | ~$5 |
###
[](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#kubernetes-clusters)
**Kubernetes Clusters**
The costs of running feeder nodes in our Kubernetes clusters are generally higher compared to standalone VMs. It also depends on your setup and the additional overhead of managing Kubernetes infrastructure and other services.
[](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs#performance-metrics)
Performance Metrics
------------------------------------------------------------------------------------------------------------------------------
* Our nodes are configured with 20-100 websocket connections open in parallel, and a transaction is being sent every 1-20 seconds so a similar configuration would be expected
* You can use public RPC endpoints to fetch data and submit txns onchain. However, they’re mostly good for testing purposes so we recommend setting up a private endpoint for consistent usage. Here are some of our recommendations:
[Chainstack\
----------](https://chainstack.com/)
[Alchemy\
-------](https://www.alchemy.com/)
[Ankr\
----](https://www.ankr.com/)
[Quicknode\
---------](https://www.quicknode.com/)
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/general-guides/run-a-feeder)
[Overview](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node)
⌘I
---
# Development Cluster Stack - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Development Cluster Stack
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Data](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#data)
* [Services](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#services)
* [Scrapers](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#scrapers)
* [Development Specific](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#development-specific)
* [Additional](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#additional)
* [Helms being tested](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#helms-being-tested)
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#data)
Data
* Influx
* PostgreSQL
* Redis
* Kafka
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#services)
Services
* Filterblock
* Tradesblock
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#scrapers)
Scrapers
* Foreign
* Liquidity
* Collector
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#development-specific)
Development Specific
* Ping jobs
* Prepare job (when install does not depend on external image)
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#additional)
Additional
* Grafana
* Loki
* Influx
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#helms-being-tested)
Helms being tested
* DIA Helm chart: DIA platform
* Influx: Timeseries db
* Grafana: Dashboard for monitoring
* Loki: Logging the services
* [Jaeger Tracing](https://www.jaegertracing.io/)
: Tracing system for services
* kube-prometheus: Monitoring Minikube cluster
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/general-guides/tutorials)
[DIA Test‐Space with Docker Compose](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose)
⌘I
---
# DIA Test‐Space with Docker Compose - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
DIA Test‐Space with Docker Compose
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Prepare](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare)
* [Scrapers](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#scrapers)
* [CEX (Kraken as example)](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#cex-kraken-as-example)
* [Prepare](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare-2)
* [Run the scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#run-the-scraper)
* [DEX (CurveFi as example)](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#dex-curvefi-as-example)
* [Prepare](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare-3)
* [Run the scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#run-the-scraper-2)
* [Clean](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#clean)
* [Advanced usage](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#advanced-usage)
* [Access services between Docker Composes](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#access-services-between-docker-composes)
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare)
Prepare
-----------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
# Start data store services
(
cd deployments/local/exchange-scraper
docker compose -f docker-compose.yml up --build --force-recreate -d
)
# Define env variables needed
export USE_ENV=true
export INFLUXURL=http://localhost:8086
export INFLUXUSER=test
export INFLUXPASSWORD=testtest
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=password
export POSTGRES_HOST=localhost
export POSTGRES_DB=postgres
export REDISURL=localhost:6379
# Set config directory
export DIA_CONFIG_DIR=./config
# Set local directory as Go dependency
go mod edit -replace "github.com/diadata-org/diadata=$(pwd)" cmd/exchange-scrapers/collector/go.mod
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#scrapers)
Scrapers
-------------------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#cex-kraken-as-example)
CEX (Kraken as example)
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare-2)
Prepare
Copy
Ask AI
# Initialize the exchange and blockchain metadata
go run ./cmd/services/blockchainservice/main.go
# Prepare pairs metadata
go run ./cmd/services/pairDiscoveryService/main.go -exchange=Kraken -mode=verification
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#run-the-scraper)
Run the scraper
Copy
Ask AI
go run ./cmd/exchange-scrapers/collector/collector.go -exchange=Kraken -mode=storeTrades
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#dex-curvefi-as-example)
DEX (CurveFi as example)
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#prepare-3)
Prepare
Copy
Ask AI
# Set needed RPC variables
export ETHEREUM_URI_REST=https://rpc.ankr.com/eth
export ETHEREUM_URI_WS=wss://eth-mainnet.g.alchemy.com/v2/7X9hL_lpF-Utavuv1aT49SWkWu9oYZTq
# Prepare the assets metadata
go run ./cmd/assetCollectionService/main.go -source=assetlists -secret=eth_assets -caching=true
go run ./cmd/assetCollectionService/main.go -source=assetlists -secret=non_eth_assets -caching=true
go run ./cmd/assetCollectionService/main.go -source=assetlists -secret=fiat_assets -caching=true
go run ./cmd/assetCollectionService/main.go -source=Curvefi -caching=true
# Prepare and populate pools
go run ./cmd/liquidityScraper/main.go -exchange=Curvefi
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#run-the-scraper-2)
Run the scraper
Copy
Ask AI
go run ./cmd/exchange-scrapers/collector/collector.go -exchange=Curvefi -mode=storeTrades
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#clean)
Clean
-------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
unset USE_ENV
unset INFLUXURL
unset INFLUXUSER
unset INFLUXPASSWORD
unset POSTGRES_USER
unset POSTGRES_PASSWORD
unset POSTGRES_HOST
unset POSTGRES_DB
unset REDISURL
unset DIA_CONFIG_DIR
unset ETHEREUM_URI_REST
unset ETHEREUM_URI_WS
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#advanced-usage)
Advanced usage
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose#access-services-between-docker-composes)
Access services between Docker Composes
On prepare step if you want to connect services between other Compose files, create a `deployments/local/exchange-scraper/docker-compose.override.yml` file:
Copy
Ask AI
version: "3.3"
services:
influxdb:
networks:
- dia-bridge
networks:
dia-bridge:
driver: bridge
And instead of run the services using this command:
Copy
Ask AI
# Start data store services
(
cd deployments/local/exchange-scraper
docker compose -f docker-compose.yml -f docker-compose.override.yml up --build --force-recreate -d
)
Now in other Compose file just use like this:
Copy
Ask AI
version: "3"
networks:
exchange-scraper_dia-bridge:
external: true
services:
service-x:
image: service-x-image
networks:
- exchange-scraper_dia-bridge
Now in Docker context, `service-x` can resolve the `http://influxdb:8086` hostname
Was this page helpful?
YesNo
[Development Cluster Stack](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack)
[DIA Test‐Space with Minikube](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-minikube)
⌘I
---
# Setting Up the Node - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Setting Up the Node
Setting Up the Node
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Requirements](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node#requirements)
Make sure you familiraize yourself with the data flow in the Lumina system before proceeding with the node setup. To learn more, checkout the architecture guide [here](https://www.diadata.org/docs/reference/architecture)
.
[](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node#requirements)
Requirements
---------------------------------------------------------------------------------------------------------------------
* Ensure that Docker or Docker Compose is installed on your machine.
* Clone the [decentral-feeder repository](https://github.com/diadata-org/decentral-feeder)
to your local machine.
* The container has minimal resource requirements, making it suitable for most machines, including Windows, macOS, Linux, and Raspberry Pi, as long as Docker is installed.
* An ETH private key from MetaMask or any other Eth wallet. Alternatively to generate private key effortlesly eth-keys tool can be used for this [ethereum/eth-keys](https://github.com/ethereum/eth-keys)
* DIA tokens in your wallet. If you’re using testnet, you can access the faucet [here](https://faucet.diadata.org/)
.
Next, select your preferred deployment method:
[Docker compose\
--------------\
\
Suitable for a single container setup and quick testing](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose)
[Docker run\
----------\
\
Suitable for simple setups without orchestration](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-run)
[Kubernetes\
----------\
\
Ideal for production environments requiring scalability and high availability](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/kubernetes)
Was this page helpful?
YesNo
[Hardware Specs](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/hardware-specs)
[Docker Compose](https://www.diadata.org/docs/guides/general-guides/run-a-feeder/setting-up-the-node/docker-compose)
⌘I
---
# Return Rates in Crypto Farming - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Research
Return Rates in Crypto Farming
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Pool Rates](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#pool-rates)
* [Total Debt Systems](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#total-debt-systems)
* [Estimation of Pool Rates from Total Rewards](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#estimation-of-pool-rates-from-total-rewards)
* [Fixed Reward Systems](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#fixed-reward-systems)
Decentralized Finance (DeFi) has attracted a lot of attention in the recent years. A rather new and hot topic inside the world of DeFi is yield farming, which allows to earn passive income on token holdings using various investment strategies coded into smart contracts. There is an ever growing number of products labeled as yield farming. Many of those are advertised with an APY (Annual Percentage Yield) rate. We emphasize that in this context, the term APY is to be read with caution. In classical finance, it refers to the annual rate of return in an investment and is a predefined rate. Hence, an investor can be sure to obtain the corresponding interest in their investment. However, most farming products heavily rely on the investment strategy in volatile crypto markets. In contrast to APYs in lending and borrowing, rates published in farming are either APYs of past periods or projections based on past data.
[](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#pool-rates)
Pool Rates
-------------------------------------------------------------------------------------------------------------------
Due to the complexity of this topic, our first step consists of publishing the pool rates as emitted in the smart contracts of various farming products such as _yearn.finance_ or _CVault_. The basic idea of pool rates is pretty straightforward and can be understood as follows. Consider a farming pool of token X and let AX(i)A\_X(i)AX(i) be the amount of token X at block number iii. Assume, farming starts at block number i0i\_0i0, then we have the following equation AX(i)\=AX(i0)⋅pX(i)A\_X(i) = A\_X(i\_0) \\cdot p\_X(i)AX(i)\=AX(i0)⋅pX(i) where pX(i)p\_X(i)pX(i) is the price corresponding to the pool of token X . Initially, i\=i0i = i\_0i\=i0 and hence pX(i0)\=1p\_X(i\_0) = 1pX(i0)\=1. Motivated by this fact, we write pX(i)\=1+rX(i)p\_X(i) = 1 + r\_X(i)pX(i)\=1+rX(i) Here, rX(i)r\_X(i)rX(i) is the _pool rate_ corresponding to the pool of token X. As the initial supply AX(i0)A\_X(i\_0)AX(i0) is constant, the price depends on the evolution of AX(i)A\_X(i)AX(i) and hence on the pool’s investment strategy - if the number of tokens AX(i)A\_X(i)AX(i) increases with block number iii, so will the pool rate. In other words, the return of an investment is determined by the change in the pool rate. The following example illustrates the relation between the pool rate and the return on an investment. We remark that in general, as for interest rates in traditional finance, differences of pool rates can be used for simple interest calculation as well as for compounded interest. **Example:** Assume an investor puts an amount of 100 tokens X into an empty pool at block number 10000000. With the notation from above this means i0\=10000000i\_0 = 10000000i0\=10000000 and AX(10000000)\=100A\_X(10000000) = 100AX(10000000)\=100. Further assume that 1000 blocks later, the investment strategy has increased the number of tokens in the pool to 101 tokens, so AX(10001000)\=101A\_X(10001000) = 101AX(10001000)\=101. The return on the initial investment after these 1000 blocks can be obtained by the difference of the pool rates at blocks 10001000 and 10000000 respectively. Indeed, we have pX(10000000)\=1p\_X(10000000) = 1pX(10000000)\=1 and thus rX(10000000)\=0r\_X(10000000) = 0rX(10000000)\=0. By the above equation for AX(i)A\_X(i)AX(i) we have pX(10001000)\=AX(10001000)AX(1000000)\=101100p\_X(10001000) = \\frac{A\_X(10001000)}{A\_X(1000000)} = \\frac{101}{100}pX(10001000)\=AX(1000000)AX(10001000)\=100101 and thus rX(10001000)\=1100r\_X(10001000) = \\frac{1}{100}rX(10001000)\=1001. This yields rX(10001000)−rX(10000000)\=1100r\_X(10001000) - r\_X(10000000) = \\frac{1}{100}rX(10001000)−rX(10000000)\=1001 and hence a return rate of 1%. Again, whether the amount of tokens in a pool increases or decreases solely depends on the investment strategy. The return rates for past time ranges can be computed by considering pool rate differences, such as done in the example above. In order to estimate future return rates, one can apply mathematical methods which allow for the estimation of future values based on past data. The simplest way of doing so is to fit a linear function to the data, which is also known under the name of (linear) regression. However, for most cases, such simple models do not yield good results for bigger time ranges. Mathematicians have tackled such problems since a long time and there is a wide range of techniques available. Nowadays, many of these are used under the name of _machine learning_.
[](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#total-debt-systems)
Total Debt Systems
-----------------------------------------------------------------------------------------------------------------------------------
A slightly different approach for farming is presented by other platforms such as _Synthetix_. Apart from constant fee rates on transactions such as trades, the dynamical return rate depends on the average return of all investments on the platform. The corresponding gains (or losses) for the investors are paid out periodically, for instance weekly. We will first explain the general mechanism and then illustrate it with an example. Consider a platform with n different pools associated to an investment strategy. In most cases, the investment strategy is short or long on a cryptocurrency, represented by a minted synthetic asset. Assume an investor makes an investment by buying from a pool of such a token X worth p0p\_0p0 US-Dollar (it could be any other currency obviously). She thereby increases the so-called system’s _total debt_ from the previous value to D0D\_0D0 (also in US-Dollar). Here, the total debt is just the value of all investments across the platform. Now assume that after one farming period has elapsed, the value of her investment is p1p\_1p1. Furthermore, the system’s total debt, i.e. the US-Dollar value of all investments together changed to D1D\_1D1. The idea is that the system does not owe the investor her initial investment, but rather her initial proportion of the system’s total debt, which is D0p0D\_0 p\_0D0p0. Hence, her actual personal debt DInvD\_{Inv}DInv is DInv\=D0p0⋅D1D\_{Inv} = D\_0 p\_0 \\cdot D\_1DInv\=D0p0⋅D1 In other words, the total debt is distributed among all investors according to their initial share of the total debt. In particular, everyone wins if D1\>D0D\_1 > D\_0D1\>D0, that is, the total debt increases, and everyone looses if D1 Note: Minikube runs on a virtualization layer on the host. The [docker](https://minikube.sigs.k8s.io/docs/drivers/docker/)
> driver is usually the recommended and default option and should be seen as a requirement. For other supported drivers, please refer to [Minikube’s official documentation](https://minikube.sigs.k8s.io/docs/drivers/)
> . You can also check [Minikube’s handbook](https://minikube.sigs.k8s.io/docs/handbook/)
> for advanced command usage.
1
First, install dependencies: [Minikube](https://github.com/kubernetes/minikube#installation)
and [Docker](https://www.docker.com/)
.
2
Next, start the development environment by running the following command to start a Minikube node:
Copy
Ask AI
./testenv.sh start
3
Build the necessary service containers by executing the following commands:
Copy
Ask AI
./testenv.sh build
4
Run the installation script to set up the necessary services (Redis cache, Kafka streams, PostgreSQL, and InfluxDB databases) by executing the following commands:
Copy
Ask AI
./testenv.sh install
Now that you have the local cluster running, you are ready to start.
5
Import the test data from the diadata snapshot service. This requires the default structure to be empty and created inside the postgres server. The script will automatically download the snapshot, install it and remove the downloaded snapshot again:
Copy
Ask AI
./testenv.sh snapshot
[](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-minikube#other-useful-commands)
Other useful commands
---------------------------------------------------------------------------------------------------------------------------------------------
To stop the cluster:
Copy
Ask AI
./testenv.sh stop
To delete the cluster node:
Copy
Ask AI
./testenv.sh delete
Was this page helpful?
YesNo
[DIA Test‐Space with Docker Compose](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-docker-compose)
[Add a New Exchange Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper)
⌘I
---
# Add a New Liquidity Scraper - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Add a New Liquidity Scraper
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Liquidity Command](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#liquidity-command)
* [Liquidity Test](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#liquidity-test)
Implement `LiquidityScraper` interface at `pkg/dia/scraper/liquidity-scrapers/ScraperInterface.go` file
Copy
Ask AI
type LiquidityScraper interface {
Pool() chan dia.Pool
Done() chan bool
}
1
Add a scraper implementation, `MyLiquidityScraper.go` file to `pkg/dia/scraper/liquidity-scrapers/` folder implement the functions:
Copy
Ask AI
func (scraper *MyLiquidityScraper) Pool() chan dia.Pool {}
func (scraper *MyLiquidityScraper) Done() chan bool {}
2
Add a constructor for the scraper:
Copy
Ask AI
func NewMyLiquidityScraper(exchange dia.Exchange) *MyLiquidityScraper {}
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#liquidity-command)
Liquidity Command
------------------------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=ExchangeName
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#liquidity-test)
Liquidity Test
------------------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=EXCHANGE_NAME
* PlatypusFinance: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=PlatypusFinance`
* Orca: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && SOLANA_URI_REST=https://try-rpc.mainnet.solana.blockdaemon.tech/ liquidityScraper -exchange=Orca`
Was this page helpful?
YesNo
[Add a New Foreign Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper)
[Additional Notes](https://www.diadata.org/docs/guides/general-guides/tutorials/additional-notes)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/resources/research/return-rates-in-crypto-farming#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Return Rates in Crypto Farming](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming#return-rates-in-crypto-farming)
[Research](https://www.diadata.org/docs/guides/resources/research#)
[Crypto Volatility Index](https://www.diadata.org/docs/guides/resources/research/cvi#)
⌘I
---
# Add a New Foreign Scraper - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Add a New Foreign Scraper
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Foreign Command](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#foreign-command)
* [Foreign Test](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#foreign-test)
Implement `ForeignScrapperer` interface at `pkg/dia/scraper/foreign-scrapers/Scrapper.go` file
Copy
Ask AI
type ForeignScrapperer interface {
UpdateQuotation() error
GetQuoteChannel() chan *models.ForeignQuotation
}
Add the scraper implementation a `MyForeignScraper.go` Golang file to `pkg/dia/scraper/foreign-scrapers/` folder and add the next implementations:
Copy
Ask AI
func (scraper *MyForeignScraper) Pool() chan dia.Pool {}
func (scraper *MyForeignScraper) Done() chan bool {}
1
Add a constructor for the scraper:
Copy
Ask AI
func NewMyForeignScraper(exchange dia.Exchange) *MyForeignScraper {}
2
Add `MyForeignScraper` case at scraper file `cmd/foreignscraper/foreign.go`:
Copy
Ask AI
switch *scraperType {
case "MyForeignScraper":
log.Println("Start scraping data")
sc = scrapers.NewMyForeignScraper(ds)
}
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#foreign-command)
Foreign Command
------------------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=ForeignType
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#foreign-test)
Foreign Test
------------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && foreignscraper -foreignType=FOREIGN_TYPE
Was this page helpful?
YesNo
[Add a New Exchange Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper)
[Add a New Liquidity Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper)
⌘I
---
# Crypto Volatility Index - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/research/cvi#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Research
Crypto Volatility Index
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Instruments are named uniquely to identify them. For example, BTC-03JUN2020-6000-C is the name of a Bitcoin call option expiring at 3rd of June 2020 for a strike price of 6000 USD. To calculate the CVI, the option levels of two dates are considered: The next Friday that is at least one month away from now and the first Friday with available options before that date. With that we ensure that the future market is observed appropriately.
Options typically expire on Fridays only, thus we can only observe them for these dates.
The CVI is then calculated using this formula: x\=100⋅{T1σ12(NT2−N30NT2−NT1)+T2σ22(N30−NT1NT2−NT1)}⋅N365N30x = 100 \\cdot \\sqrt{ \\left\\{ T\_1 \\sigma\_1^2 \\left( \\frac{N\_{T\_2} - N\_{30}}{N\_{T\_2} - N\_{T\_1}} \\right) + T\_2 \\sigma\_2^2 \\left( \\frac{N\_{30} - N\_{T\_1}}{N\_{T\_2} - N\_{T\_1}} \\right) \\right\\} \\cdot \\frac{N\_{365}}{N\_{30}} }x\=100⋅{T1σ12(NT2−NT1NT2−N30)+T2σ22(NT2−NT1N30−NT1)}⋅N30N365 where N describe the minutes until the respective event (e.g. minutes in a year, 30 days or minutes until expiry of option T1). T1 and T2 are the fractions of minutes left until expiry of these options compared to the minutes in a full year. The variances are calculated as such: σ2\=2T∑iΔKiKi2eRTQ(Ki)\\sigma^2 = \\frac{2}{T} \\sum\_{i} \\frac{\\Delta K\_i}{K\_i^2} e^{RT} Q(K\_i)σ2\=T2i∑Ki2ΔKieRTQ(Ki) with the sum of deltas being defined as the intervals between strike prices for each strike price. R is the risk-free lending rate and Q(k) is used to describe the average of the bid-ask-spread for an option K\_i. The CVI starts at a value of 1000.
Was this page helpful?
YesNo
[Return Rates in Crypto Farming](https://www.diadata.org/docs/guides/resources/research/return-rates-in-crypto-farming)
[Compounded Rates](https://www.diadata.org/docs/guides/resources/research/compounded-rates)
⌘I
---
# Add a New Exchange Scraper - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Build a Scraper
Add a New Exchange Scraper
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Add your scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#add-your-scraper)
* [Steps to run the scraper locally](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#steps-to-run-the-scraper-locally)
* [Exchanges Command](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#exchanges-command)
* [Exchange Test](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#exchange-test)
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#add-your-scraper)
Add your scraper
> Before you begin writing a scraper, please check if the exchange offers integration through WebSockets. If it does, implement the scraper using the WebSocket protocol instead of a RESTful API.
To scrape data from an exchange data source, called “**MySource**” for instance, follow these steps:
1
Create a new file in the directory `pkg/dia/scraper/exchange-scrapers/` with the filename `MySourceScraper.go`.
2
To allow the platform to call your scraper, implement a scraper that conforms to the [APIScraper](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/APIScraper.go#L81)
interface from the _scrapers_ package:
Copy
Ask AI
type APIScraper interface {
io.Closer
ScrapePair(pair dia.Pair) (PairScraper, error)
FetchAvailablePairs() (pairs []dia.Pair, err error)
Channel() chan *dia.Trade
}
Start building your scraper by writing a function with the signature `NewMySourceScraper(exchangeName string) *MySourceScraper`. We suggest that this function calls a `mainLoop()` method in a go routine, constantly receiving trade information through the trade channel of _MySourceScraper_ as long as the channel is open.In order to implement the interface, it is necessary to include the `ScrapePair` method, which returns a _MySourcePairScraper_ for a specific pair, so our main collection method can iterate over all possible trading pairs. Note that _MySourcePairScraper_ should respect and implement the [`PairScraper`](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/APIScraper.go#L103)
interfaceAlso, to ensure proper error handling and cleanup, it is recommended to include a method `Error()`, which returns an error as soon as the scraper’s channel closes. Additionally, `Close()` and `cleanup()` methods should be included to handle the closing and shutting down of channels.
> For a better understanding of how to set up a scraper, you can refer to the [`CoinBaseScraper.go`](https://github.com/diadata-org/diadata/blob/master/pkg/dia/scraper/exchange-scrapers/CoinBaseScraper.go)
> file, as it provides an example of an existing exchange scraper and its overall structure and logic.
3
To make the scraper visible to the system, add a reference to it in `Config.go` in the _dia_ package:
Copy
Ask AI
const (
MySourceExchange = "MySource"
)
4
Add a case for your scraper in the switch statement in the `pkg/dia/scraper/exchange-scrapers/APIScraper.go` file:
Copy
Ask AI
func NewAPIScraper(exchange string, key string, secret string) APIScraper {
switch exchange {
case dia.MySourceExchange:
return NewMySourceScraper(key, secret, dia.MySourceExchange)
}
}
5
Finally, add exchange’s pairs to `config/MySourceExchange.json` config:
Copy
Ask AI
{
"Coins": [\
{\
"Exchange": "MySource",\
"ForeignName": "QUICK-USD",\
"Ignore": false,\
"Symbol": "QUICK"\
}\
]
}
####
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#steps-to-run-the-scraper-locally)
Steps to run the scraper locally
1
Modify the `build/Dockerfile-genericCollector` and `build/Dockerfile-pairDiscoveryService` files and add the following two lines before the `RUN go mod tidy` step:
Copy
Ask AI
COPY . /diadata
RUN go mod edit -replace github.com/diadata-org/diadata=/diadata
2
Build the necessary service containers by running the following commands:
Copy
Ask AI
minikube image build -t diadata.pairdiscoveryservice:latest -f build/Dockerfile-pairDiscoveryService .
minikube image build -t diadata.exchangescrapercollector:latest -f build/Dockerfile-genericCollector .
3
Create a manifest for the new exchange scraper by creating a new `mysource.yaml` file. You can refer to existing files for guidance or use the following template:
Copy
Ask AI
apiVersion: "v1"
kind: Pod
metadata:
name: "exchangescraper-mysource"
spec:
containers:
- name: exchangescraper-mysource
image: diadata.exchangescrapercollector:latest
imagePullPolicy: Never
command: ["collector"]
args: ["-exchange=MySource", "-mode=current", "-pairsfile=true"]
env:
- name: USE_ENV
value: "true"
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
value: "password"
- name: POSTGRES_DB
value: "postgres"
- name: POSTGRES_HOST
value: "postgres.default.svc.cluster.local"
- name: INFLUXURL
value: "http://influx.default.svc.cluster.local:8086"
- name: INFLUXUSER
value: "test"
- name: INFLUXPASSWORD
value: "testtest"
- name: REDISURL
value: "redis.default.svc.cluster.local:6379"
- name: KAFKAURL
value: "kafka.default.svc.cluster.local:9094"
initContainers:
- name: pairdiscovery-mysource
image: diadata.pairdiscoveryservice:latest
imagePullPolicy: Never
command: ["pairDiscoveryService"]
args: ["-exchange=MySource", "-mode=verification"]
env:
- name: USE_ENV
value: "true"
- name: POSTGRES_USER
value: "postgres"
- name: POSTGRES_PASSWORD
value: "password"
- name: POSTGRES_DB
value: "postgres"
- name: POSTGRES_HOST
value: "postgres.default.svc.cluster.local"
- name: INFLUXURL
value: "http://influx.default.svc.cluster.local:8086"
- name: INFLUXUSER
value: "test"
- name: INFLUXPASSWORD
value: "testtest"
- name: REDISURL
value: "redis.default.svc.cluster.local:6379"
- name: KAFKAURL
value: "kafka.default.svc.cluster.local:9094"
4
Before running the manifest, create a new entry in the database for the new exchange:
Copy
Ask AI
kubectl exec -it deployment/postgres -- psql -U postgres -c "INSERT INTO exchange (exchange_id, "name", centralized, bridge, contract, blockchain, rest_api, ws_api, pairs_api, watchdog_delay, scraper_active) VALUES(gen_random_uuid(), 'MySource', true, false, '', '', '', 'wss://mysource.com', 'https://mysource.com', 300, true);"
5
Deploy the manifest using the following _kubectl_ command:
Copy
Ask AI
kubectl create -f mysource.yaml
Hooray Your scraper should now be running.
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#exchanges-command)
Exchanges Command
CEX
Copy
Ask AI
pairDiscoveryService -exchange=ExchangeName -mode=verification
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=ExchangeName -mode=current -pairsfile=true
DEX
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=ExchangeName -mode=current -pairsfile=true
###
[](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#exchange-test)
Exchange Test
Copy
Ask AI
go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=EXCHANGE_NAME -mode=current -pairsfile=true
Centralized:
* Bitfinex: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=Bitfinex -mode=current -pairsfile=true`
* rm ./collector.go && cp /mnt/env-context/cmd/exchange-scrapers/collector/collector.go ./collector.go && go mod edit -replace github.com/diadata-org/diadata=/mnt/env-context && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install -a && collector -exchange=Bitfinex -mode=current -pairsfile=true
* Bittrex: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=Bittrex -mode=current -pairsfile=true`
* CoinBase: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=CoinBase -mode=current -pairsfile=true`
* MEXC: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && collector -exchange=MEXC -mode=current -pairsfile=true`
Decentralized:
* PlatypusFinance
* Orca: `go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && SOLANA_URI_REST=https://try-rpc.mainnet.solana.blockdaemon.tech/ collector -exchange=Orca -mode=current -pairsfile=true`
Was this page helpful?
YesNo
[DIA Test‐Space with Minikube](https://www.diadata.org/docs/guides/general-guides/tutorials/dia-test-space-with-minikube)
[Add a New Foreign Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper)
⌘I
---
# Compounded Rates - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/research/compounded-rates#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Research
Compounded Rates
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Standard Methodology](https://www.diadata.org/docs/guides/resources/research/compounded-rates#standard-methodology)
* [DIA Methodology](https://www.diadata.org/docs/guides/resources/research/compounded-rates#dia-methodology)
[](https://www.diadata.org/docs/guides/resources/research/compounded-rates#standard-methodology)
Standard Methodology
-------------------------------------------------------------------------------------------------------------------------
Here, we present the methodology of compounded rates that is used by large banks such as the New York Federal Reserve Bank (compounded SOFR) and the Bank of England (compounded SONIA). Consider a unit investment over a time period of dcdcdc calendar days containing db≤dcdb \\leq dcdb≤dc business days. Let rir\_iri be an interest rate that is published once every business day and assume that the business day convention is such that the year has NNN days. Then, the compounded gain GGG over the whole interest period results to G\=∏i\=1di(1+ri×niN).G = \\prod\_{i=1}^{d\_i} \\left( 1 + \\frac{r\_i \\times n\_i}{N} \\right).G\=i\=1∏di(1+Nri×ni). We remark that for constant interest rates ri\=rr\_i = rri\=r and ni\=1n\_i = 1ni\=1 this simplifies to the well-known compounded gain formula G\=(1+rN)dbG = (1 + \\frac{r}{N})^{d\_b}G\=(1+Nr)db. However, in general, the rate factor nin\_ini is an integer value that accounts for iii being a business day or a non-business day. More precisely, if iii is a business day followed by kkk non-business days, we set ni\=k+1n\_i = k + 1ni\=k+1. For instance, if iii is followed by a business day, i.e., k\=0k = 0k\=0, we have ni\=1n\_i = 1ni\=1. For a friday, which is usually followed by two non-business days, we would have ni\=3n\_i = 3ni\=3. Now, in order to get the average interest III from the compounded gain GGG, we subtract the original investment and normalize, thus obtaining I\=Ndc\[∏i\=1ds(1+ri×niN)−1\]I = \\frac{N}{d\_c} \\left\[ \\prod\_{i=1}^{d\_s} \\left( 1 + \\frac{r\_i \\times n\_i}{N} \\right) - 1 \\right\]I\=dcN\[i\=1∏ds(1+Nri×ni)−1\] which is the formulation of compounded rates used by the FED and the BOE amongst others. Sources: [https://www.newyorkfed.org/medialibrary/Microsites/arrc/files/2019/Users\_Guide\_to\_SOFR.pdf](https://www.newyorkfed.org/medialibrary/Microsites/arrc/files/2019/Users_Guide_to_SOFR.pdf)
[https://www.bankofengland.co.uk/paper/2020/supporting-risk-free-rate-transition-through-the-provision-of-compounded-sonia](https://www.bankofengland.co.uk/paper/2020/supporting-risk-free-rate-transition-through-the-provision-of-compounded-sonia)
[](https://www.diadata.org/docs/guides/resources/research/compounded-rates#dia-methodology)
DIA Methodology
---------------------------------------------------------------------------------------------------------------
The methodology from the previous section has a special feature in that it mixes compounded and non-compounded rates. More precisely, investments are not compounded for weekends and holidays. This behaviour is reflected in the rate factor nin\_ini. In the Index IDIA presented below, investments are compounded over all calendar days in the respective interest period. Consider a unit investment over a time period of dcd\_cdc calendar days. Let rir\_iri be an interest rate that is published once every business day and assume that the business day convention is such that the year has NNN days. We define an interest rate rir\_iri such that rir\_iri coincides with rir\_iri on business days and is set to the rate of the previous business day if iii is a holiday or a weekend. In this straightforward manner we obtain an interest rate for all _calendar days_ and can now set IDIA\=Ndc\[∏j\=1dc(1+rjN)−1\].I\_{DIA} = \\frac{N}{d\_c} \\left\[ \\prod\_{j=1}^{d\_c} \\left( 1 + \\frac{r\_j}{N} \\right) - 1 \\right\].IDIA\=dcN\[j\=1∏dc(1+Nrj)−1\]. Link to API documentation: Coming soon!
Was this page helpful?
YesNo
[Crypto Volatility Index](https://www.diadata.org/docs/guides/resources/research/cvi)
[Polkadot Medianizer](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-liquidity-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Add a New Liquidity Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#)
[Build a Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials#)
[Add a New Exchange Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#)
⌘I
---
# Polkadot Medianizer - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Research
Polkadot Medianizer
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Laminar Chain](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#laminar-chain)
* [Setup](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#setup)
* [Cleanup](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#cleanup)
* [Use the Laminar chain’s oracle](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#use-the-laminar-chain%E2%80%99s-oracle)
* [TL;DR - Quick demo](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#tl%3Bdr-quick-demo)
[](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#laminar-chain)
Laminar Chain
--------------------------------------------------------------------------------------------------------------
The Laminar chain is built using the [Substrate framework](https://substrate.dev/)
. In our example we are going to setup a network consisting if two nodes, one is operated by Alice and one is operated by Bob.
###
[](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#setup)
Setup
First we download the Laminar chain [sources](https://github.com/laminar-protocol/laminar-chain)
and bootstrap the network. After that we execute the following statements in the chain’s directory.
Copy
Ask AI
example$ git clone https://github.com/laminar-protocol/laminar-chain.git
example$ cd laminar-chain
example/laminar-chain$ make init
example/laminar-chain$ make build
`make init` will setup the environment by downloading and installing all necessary dependencies and the required toolchain. `make build` builds the chain’s code so we can execute it. After that copy the `chainSpec.json` file from this repository into the chain’s directory. More on the spec file will be explained a little bit later.
###
[](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#cleanup)
Cleanup
When running a node being part of the laminar chain network it creates and stores lots of data because it’s constantly building new blocks and extending the actual blockchain. We are going to store all that data in a subdirectory of `/tmp` for each node (its base directory). If the base directory doesn’t exist it will be created but it is necessary to purge all data of a specific node on subsequent launches:
Copy
Ask AI
example/laminar-chain$ SKIP_WASM_BUILD= cargo run -- purge-chain --base-path /tmp/alice
This wipes the base directory of Alice’s node. For wiping Bob’s node’s data adjust the base-path parameter accordingly. The action asks for confirmation which is given by answering with `y`. **Bootstrap the network** We are going to launch Alice’s node first:
Copy
Ask AI
example/laminar-chain$ SKIP_WASM_BUILD= cargo run -- --base-path /tmp/alice --chain=chainSpec.json --alice --port 30333 --ws-port 9945 --rpc-port 9933
* This creates and runs a node that stores its data in the specified base directory.
* We also pass the chain specification file into the node. We use this file to configure the scenario in which all participating parties will own a sufficient amount of gas in order to be able to “pay” for their transmitted transactions.
* The parameter `--alice` will make Alice the node’s authority uses her predefined key pair.
* We specify three ports: One for the other peers to connect to the node, a websocket port for the off-chain worker to connect to and a port for incoming RPCs.
After that we fire up Bob’s node and tell it to connect to Alice. So in another terminal session we are executing
Copy
Ask AI
example/laminar-chain$ SKIP_WASM_BUILD= cargo run -- --base-path /tmp/bob --chain=chainSpec.json --bob --port 30334 --ws-port 9946 --rpc-port 9934 --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp
The main difference is the `bootnodes` parameter which specifies the network and identity information of Alice’s node.
###
[](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#use-the-laminar-chain%E2%80%99s-oracle)
Use the Laminar chain’s oracle
Now the two nodes start working together and our laminar chain network is ready for playing with the oracle. **About oracles** A blockchain oracle is an interface for the chain to the real world and vice versa. By feeding off-chain data to the oracle they enter the chain’s scope and can get processed by smart contracts. In this case our oracle is called an **inbound oracle**. For our example imagine a smart contract that operates on currency prices. It might trigger an action as soon as the price for a specific currency exceeds a specific value. By feeding the current prices from external sources periodically to the oracle we provide the smart contract with the required input data on-chain. **Oracle pallet** A Substrate chain’s runtime consists of modules called pallets. In the case of Laminar one of these pallets is our [oracle](https://github.com/open-web3-stack/open-runtime-module-library/tree/master/oracle)
. It can be interacted with in two ways:
1. Feeding new key-value pairs to the oracle via signed transactions.
2. Retrieving key-value pairs from the oracle either by other modules on-chain or by off-chain workers via RPC.
The Laminar implementation configures the oracle pallet to use the type `CurrencyId` as key type. That means it can be one of the predefined values _FBTC_, _FETH_, _FEUR_, etc. The value uses the type `Price`. In this example we are going to use an off-chain worker to feed currency prices and fetch them afterwards. **Our off-chain worker** The component we create to simulate new price reports and oracle queries lives off-chain and will be written in Typescript. It is completely separate from anything stored on the Laminar chain itself. We rather interact with the chain through specific calls made using the [Polkadot API for JavaScript](https://polkadot.js.org/docs/api)
. This API defines the technical aspects of how we can interact with the chain (and specifically with the oracle), i. e. how to build transactions and make RPCs. For the specific parameters regarding the Laminar chain we also make use of the [Laminar chain JS SDK](https://github.com/laminar-protocol/laminar-chain.js)
. Let’s start by switching the directory
Copy
Ask AI
example/laminar-chain$ cd ..
example$ mkdir medianizer
example/medianizer$ touch package.json
and setting up the dependencies in the `package.json` file:
Copy
Ask AI
{
"name": "medianizer-example",
"version": "0.1.0",
"description": "",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node --require ts-node/register index.ts"
},
"dependencies": {
"@laminar/api": "^0.2.0-beta.144",
"@polkadot/api": "^3.8.1"
},
"devDependencies": {
"ts-node": "^9.1.1",
"typescript": "^4.1.5"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Next step is coding the off-chain worker in the file `index.ts`. We import the required types
Copy
Ask AI
import { ApiPromise, WsProvider, Keyring } from "@polkadot/api";
import { options } from "@laminar/api";
and build the frame for the program:
Copy
Ask AI
const run = async () => {
// Everything is going to happen here in this block ...
};
export default run;
if (require.main === module) {
run().then(() => process.exit(0))
}
Now we can run
Copy
Ask AI
example/medianizer$ yarn install
example/medianizer$ yarn start
for fetching the dependencies and launching the program. However nothing is going on right now so let’s write the actual code. From now on we put everything into the async block that we just prepared. We start creating an API object:
Copy
Ask AI
const wsProvider = new WsProvider('ws://localhost:9945');
const api = await ApiPromise.create({
...options({}),
provider: wsProvider });
Please note that our API object uses a websocket to communicate with the node. And this websocket connects to port 9945 which we have specified above when firing up Alice’s node. So all the requests are submitted to her node. Next step is configuring the key material. We want to transmit signed transactions that contain the prices to be fed in the oracle. Therefore the off-chain worker needs to know the key pairs of Alice, Bob and Charlie (yes, he’s also going to take part in this example). Usually the key pairs would be imported, e. g. from a file. But as for the chain nodes we use the predefined key material which is addressed by `//[Name]`. We derive those key pairs from the keyring we create specifying the key pair format SR25519.
Copy
Ask AI
const keyring = new Keyring({ type: 'sr25519'});
const alice = keyring.addFromUri("//Alice");
const bob = keyring.addFromUri("//Bob");
const charlie = keyring.addFromUri("//Charlie");
Alice wants to trigger a transaction that feeds the oracle. If we start typing `api.tx.` the code completion shows us the available extrinsics but the oracle isn’t one of them. That’s because the default methods of the Substrate runtime are known at compile time but not the custom chain specific extrinsics that might be part of the runtime. Let’s find out what’s really available by querying the node:
Copy
Ask AI
const transactions = await api.tx;
console.log(transactions);
When executing the program we get a list of much more actually available extrinsics - and one of them is `laminarOracle`. The list tells us even more about the oracle: the available query method `feedValues`. This is exactly what we needed to know.x Now Alice reports a current BTC price of 1, i. e. she feeds the oracle with the corresponding key-value pair:
Copy
Ask AI
await api.tx['laminarOracle'].feedValues([['FBTC', 1]] as any).signAndSend(alice);
This line consists of several interesting pieces:
1. We use the API object to trigger an extrinsic (`tx` for transaction). The available extrinsics depend on the used chain. In this case we address the oracle pallet of the laminar chain which is addressed by `laminarOracle`.
2. On that extrinsic we call the method `feedValues` in order to submit key-value pairs that should be fed into the oracle. In this case we just submit a single key-value pair for the Bitcoin price.
3. As this operation is a transaction that is going to be included in a block and costs Alice some gas it needs to be signed by her. This is what happens in the last part of the line.
When this line returns the transaction has been finalized and we can now query the oracle with the current Bitcoin price. But there’s again the question of how to do that. As mentioned earlier the oracle offers retrieving the current values via RPC. So let’s find out the available RPCs:
Copy
Ask AI
const methods = await api.rpc.rpc.methods;
console.log(methods);
The output again gives us what we need. Two calls should catch our attention: `oracle_getAllValues` and `oracle_getValue`. That means we have the two functions `getAllValues` and `getValue` available for the RPC `oracle.` Now we query the current BTC price:
Copy
Ask AI
const result = await api.rpc['oracle'].getValue('Laminar', 'FBTC');
console.log(`Current aggregated BTC price: ${result}`);
As you can see we use an RPC as the query doesn’t change the state of the chain and therefore the operation is free. We specify the correct RPC (which is `oracle`) and query the value to the key associated with the Bitcoin price (which is `FBTC`). The output is a pair of two values: The current price and the timestamp of the transaction that contained the feeding operation. That’s it! Now we can run the program again with `yarn start`. The oracle will be fed and queried and the output is the expected BTC price of 1. **Data aggregation** In the previous section we fed the oracle with one single data point and queried the oracle to retrieve a value. It isn’t surprising at all that we read the value that we had written into the oracle just before. But it requires a closer look to what value is actually returned by `getValue`. The oracle pallet states that this method returns a “combined value” which indicates that there is some data aggregation happening. In fact the way the prices of each currency are aggregated is entirely up to the chain implementation. Currently the Laminar chain doesn’t implement any aggregation algorithm but the oracle pallet comes with a default implementation: It takes all fed values of a specific currency submitted within the last 3 days and returns the median value. If there aren’t any values to calculate the median from it just returns the most recent value. Let’s try it out. Disable the lines of the previous section that interacted with the oracle (via tx and RPC) and add the following:
Copy
Ask AI
const feedPrice = async (value: string, sender: any, completion: () => void) => {
const unsub = await api.tx['laminarOracle'].feedValues([['FBTC', value]] as any).signAndSend(sender, (result) => {
if (result.status.isInBlock) {
console.debug(`Transaction included at blockHash ${result.status.asInBlock}`);
} else if (result.status.isFinalized) {
console.debug(`Transaction finalized at blockHash ${result.status.asFinalized}`);
unsub();
completion();
}
});
};
For more convenience we define a function `feedPrice` which takes a price value and a sender and triggers the transaction accordingly. We use the [subscription API](https://polkadot.js.org/docs/api/start/api.query.subs)
of Polkadot JS in order to make sure that we wait for every transaction to be finalized in a block. Now our three users submit their values:
Copy
Ask AI
await new Promise((resolve) => { feedPrice("1", alice, resolve); });
await new Promise((resolve) => { feedPrice("5", bob, resolve); });
await new Promise((resolve) => { feedPrice("10", charlie, resolve); });
const result = await api.rpc['oracle'].getValue('Laminar', 'FBTC');
console.log(result);
When we query the oracle for the BTC price it returns the median value of 5 as expected. **Important!** Remember to purge the chain status and restart the two nodes before executing the code of this section.
[](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer#tl;dr-quick-demo)
TL;DR - Quick demo
----------------------------------------------------------------------------------------------------------------------
Copy
Ask AI
mkdir example
cd example
Download sources for the example and the laminar chain:
Copy
Ask AI
git clone https://github.com/diadata-org/medianizer-example.git
git clone https://github.com/laminar-protocol/laminar-chain.git
Setup laminar chain:
Copy
Ask AI
cd laminar-chain
make init
make build
cp ../medianizer-example/chain/chainSpec.json .
Run first chain node (Answer with “y” when asked for confirmation before purging):
Copy
Ask AI
SKIP_WASM_BUILD= cargo run -- purge-chain --base-path /tmp/alice
SKIP_WASM_BUILD= cargo run -- --base-path /tmp/alice --chain=chainSpec.json --alice --port 30333 --ws-port 9945 --rpc-port 9933 --node-key 0000000000000000000000000000000000000000000000000000000000000001
Run second chain node (e.g. in another terminal session):
Copy
Ask AI
SKIP_WASM_BUILD= cargo run -- purge-chain --base-path /tmp/bob
SKIP_WASM_BUILD= cargo run -- --base-path /tmp/bob --chain=chainSpec.json --bob --port 30334 --ws-port 9946 --rpc-port 9934 --bootnodes /ip4/127.0.0.1/tcp/30333/p2p/12D3KooWEyoppNCUx8Yx66oV9fJnriXwCcXwDDUA2kj6vnc6iDEp
After both nodes have started to communicate with each other run medianizer example (in yet another terminal session):
Copy
Ask AI
cd ../medianizer-example
yarn install
yarn start
Was this page helpful?
YesNo
[Compounded Rates](https://www.diadata.org/docs/guides/resources/research/compounded-rates)
[Overview](https://www.diadata.org/docs/guides/resources/t-and-c)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-computation#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview#)
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
[DIA Chain Information](https://www.diadata.org/docs/dia-stack/architecture/core-components/lasernet/chain-information#)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-foreign-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Add a New Foreign Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#)
[Build a Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials#)
[Add a New Exchange Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/dia-stack/architecture/data-sourcing#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
[DIA Stack Overview](https://www.diadata.org/docs/dia-stack/overview#)
[Architecture Overview](https://www.diadata.org/docs/dia-stack/architecture/core-components/overview#)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/resources/research/cvi#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Research](https://www.diadata.org/docs/guides/resources/research#)
[Crypto Volatility Index](https://www.diadata.org/docs/guides/resources/research/cvi#)
[Security Bounty Program](https://www.diadata.org/docs/guides/resources/security-bounty-program#)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/tutorials/add-a-new-exchange-scraper#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Add a New Exchange Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-exchange-scraper#)
[Add a New Liquidity Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-liquidity-scraper#)
[Add a New Foreign Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials/add-a-new-foreign-scraper#)
⌘I
---
# Page Not Found
[Skip to main content](https://www.diadata.org/docs/guides/how-to-guides/tutorials/development-cluster-stack#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Page Not Found
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
404
Page Not Found
==============
We couldn't find the page. Maybe you were looking for one of these pages below?
[Development Cluster Stack](https://www.diadata.org/docs/guides/general-guides/tutorials/development-cluster-stack#)
[Build a Scraper](https://www.diadata.org/docs/guides/general-guides/tutorials#)
[Stacks](https://www.diadata.org/docs/guides/chain-specific-guide/stacks#stacks)
⌘I
---
# Data Delivery - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/architecture/data-delivery#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Delivery
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Spectra](https://www.diadata.org/docs/reference/architecture/data-delivery#spectra)
* [Pull Model](https://www.diadata.org/docs/reference/architecture/data-delivery#pull-model)
* [Push Model](https://www.diadata.org/docs/reference/architecture/data-delivery#push-model)
* [Fees](https://www.diadata.org/docs/reference/architecture/data-delivery#fees)
* [Key Benefits:](https://www.diadata.org/docs/reference/architecture/data-delivery#key-benefits%3A)
[](https://www.diadata.org/docs/reference/architecture/data-delivery#spectra)
**Spectra**
---------------------------------------------------------------------------------------------
An interchain message passing protocol. Spectra is formed by a network of nodes, running a custom instance of Hyperlane, an open interoperability framework. It facilitates secure and rapid transmission of oracle data to any blockchain, without the need for chain-specific integrations. The Spectra validators observe messages on the mailboxes of the destination and origin chains. The messages are then checked through the ISM (Interchain Security Module) and delivered to these components:
* RequestOracle (Pull oracle)
* PushOracleReceiver (Push oracle)
The gas for processing messages are funded by imposing a fee for calling `request()` on _RequestOracle_, or `handle()` on the _PushOracleReceiver_ contracts. The fees are transferred to the ProtocolFeeHook – an instance of Hyperlane’s [Post-Dispatch](https://docs.hyperlane.xyz/docs/reference/hooks/overview)
hooks - that are then withdrawn manually to the Spectra gas wallet. Let’s explore how Spectra contributes to the flow of messages in the Push and Pull oracle models and how that translates to the data you receive on the destination chain.
###
[](https://www.diadata.org/docs/reference/architecture/data-delivery#pull-model)
Pull Model

* User initiates a request to the RequestOracle contract and pays a fee.
* RequestOracle processes the request on the origin chain (e.g. Ethereum), creates a message containing the request details (destination chain id, OracleRequestRecipient address, exchange pair, …etc), then dispatches it through the Mailbox.
* The validators observes the mailbox and picks up the request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain (DIA lasernet).
* OracleRequestRecipient receives and validates the message through the ISM, and passes it forward to OracleTrigger that fetches the values from the [Aggregator](https://www.diadata.org/docs/reference/architecture/data-computation#aggregator)
or meta-contract. It then creates a message with the latest price, and dispatches it back to Lasernet’s mailbox.
* Message is picked up by Spectra protocol and sent back to the RequestOracle which then checks for data freshness and adds the value to the `updates`mapping.
###
[](https://www.diadata.org/docs/reference/architecture/data-delivery#push-model)
Push Model

* Go feeder service initiates a price update based on certain parameters (such as deviation, heartbeat, & refresh frequency) on the origin chain (DIA’s lasernet).
* OracleTrigger processes the update request, reads the latest price from the meta-contract, creates a message, & dispatches it through the Mailbox.
* The validators observes the mailbox and picks up the update request. once it verifies its validity through the ISM and signs it, the relayer carries out the message delivery to the mailbox of the destination chain.
* PushOracleReceiver receives the update, validates the message through the ISM, checks for the data freshness, the adds the value to the `updates`mapping.
###
[](https://www.diadata.org/docs/reference/architecture/data-delivery#fees)
Fees
Cost of updating data on the destination chain is calculated as follows:
Copy
Ask AI
uint256 gasUsedPerTx = 97440; // Fixed gas amount
uint256 gasPrice = tx.gasprice; // Current network gas price
uint256 cost = gasUsedPerTx * gasPrice; // Total fee
[](https://www.diadata.org/docs/reference/architecture/data-delivery#key-benefits:)
Key Benefits:
-----------------------------------------------------------------------------------------------------
Deploy Anywhere, Fast
---------------------
Cross-chain data delivery is made simple through Spectra, dramatically reducing time to market for developers, and allowing data to be transmitted across blockchains with minimal friction and no chain-specific setup.
Was this page helpful?
YesNo
⌘I
---
# Pull Based Oracles - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Pull Based Oracles
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [How It Works](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#how-it-works)
* [Request Creation](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#request-creation)
* [Message Delivery Process](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#message-delivery-process)
* [Response and Callback](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#response-and-callback)
* [Making a Price Request](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#making-a-price-request)
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#how-it-works)
How It Works
----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#request-creation)
Request Creation
A request is made from the source chain for an asset symbol whose price is required (e.g. ETH/USD) which then passes through the chain’s mailbox to be then delivered to the destination chain. You check the available contract address on testnet based on the destination chain you’re reading from [here](https://www.diadata.org/docs/guides/chain-guides-overview)
. The request body is formatted as follows in JavaScript:
Copy
Ask AI
const key = "ETH/USD"; // Assuming key is an address or a bytes32 value
const requestBody = abiCoder.encode(
["string"], // Types of the parameters
[key] // Values to encode
);
And this is how it is formatted in Solidity:
Copy
Ask AI
bytes memory requestBody = abi.encode("WBTC/USD");
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#message-delivery-process)
Message Delivery Process
Once a request is created, it is transmitted to the Hyperlane mailbox. The message is then relayed to the `OracleRequestRecipient` contract , where the price data is fetched from the Oracle Metadata Contract.
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#response-and-callback)
Response and Callback
Upon receiving the request, the DIA chain initiates a transaction to deliver the message back to the end contract on the source chain. The recipient contract on the source chain must implement the IMessageRecipient interface, which includes a handle function that will receive the price quotation.
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/pull-based-oracles#making-a-price-request)
Making a Price Request
------------------------------------------------------------------------------------------------------------------------------------
In this example, we’ll be sending an ETH/USD price request from Base Sepolia to DIA Lasernet. Start by cloning the `Spectra Interoperability` repository to your local machine and switching to the `deploy`branch:[GitHub - diadata-org/Spectra-interoperability\
---------------------------------------------](https://github.com/diadata-org/Spectra-interoperability)
Copy
Ask AI
git clone https://github.com/diadata-org/Spectra-interoperability.git
git checkout deploy
Then install the node packages and compile the contracts using hardhat:
Copy
Ask AI
npm install
npx hardhat compile
Next, `cd contracts` folder, and export your wallet’s private key in your terminal as follows:
Copy
Ask AI
export PRIVATE_KEY=[paste_here]
Now, the `sendMessage.mjs` script will trigger a `request` transaction to fetch the latest price of ETH/USD from DIA lasernet. To run the script:
Copy
Ask AI
npx hardhat run scripts/sendMessage.mjs --network base_sepolia
You can also run the script on other networks by changing the value passed to the `--network` flag (e.g. `--network sepolia`). Once the price update takes place on the destination chain, which you can track from the [hyperlane explorer](https://www.diadata.org/docs/reference/cross-chain-messaging)
, you can check the txn logs for the `ReceivedMessage`event on the pull oracle contract or call the `updates`function.

The price returned is around 2,718$!
Was this page helpful?
YesNo
⌘I
---
# Architecture - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/architecture#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Architecture
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
The data flow is broken down into the following phases:
[Data sourcing\
-------------](https://www.diadata.org/docs/reference/architecture/data-sourcing)
[Data computation\
----------------](https://www.diadata.org/docs/reference/architecture/data-computation)
[Data delivery\
-------------](https://www.diadata.org/docs/reference/architecture/data-delivery)
Was this page helpful?
YesNo
⌘I
---
# Docker Compose - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Docker Compose
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Configure Environment Variables](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#configure-environment-variables)
* [Retrieve Deployed Contract](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#retrieve-deployed-contract)
* [Remove Container (Optional)](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#remove-container-optional)
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#configure-environment-variables)
Configure Environment Variables
------------------------------------------------------------------------------------------------------------------------------------------------------------------
1
Navigate to the docker-compose folder where `docker-compose.yaml` file is located.
Copy
Ask AI
cd docker-compose
2
Create a `.env` file in the same folder. it should contain the following variables:
* `NODE_OPERATOR_NAME`: A unique and descriptive name identifying the organization or entity running the node. This name is used for monitoring and should be chosen carefully to ensure it is both meaningful and recognizable (e.g., include your organization name or geographical region). Providing a clear name helps distinguish your node in dashboards and logs.
* `CHAIN_ID`: set the chain ID value
* `PRIVATE_KEY`: Your private key for the deployment.
* `DEPLOYED_CONTRACT`: The contract address. Initially, leave this empty during the first deployment to retrieve the deployed contract.
The following pushgateway vars are **mandatory** for official DIA node operators. If you’re an official operator, please reach out to the team to get these credentials. For developers testing the system, these credentials are **optional** and can be skipped.
* `PUSHGATEWAY_URL`: The Pushgateway endpoint used for pushing metrics to Prometheus.
* `PUSHGATEWAY_USER`: to allow decentralized-feeder authenticate towards the monitoring server.
* `PUSHGATEWAY_PASSWORD`: to allow decentralized-feeder authenticate towards the monitoring server.
For additional environment variable configurations, refer to [Adding Exchange Pairs](https://github.com/diadata-org/decentral-feeder/wiki/Adding-exchange-pairs)
and [Watchdog environment variables](https://github.com/diadata-org/decentral-feeder/wiki/Enabling-watchdogs)
.E.g. Env file:
Copy
Ask AI
NODE_OPERATOR_NAME=
CHAIN_ID=
PRIVATE_KEY=
DEPLOYED_CONTRACT=
PUSHGATEWAY_URL=
PUSHGATEWAY_USER=
PUSHGATEWAY_PASSWORD=
3
Open a terminal in the `docker-compose` folder and start the deployment by running:
Copy
Ask AI
docker-compose up
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#retrieve-deployed-contract)
Retrieve Deployed Contract
--------------------------------------------------------------------------------------------------------------------------------------------------------
1
Once the container is deployed with `DEPLOYED_CONTRACT` env variable empty the logs will display the deployed contract address in the following format:
Copy
Ask AI
│ time="2024-11-25T11:30:08Z" level=info msg="Contract pending deploy: 0xxxxxxxxxxxxxxxxxxxxxxxxxx."
2
Copy the displayed contract address (e.g., `0xxxxxxxxxxxxxxxxxxxxxxxxxx`) and stop the container with
Copy
Ask AI
docker rm -f
3
Check if the container is running correctly by viewing the logs. Run the following command:
Copy
Ask AI
docker-compose logs -f
4
Look for logs similar to the example below, which indicate a successful startup:
Copy
Ask AI
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - Atomic filter value for market Binance:SUSHI-USDT with 20 trades: 0.7095307176575745." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - Atomic filter value for market Simulation:UNI-USDC with 1 trades: 8.008539500390082." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - Atomic filter value for market Crypto.com:USDT-USD with 5 trades: 0.99948." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - filter median for MOVR: 9.864475653518195." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - filter median for STORJ: 0.4672954012114179." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - filter median for DIA: 0.9839597410694259." │
│ time="2024-10-29T13:39:35Z" level=info msg="Processor - filter median for WETH: 2626.9564003841315."
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#remove-container-optional)
Remove Container (Optional)
--------------------------------------------------------------------------------------------------------------------------------------------------------
1
You can optionally cleanup the deployment once you’re done by running:
Copy
Ask AI
docker rm -f
2
Verify the container has been removed:
Copy
Ask AI
docker ps -a
Was this page helpful?
YesNo
⌘I
---
# Kubernetes - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/kubernetes#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Kubernetes
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
1
Create a Kubernetes `Deployment` manifest. Replace `` with the desired version:
Copy
Ask AI
apiVersion: apps/v1
kind: Deployment
metadata:
name: decentralized-feeder
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: decentralized-feeder
template:
metadata:
labels:
app: decentralized-feeder
spec:
containers:
- name: feeder-container
image: diadata/decentralized-feeder:
env:
- name: PRIVATE_KEY
valueFrom:
secretKeyRef: {key: private_key_secret, name: private_key_secret}
- name: NODE_OPERATOR_NAME
value: ""
- name: DEPLOYED_CONTRACT
value: ""
- name: CHAIN_ID
value: ""
- name: EXCHANGEPAIRS
value: ""
- name: PUSHGATEWAY_URL
value: ""
- name: PUSHGATEWAY_USER
value: ""
- name: PUSHGATEWAY_PASSWORD
value: ""
- containerPort: 8080
For additional environment variable configurations, refer to [Adding Exchange Pairs](https://github.com/diadata-org/decentral-feeder/wiki/Adding-exchange-pairs)
and [Watchdog environment variables](https://github.com/diadata-org/decentral-feeder/wiki/Enabling-watchdogs)
.
2
Run the feeder with `DEPLOYED_CONTRACT` set to an empty string (`""`) in the Kubernetes manifest.
Copy
Ask AI
kubectl apply -f deployment.yaml
3
Monitor the logs for the deployed contract address. See the expected logs [here](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#retrieve-deployed-contract)
.
Copy
Ask AI
kubectl logs
4
Update the `DEPLOYED_CONTRACT` value in the manifest with the retrieved contract address.
5
Apply the updated manifest:
Copy
Ask AI
kubectl apply -f deployment.yaml
Was this page helpful?
YesNo
⌘I
---
# Docker Run - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-run#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Docker Run
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
1
Using the same [ENV variables](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose)
, run the feeder with `DEPLOYED_CONTRACT` initially empty:
Copy
Ask AI
docker run -d \
-e NODE_OPERATOR_NAME= \
-e PRIVATE_KEY= \
-e CHAIN_ID= \
-e DEPLOYED_CONTRACT= \
-e PUSHGATEWAY_URL= \
-e PUSHGATEWAY_USER= \
-e PUSHGATEWAY_PASSWORD= \
--name decentralized-feeder \
diadata/decentralized-feeder:
2
Retrieve the logs to get the deployed contract address. See the expected logs [here](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose#retrieve-deployed-contract)
.
Copy
Ask AI
docker logs
3
Stop the container, update the `DEPLOYED_CONTRACT` value, and restart:
Copy
Ask AI
docker stop
docker run -d \
-e NODE_OPERATOR_NAME= \
-e PRIVATE_KEY= \
-e CHAIN_ID= \
-e DEPLOYED_CONTRACT= \
-e PUSHGATEWAY_USER= \
-e PUSHGATEWAY_PASSWORD= \
-e EXCHANGEPAIRS= \
--name decentralized-feeder \
diadata/decentralized-feeder:
4
Retrieve the logs to verify the container is running as expected
Copy
Ask AI
docker logs
For additional environment variable configurations, refer to [Adding Exchange Pairs](https://github.com/diadata-org/decentral-feeder/wiki/Adding-exchange-pairs)
and [Watchdog environment variables](https://github.com/diadata-org/decentral-feeder/wiki/Enabling-watchdogs)
.
Was this page helpful?
YesNo
⌘I
---
# Terms & Conditions - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/t-and-c#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
T&C
Terms & Conditions
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
[Contributor Covenant Code of Conduct\
------------------------------------](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct)
[Licence Agreement\
-----------------](https://www.diadata.org/docs/resources/t-and-c/licence-agreement)
[Disclaimer\
----------](https://www.diadata.org/docs/resources/t-and-c/disclaimer)
Was this page helpful?
YesNo
[Polkadot Medianizer](https://www.diadata.org/docs/guides/resources/research/polkadot-medianizer)
[Licence Agreement](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement)
⌘I
---
# Data Sourcing - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/architecture/data-sourcing#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Sourcing
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Key components](https://www.diadata.org/docs/reference/architecture/data-sourcing#key-components)
* [Feeder](https://www.diadata.org/docs/reference/architecture/data-sourcing#feeder)
* [Scrapers](https://www.diadata.org/docs/reference/architecture/data-sourcing#scrapers)
* [Collector](https://www.diadata.org/docs/reference/architecture/data-sourcing#collector)
* [Processor](https://www.diadata.org/docs/reference/architecture/data-sourcing#processor)
* [Pods](https://www.diadata.org/docs/reference/architecture/data-sourcing#pods)
* [Staking Incentives](https://www.diadata.org/docs/reference/architecture/data-sourcing#staking-incentives)
At the heart of Lumina is a decentralized data collection system composed of feeder nodes operating within the Distributed Feeder Network, responsible for sourcing data and feeding it into the Lasernet chain.

Data sourcing flow in oracle feeders
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#key-components)
Key components
-------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#feeder)
**Feeder**
**A Feeder** is a single node in a Distributed Feeder Network that fetches granular market data directly from decentralized exchanges (DEXs), centralized exchanges (CEXs), and third-party data sources. Feeders are responsible for sourcing trade ticks and pushing them to Pods—smart contracts running on DIA’s Lasernet—at configurable intervals (e.g. 30 seconds). There are four main elements that make up a feeder:
[Scrapers\
--------](https://www.diadata.org/docs/reference/architecture/data-sourcing#scrapers)
[Collector\
---------](https://www.diadata.org/docs/reference/architecture/data-sourcing#collector)
[Processor\
---------](https://www.diadata.org/docs/reference/architecture/data-sourcing#processor)
[Pods\
----](https://www.diadata.org/docs/reference/architecture/data-sourcing#pods)
####
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#scrapers)
Scrapers
The expected input for a scraper is a set of pair tickers such as `BTC-USDT`. Tickers are always capitalized and symbols separated by a hyphen. It’s the role of the scraper to format the pair ticker such that it can subscribe to the corresponding (websocket) stream.
####
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#collector)
Collector
The collector gathers trades from all running scrapers. As soon as it receives a signal through a trigger channel it bundles trades in _atomic tradesblocks_. An atomic tradesblock is a set of trades restricted to one market on one exchange, for instance `BTC-USDT` trades on Binance exchange. These tradesblocks are sent to the `Processor`.
####
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#processor)
Processor
The processor is a 2-step aggregation procedure:
1
Step 1
Aggregate trades from an atomic tradesblock. The type of aggregation can be selected through an environment variable (see Feeder/main). The only assumption on the aggregation implementation is that it returns a `float64`.
2
Step 2
Aggregate filter values obtained in step 1. The selection of aggregation method and assumptions are identical to Step 1. The obtained scalar value is sent to the Oracle feeder.
####
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#pods)
Pods
Pods (or feeder contracts) are a simple key-value oracle contracts assigned to each feeder node. They store the value obtained from the Processor. It is worth mentioning that the trigger mechanism for starting a new cycle of the data collection flow can be implemented on-chain using the feeder contract. Find out more about the feeder structure and how to run your own feeder [here](https://www.diadata.org/docs/how-to-guides/run-a-feeder)
.
[](https://www.diadata.org/docs/reference/architecture/data-sourcing#staking-incentives)
Staking Incentives
---------------------------------------------------------------------------------------------------------------
To encourage honest behavior, oracle feeders will be rewarded for successful operations and penalized for harmful actions. These incentives ensure that dishonest behavior is punished and becomes economically unviable. Rewards and penalties will primarily be based on uptime and accuracy, measured by the timeliness of updates and the accuracy of prices compared to other feeders. Initially, feeders will gather the last traded price for assets from centralized exchanges (CEXs). For decentralized exchanges (DEXs), we will use trade simulation-based price estimation, which simulates trades to obtain current exchange rates. This approach ensures more accurate pricing, particularly for assets that are infrequently traded.
Was this page helpful?
YesNo
⌘I
---
# Contributor Covenant Code of Conduct - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
T&C
Contributor Covenant Code of Conduct
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Our Pledge](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-pledge)
* [Our Standards](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-standards)
* [Our Responsibilities](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-responsibilities)
* [Scope](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#scope)
* [Enforcement](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#enforcement)
* [Attribution](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#attribution)
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-pledge)
Our Pledge
---------------------------------------------------------------------------------------------------
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone.
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-standards)
Our Standards
---------------------------------------------------------------------------------------------------------
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others’ private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#our-responsibilities)
Our Responsibilities
-----------------------------------------------------------------------------------------------------------------------
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#scope)
Scope
-----------------------------------------------------------------------------------------
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#enforcement)
Enforcement
-----------------------------------------------------------------------------------------------------
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [\[email protected\]](https://www.diadata.org/cdn-cgi/l/email-protection#7c1f131f3c18151d181d081d52130e1b)
. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
[](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct#attribution)
Attribution
-----------------------------------------------------------------------------------------------------
Was this page helpful?
YesNo
[Licence Agreement](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement)
[Disclaimer](https://www.diadata.org/docs/guides/resources/t-and-c/disclaimer)
⌘I
---
# Licence Agreement - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
T&C
Licence Agreement
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [You are free to:](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#you-are-free-to%3A)
* [Under the following terms:](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#under-the-following-terms%3A)
* [Notices:](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#notices%3A)

Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
This is a human-readable summary of (and not a substitute for) the [license](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
. [Disclaimer](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
[](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#you-are-free-to:)
You are free to:
-----------------------------------------------------------------------------------------------------------------
Share
-----
copy and redistribute the material in any medium or format
Adapt
-----
remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.
[](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#under-the-following-terms:)
Under the following terms:
-------------------------------------------------------------------------------------------------------------------------------------
Attribution
-----------
You must give [appropriate credit](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial
-------------
You may not use the material for [commercial purposes](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
ShareAlike
----------
If you remix, transform, or build upon the material, you must distribute your contributions under the [same license](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
as the original.
No additional restrictions
--------------------------
You may not apply legal terms or [technological measures](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
that legally restrict others from doing anything the license permits.
[](https://www.diadata.org/docs/guides/resources/t-and-c/licence-agreement#notices:)
Notices:
-------------------------------------------------------------------------------------------------
* You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable [exception or limitation](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
* No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as [publicity, privacy, or moral rights](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
may limit how you use the material.
Was this page helpful?
YesNo
[Overview](https://www.diadata.org/docs/guides/resources/t-and-c)
[Contributor Covenant Code of Conduct](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct)
⌘I
---
# Disclaimer - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/guides/resources/t-and-c/disclaimer#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
T&C
Disclaimer
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
1. **General Information**: All content, including but not limited to texts, graphics, and services provided on this website, its linked platforms, applications, forums, blogs, social media, and other platforms associated with DIA (collectively referred to as the “Site”), are primarily sourced from third parties and are made available exclusively for general informational purposes.
2. **No Representations or Warranties:** DIA expressly disclaims all warranties, express or implied, related to the accuracy, completeness, security, or timeliness of the content and services. Nothing contained herein constitutes financial, legal, or any specialized advice. Users contemplating trading or other financial decisions should seek the counsel of a certified financial advisor. The Site does not constitute a solicitation, endorsement, or offer of any nature.
3. **‘As Is’ and ‘As Available’ Provision:** The Site, including all content and functionalities, is provided on an “AS IS” and “AS AVAILABLE” basis without any representation or endorsement. While DIA endeavors to ensure the seamless functioning of the Site, it does not warrant that the Site will be uninterrupted, timely, secure, or error-free, nor that defects, if any, will be corrected.
4. **Risk of Data Loss:** Users acknowledge that the data accessed or stored on our Site may be inadvertently lost, corrupted, or become temporarily inaccessible due to various factors. DIA shall not be held responsible for any loss, damage, or corruption of user data arising from technical failures, Internet disruptions, force majeure events, or other factors beyond or within our control.
5. **Exclusion of Implied Warranties:** To the fullest extent permissible under applicable law, all implied warranties, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, are hereby disclaimed. Some jurisdictions may prohibit the exclusion of certain warranties; thus, the above disclaimers may not apply to you in such jurisdictions.
6. **Limitation of Liability:** Under no circumstances, including negligence, shall DIA or its affiliates be liable for any indirect, special, incidental, punitive, exemplary, or consequential damages, including but not limited to loss of data, revenue, profits, or other economic advantage, arising out of or in any way connected with the use or performance of the Site or services, even if DIA had been previously advised of the possibility of such damages.
By accessing or using the Site, you hereby agree to be bound by the aforementioned terms and conditions. It is recommended to seek appropriate legal or professional advice when necessary. This is a human-readable summary of (and not a substitute for) the [license](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
. [Disclaimer](https://creativecommons.org/licenses/by-nc-sa/4.0/)
. You are free to:
Share
-----
copy and redistribute the material in any medium or format
Adapt
-----
remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms:
Attribution
-----------
You must give [appropriate credit](https://creativecommons.org/licenses/by-nc-sa/4.0/)
, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by-nc-sa/4.0/)
. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial
-------------
You may not use the material for [commercial purposes](https://creativecommons.org/licenses/by-nc-sa/4.0/)
.
ShareAlike
----------
If you remix, transform, or build upon the material, you must distribute your contributions under the [same license](https://creativecommons.org/licenses/by-nc-sa/4.0/)
as the original.
No additional restrictions
--------------------------
You may not apply legal terms or [technological measures](https://creativecommons.org/licenses/by-nc-sa/4.0/)
that legally restrict others from doing anything the license permits.
Disclaimer
----------
The licensor provides the material as-is, without any guarantees or warranties. This means there’s no promise about the material’s quality, accuracy, or any other aspects.
No Liability
------------
The licensor won’t be responsible for any kind of damages or costs that come from using the material, even if they know there’s a risk.
Notices:
* You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable [exception or limitation](https://creativecommons.org/licenses/by-nc-sa/4.0/)
.
* No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as [publicity, privacy, or moral rights](https://creativecommons.org/licenses/by-nc-sa/4.0/)
may limit how you use the material.
Was this page helpful?
YesNo
[Contributor Covenant Code of Conduct](https://www.diadata.org/docs/guides/resources/t-and-c/code_of_conduct)
⌘I
---
# Data Computation - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/reference/architecture/data-computation#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Data Computation
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Key Components](https://www.diadata.org/docs/reference/architecture/data-computation#key-components)
* [Lasernet](https://www.diadata.org/docs/reference/architecture/data-computation#lasernet)
* [Pods](https://www.diadata.org/docs/reference/architecture/data-computation#pods)
* [Data Packing](https://www.diadata.org/docs/reference/architecture/data-computation#data-packing)
* [Read Data Updates](https://www.diadata.org/docs/reference/architecture/data-computation#read-data-updates)
* [Aggregator](https://www.diadata.org/docs/reference/architecture/data-computation#aggregator)
* [How it works](https://www.diadata.org/docs/reference/architecture/data-computation#how-it-works)
* [Price Aggregation Methodology](https://www.diadata.org/docs/reference/architecture/data-computation#price-aggregation-methodology)
* [Roles](https://www.diadata.org/docs/reference/architecture/data-computation#roles)
* [Registering Feeders](https://www.diadata.org/docs/reference/architecture/data-computation#registering-feeders)
* [Removing Feeders](https://www.diadata.org/docs/reference/architecture/data-computation#removing-feeders)
* [Acceptance Threshold](https://www.diadata.org/docs/reference/architecture/data-computation#acceptance-threshold)
* [Key Benefits](https://www.diadata.org/docs/reference/architecture/data-computation#key-benefits)
[](https://www.diadata.org/docs/reference/architecture/data-computation#key-components)
Key Components
----------------------------------------------------------------------------------------------------------
[](https://www.diadata.org/docs/reference/architecture/data-computation#lasernet)
**Lasernet**
--------------------------------------------------------------------------------------------------
As the backbone of the system, Lasernet is an optimistic Ethereum Layer-2 rollup. It serves as an open data repository that handles the full lifecycle of data, minimzing trust and supporting full verifiability. The Lasernet chain is built for scalability using the Arbitrum Orbit Stack to handle large oracle transactions at a low cost. The DIA Lumina oracle consists of two major components:
Pods
----
the collection of key-value smart contract that collect price data from each feeder.
Aggregator
----------
a contract that collates these prices from the key-value contracts and provides an automatically refreshed reading of the latest market price.
An exemplary Lumina data flow can be seen here. [Feeders](https://www.diadata.org/docs/reference/architecture/data-sourcing#feeder)
scrape trades from exchanges and submit these as last prices into their Pods on Lasernet. The final aggregation of these values is done through the meta-contract (or the Aggregator). To ensure the accuracy of the final value, the meta-contract uses a _threshold_ to require a minimum number of valid price submissions before considering the data reliable. Additionally, a _timeout period_ in seconds is enforced to discard any outdated price data, so that only fresh and relevant information is used in the final calculation (e.g. 5 data submissions within 1 min).

Data flow from sourcing to final aggregation on Lasernet
[](https://www.diadata.org/docs/reference/architecture/data-computation#pods)
**Pods**
------------------------------------------------------------------------------------------
These are smart contracts that securely store on-chain data. They receive regular updates from their assigned Feeders, ensuring that asset prices are accurate and up-to-date. Feeders make price data openly available for all users on the network. Each decentralized Lumina feeder writes data into its own oracle contract. This feeder contract is a basic key-value store which stores oracle updates accessible by a key, such as `BTC/USD`. The data stored for each entry is the last price of the asset and the timestamp of that price.
###
[](https://www.diadata.org/docs/reference/architecture/data-computation#data-packing)
Data Packing
In order to pack the data efficiently, the entries (price and timestamp) are packed into the same `uint256` when an update is written to the key-value store.
Copy
Ask AI
function setValue(string memory key, uint128 value, uint128 timestamp)
public
onlyRole(UPDATER_ROLE)
{
uint256 cValue = (((uint256)(value)) << 128) + timestamp;
values[key] = cValue;
emit OracleUpdate(key, value, timestamp);
}
###
[](https://www.diadata.org/docs/reference/architecture/data-computation#read-data-updates)
Read Data Updates
You can optionally interact with the individual feeder contracts directly by calling `getValue()` that returns the latest price update stored for the requested asset.
1. Call `getValue(pairName)` with `pairName` being the full pair name such as BTC/USD. The quote asset is always in USD for any asset.
2. The response of the call contains two values:
* The current asset price in USD with a fix-comma notation of 8 decimals.
* The UNIX timestamp of the last oracle update.
[](https://www.diadata.org/docs/reference/architecture/data-computation#aggregator)
**Aggregator**
------------------------------------------------------------------------------------------------------
A smart contract that picks data from multiple Pods and creates a final median value (also referred to as a meta-contract). Multiple Aggregator smart contracts can be deployed, creating a flexible framework for users. Aggregators operate with customizable rulesets (custom sources, aggregation windows, and more), allowing them to cater to different use cases. Aggregators also have the option to benchmark data against external sources for additional security. The meta-contract exposes a simple `Read` function called `getValue()`. It has one parameter `pairKey`, which consists of the symbol of the queried asset and `/USD` to denominate its price in US Dollars. For instance, the latest Bitcoin price is queried by calling `getValue("BTC/USD")`. The function then returns two values:
1. The value of the asset in US Dollars, with 8 decimals.
2. The timestamp of the block with the latest calculation result.
The oracle has several safeguards against becoming stale or having not enough feeders providing updates.
###
[](https://www.diadata.org/docs/reference/architecture/data-computation#how-it-works)
How it works
####
[](https://www.diadata.org/docs/reference/architecture/data-computation#price-aggregation-methodology)
Price Aggregation Methodology
The current version of the meta-contract supports the median methodology which is calculated by collecting values from all registered Pods (or feeder contracts), filtering out outdated values based on the timeout period, and ensuring a minimum number of valid values (threshold) are available. The remaining valid values are sorted through a Quicksort algorithm, and the middle value is selected as the median. Later iterations of the meta-contract will allow selecting different methodologies for each price evaluation.
####
[](https://www.diadata.org/docs/reference/architecture/data-computation#roles)
Roles
Each meta-contract has an `admin` address that can setup the meta-contract for its specific usage. The admin is able to add and remove feeders, set a threshold of required feeders, and set a timeout duration after which a feeder update is considered stale.
####
[](https://www.diadata.org/docs/reference/architecture/data-computation#registering-feeders)
Registering Feeders
The meta-contract needs to learn about available Pods in the Distributed Feeder Network. The admin can add as many feeders as they wish to the price evaluation using the `addOracle()` method. The required parameter of that method is the address of a Pod on Lasernet. After an oracle is added, its latest prices are immediately part of the price evaluation.
####
[](https://www.diadata.org/docs/reference/architecture/data-computation#removing-feeders)
Removing Feeders
If needed, oracle feeders can also be removed by the admin. The required parameter of that method is is the address of a feeder contract on Lasernet. Removal is immediate, so any call made to `getValue()` from the removal block onwards will not include data from the removed feeder any more.
####
[](https://www.diadata.org/docs/reference/architecture/data-computation#acceptance-threshold)
Acceptance Threshold
To make price discovery more robust, a threshold needs to be set by the admin. This threshold corresponds to the number of feeders that need to have submitted a price to reach a valid consensus. You can find all of the contracts on Lasernet testnet, and oracle testnet deployments [here](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses)
.
[](https://www.diadata.org/docs/reference/architecture/data-computation#key-benefits)
Key Benefits
------------------------------------------------------------------------------------------------------
Full Data Transparency
----------------------
From data collection, storage and computation, every step in the process is transparent, traceable and verifiable.
Permissionless Flexibility
--------------------------
Lumina’s modular design allows developers to deploy their own custom Aggregators, offering unmatched flexibility for different data needs. Alternatively, DIA offers the Oracle Builder, a no-code solution for the same purpose.
Was this page helpful?
YesNo
⌘I
---
# Disclaimer - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/resources/t-and-c/disclaimer#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Disclaimer
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
1. **General Information**: All content, including but not limited to texts, graphics, and services provided on this website, its linked platforms, applications, forums, blogs, social media, and other platforms associated with DIA (collectively referred to as the “Site”), are primarily sourced from third parties and are made available exclusively for general informational purposes.
2. **No Representations or Warranties:** DIA expressly disclaims all warranties, express or implied, related to the accuracy, completeness, security, or timeliness of the content and services. Nothing contained herein constitutes financial, legal, or any specialized advice. Users contemplating trading or other financial decisions should seek the counsel of a certified financial advisor. The Site does not constitute a solicitation, endorsement, or offer of any nature.
3. **‘As Is’ and ‘As Available’ Provision:** The Site, including all content and functionalities, is provided on an “AS IS” and “AS AVAILABLE” basis without any representation or endorsement. While DIA endeavors to ensure the seamless functioning of the Site, it does not warrant that the Site will be uninterrupted, timely, secure, or error-free, nor that defects, if any, will be corrected.
4. **Risk of Data Loss:** Users acknowledge that the data accessed or stored on our Site may be inadvertently lost, corrupted, or become temporarily inaccessible due to various factors. DIA shall not be held responsible for any loss, damage, or corruption of user data arising from technical failures, Internet disruptions, force majeure events, or other factors beyond or within our control.
5. **Exclusion of Implied Warranties:** To the fullest extent permissible under applicable law, all implied warranties, including but not limited to the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, are hereby disclaimed. Some jurisdictions may prohibit the exclusion of certain warranties; thus, the above disclaimers may not apply to you in such jurisdictions.
6. **Limitation of Liability:** Under no circumstances, including negligence, shall DIA or its affiliates be liable for any indirect, special, incidental, punitive, exemplary, or consequential damages, including but not limited to loss of data, revenue, profits, or other economic advantage, arising out of or in any way connected with the use or performance of the Site or services, even if DIA had been previously advised of the possibility of such damages.
By accessing or using the Site, you hereby agree to be bound by the aforementioned terms and conditions. It is recommended to seek appropriate legal or professional advice when necessary. This is a human-readable summary of (and not a substitute for) the [license](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
. [Disclaimer](https://creativecommons.org/licenses/by-nc-sa/4.0/)
. You are free to:
Share
-----
copy and redistribute the material in any medium or format
Adapt
-----
remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms. Under the following terms:
Attribution
-----------
You must give [appropriate credit](https://creativecommons.org/licenses/by-nc-sa/4.0/)
, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by-nc-sa/4.0/)
. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial
-------------
You may not use the material for [commercial purposes](https://creativecommons.org/licenses/by-nc-sa/4.0/)
.
ShareAlike
----------
If you remix, transform, or build upon the material, you must distribute your contributions under the [same license](https://creativecommons.org/licenses/by-nc-sa/4.0/)
as the original.
No additional restrictions
--------------------------
You may not apply legal terms or [technological measures](https://creativecommons.org/licenses/by-nc-sa/4.0/)
that legally restrict others from doing anything the license permits.
Disclaimer
----------
The licensor provides the material as-is, without any guarantees or warranties. This means there’s no promise about the material’s quality, accuracy, or any other aspects.
No Liability
------------
The licensor won’t be responsible for any kind of damages or costs that come from using the material, even if they know there’s a risk.
Notices:
* You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable [exception or limitation](https://creativecommons.org/licenses/by-nc-sa/4.0/)
.
* No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as [publicity, privacy, or moral rights](https://creativecommons.org/licenses/by-nc-sa/4.0/)
may limit how you use the material.
Was this page helpful?
YesNo
⌘I
---
# Licence Agreement - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Licence Agreement
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [You are free to:](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#you-are-free-to%3A)
* [Under the following terms:](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#under-the-following-terms%3A)
* [Notices:](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#notices%3A)

Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)
This is a human-readable summary of (and not a substitute for) the [license](https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode)
. [Disclaimer](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
[](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#you-are-free-to:)
You are free to:
----------------------------------------------------------------------------------------------------------
Share
-----
copy and redistribute the material in any medium or format
Adapt
-----
remix, transform, and build upon the material
The licensor cannot revoke these freedoms as long as you follow the license terms.
[](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#under-the-following-terms:)
Under the following terms:
------------------------------------------------------------------------------------------------------------------------------
Attribution
-----------
You must give [appropriate credit](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
, provide a link to the license, and [indicate if changes were made](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
NonCommercial
-------------
You may not use the material for [commercial purposes](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
ShareAlike
----------
If you remix, transform, or build upon the material, you must distribute your contributions under the [same license](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
as the original.
No additional restrictions
--------------------------
You may not apply legal terms or [technological measures](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
that legally restrict others from doing anything the license permits.
[](https://www.diadata.org/docs/resources/t-and-c/licence-agreement#notices:)
Notices:
------------------------------------------------------------------------------------------
* You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable [exception or limitation](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
.
* No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as [publicity, privacy, or moral rights](https://creativecommons.org/licenses/by-nc-sa/4.0/#)
may limit how you use the material.
Was this page helpful?
YesNo
⌘I
---
# Contributor Covenant Code of Conduct - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Contributor Covenant Code of Conduct
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Our Pledge](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-pledge)
* [Our Standards](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-standards)
* [Our Responsibilities](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-responsibilities)
* [Scope](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#scope)
* [Enforcement](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#enforcement)
* [Attribution](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#attribution)
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-pledge)
Our Pledge
--------------------------------------------------------------------------------------------
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone.
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-standards)
Our Standards
--------------------------------------------------------------------------------------------------
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others’ private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#our-responsibilities)
Our Responsibilities
----------------------------------------------------------------------------------------------------------------
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#scope)
Scope
----------------------------------------------------------------------------------
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#enforcement)
Enforcement
----------------------------------------------------------------------------------------------
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [\[email protected\]](https://www.diadata.org/cdn-cgi/l/email-protection#b3d0dcd0f3d7dad2d7d2c7d29ddcc1d4)
. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project’s leadership.
[](https://www.diadata.org/docs/resources/t-and-c/code_of_conduct#attribution)
Attribution
----------------------------------------------------------------------------------------------
Was this page helpful?
YesNo
⌘I
---
# Run a Feeder - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Run a Feeder
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Please refer to our [Wiki](https://github.com/diadata-org/decentral-feeder/wiki)
page and [GitHub](https://github.com/diadata-org/decentral-feeder)
repository for the latest documentation on feeder nodes and releases.
Start by reviewing the [hardware specifications](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs)
and proceed to [running the node](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node)
based on your preferred deployment method. If you’re interested in becoming an official feeder in DIA’s feeder network, please reach out to our team over our [dedicated communication channels](https://www.diadata.org/docs/resources/community-and-support)
.
Was this page helpful?
YesNo
⌘I
---
# Contract Addresses - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Contract Addresses
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
To get familiar with the Lumina stack, you can start [here](https://www.diadata.org/docs/reference/architecture)
. To start building, find the contract addresses for the oracles on your preferred chain by selecting the type of feed you want to consume:
[Token Price Feeds\
-----------------](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses)
[RWA Price Feeds\
---------------](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses)
Was this page helpful?
YesNo
⌘I
---
# Hardware Specs - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Hardware Specs
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Cost Projections](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#cost-projections)
* [Standalone VM](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#standalone-vm)
* [Kubernetes Clusters](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#kubernetes-clusters)
* [Performance Metrics](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#performance-metrics)
| Hardware | Normal Usage | Peak Usage |
| --- | --- | --- |
| Memory | ~100 MiB | ~500 MiB |
| CPU | ~0.1 cores | ~0.3 cores |
| Storage | Minimal | N/A |
The storage is minimal because no historical data is stored on the nodes; only real-time data is pushed directly to smart contracts. These resource needs can be sufficiently met by a minimal, entry-level virtual machine from most cloud providers with the following specifications:
* 1 vCPU
* 1 GB RAM
* 10 GB Storage
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#cost-projections)
Cost Projections
----------------------------------------------------------------------------------------------------------------
###
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#standalone-vm)
**Standalone VM**
The cost of operating the decentral-feeder primarily depends on the infrastructure selected by the node operator. The following prices are estimates and may vary depending on factors such as region, additional services, network usage, and other considerations.
| Cloud Provider | Monthly Costs |
| --- | --- |
| Hetzner (CX22) | ~$4 |
| Amazon AWS (t2.micro) | ~$9 |
| DigitalOcean (Basic Droplet) | ~$5 |
###
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#kubernetes-clusters)
**Kubernetes Clusters**
The costs of running feeder nodes in our Kubernetes clusters are generally higher compared to standalone VMs. It also depends on your setup and the additional overhead of managing Kubernetes infrastructure and other services.
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/hardware-specs#performance-metrics)
Performance Metrics
----------------------------------------------------------------------------------------------------------------------
* Our nodes are configured with 20-100 websocket connections open in parallel, and a transaction is being sent every 1-20 seconds so a similar configuration would be expected
* You can use public RPC endpoints to fetch data and submit txns onchain. However, they’re mostly good for testing purposes so we recommend setting up a private endpoint for consistent usage. Here are some of our recommendations:
[Chainstack\
----------](https://chainstack.com/)
[Alchemy\
-------](https://www.alchemy.com/)
[Ankr\
----](https://www.ankr.com/)
[Quicknode\
---------](https://www.quicknode.com/)
Was this page helpful?
YesNo
⌘I
---
# Token Price Feeds - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Token Price Feeds
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Mainnet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#mainnet)
* [DIA Lasernet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#dia-lasernet)
* [Arbitrum](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#arbitrum)
* [Optimism](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#optimism)
* [Base](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#base)
* [Plume](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#plume)
* [Sonic](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#sonic)
* [Testnet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#testnet)
* [DIA Lasernet Testnet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#dia-lasernet-testnet)
* [Sepolia](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#sepolia)
* [Base Sepolia](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#base-sepolia)
* [Arbitrum Sepolia](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#arbitrum-sepolia)
* [Optimism Sepolia](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#optimism-sepolia)
* [Unichain Sepolia](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#unichain-sepolia)
* [Somnia Testnet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#somnia-testnet)
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#mainnet)
Mainnet
----------------------------------------------------------------------------------------------------------------------
* The push based oracles update prices on every 2% deviation with a 12h heartbeat, and a 120 seconds refresh frequency. - The available price feeds for all the oracles are: - BTC/USD - USDC/USD - DIA/USD
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#dia-lasernet)
DIA Lasernet
| Contract | Address |
| --- | --- |
| MailBox | [0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392](https://explorer.diadata.org/address/0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392) |
| OracleRequestRecipient | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://explorer.diadata.org/address/0xA42217338614B7e67D022C52D1CD38e02D619bb0) |
| DIAOracleMetaV2 | [0x5eeB8c00CD8F189f62c9BAD352C0C474429F8A27](https://explorer.diadata.org/address/0x5eeB8c00CD8F189f62c9BAD352C0C474429F8A27) |
| OracleTrigger | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://explorer.diadata.org/address/0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://explorer.diadata.org/address/0xE74B7D236A97eED9026926073cBb436638266888) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#arbitrum)
Arbitrum
| Contract | Address |
| --- | --- |
| Push Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://arbiscan.io/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| Pull Oracle | [0xE74B7D236A97eED9026926073cBb436638266888](https://arbiscan.io/address/0xe74b7d236a97eed9026926073cbb436638266888) |
| MailBox | [0x979Ca5202784112f4738403dBec5D0F3B9daabB9](https://arbiscan.io/address/0x979ca5202784112f4738403dbec5d0f3b9daabb9) |
| ISM | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://arbiscan.io/address/0x92f0f4c9f769ed83609cd2ccd1acce224bbc8cbf) |
| Protocol Fee Hook | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://arbiscan.io/address/0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#optimism)
Optimism
| Contract | Address |
| --- | --- |
| Push Oracle | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://optimistic.etherscan.io/address/0x048050547eb6e68cb37fb21eeafead40cf2cbdbb) |
| Pull Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://optimistic.etherscan.io/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| MailBox | [0xd4C1905BB1D26BC93DAC913e13CaCC278CdCC80D](https://optimistic.etherscan.io/address/0xd4C1905BB1D26BC93DAC913e13CaCC278CdCC80D) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://optimistic.etherscan.io/address/0xe74b7d236a97eed9026926073cbb436638266888) |
| Protocol Fee Hook | [0x0ec9C62333E29243B04C934bC924c169c1255027](https://optimistic.etherscan.io/address/0x0ec9c62333e29243b04c934bc924c169c1255027) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#base)
Base
| Contract | Address |
| --- | --- |
| Push Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://basescan.org/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| Pull Oracle | [0xE74B7D236A97eED9026926073cBb436638266888](https://basescan.org/address/0xe74b7d236a97eed9026926073cbb436638266888) |
| MailBox | [0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D](https://basescan.org/address/0xeA87ae93Fa0019a82A727bfd3eBd1cFCa8f64f1D) |
| ISM | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://basescan.org/address/0x92f0f4c9f769ed83609cd2ccd1acce224bbc8cbf) |
| Protocol Fee Hook | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://basescan.org/address/0x048050547eb6e68cb37fb21eeafead40cf2cbdbb) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#plume)
Plume
| Contract | Address |
| --- | --- |
| Push Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://explorer.plume.org/address/0xA42217338614B7e67D022C52D1CD38e02D619bb0) |
| Pull Oracle | [0xE74B7D236A97eED9026926073cBb436638266888](https://explorer.plume.org/address/0xE74B7D236A97eED9026926073cBb436638266888) |
| MailBox | [0x3a464f746D23Ab22155710f44dB16dcA53e0775E](https://explorer.plume.org/address/0x3a464f746D23Ab22155710f44dB16dcA53e0775E) |
| ISM | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://explorer.plume.org/address/0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF) |
| Protocol Fee Hook | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://explorer.plume.org/address/0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#sonic)
Sonic
| Contract | Address |
| --- | --- |
| Push Oracle | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://sonicscan.org/address/0x048050547eb6e68cb37fb21eeafead40cf2cbdbb) |
| Pull Oracle | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://sonicscan.org/address/0xa42217338614b7e67d022c52d1cd38e02d619bb0) |
| MailBox | [0x3a464f746D23Ab22155710f44dB16dcA53e0775E](https://sonicscan.org/address/0x3a464f746D23Ab22155710f44dB16dcA53e0775E) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://sonicscan.org/address/0xe74b7d236a97eed9026926073cbb436638266888) |
| Protocol Fee Hook | [0x0ec9C62333E29243B04C934bC924c169c1255027](https://sonicscan.org/address/0x0ec9c62333e29243b04c934bc924c169c1255027) |
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#testnet)
Testnet
----------------------------------------------------------------------------------------------------------------------
* The push based oracle updates prices on every 1% deviation. - The available price feeds for all the oracles are: - BTC/USD - ETH/USD - DIA/USD - USDC/USD
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#dia-lasernet-testnet)
DIA Lasernet Testnet
| Contract | Address |
| --- | --- |
| MailBox | [0x16cD72271498bcaD5aeB9f2D785bA82dC5AfA5E2](https://testnet-explorer.diadata.org/address/0x16cD72271498bcaD5aeB9f2D785bA82dC5AfA5E2) |
| OracleRequestRecipient | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://testnet-explorer.diadata.org/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| DIAOracleMetaV2 | [0x0087342f5f4c7AB23a37c045c3EF710749527c88](https://testnet-explorer.diadata.org/address/0x0087342f5f4c7AB23a37c045c3EF710749527c88) |
| OracleTrigger | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://testnet-explorer.diadata.org/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e) |
| ISM | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://testnet-explorer.diadata.org/address/0x61D217a26D0Bff1D2b4c6f5880e621071326aadC) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#sepolia)
Sepolia
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.etherscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
| MailBox | [0xfFAEF09B3cd11D9b20d1a19bECca54EEC2884766](https://sepolia.etherscan.io/address/0xffaef09b3cd11d9b20d1a19becca54eec2884766) |
| ISM | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://sepolia.etherscan.io/address/0xb869617a3cfcda07a4cc230d996120074e7c817e) |
| Protocol Fee Hook | [0x611C8b288c642336136a436d7125AC49FA71468B](https://sepolia.etherscan.io/address/0x611c8b288c642336136a436d7125ac49fa71468b) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#base-sepolia)
Base Sepolia
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.basescan.org/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.basescan.org/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
| MailBox | [0x6966b0E55883d49BFB24539356a2f8A673E02039](https://sepolia.basescan.org/address/0x6966b0e55883d49bfb24539356a2f8a673e02039) |
| ISM | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://sepolia.basescan.org/address/0xb869617a3cfcda07a4cc230d996120074e7c817e) |
| Protocol Fee Hook | [0x611C8b288c642336136a436d7125AC49FA71468B](https://sepolia.basescan.org/address/0x611C8b288c642336136a436d7125AC49FA71468B) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#arbitrum-sepolia)
Arbitrum Sepolia
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.arbiscan.io/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.arbiscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
| MailBox | [0x598facE78a4302f11E3de0bee1894Da0b2Cb71F8](https://sepolia.arbiscan.io/address/0x598face78a4302f11e3de0bee1894da0b2cb71f8) |
| ISM | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://sepolia.arbiscan.io/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e) |
| Protocol Fee Hook | [0x611C8b288c642336136a436d7125AC49FA71468B](https://sepolia.arbiscan.io/address/0x611c8b288c642336136a436d7125ac49fa71468b) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#optimism-sepolia)
Optimism Sepolia
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia-optimism.etherscan.io/address/0x9bb71344ed950f9cfd85ee1c7258553b01d95fa0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia-optimism.etherscan.io/address/0x61d217a26d0bff1d2b4c6f5880e621071326aadc) |
| MailBox | [0x6966b0E55883d49BFB24539356a2f8A673E02039](https://sepolia-optimism.etherscan.io/address/0x6966b0e55883d49bfb24539356a2f8a673e02039) |
| ISM | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://sepolia-optimism.etherscan.io/address/0xb869617a3cfcda07a4cc230d996120074e7c817e) |
| Protocol Fee Hook | [0x611C8b288c642336136a436d7125AC49FA71468B](https://sepolia-optimism.etherscan.io/address/0x611c8b288c642336136a436d7125ac49fa71468b) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#unichain-sepolia)
Unichain Sepolia
| Contract | Address |
| --- | --- |
| Push Oracle | [0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0](https://sepolia.uniscan.xyz/address/0x9bb71344Ed950F9cFD85EE1C7258553B01d95FA0) |
| Pull Oracle | [0x61D217a26D0Bff1D2b4c6f5880e621071326aadC](https://sepolia.uniscan.xyz/address/0x61D217a26D0Bff1D2b4c6f5880e621071326aadC) |
| MailBox | [0xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeD](https://sepolia.uniscan.xyz/address/0xDDcFEcF17586D08A5740B7D91735fcCE3dfe3eeD) |
| ISM | [0xb869617a3CFcdA07A4cC230d996120074e7c817e](https://sepolia.uniscan.xyz/address/0xb869617a3CFcdA07A4cC230d996120074e7c817e) |
| Protocol Fee Hook | [0x611C8b288c642336136a436d7125AC49FA71468B](https://sepolia.uniscan.xyz/address/0x611C8b288c642336136a436d7125AC49FA71468B) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/token-addresses#somnia-testnet)
Somnia Testnet
| Contract | Address |
| --- | --- |
| Push Oracle | [0xFb1462A649A92654482F8E048C754333ad85e5C0](https://shannon-explorer.somnia.network/address/0xFb1462A649A92654482F8E048C754333ad85e5C0) |
| Pull Oracle | [0x4E0BD1602f2FeC717E751F24f4e8178bfb9f5dc6](https://shannon-explorer.somnia.network/address/0x4E0BD1602f2FeC717E751F24f4e8178bfb9f5dc6) |
| MailBox | [0x7d498740A4572f2B5c6b0A1Ba9d1d9DbE207e89E](https://shannon-explorer.somnia.network/address/0x7d498740A4572f2B5c6b0A1Ba9d1d9DbE207e89E) |
| ISM | [0xdBEf26113A6c84f2E1Ad13Bbb43898e4Ff4286dc](https://shannon-explorer.somnia.network/address/0xdBEf26113A6c84f2E1Ad13Bbb43898e4Ff4286dc) |
| Protocol Fee Hook | [0x67f4e6b2EE6535F9D3Eca74E63a665F8c888C2bc](https://shannon-explorer.somnia.network/address/0x67f4e6b2EE6535F9D3Eca74E63a665F8c888C2bc) |
Was this page helpful?
YesNo
⌘I
---
# Setting Up the Node - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Setting Up the Node
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Requirements](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node#requirements)
Make sure you familiraize yourself with the data flow in the Lumina system before proceeding with the node setup. To learn more, checkout the architecture guide [here](https://www.diadata.org/docs/reference/architecture)
.
[](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node#requirements)
Requirements
-------------------------------------------------------------------------------------------------------------
* Ensure that Docker or Docker Compose is installed on your machine.
* Clone the [decentral-feeder repository](https://github.com/diadata-org/decentral-feeder)
to your local machine.
* The container has minimal resource requirements, making it suitable for most machines, including Windows, macOS, Linux, and Raspberry Pi, as long as Docker is installed.
* An ETH private key from MetaMask or any other Eth wallet. Alternatively to generate private key effortlesly eth-keys tool can be used for this [ethereum/eth-keys](https://github.com/ethereum/eth-keys)
* DIA tokens in your wallet. If you’re using testnet, you can access the faucet [here](https://faucet.diadata.org/)
.
Next, select your preferred deployment method:
[Docker compose\
--------------\
\
Suitable for a single container setup and quick testing](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-compose)
[Docker run\
----------\
\
Suitable for simple setups without orchestration](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/docker-run)
[Kubernetes\
----------\
\
Ideal for production environments requiring scalability and high availability](https://www.diadata.org/docs/how-to-guides/run-a-feeder/setting-up-the-node/kubernetes)
Was this page helpful?
YesNo
⌘I
---
# Community & Support - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/resources/community-and-support#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Community & Support
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
You can connect with us and find support through the following channels:
[Forum\
-----](https://forum.diadata.org/)
[Twitter/X\
---------](https://x.com/DIAdata_org)
[Discord\
-------](https://discord.com/invite/ZvGjVY5uvs)
[Github\
------](https://github.com/diadata-org/)
Was this page helpful?
YesNo
⌘I
---
# RWA Price Feeds - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
RWA Price Feeds
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
On this page
* [Mainnet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#mainnet)
* [Arbitrum](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#arbitrum)
* [Oracle Details](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#oracle-details)
* [Hyperlane Details](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#hyperlane-details)
* [DIA Lasernet](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#dia-lasernet)
[Bring DIA Oracles to Your Chain](https://www.diadata.org/docs/how-to-guides/request-a-custom-oracle)
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#mainnet)
Mainnet
--------------------------------------------------------------------------------------------------------------------
* The push based oracles update prices on every 1% deviation with a 24h heartbeat, and a 120 seconds refresh frequency.
* The available price feeds for all the oracles are:
* APPL
* XAU/USD
* USD/EUR
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#arbitrum)
Arbitrum
####
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#oracle-details)
Oracle Details
| Contract | Address |
| --- | --- |
| Push Oracle | [0xEB3b12FB37090ACc6773B59619799941536FA198](https://arbiscan.io/address/0xEB3b12FB37090ACc6773B59619799941536FA198) |
####
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#hyperlane-details)
Hyperlane Details
| Contract | Address |
| --- | --- |
| MailBox | [0x979Ca5202784112f4738403dBec5D0F3B9daabB9](https://arbiscan.io/address/0x979ca5202784112f4738403dbec5d0f3b9daabb9) |
| ISM | [0x92F0f4C9F769ed83609CD2ccD1ACcE224bBC8cBF](https://arbiscan.io/address/0x92f0f4c9f769ed83609cd2ccd1acce224bbc8cbf) |
| Protocol Fee Hook | [0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB](https://arbiscan.io/address/0x048050547eb6e68cB37Fb21EEafEad40CF2CbdbB) |
###
[](https://www.diadata.org/docs/how-to-guides/fetch-price-data/contract-addresses/rwa-addresses#dia-lasernet)
DIA Lasernet
| Contract | Address |
| --- | --- |
| MailBox | [0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392](https://explorer.diadata.org/address/0xa016e5E7Ce70E78ba7B914299B3c2d44f69Ad392) |
| OracleRequestRecipient | [0xA42217338614B7e67D022C52D1CD38e02D619bb0](https://explorer.diadata.org/address/0xA42217338614B7e67D022C52D1CD38e02D619bb0) |
| DIAOracleMetaV2 | [0x30F5A368a1426851C23E90467F6dCc688116194A](https://explorer.diadata.org/address/0x30F5A368a1426851C23E90467F6dCc688116194A) |
| OracleTrigger | [0x8ed69fd34A1e29b6c6012e89C555b83b5DC7Dad5](http://explorer.diadata.org/address/0x8ed69fd34A1e29b6c6012e89C555b83b5DC7Dad5) |
| ISM | [0xE74B7D236A97eED9026926073cBb436638266888](https://explorer.diadata.org/address/0xE74B7D236A97eED9026926073cBb436638266888) |
Was this page helpful?
YesNo
⌘I
---
# Request a Custom Oracle - DIA Oracles
[Skip to main content](https://www.diadata.org/docs/how-to-guides/request-a-custom-oracle#content-area)
[DIA Oracles home page](https://www.diadata.org/)
Search...
⌘K
Search...
Navigation
Request a Custom Oracle
[Get Started](https://www.diadata.org/docs/home)
[DIA Stack](https://www.diadata.org/docs/dia-stack/overview)
[Guides](https://www.diadata.org/docs/guides/quickstart)
[API Reference](https://www.diadata.org/docs/reference/apis)
Get in touch with us:
[](https://t.me/DIAOracles_Support_Bot)
[](https://t.me/DIAOracles_Support_Bot)
[Integrations team\
-----------------](https://t.me/DIAOracles_Support_Bot)
[For a consultation with the DIA team, get in touch via Telegram. The team will gather the requirements and create a solution proposal for you.](https://t.me/DIAOracles_Support_Bot)
[Contact Us](https://t.me/DIABDteam)
[](https://forum.diadata.org/)
[](https://forum.diadata.org/)
[Forum request\
-------------](https://forum.diadata.org/)
[If you already have a specific implementation in mind, you can directly and autonomously submit a request via the DIA Forum.](https://forum.diadata.org/)
[Submit a CDR](https://forum.diadata.org/)
Was this page helpful?
YesNo
⌘I
---