ray trades

Streams the latest 50 DEX trades by token on Solana as they happen, where side currency mint address is So1111…1112, currency mint address is 4k3Dyj…kX6R and side amount is above 0: quantile of trade price in USD, sum of trade side amount in USD, block time, transaction signature, market address, protocol name, protocol family and 8 more fields.

By gaurav · saved 7 April 2025 · Bitquery API v2

What it returns

Filters

The subscription

subscription LatestTrades($token: String, $base: String) {
  Solana {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 50}
      where: {Transaction: {Result: {Success: true}}, Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $token}}}, Currency: {MintAddress: {is: $base}}}}
    ) {
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      volume: sum(of: Trade_Side_AmountInUSD)
      Block {
        Time
      }
      Transaction {
        Signature
      }
      Trade {
        Market {
          MarketAddress
        }
        Dex {
          ProtocolName
          ProtocolFamily
        }
        Side {
          Type
        }
        PriceInUSD
        close: PriceInUSD
        Amount
        Side {
          Currency {
            Symbol
            MintAddress
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "base": "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R",
  "token": "So11111111111111111111111111111111111111112",
  "interval": 1,
  "dataset": "realtime",
  "time_ago": "2025-04-04T04:21:23Z"
}

Similar queries