Copy of Your First Query
POST /graphql HTTP/1.1 Host: streaming.bitquery.io Content-Type: application/json Authorization: Bearer ory_at_-PfjQ5YAUOFErdwlVRAo2evm2KUr-PwjiJxSaaJDU90.dCebFICL1HNdGGkrNDybH1znRQfIHVcJ3Wt6VflqpHg Content-Length: 1978 {"query":"query pairs($min_count: String, $network: evm_network, $time_1h_ago: DateTime, $time_ago: DateTime, $eth: String!, $weth: String!, $usdc: String!, $usdt: String!) {\n EVM(network: $network) {\n DEXTradeByTokens(\n where: {Block: {Time: {since: $time_ago}}, any: [{Trade: {Side: {Currency: {SmartContract: {is: $eth}}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdt}}}, Currency: {SmartContract: {notIn: [$eth]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdc}}}, Currency: {SmartContract: {notIn: [$eth, $usdt]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $weth}}}, Currency: {SmartContract: {notIn: [$eth, $usdc, $usdt]}}}}, {Trade: {Side: {Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}, Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}}], TransactionStatus: {Success: true}}\n orderBy: {descendingByField: \"usd\"}\n limit: {count: 20}\n ) {\n Block {\n Time(maximum: Block_Time, selectWhere: {after: $time_1h_ago})\n }\n Trade {\n Currency {\n Symbol\n Name\n SmartContract\n ProtocolName\n }\n Side {\n Currency {\n Symbol\n Name\n SmartContract\n ProtocolName\n }\n }\n price_last: PriceInUSD(maximum: Block_Number)\n price_1h_ago: PriceInUSD(\n minimum: Block_Number\n if: {Block: {Time: {after: $time_1h_ago}}}\n )\n }\n usd: sum(of: Trade_Side_AmountInUSD)\n count(selectWhere: {ge: $min_count})\n }\n }\n}\n","variables":"{\n \"min_count\": \"100\",\n \"time_1h_ago\": \"2026-01-26T12:38:56Z\",\n \"time_ago\": \"2026-01-25T13:38:56Z\",\n \"eth\": \"0x\",\n \"usdc\": \"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48\",\n \"usdt\": \"0xdac17f958d2ee523a2206206994597c13d831ec7\",\n \"weth\": \"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2\",\n \"network\": \"eth\"\n}"}
What it returns
- block time
- currency symbol
- currency name
- smart contract
- protocol name
- side currency symbol
- side currency name
- side smart contract
- side protocol name
- price in USD
- sum of trade side amount in USD
- count
Filters
- block time since 2026-01-25
The query
query pairs($min_count: String, $network: evm_network, $time_1h_ago: DateTime, $time_ago: DateTime, $eth: String!, $weth: String!, $usdc: String!, $usdt: String!) {
EVM(network: $network) {
DEXTradeByTokens(
where: {Block: {Time: {since: $time_ago}}, any: [{Trade: {Side: {Currency: {SmartContract: {is: $eth}}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdt}}}, Currency: {SmartContract: {notIn: [$eth]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $usdc}}}, Currency: {SmartContract: {notIn: [$eth, $usdt]}}}}, {Trade: {Side: {Currency: {SmartContract: {is: $weth}}}, Currency: {SmartContract: {notIn: [$eth, $usdc, $usdt]}}}}, {Trade: {Side: {Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}, Currency: {SmartContract: {notIn: [$usdc, $usdt, $weth, $eth]}}}}], TransactionStatus: {Success: true}}
orderBy: {descendingByField: "usd"}
limit: {count: 20}
) {
Block {
Time(maximum: Block_Time, selectWhere: {after: $time_1h_ago})
}
Trade {
Currency {
Symbol
Name
SmartContract
ProtocolName
}
Side {
Currency {
Symbol
Name
SmartContract
ProtocolName
}
}
price_last: PriceInUSD(maximum: Block_Number)
price_1h_ago: PriceInUSD(
minimum: Block_Number
if: {Block: {Time: {after: $time_1h_ago}}}
)
}
usd: sum(of: Trade_Side_AmountInUSD)
count(selectWhere: {ge: $min_count})
}
}
}
Variables
{
"min_count": "100",
"time_1h_ago": "2026-01-26T12:38:56Z",
"time_ago": "2026-01-25T13:38:56Z",
"eth": "0x",
"usdc": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"usdt": "0xdac17f958d2ee523a2206206994597c13d831ec7",
"weth": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"network": "eth"
}
Similar queries
- CRV hourly OHLC on Curve - Ethereum · Ethereum · DEXTradeByTokens
- Top Metric liquidity pools by 24h volume on Ethereum · Ethereum · DEXTradeByTokens
- ATH of eth token · Ethereum · DEXTradeByTokens
- historical price and historical volume · Ethereum · DEXTradeByTokens
- topTraders EVM · Ethereum · DEXTradeByTokens