Token Trades API
For real-time + last ~30 days, use the Trading cube: Trading.Trades gives you clean, MEV-filtered token trade swaps with USD price, market cap, and supply on every row across 10 chains in one API. Use the EVM queries on this page for raw per-swap detail or call and event context. An EVM query without a dataset argument runs on the realtime dataset, which holds only the last few days; add dataset: combined or dataset: archive for historical token trade data, as several examples below do.
We have three main APIs to get DEX trading data.
- DEXTrades
- DEXTradeByTokens
- Trades cube
Read DEXTrades vs DEXTradeByTokens vs Trades cube to get a better understanding on when to use which cube.
Subscribe to realtime DEXTrades on Ethereum Mainnet
This subscription streams every DEX trade on Ethereum mainnet as it happens.
Subscription: every Ethereum DEX trade as it happens
subscription MyQuery {
EVM(network: eth) {
DEXTrades {
Block {
Time
Number
}
Transaction {
Hash
}
Call {
Signature {
Name
Signature
}
}
Log {
Index
SmartContract
Signature {
Signature
Name
}
}
Trade {
Sender
Buy {
Buyer
AmountInUSD
Amount
Seller
PriceInUSD
Price
Currency {
Name
Symbol
SmartContract
}
}
Dex {
SmartContract
ProtocolName
ProtocolVersion
}
Sell {
Buyer
AmountInUSD
Amount
Seller
PriceInUSD
Price
Currency {
Name
Symbol
SmartContract
}
}
}
}
}
}
Get the Buys, Sells, Buy Volume, Sell Volume and Makers
Fetch buys, sells, volumes, and the number of makers for a specific pool (0x842293fa6ee0642bf61ebf8310e7e546039ba7f4). A video walks through building DexScreener-style trade stats with this query.
Buys, sells, volume and makers for one pool, with variables
query MyQuery(
$network: evm_network
$token: String
$pairAddress: String
$min5_timestamp: DateTime
$hr1_timestamp: DateTime
) {
EVM(dataset: realtime, network: $network) {
DEXTradeByTokens(
where: {
TransactionStatus: { Success: true }
Trade: {
Currency: { SmartContract: { is: $token } }
Dex: { SmartContract: { is: $pairAddress } }
}
Block: { Time: { since: $hr1_timestamp } }
}
) {
Trade {
Currency {
Name
SmartContract
Symbol
}
startPrice: PriceInUSD(minimum: Block_Time)
Price_at_min5: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { after: $min5_timestamp } } }
)
current_price: PriceInUSD(maximum: Block_Time)
Dex {
ProtocolName
ProtocolFamily
SmartContract
}
Side {
Currency {
Symbol
Name
SmartContract
}
}
}
makers: count(distinct: Transaction_From)
makers_5min: count(
distinct: Transaction_From
if: { Block: { Time: { after: $min5_timestamp } } }
)
buyers: count(
distinct: Transaction_From
if: { Trade: { Side: { Type: { is: sell } } } }
)
buyers_5min: count(
distinct: Transaction_From
if: {
Trade: { Side: { Type: { is: sell } } }
Block: { Time: { after: $min5_timestamp } }
}
)
sellers: count(
distinct: Transaction_From
if: { Trade: { Side: { Type: { is: buy } } } }
)
sellers_5min: count(
distinct: Transaction_From
if: {
Trade: { Side: { Type: { is: buy } } }
Block: { Time: { after: $min5_timestamp } }
}
)
trades: count
trades_5min: count(if: { Block: { Time: { after: $min5_timestamp } } })
traded_volume: sum(of: Trade_Side_AmountInUSD)
traded_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { after: $min5_timestamp } } }
)
buy_volume: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
buy_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {
Trade: { Side: { Type: { is: sell } } }
Block: { Time: { after: $min5_timestamp } }
}
)
sell_volume: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {
Trade: { Side: { Type: { is: buy } } }
Block: { Time: { after: $min5_timestamp } }
}
)
buys: count(if: { Trade: { Side: { Type: { is: sell } } } })
buys_5min: count(
if: {
Trade: { Side: { Type: { is: sell } } }
Block: { Time: { after: $min5_timestamp } }
}
)
sells: count(if: { Trade: { Side: { Type: { is: buy } } } })
sells_5min: count(
if: {
Trade: { Side: { Type: { is: buy } } }
Block: { Time: { after: $min5_timestamp } }
}
)
}
}
}
{
"network": "eth",
"token": "0x6982508145454Ce325dDbE47a25d4ec3d2311933",
"pairAddress": "0xA43fe16908251ee70EF74718545e4FE6C5cCEc9f",
"hr1_timestamp": "2024-11-14T03:20:00Z",
"min5_timestamp": "2024-11-14T04:15:00Z"
}
Get the Buys, Sells, Buy Volume, Sell Volume and Makers of Multiple Tokens
Same metrics as above, but for multiple pools at once.
The same metrics for several pools, with variables
query MyQuery(
$network: evm_network,
$token: String,
$pairAddress: [String!],
$min5_timestamp: DateTime,
$hr1_timestamp: DateTime
) {
EVM(dataset: realtime, network: $network) {
DEXTradeByTokens(
where: {
TransactionStatus: { Success: true },
Trade: {
Dex: { SmartContract: { in: $pairAddress } },
Side: { Currency: { SmartContract: { is: $token } } }
},
Block: { Time: { since: $hr1_timestamp } }
}
) {
/* same fields as previous */
}
}
}
{
"network": "eth",
"token": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"pairAddress": [
"0x055FB841Cce69000FBAFF2691Ad39Fa6E23826a1",
"0x8d345583C9289D69d4a55797CcadC5A1eA150A44"
],
"hr1_timestamp": "2025-06-18T07:34:00Z",
"min5_timestamp": "2025-06-18T08:28:00Z"
}
Get First 500 Buyers of a specific token
This returns the first 500 buyers of an ERC-20 token, 0x3c3a81e81dc49A522A592e7622A7E711c06bf354 in this example.
First 500 buyers of an ERC-20 token
query MyQuery {
EVM(network: eth, dataset: combined) {
DEXTrades(
limit: { count: 500 }
orderBy: { ascending: Block_Time }
limitBy: { count: 1, by: Trade_Sell_Buyer }
where: {
Trade: {
Sell: {
Currency: {
SmartContract: {
is: "0x3c3a81e81dc49A522A592e7622A7E711c06bf354"
}
}
}
}
}
) {
Block {
Time
}
Trade {
Sell {
Buyer
}
}
Transaction {
From
Hash
}
}
}
}
Historical Token Trades & Price API
Use the DEXTrades API for historical buyside and sellside trades of BLUR token by the 1inch router.
BLUR trades routed through 1inch, from the archive (fields omitted)
{
EVM(dataset: archive, network: eth) {
buyside: DEXTrades(
limit: { count: 10 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Buy: {
Currency: { SmartContract: { is: "0x5283d291dbcf85356a21ba090e6db59121208b44" } }
Seller: { is: "0x1111111254eeb25477b68fb85ed929f73a960582" }
}
}
Block: {
Time: {
since: "2023-03-03T01:00:00Z",
till: "2023-03-05T05:15:23Z"
}
}
}
) {
/* buyside fields */
}
sellside: DEXTrades(
limit: { count: 10 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Sell: {
Currency: { SmartContract: { is: "0x5283d291dbcf85356a21ba090e6db59121208b44" } }
Buyer: { is: "0x1111111254eeb25477b68fb85ed929f73a960582" }
}
}
Block: {
Time: {
since: "2023-03-03T01:00:00Z",
till: "2023-03-05T05:15:23Z"
}
}
}
) {
/* sellside fields */
}
}
}
Get Price Change 5min, 1h, 6h and 24h of a specific token
This returns the price change over 5 minutes, 1, 6 and 24 hours for one token. Change Currency{SmartContract} and Dex{SmartContract} to your token and pool.
Price change over 5 minutes, 1, 6 and 24 hours
query MyQuery {
EVM(dataset: combined) {
DEXTradeByTokens(
where: {Trade: {Currency: {SmartContract: {is: "0x4393b54385e91824A2Ae5DFd35e226A3313A1a18"}}, Dex: {SmartContract: {is: "0x2bE4042B40359555b41C1A8b80bf604267DE0C5A"}}}, TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}}
){
Trade {
Price_5min_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{minutes_ago:5}}}})
Price_1h_ago: PriceInUSD(minimum:Block_Number if:{Block:{Time:{since_relative:{hours_ago:1}}}})
Price_6h_ago: PriceInUSD(minimum: Block_Number if:{Block:{Time:{since_relative:{hours_ago:6}}}})
Price_24h_ago: PriceInUSD(minimum: Block_Number)
CurrentPrice: PriceInUSD(maximum: Block_Number)
}
volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
)
volume_1h: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
)
volume_6h: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {hours_ago: 6}}}}
)
volume_24h: sum(
of: Trade_Side_AmountInUSD
)
Price_Change_5min: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100")
Price_Change_1h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100")
Price_Change_6h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100")
Price_Change_24h: calculate(expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100")
}
}
}
Top 10 Eth Tokens by Price Change in last 1h
This returns the 10 Ethereum tokens with the biggest price change in the last hour.
Ten Ethereum tokens with the biggest 1-hour price change
query MyQuery {
EVM(dataset: combined) {
DEXTradeByTokens(
limit: {count: 10}
orderBy: {descendingByField: "Price_Change_1h"}
where: {TransactionStatus: {Success: true}, Block: {Time: {since_relative: {hours_ago: 24}}}, Trade: {Side: {Currency: {SmartContract: {is: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"}}}}}
) {
Trade {
Currency {
Name
Symbol
SmartContract
}
Price_5min_ago: PriceInUSD(
minimum: Block_Number
if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} selectWhere:{ne:0}
)
Price_1h_ago: PriceInUSD(
minimum: Block_Number
if: {Block: {Time: {since_relative: {hours_ago: 1}}}} selectWhere:{ne:0}
)
Price_6h_ago: PriceInUSD(
minimum: Block_Number
if: {Block: {Time: {since_relative: {hours_ago: 6}}}} selectWhere:{ne:0}
)
Price_24h_ago: PriceInUSD(minimum: Block_Number selectWhere:{ne:0})
CurrentPrice: PriceInUSD(maximum: Block_Number selectWhere:{ne:0})
Side {
Currency {
Name
Symbol
SmartContract
}
}
Dex {
SmartContract
}
}
volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
)
volume_1h: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {hours_ago: 1}}}}
)
volume_6h: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {since_relative: {hours_ago: 6}}}}
)
volume_24h: sum(of: Trade_Side_AmountInUSD)
Price_Change_5min: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100"
)
Price_Change_1h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100"
)
Price_Change_6h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100"
)
Price_Change_24h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100"
)
}
}
}
Latest Trades of a Token
Fetch the most recent 50 trades for a given token:
The 50 latest trades of one token
query LatestTrades {
EVM(network: eth) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Currency: {
SmartContract: { is: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599" }
}
Price: { gt: 0 }
}
}
) {
Block {
allTime: Time
}
Trade {
Dex {
OwnerAddress
ProtocolFamily
ProtocolName
}
AmountInUSD
Buyer
Seller
Side {
Type
Buyer
Seller
}
Price
Amount
Side {
Currency {
Symbol
SmartContract
Name
}
AmountInUSD
Amount
}
}
}
}
}
Our DEX Dashboard gives you a easier way to check the data -> DEXrabbit.
Latest Trades of Multiple Tokens
Latest trades of WBTC and LINK
query LatestTrades {
EVM(network: eth) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
TransactionStatus: { Success: true }
Trade: {
Side: {
Currency: { SmartContract: { in: [
"0x",
"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"0xdac17f958d2ee523a2206206994597c13d831ec7"
] } }
}
Currency: { SmartContract: { in: [
"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
"0x514910771af9ca656af840dff83e8264ecf986ca"
] } }
Success: true
}
Block: { Time: { since: "2025-08-17T08:55:31Z" } }
}
) {
Block {
Time
}
Transaction {
Hash
}
Trade {
Dex {
SmartContract
ProtocolFamily
ProtocolName
}
AmountInUSD
Buyer
Seller
Side {
Type
Buyer
Seller
}
PriceInUSD
Amount
Side {
Currency {
Symbol
SmartContract
Name
}
AmountInUSD
Amount
}
}
}
}
}
Token Trade Analytics
Trade totals for one BNB Chain token over its full history: pairs, DEXs, amount and USD volume, and the number of accounts that bought and sold it. The USD sums leave out mispriced trades.
Pairs, DEXs, volume and traders for one BNB Chain token
{
EVM(network: bsc, dataset: combined) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
SmartContract: { is: "0xc342774492b54ce5f8ac662113ed702fc1b34972" }
}
}
}
orderBy: { descendingByField: "usd" }
limit: { count: 1000 }
) {
Trade {
Currency {
Decimals
Symbol
SmartContract
Fungible
Name
}
Amount(maximum: Block_Number)
AmountInUSD(maximum: Block_Number)
}
pairs: uniq(of: Trade_Side_Currency_SmartContract)
dexes: uniq(of: Trade_Dex_OwnerAddress)
amount: sum(of: Trade_Amount)
usd: sum(of: Trade_AmountInUSD, if: { Trade: { PriceAsymmetry: { lt: 0.1 } } })
usd2: sum(of: Trade_Side_AmountInUSD, if: { Trade: { PriceAsymmetry: { lt: 0.1 } } })
buyers: uniq(of: Transaction_From, if: { Trade: { Side: { Type: { is: sell } } } })
sellers: uniq(of: Transaction_From, if: { Trade: { Side: { Type: { is: buy } } } })
count
}
}
}
Aggregated Token Data (Volume & Price, Last 24h)
Use this API to get historical price and volume for a specific token (example: bid:solana:9WHhgXJBGgxghkh5wAUWJFHVbnsRbonRYTnH2EChpump) over the past 24 hours, with 1h, 4h, and 24h breakdowns.
Try it on IDE: Historical Price & Volume API
Trading.Tokens volume and price for the past 24 hours
{
Trading {
Tokens(
where: {
Interval: { Time: { Duration: { eq: 1 } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
Token: {
Id: {
in: ["bid:solana:9WHhgXJBGgxghkh5wAUWJFHVbnsRbonRYTnH2EChpump"]
}
}
}
) {
Currency {
Id
Name
Symbol
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
H4Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }
)
H24Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 24 } } } }
)
}
}
v1h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
v4h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }
)
v24h: sum(of: Volume_Usd)
}
}
}
Top Traders of a Token
Returns the top 100 traders of a token by USD volume. It ranks Transaction.From, the account that sent each swap, since on a sale Trade.Buyer is the pool or a router. Side.Type describes the counter-side of each trade, so bought sums the rows where Side.Type is sell. PriceAsymmetry: { lt: 0.1 } leaves out trades whose two sides disagree on value (PriceAsymmetry reference).
Top 100 traders of a token, with variables
query topTraders($network: evm_network, $token: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
where: { Trade: { Currency: { SmartContract: { is: $token } }, PriceAsymmetry: { lt: 0.1 } } }
) {
Transaction {
From
}
bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } })
sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } })
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"network": "eth",
"token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
}
You can check the data here on DEXrabbit.
Get all Trading Pairs data of a specific token
Pairs a token trades in, with variables
query tokenTrades(
$network: evm_network,
$token: String,
$time_10min_ago: DateTime,
$time_1h_ago: DateTime,
$time_3h_ago: DateTime
) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "usd" }
where: { Trade: { Currency: { SmartContract: { is: $token } } }, Block: { Time: { after: $time_3h_ago } } }
limit: { count: 200 }
) {
Trade {
Currency {
Symbol
Name
SmartContract
Fungible
}
Side {
Currency {
Symbol
Name
SmartContract
}
}
price_usd: PriceInUSD(maximum: Block_Number)
price_last: Price(maximum: Block_Number)
price_10min_ago: Price(
maximum: Block_Number
if: { Block: { Time: { before: $time_10min_ago } } }
)
price_1h_ago: Price(
maximum: Block_Number
if: { Block: { Time: { before: $time_1h_ago } } }
)
price_3h_ago: PriceInUSD(minimum: Block_Number)
}
usd: sum(of: Trade_AmountInUSD)
count
}
}
}
{
"network": "eth",
"token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
"time_10min_ago": "2024-09-22T12:39:26Z",
"time_1h_ago": "2024-09-22T11:49:26Z",
"time_3h_ago": "2024-09-22T09:49:26Z"
}
You can check the data here on DEXrabbit.
Get all DEXs where a specific token is listed
DEXs that trade a token, with variables
query tokenDexMarkets($network: evm_network, $token: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "amount" }
where: { Trade: { Currency: { SmartContract: { is: $token } } } }
) {
Trade {
Dex {
ProtocolFamily
ProtocolName
}
}
amount: sum(of: Trade_Amount)
pairs: uniq(of: Trade_Side_Currency_SmartContract)
trades: count
}
}
}
{
"network": "eth",
"token": "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
}
You can check the data here on DEXrabbit.
Latest Trades of a Token pair
Latest trades of one pair, with variables
query LatestTrades($network: evm_network, $token: String, $base: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Side: {
Amount: { gt: "0" },
Currency: { SmartContract: { is: $base } }
},
Currency: { SmartContract: { is: $token } },
Price: { gt: 0 }
}
}
) {
Block {
allTime: Time
}
Trade {
Dex {
OwnerAddress
ProtocolFamily
ProtocolName
}
Currency {
Symbol
SmartContract
Name
}
Price
AmountInUSD
Amount
Side {
Type
Currency {
Symbol
SmartContract
Name
}
AmountInUSD
Amount
}
}
}
}
}
{
"network": "eth",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"base": "0x0ccae1bc46fb018dd396ed4c45565d4cb9d41098"
}
You can check the data here on DEXrabbit.
Get OHLC data for a particular token pair
Five-minute USD candles for one pair, with variables
query tradingViewPairs($network: evm_network, $token: String, $base: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { ascendingByField: "Block_Time" }
where: {
Trade: {
Side: { Amount: { gt: "0" }, Currency: { SmartContract: { is: $base } } },
Currency: { SmartContract: { is: $token } },
PriceAsymmetry: { lt: 0.5 }
}
}
) {
Block {
Time(interval: { count: 5, in: minutes })
}
Trade {
open: PriceInUSD(minimum: Block_Number)
close: PriceInUSD(maximum: Block_Number)
max: PriceInUSD(maximum: Trade_PriceInUSD)
min: PriceInUSD(minimum: Trade_PriceInUSD)
}
volume: sum(of: Trade_Side_Amount)
}
}
}
{
"network": "eth",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"base": "0x0ccae1bc46fb018dd396ed4c45565d4cb9d41098"
}
You can check the data here on DEXrabbit.
Top Traders of a token pair
The same ranking for one pair: accounts that sent swaps between WETH and the base token, with bought and sold counted the same way.
Top 100 traders of one pair, with variables
query pairTopTraders($network: evm_network, $token: String, $base: String) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
where: {
Trade: {
Currency: { SmartContract: { is: $token } },
Side: { Amount: { gt: "0" }, Currency: { SmartContract: { is: $base } } },
PriceAsymmetry: { lt: 0.1 }
}
}
) {
Transaction {
From
}
bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } })
sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } })
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"network": "eth",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"base": "0x0ccae1bc46fb018dd396ed4c45565d4cb9d41098"
}
You can check the data here on DEXrabbit.
Get all DEXs where a specific token pair is listed
DEXs that trade one pair, with variables
query pairDexList(
$network: evm_network,
$token: String,
$base: String,
$time_10min_ago: DateTime,
$time_1h_ago: DateTime,
$time_3h_ago: DateTime
) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "amount" }
where: {
Trade: {
Currency: { SmartContract: { is: $token } },
Side: { Amount: { gt: "0" }, Currency: { SmartContract: { is: $base } } }
},
Block: { Time: { after: $time_3h_ago } }
}
) {
Trade {
Dex {
ProtocolFamily
ProtocolName
}
price_last: PriceInUSD(maximum: Block_Number)
price_10min_ago: PriceInUSD(
maximum: Block_Number
if: { Block: { Time: { before: $time_10min_ago } } }
)
price_1h_ago: PriceInUSD(
maximum: Block_Number
if: { Block: { Time: { before: $time_1h_ago } } }
)
price_3h_ago: PriceInUSD(minimum: Block_Number)
}
amount: sum(of: Trade_Side_Amount)
pairs: uniq(of: Trade_Side_Currency_SmartContract)
trades: count
}
}
}
{
"network": "eth",
"token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
"base": "0x0ccae1bc46fb018dd396ed4c45565d4cb9d41098",
"time_10min_ago": "2024-09-22T13:10:42Z",
"time_1h_ago": "2024-09-22T12:20:42Z",
"time_3h_ago": "2024-09-22T10:20:42Z"
}
You can check the data here on DEXrabbit.
Top Gainers
Pairs ranked by USD price change over the last hour, among pairs with at least 100 trades in that hour. A pair can appear twice, once for each of its tokens. buyers and sellers count the accounts that sent those swaps.
Pairs ranked by 1-hour price gain, with variables
query ($network: evm_network) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "change_1h" }
limit: { count: 100 }
where: {
Block: { Time: { since_relative: { hours_ago: 1 } } }
Trade: { PriceAsymmetry: { lt: 0.1 } }
}
) {
Trade {
Currency {
Symbol
Name
SmartContract
}
Side {
Currency {
Symbol
Name
SmartContract
}
}
price_last: PriceInUSD(maximum: Block_Number)
price_1h_ago: PriceInUSD(minimum: Block_Number)
}
change_1h: calculate(expression: "($Trade_price_last - $Trade_price_1h_ago) / $Trade_price_1h_ago * 100")
dexes: uniq(of: Trade_Dex_OwnerAddress)
amount: sum(of: Trade_Side_Amount)
usd: sum(of: Trade_Side_AmountInUSD)
buyers: uniq(of: Transaction_From, if: { Trade: { Side: { Type: { is: sell } } } })
sellers: uniq(of: Transaction_From, if: { Trade: { Side: { Type: { is: buy } } } })
count(selectWhere: { ge: "100" })
}
}
}
{ "network": "eth" }
You can check the data here on DEXrabbit.
Top Bought tokens
Tokens ranked by USD bought. Buys are the rows where Side.Type, the counter-side, is sell, and the PriceAsymmetry filter keeps mispriced trades out of the totals.
Tokens ranked by USD bought, with variables
query timeDiagram($network: evm_network) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "buy" }
limit: { count: 100 }
where: { Trade: { PriceAsymmetry: { lt: 0.1 } } }
) {
Trade {
Currency {
Symbol
Name
SmartContract
}
}
buy: sum(
of: Trade_Side_AmountInUSD,
if: { Trade: { Side: { Type: { is: sell } } } }
)
sell: sum(
of: Trade_Side_AmountInUSD,
if: { Trade: { Side: { Type: { is: buy } } } }
)
}
}
}
{ "network": "eth" }
You can check the data here on DEXrabbit.
Top Sold tokens
Tokens ranked by USD sold, where sales are the rows with Side.Type set to buy.
Tokens ranked by USD sold, with variables
query timeDiagram($network: evm_network) {
EVM(network: $network) {
DEXTradeByTokens(
orderBy: { descendingByField: "sell" }
limit: { count: 100 }
where: { Trade: { PriceAsymmetry: { lt: 0.1 } } }
) {
Trade {
Currency {
Symbol
Name
SmartContract
}
}
buy: sum(
of: Trade_Side_AmountInUSD,
if: { Trade: { Side: { Type: { is: sell } } } }
)
sell: sum(
of: Trade_Side_AmountInUSD,
if: { Trade: { Side: { Type: { is: buy } } } }
)
}
}
}
{ "network": "eth" }
You can check the data here on DEXrabbit.
Latest Token Trades
In DEXTrades on EVM chains, Buy and Sell are the pool's side of the trade (DEXTrades cube): buyside below holds trades where the pool received the token, that is, traders sold it, and sellside trades where traders bought it.
Buy side and sell side of one token's trades (fields omitted)
{
EVM(dataset: archive, network: eth) {
buyside: DEXTrades(
limit: { count: 10 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Buy: {
Currency: {
SmartContract: {
is: "0x5283d291dbcf85356a21ba090e6db59121208b44"
}
}
}
}
}
) {
/* fields */
}
sellside: DEXTrades(
limit: { count: 10 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Sell: {
Currency: {
SmartContract: {
is: "0x5283d291dbcf85356a21ba090e6db59121208b44"
}
}
}
}
}
) {
/* fields */
}
}
}
The IDE has the full latest-trades query with every field.
Token trade from a specific DEX
Uniswap v3 trades in which traders sold WETH (fields omitted)
{
EVM(dataset: archive, network: eth) {
buyside: DEXTrades(
limit: { count: 5 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Buy: {
Currency: {
SmartContract: {
is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
}
}
Dex: { ProtocolName: { is: "uniswap_v3" } }
}
}
) {
/* fields */
}
}
}
The IDE has the full DEX-filtered version.
Subscribe to new token trades (WebSocket)
Subscription: new WETH trades each block (fields omitted)
subscription {
EVM(network: eth, trigger_on: head) {
buyside: DEXTrades(
orderBy: { descending: Block_Time }
where: {
Trade: {
Buy: {
Currency: {
SmartContract: {
is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
}
}
}
}
) {
/* fields */
}
sellside: DEXTrades(
orderBy: { descending: Block_Time }
where: {
Trade: {
Sell: {
Currency: {
SmartContract: {
is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
}
}
}
}
) {
/* fields */
}
}
}
The IDE has the full subscription.
OHLC in USD of a Token
Hourly open, high, low and close prices in USD for USDT, from its trades against WETH.
Hourly USD candles for USDT
{
EVM(network: eth, dataset: realtime) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_testfield" }
where: {
Trade: {
Currency: {
SmartContract: { is: "0xdac17f958d2ee523a2206206994597c13d831ec7" }
}
PriceAsymmetry: { lt: 0.1 }
Side: {
Currency: {
SmartContract: {
is: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
}
}
}
}
limit: { count: 10 }
) {
Block {
testfield: Time(interval: { in: hours, count: 1 })
}
volume: sum(of: Trade_Amount)
Trade {
high: PriceInUSD(maximum: Trade_PriceInUSD)
low: PriceInUSD(minimum: Trade_PriceInUSD)
open: PriceInUSD(minimum: Block_Number)
close: PriceInUSD(maximum: Block_Number)
}
count
}
}
}
Get Token Metadata
Name, symbol and decimals of a token
query MyQuery {
EVM(network: eth, dataset: combined) {
DEXTradeByTokens(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Currency: {
SmartContract: { is: "0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE" }
}
}
}
) {
Trade {
Currency {
Name
Symbol
SmartContract
ProtocolName
HasURI
Fungible
Decimals
}
}
}
}
}
Top Buyers of a Token
Ten largest buyers of a token by USD
{
EVM {
DEXTradeByTokens(
orderBy: { descendingByField: "bought" }
limit: { count: 10 }
where: {
Trade: {
Currency: {
SmartContract: { is: "0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39" }
}
}
}
) {
Trade {
Buyer
Currency {
Symbol
Name
SmartContract
}
}
bought: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
}
}
}
Top Sellers of a Token
Ten largest sellers of a token by USD
{
EVM {
DEXTradeByTokens(
orderBy: { descendingByField: "sold" }
limit: { count: 10 }
where: {
Trade: {
Currency: {
SmartContract: { is: "0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39" }
}
}
}
) {
Trade {
Buyer
Currency {
Symbol
Name
SmartContract
}
}
sold: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
}
}
}
Get trading volume, buy volume, sell volume of a token
This returns the traded, buy and sell volume in USD of BNB's ERC-20 contract on Ethereum (0xB8c77482e45F1F44dE1745F52C74426C631bDD52), across every DEX, over the last 24 hours. PriceAsymmetry: { lt: 0.1 } drops mispriced trades, which would otherwise skew the USD sums.
24-hour traded, buy and sell volume of one token
query MyQuery {
EVM {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
SmartContract: { is: "0xB8c77482e45F1F44dE1745F52C74426C631bDD52" }
}
PriceAsymmetry: { lt: 0.1 }
}
TransactionStatus: { Success: true }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Trade {
Currency {
Name
Symbol
SmartContract
}
}
traded_volume_in_usd: sum(of: Trade_Side_AmountInUSD)
sell_volume_in_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
buy_volume_in_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
}
}
}
Stablecoin Peg Health (Latest Price Across All DEXs)
Get the latest price of a stablecoin across all EVM DEXs. Returns one row per DEX protocol with the most recent trade price. Useful for monitoring peg health and identifying which exchanges have the stablecoin trading closest to its target peg (e.g., $1.00 for USD-pegged stablecoins).
Browse multi-chain stablecoin DEX prices on DEXrabbit's Stablecoins category.
Latest stablecoin price on each DEX
{
EVM(network: eth) {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limitBy: { count: 1, by: Trade_Dex_SmartContract }
where: {
Trade: {
Currency: {
SmartContract: {
is: "CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s"
}
}
}
}
) {
Block {
Time
}
Transaction {
Hash
}
Trade {
Amount
AmountInUSD
Price
PriceInUSD
Currency {
Name
SmartContract
Symbol
}
Dex {
ProtocolName
ProtocolFamily
SmartContract
}
Side {
Type
Currency {
Name
SmartContract
Symbol
}
AmountInUSD
Amount
}
}
}
}
}
Realised PnL, buy volume, sell volume
Get realised PnL, buy volume, and sell volume for a token on EVM of a trader for over a time window.
One trader's realised PnL and buy and sell volume, with variables
query ($trader: String) {
EVM(network: eth, dataset: combined) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
SmartContract: { is: "0x80029DBba7FA84bb16724a9fF6eE11c367D2FcfB" }
}
}
any: [
{ Trade: { Buyer: { is: $trader } } }
{ Trade: { Seller: { is: $trader } } }
]
TransactionStatus: { Success: true }
Block: { Date: { since: "2026-03-11", till: "2026-03-13" } }
}
) {
Trade {
Currency {
Name
Symbol
SmartContract
}
}
buy_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Buyer: { is: $trader }, Side: { Type: { is: sell } } } }
)
sell_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Seller: { is: $trader }, Side: { Type: { is: buy } } } }
)
buy_volume: sum(
of: Trade_Amount
if: { Trade: { Buyer: { is: $trader }, Side: { Type: { is: sell } } } }
)
sell_volume: sum(
of: Trade_Amount
if: { Trade: { Seller: { is: $trader }, Side: { Type: { is: buy } } } }
)
PnL: calculate(expression: "$sell_volume_usd - $buy_volume_usd")
trades: count
}
}
}
{
"trader": "0x0a62Bd9Ee12119a5aC4807C0970fed8B71E83163"
}
Getting OHLC and Distinct Buys/Sells
Daily OHLC, priced in WBNB, with buy and sell counts for Aave Token against WBNB on BNB Chain from 1 July to 1 August 2023. A buy is a row where Side.Type is sell; buyers and sellers count the distinct accounts that sent those swaps.
Daily candles with buy and sell counts
{
EVM(dataset: archive, network: bsc) {
daily: DEXTradeByTokens(
limit: { count: 30 }
orderBy: { descendingByField: "Block_time_field" }
where: {
Trade: {
Side: {
Currency: {
SmartContract: {
is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
}
}
Amount: { ge: "0" }
}
Currency: {
SmartContract: { is: "0xfb6115445bff7b52feb98650c87f44907e58f802" }
}
PriceAsymmetry: { lt: 0.1 }
}
Block: { Date: { since: "2023-07-01", till: "2023-08-01" } }
}
) {
Block {
time_field: Time(interval: { in: days, count: 1 })
}
volume: sum(of: Trade_Amount)
buyers: count(
distinct: Transaction_From
if: { Trade: { Side: { Type: { is: sell } } } }
)
sellers: count(
distinct: Transaction_From
if: { Trade: { Side: { Type: { is: buy } } } }
)
distinctTransactions: count(distinct: Transaction_Hash)
total_buys: count(if: { Trade: { Side: { Type: { is: sell } } } })
total_sales: count(if: { Trade: { Side: { Type: { is: buy } } } })
total_count: count
Trade {
Currency {
Name
}
Side {
Currency {
Name
}
}
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
open: Price(minimum: Block_Number)
close: Price(maximum: Block_Number)
}
}
}
}
Get Least Traded Token
The 10 least traded tokens in one November 2023 week
query MyQuery {
EVM(dataset: archive, network: eth) {
DEXTradeByTokens(
limit: { count: 10 }
where: {
Block: {
Time: {
after: "2023-11-20T00:00:00Z"
before: "2023-11-27T00:00:00Z"
}
}
}
orderBy: { ascendingByField: "count" }
) {
Trade {
Currency {
Name
SmartContract
}
}
count
}
}
}
First X Buyers of a Token
The first 10 accounts to buy BLUR. Buyers of a token sit on the pool's Sell side, where the pool paid the token out, so the filter is on Trade.Sell.Currency. Trade.Sell.Buyer is often a router, so the buyer is Transaction.From.
First 10 buyers of BLUR
{
EVM(dataset: archive, network: eth) {
buyside: DEXTrades(
limit: { count: 10 }
limitBy: { by: Transaction_From, count: 1 }
orderBy: { ascending: Block_Time }
where: {
Trade: {
Sell: {
Currency: {
SmartContract: {
is: "0x5283d291dbcf85356a21ba090e6db59121208b44"
}
}
}
}
}
) {
Block {
Number
Time
}
Transaction {
From
To
Hash
}
Trade {
Sell {
Amount
Buyer
Currency {
Name
Symbol
}
Seller
Price
}
}
}
}
}
Volume of Multiple Tokens Across Different Chains
Get volume and price change data for multiple tokens trading on different chains (Solana, Ethereum, BSC, Tron) in a single query using the Trading API. Returns volume for 1h, 4h, and 24h periods, plus price change percentages for the same intervals.
For EVM chains (Ethereum, BSC, etc.) in the Trading API, use all lowercase addresses in the token ID format (e.g., bid:eth:0x... with lowercase hex). Mixed-case addresses may not match.
Volume and price change for tokens on four chains
query {
TokenAsBase: Trading {
Pairs(
where: {
Interval: { Time: { Duration: { eq: 1 } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
Price: { IsQuotedInUsd: true }
Token: {
Id: {
in: [
"bid:solana:CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s"
"bid:eth:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78"
"bid:bsc:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78"
"bid:tron:TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"
]
}
}
Market: { Protocol: { notIn: ["jupiter", "dex_solana_v3"] } }
}
) {
Token {
Name
Symbol
Id
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
maximum: Block_Time
if: { Block: { Time: { till_relative: { hours_ago: 1 } } } }
)
H4Ago: Mean(
maximum: Block_Time
if: { Block: { Time: { till_relative: { hours_ago: 4 } } } }
)
H24Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { after_relative: { hours_ago: 24 } } } }
)
}
}
Price_change_1h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H1Ago ) / $Price_Average_H1Ago ) * 100"
)
Price_change_4h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H4Ago ) / $Price_Average_H4Ago ) * 100"
)
Price_change_24h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H24Ago ) / $Price_Average_H24Ago ) * 100"
)
v1h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
v4h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }
)
v24h: sum(of: Volume_Usd)
}
}
}
Trader-Focused Trade APIs (with USD Price, Market Cap & Supply)
The queries below use the Trades cube (Trading { Trades }) which is trader-focused and provides reliable USD prices including for all tokens. See DEXTrades vs DEXTradeByTokens vs Trades cube for when to use which.
Get All DEX Trades on Ethereum With Price, Market Cap, and Supply
Stream all Ethereum DEX trades in real time with USD price, market cap, FDV, circulating supply, and transaction fee data. Filter by Pair.Market.Network: Ethereum to capture every swap across all Ethereum DEXs in a single subscription.
You can run this subscription in the Bitquery IDE.
Subscription: Ethereum trades with USD price, market cap and supply
subscription {
Trading {
Trades(where: { Pair: { Market: { Network: { is: "Ethereum" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
Top Traders by PnL for a Specific Pool (Last 30 Minutes)
Rank traders by PnL on one pool: filter Pair.Market.Program (the pool; for Uniswap v3, Pair.Market.Address is the factory and would cover every v3 pool), last 30 minutes, limit: 10, and orderBy PnL descending. Useful for leaderboards, smart-money screens, and pool-specific trader analytics.
You can run this query in the Bitquery IDE.
Ten traders with the highest PnL in one pool over 30 minutes
{
Trading {
Trades(
limit: { count: 10 }
orderBy: { descendingByField: "PnL" }
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Network: { is: "Ethereum" }
Program: { is: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640" }
}
}
}
) {
Trader {
Address
}
Amount_Bought: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
Amount_Sold: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
Amount_Bought_native: sum(of: Amounts_Base, if: { Side: { is: "Buy" } })
Amount_Sold_native: sum(of: Amounts_Base, if: { Side: { is: "Sell" } })
PnL: calculate(expression: "$Amount_Sold - $Amount_Bought")
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
Video Tutorial | How to get Token Trade Stats for EVM chains like DexScreener shows
Ready to run this in production?
Get an API key and run these queries in minutes, or talk to us about plans and enterprise delivery.