Trader's PnL for the last 30mins for a specific token
New Trade Stream
Returns trades, where trader address is QeHykJ…BWC2 and token ID is bid:solana:8xs8TCoAMJ4zj5aeXmrDP2BechGrXLMzVyMVBxfCpump: trader address, sum of amounts in USD base, sum of amounts base, calculate, count, currency ID, currency name and 11 more fields.
What it returns
- trader address
- sum of amounts in USD base
- sum of amounts base
- calculate
- count
- currency ID
- currency name
- currency symbol
- market address
- program
- network
- token address
- token ID
- is native
- token symbol
- quote token address
- quote token ID
- quote token symbol
Filters
- trader address is QeHykJ…BWC2
- token ID is bid:solana:8xs8TCoAMJ4zj5aeXmrDP2BechGrXLMzVyMVBxfCpump
The query
{
Trading {
Trades(
where: {Block: {Time: {since_relative: {minutes_ago: 30}}}, Pair: {Token: {Id: {is: "bid:solana:8xs8TCoAMJ4zj5aeXmrDP2BechGrXLMzVyMVBxfCpump"}}}Trader:{Address:{is:"QeHykJGZj6B2Syhi5a63t9oaLTwKXZqM4J5PjeZBWC2"}}}
) {
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"}})
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
}
}
}
Similar queries
- Elysium latest trades of one token (WHYPE) · Trading (all chains) · Trades
- Elysium DEX protocols by trade count · Trading (all chains) · Trades
- FOMO App: Trades per Day (Trading API) · Trading (all chains) · Trades
- save with commit · Trading (all chains) · Tokens