Smart contracts which are built upon blockchains open up oppurtunities for a wide range of possible financial tools and mechanisms. Some of which need to consume data from external sources. Pyth Network is an cross-chain publish-subscribe design oracle which sources the price data of digital assets such as Bitcoin/USD and commodities such as Crude oil.
Pyth Network Sources this data from various institutional firms listed here, https://www.pyth.network/publishers
They make this data available via API's and Pyth Smart Contracts
Pyth has three API Categories
Price Feed set of APIs focus on retrieving and managing price data, including Exponential Moving Averages (EMA) and general price feeds. They also handle updating feeds, parsing updates, and managing related fees and time periods.
Currently only EVM Chains are supported.
The following are the listed API's
getEmaPriceNoOlderThan
getEmaPriceUnsafe
getPriceNoOlderThan
getPriceUnsafe
getUpdateFee
Input:
Crypto.BTC/USD
0xe62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
)600 - 1
secondsBase
Output:
age
values in seconds (from 600
down to 1
). In most cases, a Stale Price response was received for age < 60
values.This information is helpful to API consumers to calculate the refresh/refetch rate of a price
Base
chain resulted in a Price Not Found error.Feedback:
parsePriceFeedUpdates
parsePriceFeedUpdatesUnique
updatePriceFeeds
updatePriceFeedsIfNecessary
For priceUpdates
, we need to fetch the price update data from Hermes API:
Feedback:
It would be helpful if the hex data returned from the API was already prefixed with 0x to align with input parameter format of the PriceFeedUpdate
API's and avoid extra parsing steps.
This set of API's provide historical data
The following TradingView API routes were tested and successfully returned valid responses:
/v1/shims/tradingview/history
/v1/shims/tradingview/groups
/v1/shims/tradingview/symbol_info
/v1/shims/tradingview/symbols
/v1/shims/tradingview/search
/v1/shims/tradingview/config
/v1/shims/tradingview/streaming
All the above-listed endpoints worked as expected and provided valid responses.
GET /v1/updates/price/{timestamp}
Retrieves historical price updates for a provided timestamp.
GET /v1/updates/price/{timestamp}/{interval}
Retrieves historical price updates for a provided time interval.
1731761220
60
e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43
Both API responses were successful and valid, providing the expected data for the given inputs.
Entropy set of API endpoints provide verifiable randomn numbers
It appears that the API reference documentation hasn't been updated yet: Pyth API Reference for Entropy.
I found the documentation for Entropy at this link: Pyth Network Entropy Docs.
Feedback:
Update documentation from Fortuna DOURO Labs to the API reference section.
Sources: