Makers, buyers and sellers

Returns DEX trades by token on Solana, where currency mint address is DqTgBb…pump, block time before 2025-01-24 and block time after 2025-01-24: price in USD, trade amount, count and sum of trade side amount in USD.

By Jacob · saved 26 January 2025 · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String!, $time_10min_ago: DateTime!, $time_to: DateTime!) {
  Solana(dataset: realtime) {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: $token}}}, Block: {Time: {before: $time_to, after: $time_10min_ago}}}
    ) {
      Trade {
        start: PriceInUSD(minimum: Block_Time)
        end: PriceInUSD(maximum: Block_Time)
        amount_max: Amount(maximum: Trade_Amount)
      }
      buyers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      sellers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      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}}}}
      )
      buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
      sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
    }
  }
}

Variables

{
  "token":"DqTgBbb527kT5PKPD6DQ4HRun1yXTkTYsEdGEbCgpump",
  "time_10min_ago": "2025-01-24T17:00:00Z",
  "time_to": "2025-01-24T18:02:00Z"
}

Similar queries