OHLCV stats CP latest

Returns DEX trades by token on Solana, where currency mint address is 75WLMc…pump, market market address is 8aev9e…7K9h and block time since 2025-05-11: price in USD, side currency symbol, count and sum of trade side amount in USD.

By DeAura · saved 12 May 2025 · run 8 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String!, $pair_address: String!, $time_5min_ago: DateTime!, $time_1h_ago: DateTime!, $time_6h_ago: DateTime!, $time_24h_ago: DateTime!) {
  Solana(dataset: realtime) {
    DEXTradeByTokens(
      where: {Transaction: {Result: {Success: true}},Trade: {Currency: {MintAddress: {is: $token}}, Market: {MarketAddress: {is: $pair_address}}}, Block: {Time: {since: $time_24h_ago}}}
    ) {
      Trade {
        start: PriceInUSD(minimum: Block_Time)
        min5: PriceInUSD(
          minimum: Block_Time
          if: {Block: {Time: {after: $time_5min_ago}}}
        )
        end: PriceInUSD(maximum: Block_Time)
        Side {
          Currency {
            Symbol
          }
        }
      }
      makers: count(distinct: Transaction_Signer)
      buyers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}}
      )
      sellers: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}}
      )
      trades: count
      traded_volume: sum(of: Trade_Side_AmountInUSD)
      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}}}})
      makers_5min: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_5min_ago}}}
      )
      buyers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sellers_5min: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      trades_5min: count(if: {Block: {Time: {after: $time_5min_ago}}})
      traded_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_5min_ago}}}
      )
      buy_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sell_volume_5min: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      buys_5min: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      sells_5min: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
      )
      makers_1h: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_1h_ago}}}
      )
      buyers_1h: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sellers_1h: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      trades_1h: count(if: {Block: {Time: {after: $time_1h_ago}}})
      traded_volume_1h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_1h_ago}}}
      )
      buy_volume_1h: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sell_volume_1h: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      buys_1h: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      sells_1h: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_1h_ago}}}
      )
      makers_6h: count(
        distinct: Transaction_Signer
        if: {Block: {Time: {after: $time_6h_ago}}}
      )
      buyers_6h: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      sellers_6h: count(
        distinct: Transaction_Signer
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      trades_6h: count(if: {Block: {Time: {after: $time_6h_ago}}})
      traded_volume_6h: sum(
        of: Trade_Side_AmountInUSD
        if: {Block: {Time: {after: $time_6h_ago}}}
      )
      buy_volume_6h: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      sell_volume_6h: sum(
        of: Trade_Side_AmountInUSD
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      buys_6h: count(
        if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_6h_ago}}}
      )
      sells_6h: count(
        if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_6h_ago}}}
      )
    }
  }
}

Variables

{
  "token":"75WLMcKrVZAVwh13SBc1jiSMR9GKtHuXgqVHVt67pump",
  "pair_address": "8aev9ehN5fT1kvGDRV4v3QjXAgx7vAhK6xEELNm17K9h",
  "time_5min_ago":"2025-05-12T09:00:00Z",
  "time_1h_ago": "2025-05-12T08:05:00Z",
  "time_6h_ago": "2025-05-12T03:05:00Z",
  "time_24h_ago": "2025-05-11T09:15:00Z"
}

Similar queries