DIA made API data easily accessible through GraphQL endpoint.
https://api.diadata.org/graphql/query
Also you can use a dedicated front-end to try out queries:
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:
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. |
FeedSelection
filtering optionsLiquidityThreshold
, which would result in such query:
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 |