Queries

Query examples provided for the DFX subgraphs

All the query examples can be tested on the playground in the subgraphs provided below


DFX Factory

Total liquidity, volume, and pools

This query gets the all time information about DFX

{
  dfxfactories {
    id
    pairCount
    totalVolumeUSD
    totalLiquidityUSD
  }
}

DFX Day Data

Daily snapshots of all total liquidity and volume

This query gets the daily snapshots on the all time information about DFX such as the US dollar value of the total liquidity and total volume across all DFX pools


Trade

This query gets the latest 10 trades that were made in a pool. i.e. the EURS/USDC pool


Pairs

This query lists the all pairs offered by DFX


Pair by ID

This query gets a pair by its id (contract address). For example below is the EURS/USDC pool


Pairs ordered by liquidity

This query lists the all pairs offered by DFX ordered by liquidity in descending direction


Pairs ordered by volume

This query lists the all pairs offered by DFX ordered by volume in descending direction


Pair Day Data

This query lists a pair's data for a particular day ordered by date in ascending direction. For example below is the CADC/USDC pool


Tokens

This query lists the all tokens offered on DFX


Token by ID

This query gets a token by its id (contract address) For example below is the USDC token


Token Day Data

This query lists a pair's data for a particular day ordered by date in ascending direction. For example below is the CADC/USDC pool


Pool Participants

Volume

This query lists the top 5 addresses by trading volume in a pool. For example below is the CADC/USDC pool

Last updated

Was this helpful?