Skip to main content

Solana Trader API

Need real-time Solana trader data or anything from the last ~30 days?

For real-time trader and wallet data over the last ~30 days across 10 chains in one API, use the Trading cube. Trading.Trades gives you clean, MEV-filtered swaps with Trader.Address as a first-class filter plus USD price, market cap, and supply on every row. Use this page when you need historical Solana trader data older than ~30 days, raw per-swap detail, or call / event context.

In this section we will see how to get Solana trader information using our API. More queries on DEX trades including latest trades, OHLC, and other data points can be found in the Solana DEX Trades API page.

note

Trade Side Account field will not be available for aggregate queries in Archive and Combined Datasets

Top Traders of a token​

This returns the top traders of a mint by USD value over a date range. It reads the archive dataset, which holds the depth a historical range needs, and filters by token mint, quote currency (e.g. SOL), and optional date range. For each trader you get buy/sell counts, buy/sell volume, total volume, and trade count.

Run query

{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: "98sMhvDwXj1RQi5c5Mndm3vPe9cBqPrbLaufMXFNMh5g" } }
Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }
}
Transaction: { Result: { Success: true } }
Block: { Date: { since: "2026-01-01", till: "2026-01-02" } }
}
orderBy: { descendingByField: "volume" }
limit: { count: 100 }
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Account {
Owner
}
}
buys: count(if: { Trade: { Side: { Type: { is: buy } } } })
sells: count(if: { Trade: { Side: { Type: { is: sell } } } })
buy_volume: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
volume: sum(of: Trade_Side_AmountInUSD)
trades: count
}
}
}

Change the token mint (Trade.Currency.MintAddress), quote currency (Trade.Side.Currency.MintAddress), and Block.Date.since / till to match your token and time window.

Trades of Wallets in Realtime​

Streams trades made by any wallet in addressList as they confirm. Open it in the Bitquery IDE.

subscription MyQuery($addressList: [String!]) {
Solana {
DEXTrades(
where: {Transaction: {Result: {Success: true}}, any: [{Trade: {Buy: {Account: {Address: {in: $addressList}}}}}, {Trade: {Buy: {Account: {Token: {Owner: {in: $addressList}}}}}}, {Trade: {Sell: {Account: {Address: {in: $addressList}}}}}, {Trade: {Sell: {Account: {Token: {Owner: {in: $addressList}}}}}}]}
) {
Instruction {
Program {
Method
}
}
Block {
Time
}
Trade {
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
}
AmountInUSD
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
}
AmountInUSD
}
}
Transaction {
Signature
Signer
}
}
}
}
{
"addressList": ["7eWHXZefGY98o9grrrt1Z3j7DcPDEhA4UviQ1pVNhTXX", "6LNdbvyb11JH8qxAsJoPSfkwK4zJDQKQ6LNp4mxt8VpR"]
}

Trades of Wallets with PreBalance, PostBalance​

Same as above, with the balance changes each trade produced. Open it in the Bitquery IDE.

query MyQuery($addressList: [String!]) {
Solana {
DEXTrades(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}}, any: [{Trade: {Buy: {Account: {Address: {in: $addressList}}}}}, {Trade: {Buy: {Account: {Token: {Owner: {in: $addressList}}}}}}, {Trade: {Sell: {Account: {Address: {in: $addressList}}}}}, {Trade: {Sell: {Account: {Token: {Owner: {in: $addressList}}}}}}]}
) {
Instruction {
Program {
Method
}
}
Block {
Time
}
Trade {
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
}
AmountInUSD
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
}
AmountInUSD
}
}
Transaction {
Signature
Signer
}
joinBalanceUpdates(join: left, Transaction_Signature: Transaction_Signature) {
Block{
Time
}
BalanceUpdate {
PreBalance
PostBalance
Account {
Address
Token {
Owner
}
}
}
}
}
}
}
{
"addressList": ["HevtGooXxDjLfvLM1vUY2y7b9gyu59whR4ycnQj3UjUT"]
}

Get count of Buys and Sells of a Trader​

Counts how many times a wallet bought and sold, with the USD value it moved. This reads the Trading cube, where Trader.Address is a first-class filter and every row carries a vetted USD price, so it answers in about a second across the last 30 days. For a range older than that, use DEXTradeByTokens with dataset: archive as the sections above do, and expect it to be slower and to return somewhat fewer trades than realtime over a window both cover. Open it in the Bitquery IDE

query TraderBuysSells($trader: String) {
Trading {
Trades(
where: {
Trader: { Address: { is: $trader } }
Block: { Time: { since_relative: { days_ago: 30 } } }
}
) {
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
volumeUsd: sum(of: AmountsInUsd_Base)
}
}
}
{
"trader": "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"
}

Total Bought, Total Sold, Avg Sell price, Last Active Trade by an Address​

Returns what a wallet bought and sold in one mint, its average sell price and when it last traded. Open it in the Bitquery IDE

query MyQuery ($trader:String, $token:String){
Solana(dataset: realtime) {
DEXTradeByTokens(
where: { Trade: {Currency:{MintAddress:{is:$token}} Side: {Currency: {MintAddress: {in: ["So11111111111111111111111111111111111111112", "11111111111111111111111111111111"]}}}}, any: [{Trade: {Account: {Address: {is: $trader}}}}, {Trade: {Account: {Token: {Owner: {is: $trader}}}}}]}
) {
Block{
last_active_time:Time(maximum:Block_Time)
}
total_buy: sum(of:Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: buy}}}})
total_sell: sum(of:Trade_Side_AmountInUSD if: {Trade: {Side: {Type: {is: sell}}}})
avg_sell_price: average(of:Trade_PriceInUSD if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
{
"token":"FSJYiGZhJ1wDPNhHbSHm49yJkzbFp7FykNB2SZFipump",
"trader": "CECN4BW4DKnbyddkd9FhWVR5dotzKhQr5p7DUPhQ55Du"
}

Subscribe to a Trader in Real-time​

Streams one message per trade made by a wallet, over a WebSocket. See the WebSocket subscriptions guide

Filter by wallet with Account: {Address: {is}}. Open it in the Bitquery IDE

Switch subscription to query to read the wallet's past activity instead.

subscription {
Solana {
buy: DEXTrades(
where: {Trade: {Buy: {Account: {Address: {is: "CP1d7VVnCMy321G6Q1924Bibp528rqibTX8x9UL6wUCe"}}}}}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
MetadataAddress
Key
IsMutable
EditionNonce
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Order {
LimitPrice
LimitAmount
OrderId
}
Price
}
Market {
MarketAddress
}
Sell {
Account {
Address
}
Currency {
IsMutable
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
}
}
}
sell: DEXTrades(
where: {Trade: {Sell: {Account: {Address: {is: "CP1d7VVnCMy321G6Q1924Bibp528rqibTX8x9UL6wUCe"}}}}}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
MetadataAddress
Key
IsMutable
EditionNonce
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Order {
LimitPrice
LimitAmount
OrderId
}
Price
}
Market {
MarketAddress
}
Sell {
Account {
Address
}
Currency {
IsMutable
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
}
}
}
}
}

Get the First 100 buyers of a Token​

Returns the first 100 wallets that bought a given mint. Open it in the Bitquery IDE

query MyQuery {
Solana {
DEXTrades(
where: {
Trade: {
Buy: {
Currency: {
MintAddress: {
is: "2Z4FzKBcw48KBD2PaR4wtxo4sYGbS7QqTQCLoQnUpump"
}
}
}
}
}
limit: { count: 100 }
orderBy: { ascending: Block_Time }
) {
Trade {
Buy {
Amount
Account {
Token {
Owner
}
}
}
}
}
}
}
Build with Bitquery

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.