Oracle System
Here we describe the oracle system which is provided by Javsphere powered by @pythNetwork
pyth.Network
Pyth Network price feeds provide real-time financial market data to smart contract applications on 50+ blockchains. Pyth's market data is contributed by over 95 reputable first-party data providers(opens in a new tab), including some of the biggest exchanges and market making firms in the world. Each price feed publishes a robust aggregate of these prices multiple times per second. The protocol offers over 450 price feeds(opens in a new tab) covering a number of different asset classes, including US equities, commodities, and cryptocurrencies.
Pythnet Price Feeds are available on 40+ blockchain ecosystems, and can also be used in off-chain applications. For the DMC we use the off-chain solution to bring the feed to DMC.

Contracts
Prices
The prices can be requested by calling the method
The main IDs are provided by the pythNetwork and can be found here: https://pyth.network/developers/price-feed-ids
At example the id for BTC/USD is:
EMA for prices
The Exponential Moving Average (EMA) is a technical indicator used in trading practices that shows how the price of an asset or security changes over a certain period of time. The EMA is different from a simple moving average in that it places more weight on recent data points (i.e., recent prices).
Javsphere Prices and IDs
We added additional ids and feeds which are not provided by Pyth
DMC
Defichain DEX
Request price
By calling the getPrice(id) method you get the following values:
With this values you can calculate the price as follows and also described here: https://docs.pyth.network/price-feeds/best-practices
Example: Price: 123673 Expo: -6 => 123673 * 10 ** -6 = 0.1236729

Last updated
Was this helpful?