OHLC subscription

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

By Divyasshree · saved 22 November 2024 · run 2 times · Bitquery API v2

What it returns

Filters

The subscription

subscription ($token: String, $base: String, $time_ago: DateTime) {
  Solana {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $token}}}, Currency: {MintAddress: {is: $base}}}, Block: {Time: {after: $time_ago}}}
    ) {
      Block {
        Time
      }
      Trade {
        close: PriceInUSD(maximum: Transaction_Index)
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "base": "7MDJrHNWxNVTFNwbAVVJazr5WgF7h2FTMqJpQgMGWoay",
  "token": "So11111111111111111111111111111111111111112"
}

Similar queries