test-2024-10-30 17:07:40

Returns DEX trades by token on Solana, where side currency mint address is So1111…1112, currency mint address is Cwa6QN…pump and side currency symbol is WSOL, sorted by block time: block time, price in USD and sum of trade side amount in USD.

By peanut · saved 30 October 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($token: String, $time_ago: DateTime, $time_before: DateTime, $resolution: OLAP_DateTimeIntervalUnits, $space: Int) {
  Solana(network: solana, dataset: combined) {
    DEXTradeByTokens(
      where: {Block: {Time: {after: $time_ago, before: $time_before}}, Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}, Symbol: {is: "WSOL"}}}, Currency: {MintAddress: {is: $token}}}}
      orderBy: {ascendingByField: "Block_Time"}
    ) {
      Block {
        Time(interval: {count: $space, in: $resolution})
      }
      Trade {
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Slot)
        close: PriceInUSD(maximum: Block_Slot)
      }
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "token": "Cwa6QNeNP2Qh7zR34hdzJdgtDDmaD2Y96m7c9HBdpump",
  "time_ago": "2024-10-29T20:30:00.000Z",
  "time_before": "2024-10-30T02:30:00.000Z",
  "space": 1,
  "resolution": "minutes"
}

Similar queries