PnL query
Returns trades, sorted by pn l, highest first: trader address, sum of amounts in USD quote, calculate, token address, token ID, token symbol, network and 5 more fields.
What it returns
- trader address
- sum of amounts in USD quote
- calculate
- token address
- token ID
- token symbol
- network
- quote token address
- quote token ID
- quote token symbol
- market address
- program
The query
{
Trading {
Trades(
orderBy:{descendingByField:"PnL"}
where: {Block: {Time: {since_relative: {minutes_ago: 30}}}}) {
Trader {
Address
}
Amount_Bought: sum(of: AmountsInUsd_Quote, if: {Side: {is: "Buy"}})
Amount_Sold: sum(of: AmountsInUsd_Quote, if: {Side: {is: "Sell"}})
PnL: calculate(expression: "$Amount_Sold - $Amount_Bought")
Pair {
Token {
Address
Id
Symbol
Network
}
QuoteToken {
Address
Id
Symbol
Network
}
Market {
Address
Program
Network
}
}
}
}
}
Similar queries
- Robinhood Chain Aero Slipstream latest trades · Trading (all chains) · Trades
- Robinhood Chain Aero Slipstream 24h volume, traders and pools · Trading (all chains) · Trades
- FOMO App: Trades per Day (Trading API) · Trading (all chains) · Trades
- save with commit · Trading (all chains) · Tokens