Base Buy and Sell Volume

Returns DEX trades by token on Base, where currency smart contract is 0x8a9c…4f94, side currency smart contract is 0x4200…0006 and block time since 2025-11-11: currency name, currency symbol, smart contract, side currency name, side currency symbol, side smart contract, sum of trade side amount in USD and 2 more fields.

By William Lopez-Cordero · saved 12 November 2025 · Bitquery API v2

What it returns

Filters

The query

query BaseTokenVolume($baseToken: String!, $quoteToken: String!, $since: DateTime!, $till: DateTime!) {
  EVM(network: base) {
    DEXTradeByTokens(
      where: {Block: {Time: {since: $since, till: $till}}, TransactionStatus: {Success: true}, Trade: {Currency: {SmartContract: {is: $baseToken}}, Side: {Currency: {SmartContract: {is: $quoteToken}}}}}
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
        Side {
          Currency {
            Name
            Symbol
            SmartContract
          }
        }
      }
      traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD)
      buy_volume_in_usd: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      sell_volume_in_usd: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      total_volume: sum(of: Trade_Amount)
      buy_volume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
      sell_volume: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
      buy_count: count(if: {Trade: {Side: {Type: {is: sell}}}})
      sell_count: count(if: {Trade: {Side: {Type: {is: buy}}}})
      total_trades: count
    }
  }
}

Variables

{
  "baseToken": "0x8a9cf9ae6536127129727938cb1a6438273e4f94",
  "quoteToken": "0x4200000000000000000000000000000000000006",
  "since": "2025-11-11T00:00:00Z",
  "till": "2025-11-12T00:00:00Z"
}

Similar queries