Sample queries
This section provides sample examples on how you can query the subgraph to retrieve information about pools, tokens, transactions and more.
#
Overall DataTo query overall data you can pass in the DMM Factory address and select from various fields.
#
Overall StatsAll time volume in USD, total liquidity in USD, all time transaction count.
#
Overall Historical lookupUse The Graph's block query feature and query at any earlier block to view the stats. This can be used to view things like 24hr volume etc.
#
Pools Data#
Pool OverviewReturns a snapshot of the current state of the pool with common values. This example fetches the DAI/ETH pool.
#
All Pools in DMMTo fetch all pools on DMM might have to use a loop and graphql skip query, beacuse of the limitation of Graph to return to 1000 per query.
- where skip is an incrementing variable passed into your query
#
Most liquid poolsIn the order of liquidity returns the most liquid pools in DMM.
You can visit the subgraph sandbox play around to try out these queries and explore any other data you'd like.