volume and trades for a token in different time frames

Returns DEX trades by token on BNB Chain: currency name, currency symbol, smart contract, sum of trade side amount in USD and count.

By Kshitij Mahajan · saved 2 September 2025 · Bitquery API v2

What it returns

The query

query MyQuery($currency: String) {
  EVM(network: bsc) {
    DEXTradeByTokens(
      where: {
        Trade: {
          Currency: {
            SmartContract: {is: $currency}
          },
          Success: true
        }, 
        Block: {
          Time: {since_relative: {hours_ago: 24}}
        }
      }
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
      }
      volume_24hr: sum(of: Trade_Side_AmountInUSD)
      volume_1hr: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative: {hours_ago:1}}}}
      )
      volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {since_relative:{minutes_ago:5}}}}
      )
      trades_24hr: count
      trades_1hr: count(if: {Block: {Time: {since_relative: {hours_ago:1}}}})
      trades_5min: count(if: {Block: {Time: {since_relative:{minutes_ago:5}}}})
    }
  }
}

Variables

{
  "currency": "0x9b48a54bcce09e59b0479060e9328ab7dbdb0d40",
  "time_24hr_ago": "2024-03-23T15:00:00Z",
  "time_1hr_ago": "2024-03-24T14:00:00Z",
  "time_5min_ago": "2024-03-24T15:55:00Z",
}

Similar queries