Get trading volume, buy volume, sell volume of a token

Returns DEX trades by token on Solana, where currency mint address is 4kJkgx…16Dm, side currency mint address is So1111…1112 and DEX program address is dbcij3…MaqN: currency mint address, decimals, side currency name, side currency mint address, sum of trade side amount in USD and sum of trade amount.

By gaurav · saved 23 May 2025 · run 9 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      where: {Block: {Time: {since: "2025-05-23T09:00:00Z", till: "2025-05-23T11:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "4kJkgxzuk1gcjsgRSVhdeSiC15ibQLRDKTuqtf2i16Dm"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}}}}
    ) {
      Trade {
        Currency {
          MintAddress
          Decimals
        }
        Side {
          Currency {
            Name
            MintAddress
          }
        }
      }
      traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
      traded_volume: sum(of: Trade_Amount)
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
    }
  }
}

Variables

{
}

Similar queries