📈Subgraph Query Examples
Last updated
Last updated
An example querying total pair counts, total liquidity in USD, and total Volume in USD:
If you want to get the ticker data for a specific contract address, use the lower case address (except for the SRG address) as an id as follows.
If you want to get the pair data use the following as id: 0x9f19c8e321bD14345b797d43E01f0eED030F5Bff_0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c for SRG-BNB
[contract address]_0x9f19c8e321bD14345b797d43E01f0eED030F5Bff for all others
To get all current tickers data you can query tickers as follows.
To get all current pairs data you can query pairs as follows.
You can also query historical data by specifying a block number as shown below.
The volume provided for the tickers is cumulative, so subtract the current volume from the volume 24 hours ago if you want day volume for example.
The maximum items you can query at once is 1000. Thus, to get all possible pairs or ticker data, you can integrate using the skip variable. To get items beyond the first 1000 you can also set the skip as shown below.