PnL query

Returns trades, where trader address is FkaLnX…3MZp and market network is Solana, sorted by pn l, highest first: trader address, sum of amounts in USD quote, calculate, token address, token ID, token symbol, network and 5 more fields.

By gaurav · saved 5 May 2026 · Bitquery API v2

What it returns

Filters

The query

{
  Trading {
    Trades(
      orderBy: {descendingByField: "PnL"}
      where: {Trader: {Address: {is: "FkaLnX17cXZGyeu3kZGdHCNdFMJJzBrPPYVvd18B3MZp"}}, 
        Pair: {Market: {Network: {is: "Solana"}}}, 
        Block: {Time: {since_relative: {minutes_ago: 3000}}}}
    ) {
      Trader {
        Address
      }
      Amount_Bought: sum(of: AmountsInUsd_Quote, if: {Side: {is: "Buy"}})
      Amount_Sold: sum(of: AmountsInUsd_Quote, if: {Side: {is: "Sell"}})
      PnL: calculate(expression: "$Amount_Sold - $Amount_Bought")
      Pair {
        Token {
          Address
          Id
          Symbol
          Network
        }
        QuoteToken {
          Address
          Id
          Symbol
          Network
        }
        Market {
          Address
          Program
          Network
        }
      }
    }
  }
}

Similar queries