Stream Solana Data with OHLCV

Streams DEX trades by token on Solana as they happen, where currency mint address is not EPjFWd…Dt1v, side amount is above 0 and trade price in USD is above 0, sorted by block time: block time, price in USD, side amount in USD, decimals, currency mint address, currency name, currency symbol and 3 more fields.

By chainedge · saved 23 November 2024 · run 35 times · Bitquery API v2

What it returns

Filters

The subscription

subscription ($token: String, $base: String, $time_ago: DateTime) {
  Solana(network: solana) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $token}}}, Currency: {MintAddress: {is: $base, notIn: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Dex: {}, PriceInUSD: {gt: 0}}, Block: {Time: {after: $time_ago}, Hash: {}}}
    ) {
      Block {
        Time
      }
      Trade {
        close: PriceInUSD(maximum: Transaction_Index)
        Side {
          AmountInUSD(selectWhere: {gt: "1"})
        }
        Currency {
          Decimals
          MintAddress
          Name
          Symbol
        }
      }
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      close: median(of: Trade_PriceInUSD)
      open: median(of: Trade_PriceInUSD)
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Similar queries