Realised Pnl, Buy volume, Sell Volume Ethereum
Historical data This query already reads history - it uses the combined dataset, which needs the historical data add-on for this chain. Without the add-on it fails with 'access restricted: your plan only allows realtime'. Drop the dataset argument to fall back to the recent window. Datasets: https:
What it returns
- currency name
- currency symbol
- smart contract
- sum of trade side amount in USD
- sum of trade amount
- calculate
- count
Filters
- currency smart contract is 0x8002…FcfB
- block date since 2026-03-11
- block date till 2026-03-13
The query
# Historical data
# This query already reads history - it uses the combined dataset, which
# needs the historical data add-on for this chain.
#
# Without the add-on it fails with 'access restricted: your plan only allows
# realtime'. Drop the dataset argument to fall back to the recent window.
#
# Datasets: https://docs.bitquery.io/docs/graphql/dataset/archive/
# Retention: https://docs.bitquery.io/docs/graphql/data-coverage-retention/
#
# For more info on the endpoint visit -
# https://docs.bitquery.io/docs/blockchain/Ethereum/dextrades/dex-api/
# For faster results try using indexed feilds in where and orderBy clause -
# https://docs.bitquery.io/docs/graphql/indexed-fields-reference/
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
}
}
}
Variables
{
"trader": "0x0a62Bd9Ee12119a5aC4807C0970fed8B71E83163"
}
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