-
Notifications
You must be signed in to change notification settings - Fork 48
Create Oracles.md #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Create Oracles.md #428
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e86073b
Create Oracles.md
JKtranslator db80958
Update index.md
JKtranslator 405c343
Update index.md
JKtranslator 1652179
Update index.md
JKtranslator 9e50982
Update index.md
JKtranslator e3e8794
Update index.md
JKtranslator 55a3102
Update Oracles.md
JKtranslator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
sidebar_position: 30 | ||
sidebar_label: Oracles | ||
title: Oracles | ||
--- | ||
|
||
# Ecosystem Price Oracles, powered by DIA | ||
|
||
|
||
## Introduction to DIA | ||
|
||
**[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. | ||
|
||
|
||
## Information on Usage of DIA Oracles on Alephium | ||
|
||
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. | ||
|
||
**If dApps require a custom oracle with different assets and configurations, please [contact DIA on Telegram](https://t.me/diabdteam).** | ||
|
||
|
||
## Price Oracles | ||
|
||
|
||
### Deployed contracts | ||
|
||
The main oracle contracts on Group 0 are deployed at the following addresses: | ||
|
||
|
||
|
||
* **Testnet**: vKdWgyqtQZzAV7eoMXxQCkyiNtceViGZheXC1iHbKFDZ | ||
* **Mainnet:** 285zrkZTPpUCpjKg9E3z238VmpUBQEAbESGsJT6yX7Rod | ||
JKtranslator marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
(New groups will be added in the near future). | ||
|
||
|
||
### How to access DIA oracles? | ||
|
||
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”. | ||
|
||
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. | ||
|
||
|
||
### Included price feeds | ||
|
||
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. | ||
|
||
|
||
<table> | ||
JKtranslator marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
<tr> | ||
<td><strong><code>Asset</code></strong> | ||
</td> | ||
<td><strong><code>Query Symbol</code></strong> | ||
</td> | ||
<td><strong><code>Sources Overview</code></strong> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>Bitcoin (BTC)</code> | ||
</td> | ||
<td><code>BTC/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Bitcoin/0x0000000000000000000000000000000000000000/">BTC Sources</a></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>USD Coin (USDC)</code> | ||
</td> | ||
<td><code>USDC/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Ethereum/0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48/">USDC Sources</a></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>Ether (ETH)</code> | ||
</td> | ||
<td><code>ETH/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Ethereum/0x0000000000000000000000000000000000000000/">ETH Sources</a></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>Wrapped Bitcoin (WBTC)</code> | ||
</td> | ||
<td><code>WBTC/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Ethereum/0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599/">WBTC Sources</a></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>Tether USD (USDT)</code> | ||
</td> | ||
<td><code>USDT/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Ethereum/0xdAC17F958D2ee523a2206206994597C13D831ec7/">USDT Sources</a></code> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><code>Alephium (ALPH)</code> | ||
</td> | ||
<td><code>ALPH/USD</code> | ||
</td> | ||
<td><code><a href="https://www.diadata.org/app/price/asset/Alephium/tgx7VNFoP9DJiFMFgXXtafQZkUvyEdDHT9ryamHJYrjq/">ALPH Sources</a></code> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
|
||
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. | ||
|
||
|
||
### Oracle configuration settings | ||
|
||
|
||
#### Methodology: VWAPIR | ||
|
||
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). | ||
|
||
|
||
#### Update frequency: 0.5% deviation + 1-hour heartbeat | ||
|
||
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%. | ||
|
||
|
||
## Example | ||
|
||
You can find a deployment example [here](https://github.com/alephium/ralph-example/tree/master/call-oracle/contracts). | ||
|
||
## Support | ||
|
||
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). | ||
JKtranslator marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
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). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.