Skip to content

Commit 8f8f8f7

Browse files
authored
Merge pull request #428 from alephium/JKtranslator-patch-20
Create Oracles.md
2 parents 3e73869 + 55a3102 commit 8f8f8f7

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

docs/dapps/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ for compiling, testing and deploying smart contracts.
1515
Here, you'll find information on high-level
1616
[concepts](/dapps/concepts/overview) and
1717
[standards](/dapps/standards/fungible-tokens), as well as practical
18-
tutorials to help you get hands-on experience.
18+
tutorials to help you get hands-on experience.
19+
20+
You can also find information about Oracles [here].
1921

2022
Dive in to explore and build innovative DApps on Alephium!

docs/infrastructure/Oracles.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
sidebar_position: 30
3+
sidebar_label: Oracles
4+
title: Oracles
5+
---
6+
7+
# Ecosystem Price Oracles, powered by DIA
8+
9+
## Introduction to DIA
10+
11+
**[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.
12+
13+
## Information on Usage of DIA Oracles on Alephium
14+
15+
The DIA oracle on Alephium is free of use. dApps built on Alephium can leverage the oracles to access up-to-date asset price information. This oracles are designed for production environments and comes with a predefined list of feeds and settings.
16+
17+
**If dApps require a custom oracle with different assets and configurations, please [contact DIA on Telegram](https://t.me/diabdteam).**
18+
19+
## Price Oracles
20+
21+
### Deployed contracts
22+
23+
The main oracle contracts on Group 0 are deployed at the following addresses:
24+
25+
- **Testnet**: vKdWgyqtQZzAV7eoMXxQCkyiNtceViGZheXC1iHbKFDZ
26+
- **Mainnet:** 285zrkZTPpUCpjKg9E3z238VmpUBQEAbESGsJT6yX7Rod
27+
28+
(New groups will be added in the near future).
29+
30+
### How to access DIA oracles?
31+
32+
Locate one of the deployed contracts (either testnet or mainnet) and call the `get-value `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”.
33+
34+
This will return two values:
35+
36+
1. The price of the asset, with 8 decimals.
37+
2. The timestamp of the last update in Unix time format, in UTC timezone.
38+
39+
### Included price feeds
40+
41+
The Alephium oracle includes the following price feeds. Use the Query Symbol as a parameter in the `get-value` function to receive the latest price information for any of these assets.
42+
43+
| Asset | Query Symbol | Sources Overview |
44+
| ----------- | ----------- | ------|
45+
| Bitcoin (BTC) | BTC/USD | [BTC Sources](https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/) |
46+
| USD Coin (USDC) | USDC/USD | [USDC Sources](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
47+
| Ether (ETH) | ETH/USD | [ETH Sources](https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/) |
48+
| Wrapped Bitcoin (WBTC) | WBTC/USD | [WBTC Sources](https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/) |
49+
| Tether USD (USDT) | USDT/USD | [USDT Sources](https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/) |
50+
| Alephium (ALPH) | ALPH/USD | [ALPH Sources](https://www.diadata.org/app/price/asset/Alephium/tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq/) |
51+
52+
Learn more about DIA’s [data sourcing](https://docs.diadata.org/introduction/dia-technical-structure/data-sourcing) and [data computation](https://docs.diadata.org/introduction/dia-technical-structure/data-computation) architecture.
53+
54+
55+
### Oracle configuration settings
56+
57+
#### Methodology: VWAPIR
58+
59+
The final price point for each asset is calculated by computing the assets' trade information across multiple DEXs and CEXs. This is done using a [Volume Weighted Average Price with Interquartile Range (VWAPIR) methodology](https://docs.diadata.org/products/token-price-feeds/exchangeprices/vwapir-volume-weighted-average-price-with-interquartile-range-filter).
60+
61+
#### Update frequency: 0.5% deviation + 1-hour heartbeat
62+
63+
Each asset is updated every two minutes if the new price deviates from the old one by more than 0.5%. Additionally, a heartbeat of 1 hour is applied, which means that each price is updated at least once per day even if it moves by less than 0.5%.
64+
65+
## Example
66+
67+
You can find a deployment example [here](https://github.com/alephium/ralph-example/tree/master/call-oracle/contracts).
68+
69+
## Support
70+
71+
For developer assistance, connect with the DIA team directly on[Discord](https://chat.openai.com/c/d2ca764b-00d6-4de7-8555-0cc30ac416b1#) or [Telegram](https://t.me/diadata_org).
72+
73+
Developers seeking other specialized, production-grade oracle with tailored price feeds and configurations can initiate the request by [contacting the DIA BD Team via Telegram](https://t.me/diabdteam).

0 commit comments

Comments
 (0)