Top-AI-markets-by-volume-Polymarket
Historical data This query uses the realtime dataset (the default), which holds only a recent window - hours to days depending on the cube. For older data add a dataset to the top-level element: EVM(network: matic, dataset: combined) archive full history combined archive + realtime in one result
What it returns
- question ID
- image
- title
- market ID
- created at
- sum of trade outcome trade collateral amount in USD
- calculate
- count
Filters
- marketplace protocol name is polymarket
The query
# Historical data
# This query uses the realtime dataset (the default), which holds only a
# recent window - hours to days depending on the cube.
#
# For older data add a dataset to the top-level element:
#
# EVM(network: matic, dataset: combined)
#
# archive full history
# combined archive + realtime in one result
#
# Archive and combined need the historical data add-on:
# https://bitquery.io/pricing
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
query TopAIMarketsByVolume($time_ago: Int!, $limit: Int!) {
EVM(network: matic) {
PredictionTrades(
where: {Block: {Time: {since_relative: {hours_ago: $time_ago}}}, Trade: {Prediction: {Marketplace: {ProtocolName: {is: "polymarket"}}, Question: {Title: {includesCaseInsensitive: " AI "}}}}}
limit: {count: $limit}
orderBy: {descendingByField: "sumBuyAndSell"}
) {
Trade {
Prediction {
Question {
Id
Image
Title
MarketId
CreatedAt
}
}
}
buyUSD: sum(
of: Trade_OutcomeTrade_CollateralAmountInUSD
if: {Trade: {OutcomeTrade: {IsOutcomeBuy: true}}}
)
sellUSD: sum(
of: Trade_OutcomeTrade_CollateralAmountInUSD
if: {Trade: {OutcomeTrade: {IsOutcomeBuy: false}}}
)
sumBuyAndSell: calculate(expression: "$buyUSD + $sellUSD")
trades: count
buyers: count(distinct: Trade_OutcomeTrade_Buyer)
sellers: count(distinct: Trade_OutcomeTrade_Seller)
}
}
}
Variables
{
"time_ago": 24,
"limit": 100
}
Similar queries
- Polymarket Volume by Exchange Contract and Collateral · Polygon · PredictionTrades
- latest prediction market trades · Polygon · PredictionTrades
- activity of user · Polygon · PredictionTrades
- Polymarket Notional Volume, Taker Volume,Maker Volume · Polygon · PredictionTrades
- buys and sells of a wallet on polymarket · Polygon · PredictionTrades