dex info

Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(network: $network, dataset: combined) archive full history combined archive + realtime in one resu

By Akshat · saved 22 September 2024 · run 27 times · Bitquery API v2

What it returns

Filters

The query

# Historical data
#   This query uses the realtime dataset (the default), which holds only a
#   recent window - hours to days depending on the cube.
#
#   For older data add a dataset to the top-level element:
#
#     EVM(network: $network, dataset: combined)
#
#     archive   full history
#     combined  archive + realtime in one result
#
#   Archive and combined need the historical data add-on:
#   https://bitquery.io/pricing
#
# Datasets:  https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#

query DexMarkets($network: evm_network, $market: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Dex: {ProtocolFamily: {is: $market}}}}
    ) {
      Block {
        Time(interval: {count: 1, in: hours})
      }
      trades: count
      buyers: uniq(of: Trade_Buyer)
      sellers: uniq(of: Trade_Sender)
      tokens: uniq(of: Trade_Currency_SmartContract)
    }
  }
}

Variables

{
  "market": "Uniswap",
  "network": "eth"
}

Similar queries