Solana Sell&Buy Query Example
Returns 5 DEX trades on Solana, where buy currency mint address is So1111…1112 or 8KhfhN…Pt28 and sell currency mint address is 8KhfhN…Pt28 or So1111…1112, sorted by block time field, highest first: block time, buy currency mint address, sell currency mint address, median of trade buy price, count, sum of trade buy amount and sum of trade sell amount.
What it returns
- block time
- buy currency mint address
- sell currency mint address
- median of trade buy price
- count
- sum of trade buy amount
- sum of trade sell amount
Filters
- buy currency mint address is So1111…1112 or 8KhfhN…Pt28
- sell currency mint address is 8KhfhN…Pt28 or So1111…1112
The query
query MyQuery {
Solana {
DEXTrades(
limit: {count: 5}
orderBy: {descendingByField: "Block_Time_Field"}
where: {
Trade: {
Buy: {Currency: {MintAddress: {in: ["So11111111111111111111111111111111111111112", "8KhfhNHsy62wbbRRSYBx7pameubiQ9guYn4KyD74Pt28"]}}},
Sell: {Currency: {MintAddress: {in: ["8KhfhNHsy62wbbRRSYBx7pameubiQ9guYn4KyD74Pt28", "So11111111111111111111111111111111111111112"]}}}
}
}
) {
Block {
Time_Field: Time(interval: {in: minutes, count: 5})
}
Trade {
Buy { Currency { MintAddress }}
Sell { Currency { MintAddress }}
}
Price: median(of: Trade_Buy_Price)
Unique_Buyers: count(distinct: Trade_Buy_Account_Address)
Unique_sellers: count(distinct: Trade_Sell_Account_Address)
total_transactions: count(distinct: Transaction_Signature)
buy_volume: sum(of: Trade_Buy_Amount)
sell_volume: sum(of: Trade_Sell_Amount)
}
}
}
Similar queries
- PumpSwap boost buy-and-burn trades · Solana · DEXTrades
- PumpSwap trades count by instruction method · Solana · DEXTrades
- FOMO App: One Wallet's Trades (Solana) · Solana · DEXTrades
- FOMO App: Latest Trades (Solana) · Solana · DEXTrades
- Solana dextrades for a token · Solana · DEXTrades