test with currencies

Returns DEX trades by token on Solana, where currency mint address is EKpQGS…zcjm, block time after 2024-10-30 and block time before 2024-10-30, sorted by block time: block time, currency symbol, currency mint address, side currency mint address, side currency symbol, price in USD and sum of trade side amount in USD.

By Aleksey · saved 30 October 2024 · run 1 time · 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(aggregates: only, network: solana, dataset: combined) {
    DEXTradeByTokens(
      where: {Trade: {Side: {Amount: {gt: "0"}}, Currency: {MintAddress: {is: $token}}}, Block: {Time: {after: $time_ago, before: $time_before}}}
      orderBy: {ascendingByField: "Block_Time"}
    ) {
      Block {
        Time(interval: {count: $space, in: $resolution})
      }
      Trade {
        Currency {
          Symbol
          MintAddress
        }
        Side {
          Currency {
            MintAddress
            Symbol
          }
        }
        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": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
  "time_ago": "2024-10-30T02:35:35.000Z",
  "time_before": "2024-10-30T07:35:35.000Z",
  "space": 1,
  "resolution": "minutes"
}

Similar queries