top-traders-for-wld-usdc-pair
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: $network, dataset: combined) archive full history combined archive + realtime in one resu
What it returns
- buyer
- sum of trade amount
- sum of trade side amount
- sum of trade side amount in USD
Filters
- currency smart contract is 0xdc6f…26f1
- side currency smart contract is 0x0b2c…ff85
- block time since 2024-11-12
- side amount is above 0
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: $network, 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 pairTopTraders($network: evm_network, $token: String, $base: String, $time_ago: DateTime) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {SmartContract: {is: $base}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}}, Block: {Time: {since: $time_ago}}}
) {
Trade {
Buyer
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
sideVolume: sum(of: Trade_Side_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
Variables
{
"network": "optimism",
"base": "0xdc6ff44d5d932cbd77b52e5612ba0529dc6226f1",
"token": "0x0b2c639c533813f4aa9d7837caf62653d097ff85",
"time_ago": "2024-11-12T06:32:59Z"
}
Similar queries
- AfricaCryptoChainx · Ethereum · DEXTradeByTokens
- UniversalSearch EVM · Ethereum · DEXTradeByTokens
- trade stats for a token pair on uniswap v4 optimism · Optimism · DEXTradeByTokens
- get virtual pool address for a token on uniswap v4 optimism · Optimism · DEXTradeByTokens
- Optimism pair list · Optimism · DEXTradeByTokens