Realised Pnl Ethereum

Returns DEX trades by token on Ethereum, where currency smart contract is 0x9Bf7…0F14, block date since 2026-03-11 and block date till 2026-03-13: currency name, currency symbol, smart contract, sum of trade side amount in USD, calculate and count.

By Akshat · saved 12 March 2026 · run 4 times · Bitquery API v2

What it returns

Filters

The query

query($trader: String){
  EVM(network:eth dataset: combined) {
    DEXTradeByTokens(
      where: {
        Trade: {
          Currency: {
            SmartContract: { is: "0x9Bf729A48F061A312fc8b4c1C0D6149aA6920F14" }
          }
        }
        any:[{Trade:{Buyer:{is:$trader}}},{Trade:{Seller:{is:$trader}}}]
        TransactionStatus:{ Success: true } 
        Block: { Date: { since: "2026-03-11", till: "2026-03-13" } }
      }
    ) {
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
      }
      buy_volume: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: {Buyer:{is:$trader} Side: { Type: { is: sell } } } }
      )
      sell_volume: sum(
        of: Trade_Side_AmountInUSD
        if: { Trade: {Seller:{is:$trader} Side: { Type: { is: buy } } } }
      )
      PnL:calculate(expression:"$sell_volume - $buy_volume")
      trades: count
    }
  }
}

Variables

{
  "trader": "0xc904b53F8aE1cC9849bFa3fC7516F5902829c68E"
}

Similar queries