Tron wallet PnL across tokens last 7 days

Bought and sold USD and PnL per token for one Tron wallet over the last 7 days

Returns 100 DEX trades by token on Tron, sorted by PnL, highest first: currency symbol, currency name, smart contract, sum of trade side amount in USD, calculate and count.

By Divyasshree · saved 1 December 2026 · Bitquery API v2

What it returns

The query

query WalletPnLTron {
  Tron {
    DEXTradeByTokens(
      where: {
        Transaction: { Result: { Success: true } }
        Block: { Time: { since_relative: { days_ago: 7 } } }
        any: [
          { Trade: { Buyer: { is: "TK2nJVdoyfBL2Htee1NLsiAU2QnuZzCBAQ" } } }
          { Trade: { Seller: { is: "TK2nJVdoyfBL2Htee1NLsiAU2QnuZzCBAQ" } } }
        ]
      }
      orderBy: { descendingByField: "pnl" }
      limit: { count: 100 }
    ) {
      Trade {
        Currency {
          Symbol
          Name
          SmartContract
        }
      }
      bought_usd: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: sell } } } }
      )
      sold_usd: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: { Side: { Type: { is: buy } } } }
      )
      pnl: calculate(expression: "$sold_usd - $bought_usd")
      trades: count
    }
  }
}

Similar queries