Trader's PnL for the last 30mins for a specific token

New Trade Stream

Returns trades, where trader address is QeHykJ…BWC2 and token ID is bid:solana:8xs8TCoAMJ4zj5aeXmrDP2BechGrXLMzVyMVBxfCpump: trader address, sum of amounts in USD base, sum of amounts base, calculate, count, currency ID, currency name and 11 more fields.

By Akshat · saved 6 April 2026 · run 16 times · Bitquery API v2

What it returns

Filters

The query

{
  Trading {
    Trades(
      where: {Block: {Time: {since_relative: {minutes_ago: 30}}}, Pair: {Token: {Id: {is: "bid:solana:8xs8TCoAMJ4zj5aeXmrDP2BechGrXLMzVyMVBxfCpump"}}}Trader:{Address:{is:"QeHykJGZj6B2Syhi5a63t9oaLTwKXZqM4J5PjeZBWC2"}}}
    ) {
      Trader {
        Address
      }
      Amount_Bought:sum(of:AmountsInUsd_Base if:{Side:{is:"Buy"}})
      Amount_Sold:sum(of:AmountsInUsd_Base if:{Side:{is:"Sell"}})
      Amount_Bought_native:sum(of:Amounts_Base if:{Side:{is:"Buy"}})
      Amount_Sold_native:sum(of:Amounts_Base if:{Side:{is:"Sell"}})
      PnL: calculate(expression:"$Amount_Sold - $Amount_Bought")
      buys:count(if:{Side:{is:"Buy"}})
      sells:count(if:{Side:{is:"Sell"}})
      Pair {
        Currency {
          Id
          Name
          Symbol
        }
        Market {
          Address
          Program
          Network
        }
        Token {
          Address
          Id
          IsNative
          Symbol
          TokenId
          Network
        }
        QuoteToken {
          Address
          Id
          IsNative
          Symbol
          TokenId
          Network
        }
      }
    }
  }
}

Similar queries