trade_volume_openbook

Returns DEX trades by token on Solana, where currency mint address is EPjFWd…Dt1v, DEX protocol family is OpenBook and block time since 2025-03-10: currency mint address, decimals, side currency name, side currency mint address, sum of trade side amount in USD and sum of trade amount.

By Akshat · saved 18 March 2025 · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  Solana(dataset: combined) {
    DEXTradeByTokens(
      where: {Block: {Time: {since: "2025-03-10T07:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Dex: {ProtocolFamily: {is: "OpenBook"}}}}
    ) {
      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}}}}
      )
    }
  }
}

Similar queries