trade stats for a token pair on uniswap v4 arbitrum
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: arbitrum, dataset: combined) archive full history combined archive + realtime in one resu
What it returns
- currency name
- currency symbol
- smart contract
- sum of trade amount
- sum of trade side amount in USD
Filters
- trade pool ID is 0x0958…a722
- DEX protocol name is uniswap_v4
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: arbitrum, 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 {
EVM(network: arbitrum, dataset: realtime) {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
where: {Block: {Time: {since_relative: {days_ago: 1}}}, Trade: {Dex: {ProtocolName: {is: "uniswap_v4"}}, PoolId: {is: "0x09588c415f6c809de684d3dd749e76d6bf0c12ac37d1d59a79e746013384a722"}}}
) {
Trade {
Currency {
Name
Symbol
SmartContract
}
}
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)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
Similar queries
- optimized query to get pools data · Ethereum · DEXTradeByTokens
- AfricaCryptoChainx · Ethereum · DEXTradeByTokens
- UniversalSearch EVM · Ethereum · DEXTradeByTokens
- without fragment · Ethereum · DEXTradeByTokens
- get virtual pool address for a token on uniswap v4 arbitrum · Arbitrum · DEXTradeByTokens