subscription token solana with side filter

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

By Aleksey · saved 12 September 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The subscription

subscription ($token: String) {
  Solana {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {
        Trade: {
          Currency: {
            MintAddress: {is: $token}
          }
          Side: {
            Currency: {
              MintAddress: {
                in: [
                  "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh",
                  "",
                  "So11111111111111111111111111111111111111112",
                  "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
                  "7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",
                  "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
                  "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
                ]
              }
            }
          }
        }
      }
    ) {
      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