subscription token solana

Streams DEX trades by token on Solana as they happen, where currency mint address is So1111…1112, sorted by block time: block time, price in USD and sum of trade side amount in USD.

By Nadia · saved 12 September 2024 · Bitquery API v2

What it returns

Filters

The subscription

subscription ($token: String) {
  Solana {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Currency: {MintAddress: {is: $token}}}}
    ) {
      Block {
        Time(interval: {count: 5, in: minutes})
      }
      Trade {
        open: PriceInUSD(minimum: Block_Slot)
        close: PriceInUSD(maximum: Block_Slot)
        max: PriceInUSD(maximum: Trade_PriceInUSD)
        min: PriceInUSD(minimum: Trade_PriceInUSD)
      }
      volume: sum(of: Trade_Side_AmountInUSD, selectWhere: {gt: "0"})
    }
  }
}

Variables

{
  "token": "So11111111111111111111111111111111111111112"
}

Similar queries