24 hours bought and sold amounts in usd for a wallet

Returns prediction trades on Polygon, where outcome trade buyer is 0x101f…8e1a and marketplace protocol name is polymarket: sum of trade outcome trade collateral amount in USD.

By Kshitij Mahajan · saved 24 March 2026 · Bitquery API v2

What it returns

Filters

The query

query WalletTrades($hoursAgo: Int!, $buyer: String!) {
  EVM(network: matic) {
    buys: PredictionTrades(
      where: {
        Trade: {
          Prediction: {
            Marketplace: {ProtocolName: {is: "polymarket"}},
          },
          OutcomeTrade: {IsOutcomeBuy: true, Buyer: {is: $buyer}}
        },
        Block: {Time: {since_relative: {hours_ago: $hoursAgo}}}
      }
    ) {
      # Trade {
      #   OutcomeTrade { CollateralAmountInUSD }
      #   Prediction { ConditionId }
      # }
      bought: sum(of: Trade_OutcomeTrade_CollateralAmountInUSD)
    }

    sells: PredictionTrades(
      where: {
        Trade: {
          Prediction: {
            Marketplace: {ProtocolName: {is: "polymarket"}},
          },
          OutcomeTrade: {IsOutcomeBuy: false, Buyer: {is: $buyer}}
        },
        Block: {Time: {since_relative: {hours_ago: $hoursAgo}}}
      }
    ) {
      # Trade {
      #   OutcomeTrade { CollateralAmountInUSD }
      #   Prediction { ConditionId }
      # }
      sold: sum(of: Trade_OutcomeTrade_CollateralAmountInUSD)
    }
  }
}

Variables

{
  "hoursAgo": 24,
  "buyer": "0x101f2f96db1e39a9f36a1fa067751d541fd38e1a"
  
}

Similar queries