per-market wallet aggregates

Returns 5000 prediction trades on Polygon, where question ID is 0x4a98…3f00, sorted by USD, highest first: buyer, sum of trade outcome trade collateral amount in USD, count and seller.

By Akshat · saved 29 April 2026 · Bitquery API v2

What it returns

Filters

The query

query WalletAggregates($questionId: String!,  $perSide: Int!) {
  EVM(dataset: realtime, network: matic) {
    buyers: PredictionTrades(
      where: {
        TransactionStatus: { Success: true }
        Block: { Time: { since_relative: {days_ago:4} } }
        Trade: { Prediction: { Question: { Id: { is: $questionId } } } }
      }
      limit: { count: $perSide }
      limitBy: { by: Trade_OutcomeTrade_Buyer, count: 1 }
      orderBy: { descendingByField: "usd" }
    ) {
      Trade { OutcomeTrade { Buyer } }
      usd: sum(of: Trade_OutcomeTrade_CollateralAmountInUSD)
      trade_count: count
    }
    sellers: PredictionTrades(
      where: {
        TransactionStatus: { Success: true }
        Block: { Time: { since_relative:{days_ago:4} } }
        Trade: { Prediction: { Question: { Id: { is: $questionId } } } }
      }
      limit: { count: $perSide }
      limitBy: { by: Trade_OutcomeTrade_Seller, count: 1 }
      orderBy: { descendingByField: "usd" }
    ) {
      Trade { OutcomeTrade { Seller } }
      usd: sum(of: Trade_OutcomeTrade_CollateralAmountInUSD)
      trade_count: count
    }
  }
}

Variables

{
  "questionId": "0x4a988370f74fae221e5dfd27ed58707c531647fde9e2292363e1de1628a23f00",
  "perSide": 5000
}

Similar queries