BullX Solana API
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 BullX-style trader data older than ~30 days, raw per-swap detail, or call / event context.
This section will guide you through different APIs which will tell you how to get data like realtime trades just like how BullX shows for Solana.
Trade Side Account field will not be available for aggregate queries in Archive and Combined Datasets
Get Trade Transactions of BullX for a particular pair in realtime
This subscribes to a Solana pair and streams each trade as it confirms. Open it in the Bitquery IDE: Solana pair trades.
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "token mint address"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Trade {
Currency {
Name
Symbol
}
Amount
PriceAgainstSideCurrency: Price
PriceInUSD
Side {
Currency {
Name
Symbol
}
Amount
Type
}
}
Transaction {
Maker: Signer
Signature
}
}
}
}
Get Buy Volume, Sell Volume, Buys, Sells, Makers, Total Trade Volume, Buyers, Sellers of a specific Token of BullX
This returns the headline stats for a token over the last 5 minutes and hour: value bought and sold, counts on each side, makers, and distinct buyers and sellers. Set time_5min_ago and time_1h_ago to those moments relative to now; the values below are only a shape to copy, and the example pair is Pnut against WSOL.
Open it in the Bitquery IDE: token pair stats.
query MyQuery($token: String!, $side_token: String!, $pair_address: String!, $time_5min_ago: DateTime!, $time_1h_ago: DateTime!) {
Solana(dataset: realtime) {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: $token}}, Side: {Currency: {MintAddress: {is: $side_token}}}, Market: {MarketAddress: {is: $pair_address}}}, Block: {Time: {since: $time_1h_ago}}}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
start: PriceInUSD(minimum: Block_Time)
min5: PriceInUSD(
minimum: Block_Time
if: {Block: {Time: {after: $time_5min_ago}}}
)
end: PriceInUSD(maximum: Block_Time)
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Market {
MarketAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
}
makers: count(distinct: Transaction_Signer)
makers_5min: count(
distinct: Transaction_Signer
if: {Block: {Time: {after: $time_5min_ago}}}
)
buyers: count(
distinct: Transaction_Signer
if: {Trade: {Side: {Type: {is: buy}}}}
)
buyers_5min: count(
distinct: Transaction_Signer
if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
)
sellers: count(
distinct: Transaction_Signer
if: {Trade: {Side: {Type: {is: sell}}}}
)
sellers_5min: count(
distinct: Transaction_Signer
if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
)
trades: count
trades_5min: count(if: {Block: {Time: {after: $time_5min_ago}}})
traded_volume: sum(of: Trade_Side_AmountInUSD)
traded_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {Block: {Time: {after: $time_5min_ago}}}
)
buy_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: buy}}}}
)
buy_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
)
sell_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: sell}}}}
)
sell_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
)
buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
buys_5min: count(
if: {Trade: {Side: {Type: {is: buy}}}, Block: {Time: {after: $time_5min_ago}}}
)
sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
sells_5min: count(
if: {Trade: {Side: {Type: {is: sell}}}, Block: {Time: {after: $time_5min_ago}}}
)
}
}
}
{
"token":"2qEHjDLDLbuBgRYvsxhc5D6uDWAivNFZGan56P1tpump",
"side_token": "So11111111111111111111111111111111111111112",
"pair_address": "4AZRPNEfCJ7iw28rJu5aUyeQhYcvdcNm8cswyL51AY9i",
"time_5min_ago":"2024-11-06T15:13:00Z",
"time_1h_ago": "2024-11-06T14:18:00Z"
}
Get Top Pairs on Solana on BullX
This ranks the ten busiest Solana pairs by trade count, returning trades, buys, sells and the value moved on each side. The window is whatever the Block: {Time: {since: ...}} bound sets, so move it to a recent timestamp before running it, an hour back for an hourly board. Run it as a plain request rather than a WebSocket subscription, because aggregates such as sum are recomputed per message on a subscription.
Open it in the Bitquery IDE: top Solana pairs.
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}, Trade: {Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {since: "2024-08-15T04:19:00Z"}}}
orderBy: {descendingByField: "total_trades"}
limit: {count: 10}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
start: PriceInUSD(minimum: Block_Time)
min5: PriceInUSD(
minimum: Block_Time
if: {Block: {Time: {after: "2024-08-15T05:14:00Z"}}}
)
end: PriceInUSD(maximum: Block_Time)
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Market {
MarketAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
}
makers: count(distinct:Transaction_Signer)
total_trades: count
total_traded_volume: sum(of: Trade_Side_AmountInUSD)
total_buy_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: buy}}}}
)
total_sell_volume: sum(
of: Trade_Side_AmountInUSD
if: {Trade: {Side: {Type: {is: sell}}}}
)
total_buys: count(if: {Trade: {Side: {Type: {is: buy}}}})
total_sells: count(if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
Get OHLC for a token pair
This returns OHLC candles for a token pair, the input for a price chart. Open it in the Bitquery IDE
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "token mint address"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, PriceAsymmetry: {lt: 0.1}}}
limit: {count: 10}
) {
Block {
Timefield: Time(interval: {in: minutes, count: 1})
}
volume: sum(of: Trade_Amount)
Trade {
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
open: Price(minimum: Block_Slot)
close: Price(maximum: Block_Slot)
}
count
}
}
}
Get Top Traded Pairs
This ranks pairs by traded value. Open it in the Bitquery IDE.
query ($time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) {
Solana {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_3h_ago}}, any: [{Trade: {Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}}, {Trade: {Currency: {MintAddress: {not: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}, {Trade: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}, Side: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}}}}]}
orderBy: {descendingByField: "usd"}
limit: {count: 100}
) {
Trade {
Currency {
Symbol
Name
MintAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
price_last: PriceInUSD(maximum: Block_Slot)
price_10min_ago: PriceInUSD(
maximum: Block_Slot
if: {Block: {Time: {before: $time_10min_ago}}}
)
price_1h_ago: PriceInUSD(
maximum: Block_Slot
if: {Block: {Time: {before: $time_1h_ago}}}
)
price_3h_ago: PriceInUSD(minimum: Block_Slot)
}
dexes: uniq(of: Trade_Dex_ProgramAddress)
amount: sum(of: Trade_Side_Amount)
usd: sum(of: Trade_Side_AmountInUSD)
traders: uniq(of: Trade_Account_Owner)
count(selectWhere: {ge: "100"})
}
}
}
{
"time_10min_ago": "2024-09-19T12:26:17Z",
"time_1h_ago": "2024-09-19T11:36:17Z",
"time_3h_ago": "2024-09-19T09:36:17Z"
}
Get trading volume, buy volume, sell volume of a token
This sums what a token traded against WSOL across every Solana venue, split by side. It reads the Trading cube rather than the chain-level DEXTradeByTokens: each row carries a vetted USD price, and the Solana archive and combined datasets return about a fifth fewer trades than realtime over the same window, so totals taken from them read low. The example uses PUMP; swap the base address for the mint you want. Open it in the Bitquery IDE.
{
Trading {
Trades(
where: {
Pair: {
Market: { Network: { is: "Solana" } }
Token: { Address: { is: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn" } }
QuoteToken: {
Address: { is: "So11111111111111111111111111111111111111112" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
bought: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sold: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
traders: count(distinct: Trader_Address)
}
}
}
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.