# Bitquery Docs — full text: Solana
> 67 pages. All parts and the curated entry points: https://docs.bitquery.io/llms.txt
## Bags FM API - Bitquery
URL: https://docs.bitquery.io/docs/blockchain/Solana/bags-fm-api/
Bags FM on Solana: new token creations, USD and quote prices, all trades, latest trades by token and token transfers, with GraphQL queries and streams.
# Bags FM API Documentation
:::tip Need real-time Bags FM data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Bags FM data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Welcome to the **Bags FM API documentation**, powered by **Bitquery blockchain data APIs**.
This guide covers how to use Bitquery to fetch and analyze **Bags FM token data** on Solana, including **token creation, supply, transfers, trades, and prices**.
You can use these APIs to integrate **real-time Bags FM data** into your applications.
The **Bitquery Bags FM API** provides comprehensive access to **Bags FM launchpad data**, including **Bags FM token creation API**, **Bags FM token transfers**, **Bags FM token trades**, and **real-time Bags FM price API** streams.
:::note
Bags FM tokens are launched on Meteora DBC.
:::
## Table of Contents
### [API Endpoints](#api-endpoints)
1. **[New Bags FM Token Created (Instructions API v1)](#1-new-bags-fm-token-created-instructions-api-v1)**
2. **[New Bags FM Token Created (Instructions API v2)](#2-new-bags-fm-token-created-instructions-api-v2)**
3. **[New Bags FM Token Created (TokenSupply API)](#3-new-bags-fm-token-created-tokensupply-api)**
4. **[USD Price of All Bags FM Tokens (Stream API)](#4-usd-price-of-all-bags-fm-tokens-stream-api)**
5. **[Price of Bags FM Tokens vs Quote Tokens (Stream API)](#5-price-of-bags-fm-tokens-vs-quote-tokens-stream-api)**
6. **[All Trades of Bags FM Tokens (DEXTrades API)](#6-all-trades-of-bags-fm-tokens-dextrades-api)**
7. **[Latest Trades of Bags FM Tokens (DEXTradeByToken API)](#7-latest-trades-of-bags-fm-tokens-dextradebytoken-api)**
8. **[All Transfers of Bags FM Tokens (Token Transfers API)](#8-all-transfers-of-bags-fm-tokens-token-transfers-api)**
## Key Features
- **Real-time Bags FM token creation tracking** via **Solana token creation API**
- **Solana token supply updates** for Bags FM tokens
- **Live USD price streams** for Bags FM tokens with **Bags FM token USD price stream**
- **Price feeds against quote tokens** for comprehensive market data
- **Historical and latest trades** from DEXs using **Bags FM token trades** endpoints
- **Complete token transfer history** with **Bags FM token transfers** tracking
---
## Endpoints & Queries
### 1. New Bags FM Token Created (Instructions API v1)
Track **new Bags FM token creation** events on Solana using the **Instructions API**. This **Bags token creation API** endpoint provides real-time data on token launches by tracking the Bags.FM Creator program.
To convert this API into a stream, simply add `subscription` in front of the query. Check out [this example](https://ide.bitquery.io/of-Bagsfm-token-creation-using-instructions-stream-v1).
🔗 [Try Query](https://ide.bitquery.io/Bagsfm-token-creation-using-instructions-api-v1_2)
```graphql
{
Solana {
Instructions(
orderBy: { descending: Block_Time }
where: {
Instruction: { Program: { Method: { is: "mintTo" } } }
Transaction: {
Result: { Success: true }
Signer: { is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv" }
}
}
limit: { count: 10 }
) {
Instruction {
Program {
Arguments {
Name
Value {
__typename
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
AccountNames
Json
Name
}
Accounts {
Address
}
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
Logs
TokenBalanceUpdatesCount
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
---
### 2. New Bags FM Token Created (Instructions API v2)
Fetch Bags FM token creation using the **Instructions API**. In this version, we track Meteora DBC's instructions.
To convert this API into a stream, simply add `subscription` in front of the query. Check out [this example](https://ide.bitquery.io/Bagsfm-token-creation-using-instructions-stream-v2_4).
🔗 [Try Query](https://ide.bitquery.io/Bagsfm-token-creation-using-instructions-stream-v2_5)
```graphql
query {
Solana {
Instructions(
limit: { count: 100 }
orderBy: { descending: Block_Time }
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
Accounts: {
includes: {
Address: { is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Program {
Arguments {
Name
Value {
__typename
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
AccountNames
Json
Name
}
Accounts {
Address
}
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
Logs
TokenBalanceUpdatesCount
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
---
### 3. New Bags FM Token Created (TokenSupply API)
Track Bags FM token creation using the **Solana TokenSupply API**. This endpoint provides **Bags FM token data** including supply information and creation timestamps. For the same API as a WebSocket stream, [try this](https://ide.bitquery.io/Bagsfm-token-creation-stream-using-Solana-token-supply-updates).
🔗 [Try Query](https://ide.bitquery.io/Bagsfm-token-creation-using-Solana-token-supply-updates)
```graphql
{
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: {
Signer: { is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv" }
}
TokenSupplyUpdate: { Amount: { ne: "0" } }
}
limit: { count: 20 }
orderBy: { descending: Block_Time }
) {
Instruction {
Program {
Method
}
}
TokenSupplyUpdate {
Currency {
Name
Symbol
MintAddress
Decimals
}
Amount
AmountInUSD
PreBalance
PreBalanceInUSD
PostBalance
PostBalanceInUSD
Account {
Address
Owner
Token {
Owner
}
}
}
Block {
Time
Height
}
Instruction {
Program {
Address
Method
}
}
Transaction {
Signature
Signer
}
}
}
}
```
---
### 4. USD Price of All Bags FM Tokens (Stream API)
Get **real-time USD prices** of all Bags FM tokens with the **Bitquery Price Index Stream API**. This **Bags FM token USD price WebSocket stream** provides continuous price updates.
🔗 [Try Stream](https://ide.bitquery.io/USD-Price-of-all-BAGs-token-in-Stream)
If you want to use it as a regular API, simply remove `subscription` from the front of the query.
```graphql
subscription {
Trading {
Pairs(
where: {
Interval: { Time: { Duration: { eq: 1 } } }
Price: { IsQuotedInUsd: true }
Token: { Address: { endsWith: "BAGS" } }
}
) {
Token {
Id
Symbol
Address
Name
}
Interval {
Time {
Start
End
Duration
}
}
Volume {
Usd
Quote
Base
}
Price {
Average {
Mean
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
```
---
### 5. Price of Bags FM Tokens vs Quote Tokens (Stream API)
Fetch **token-to-token prices** for all Bags FM tokens against their **quote tokens**. This **real-time Bags FM price WebSocket stream** provides comprehensive market data.
🔗 [Try Query](https://ide.bitquery.io/Price-of-all-Bags-FM-token-against-their-relevant-quote-token-in-Stream)
```graphql
subscription {
Trading {
Pairs(
where: {
Interval: { Time: { Duration: { eq: 1 } } }
Price: { IsQuotedInUsd: false }
Token: { Address: { endsWith: "BAGS" } }
}
) {
Token {
Id
Symbol
Address
Name
}
QuoteToken {
Name
Symbol
Address
}
Interval {
Time {
Start
End
Duration
}
}
Volume {
Usd
Quote
Base
}
Price {
Average {
Mean
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
```
---
### 6. All Trades of Bags FM Tokens (DEXTrades API)
Get **all trades of Bags FM tokens** from Meteora and other DEXs. This **Bags FM token trades** WebSocket provides comprehensive trading data.
🔗 [Try Query](https://ide.bitquery.io/All-Trade-for-Bagsfm-tokens)
```graphql
subscription {
Solana {
DEXTrades(
where: {
any: [
{
Trade: {
Buy: {
Currency: {
UpdateAuthority: {
is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv"
}
}
}
}
}
{
Trade: {
Sell: {
Currency: {
UpdateAuthority: {
is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv"
}
}
}
}
}
]
}
limit: { count: 20 }
orderBy: { descending: Block_Time }
) {
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Buy {
Amount
AmountInUSD
Currency {
MetadataAddress
ProgramAddress
TokenCreator {
Address
}
UpdateAuthority
Symbol
Name
MintAddress
}
Price
}
Sell {
Amount
AmountInUSD
Currency {
Symbol
Name
MintAddress
}
Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
}
}
}
}
```
---
### 7. Latest Trades of Bags FM Tokens (DEXTradeByToken API)
Fetch the **latest trades of Bags FM tokens** with the **DEXTradeByToken API**. This endpoint provides real-time **Bags FM token trades** data.
🔗 [Try Query](https://ide.bitquery.io/Latest-trades-of-Bags-FM-token-using-Dextradebytoken-api_1)
```graphql
query LatestTrades {
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Currency: {
UpdateAuthority: {
is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv"
}
}
Side: {
Currency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
"JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"
"EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm"
]
}
}
}
}
}
) {
Block {
Time
}
Transaction {
Signature
Signer
FeePayer
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
AmountInUSD
PriceInUSD
Price
Amount
Currency {
Symbol
MintAddress
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
---
### 8. All Transfers of Bags FM Tokens (Token Transfers API)
Track **all transfers of Bags FM tokens** across wallets. This **Bags FM token transfers** endpoint provides complete transfer history.
🔗 [Try Query](https://ide.bitquery.io/Solana-token-transfers-of-Bags-fm-tokens)
```graphql
{
Solana {
Transfers(
orderBy: { descending: Block_Time }
limit: { count: 10 }
where: {
Transfer: {
Currency: {
UpdateAuthority: {
is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv"
}
}
}
}
) {
Block {
Time
Height
Slot
}
Transfer {
Amount
AmountInUSD
Authority {
Address
}
Currency {
UpdateAuthority
Name
Symbol
MintAddress
}
Index
Receiver {
Address
Owner
}
Sender {
Address
Owner
}
}
}
}
}
```
## Video Tutorials
### Get Unlimited Bags FM Token Data Using Bitquery API
## Use Cases
- **Trading Platforms** – Integrate **Bags FM price feeds**, **Bags FM token trades**, and liquidity data using the **Bitquery Bags FM API**
- **Analytics Dashboards** – Track creation, **Bags FM token transfers**, supply, and prices with comprehensive **Bags FM token data**
- **Arbitrage Bots** – Monitor **Bags FM token USD price stream** differences in real time
## Why Use Bitquery for Bags FM API?
- **Low-latency blockchain data** (sub-400ms, moving to <100ms) for **real-time Bags FM price API**
- **Comprehensive Solana coverage** with real-time streams for **Bags FM token data**
- **Unified price index** for accurate token valuations via **Bags FM token USD price stream**
- **Historical + real-time queries** for flexible use cases with **Bags FM token trades** and **Bags FM token transfers**
## Multi-Exchange Data
The **Bags FM token trades** endpoints aggregate data from multiple Solana DEXs:
- [Meteora API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/)
- [Raydium API](/docs/blockchain/Solana/Solana-Raydium-DEX-API/)
- [Orca API](/docs/blockchain/Solana/solana-orca-dex-api/)
- [Jupiter API](/docs/blockchain/Solana/solana-jupiter-api/)
- [PumpFun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Letsbonk API](/docs/blockchain/Solana/letsbonk-api/)
## 🔗 Related Solana APIs
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Track token creation and burn instructions
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Monitor trading activities across all DEXs
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track token transfers and movements
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor balance changes from trades and transfers
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Track token supply and creation events
## Conclusion
The **Bags FM API (via Bitquery)** delivers **complete blockchain data access** for Bags FM tokens.
From **token creation** and **supply updates** to **real-time USD prices** through [crypto price API](/docs/trading/crypto-price-api/), **DEX trades**, and **transfers**, it provides everything you need to build apps, dashboards, and trading systems.
The **Bitquery Bags FM API** is your comprehensive solution for accessing **Bags FM token data**, **Bags FM token transfers**, **Bags FM token trades**, and **real-time Bags FM price API** streams on the Solana blockchain.
---
## Believe Launchpad API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Believe-API/
Believe Launchpad on Solana: track token creation on Meteora DBC in real time, creation time, graduated tokens and creator fee claims.
# Believe Launchpad API
:::tip Need real-time Believe data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Believe data older than ~30 days**, raw per-swap detail, or call / event context.
:::
## 🎯 What is Believe Launchpad?
The Believe Launchpad is a decentralized token launchpad built on the Solana blockchain that simplifies token creation and trading. It allows users to mint tokens directly through social media interactions (especially X/Twitter), making token creation accessible to everyone, even without technical expertise.
## Related APIs
- **[Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)** - Core DBC functionality
- **[Moonshot APIs](/docs/blockchain/Solana/Moonshot-API/)** - Alternative launchpad
- **[FourMeme APIs](/docs/blockchain/BSC/four-meme-api/)** - BSC-based token creation
## Pro Tips
- **Use the IDE**: The Bitquery IDE provides autocomplete and validation
- **Start Simple**: Begin with basic queries and gradually add complexity
- **Test Incrementally**: Build queries step by step, testing each addition
- **Contact Support**: Get help on [Telegram](https://t.me/Bloxy_info) for specific issues
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## Track Token creation using Believe Launchpad on Meteora DBC in realtime
Use the stream: [Track Believe token creations on Meteora DBC (realtime) ➤](https://ide.bitquery.io/track-Token-creation-using-Believe-Protocol-on-Meteora-DBC-in-realtime_2). `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` is the address of Meteora DBC and `5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE` is the Believe Token Authority address, the address which is responsible for calling the instructions on Meteora DBC Program.
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
Accounts: {
includes: {
Address: { is: "5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
## Check when a Believe Launchpad token was created on Meteora DBC
Using below query, you can check when was a Believe Launchpad token created. Here we have taken the example of checking creation time and transaction signature of this token `GsVr8GdT57gBa6GxujrtAeRGmYbFfABGFk2eaG2DzBLV`. Note: we only have last 8 hours of Solana Instructions data so this query will not return anything for the Believe Launchpad token which was created more than 8 hours ago.
Run the query: [Get a Believe token's creation time and dev address? ➤](https://ide.bitquery.io/check-when-a-Believe-protocol-token-was-created-on-Meteora-DBC_1).
```graphql
query MyQuery($tokenAddress: String!) {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {is: "initialize_virtual_pool_with_spl_token"}}, Accounts: {includes: {Address: {is: $tokenAddress }}}}, Transaction: {Result: {Success: true}, Signer: {is: "5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE"}}}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
{
"tokenAddress": "GsVr8GdT57gBa6GxujrtAeRGmYbFfABGFk2eaG2DzBLV"
}
```
## Get the Believe Launchpad tokens which are graduated to Meteora
For checking which Believe tokens graduated, we need to get all the tokens created by Believe on Meteora DBC using this [Get All Token Creations by Believe - API](/docs/blockchain/Solana/Believe-API/#get-latest-meteora-dbc-token-creations-using-believe-launchpad) and then after getting all the token addresses put them in [Check if the Believe Tokens has Graduated - API](https://ide.bitquery.io/Check-if-the-tokens-have-migrated-from-Meteora-DBC_1) to check which of them graduated to Meteora.
```graphql
query MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: {
Result: { Success: true }
Signer: { is: "5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE" }
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
Then put all the token addresses in the `$tokenAddresses` variable in the following query. Run it here: [Check if the tokens have migrated from Meteora DBC ➤](https://ide.bitquery.io/Check-if-the-tokens-have-migrated-from-Meteora-DBC_1).
```graphql
query MyQuery($tokenAddresses: [String!]) {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}, Accounts: {includes: {Address: {in: $tokenAddresses}}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
{
"tokenAddresses":["3EX4yHYs25RXaNMBgaNtpGxPKvX73P9QWVw8fpNEhnow","2bzXpTCu3faGocjBKZvxv63yV3gnWDZYfH6mRVfGzbh8","Dpz6knqUSTfV2ESXqQvbiWVznzRPYSYivUtXT3TVpWkA"]
}
```
## Get latest Meteora DBC Token Creations using Believe Launchpad
Check this API: [Latest Believe token creations ➤](https://ide.bitquery.io/Token-creation-using-Believe-Protocol-on-Meteora-DBC#) to get the 10 latest Believe Launchpad created Tokens.
```graphql
query MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: {
Result: { Success: true }
Signer: { is: "5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE" }
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
## Get latest Claims of Creator Fees using Believe Launchpad
Check this query: [Latest creator trading fee claims (Believe) ➤](https://ide.bitquery.io/Claim-creator-trading-fee-using-Believe-Protocol-on-Meteora-DBC#) to get the most recent claims of creator trading fees via Believe Launchpad.
```graphql
query MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "claim_creator_trading_fee" }
}
}
Transaction: {
Result: { Success: true }
Signer: { is: "5qWya6UjwWnGVhdSBL3hyZ7B45jbk6Byt1hwd7ohEGXE" }
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
---
## BonkSwap API: Trades, Top Traders, One Wallet's Swaps and OHLC on Solana
URL: https://docs.bitquery.io/docs/blockchain/Solana/BonkSwap-API/
BonkSwap on Solana via Bitquery GraphQL: latest swaps, top traders by USD volume, one wallet's BonkSwap trades, hourly OHLC for USELESS/USD1, and a live stream.
# BonkSwap API: Trades, Top Traders, One Wallet's Swaps and OHLC on Solana
BonkSwap is the AMM of the Bonk ecosystem on Solana, program `BSwp6bEBihVLdqJRKGgzjcGLHkcTuzmSo1TQkHepzH8p`. Its volume today runs through pairs quoted in USD1, the stablecoin the venue leans on, with USELESS/USD1 the busiest of them. Bitquery labels its swaps `ProtocolName: "bonkswap"` in the Solana `DEXTrades` and `DEXTradeByTokens` cubes, so every query on this page is one filter away from covering any other Solana DEX. Every example runs in the [IDE](https://ide.bitquery.io); Solana queries go to the `eap` endpoint. Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. For swaps with the trader, USD and market cap on every row for the last month, the [Trading cube](/docs/trading/crypto-trades-api/trades-api) covers BonkSwap too.
## Latest swaps on BonkSwap
One row per swap per token, newest first, with the counter token, the price in USD, the market and the signer. Change `query` to `subscription` and drop `limit` and `orderBy` for a live feed. Saved query [here](https://ide.bitquery.io/Latest-Trades-on-BonkSwap).
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Transaction: { Result: { Success: true } }
Trade: { Dex: { ProtocolName: { is: "bonkswap" } } }
}
) {
Block {
Time
}
Trade {
Currency {
Symbol
MintAddress
}
Amount
PriceInUSD
Side {
Currency {
Symbol
}
Amount
Type
}
Market {
MarketAddress
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Top traders by USD volume
Group the last day by the transaction signer. `tokens` says how many different tokens each wallet touched. Saved query [here](https://ide.bitquery.io/Top-Traders-on-BonkSwap).
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 50 }
where: {
Transaction: { Result: { Success: true } }
Trade: { Dex: { ProtocolName: { is: "bonkswap" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Transaction {
Signer
}
trades: count
volumeUsd: sum(of: Trade_Side_AmountInUSD)
tokens: uniq(of: Trade_Currency_MintAddress)
}
}
}
```
## One wallet's BonkSwap trades
Filter `Transaction.Signer`. The example is the most active BonkSwap wallet at the time of writing; take any address from the table above. Saved query [here](https://ide.bitquery.io/Bonkswap-Trades-by-Trader-API).
```graphql
{
Solana {
DEXTrades(
orderBy: [{ descending: Block_Time }, { descending: Transaction_Index }, { descending: Trade_Index }]
limit: { count: 20 }
where: {
Transaction: { Signer: { is: "9EVzTzLSfYHrjXpejBRFGmZVG9jRsS4tDtcE1NpD6srb" } }
Trade: { Dex: { ProtocolName: { is: "bonkswap" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Block {
Time
}
Trade {
Buy {
Currency {
Symbol
}
Amount
AmountInUSD
}
Sell {
Currency {
Symbol
}
Amount
AmountInUSD
}
Market {
MarketAddress
}
}
Transaction {
Signature
}
}
}
}
```
## Hourly OHLC for USELESS/USD1
Candles for the last day of the busiest BonkSwap pair. `Trade.Amount` sums the USELESS volume; the four price fields come from the highest and lowest prices in the hour and the first and last slot. Saved query [here](https://ide.bitquery.io/ohlc-for-bonkswap-token).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "bonkswap" } }
Currency: { MintAddress: { is: "Dz9mQ9NzkBcCsuGPFJ3r1bS4wgqKMHBPiVuniW8Mbonk" } }
Side: { Currency: { MintAddress: { is: "USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB" } } }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
limit: { count: 24 }
orderBy: { descendingByField: "Block_Timefield" }
) {
Block {
Timefield: Time(interval: { in: hours, 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
}
}
}
```
## Every BonkSwap swap, live
The protocol filter on `DEXTrades` as a subscription; each message is one swap with both sides.
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: { Dex: { ProtocolName: { is: "bonkswap" } } }
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Buy {
Currency {
Symbol
MintAddress
}
Amount
AmountInUSD
Account {
Address
}
}
Sell {
Currency {
Symbol
MintAddress
}
Amount
AmountInUSD
}
Market {
MarketAddress
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Related pages
- [Solana DEX trades API](/docs/blockchain/Solana/solana-dextrades)
- [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)
- [Solana API hub](/docs/blockchain/Solana/)
- [Shred streams for Solana](/docs/streams/real-time-solana-data/)
---
## Build AI Trading Agents with Bitquery Solana Data
URL: https://docs.bitquery.io/docs/blockchain/Solana/ai-agent-solana-data/
Solana AI trading agent guide: trending tokens, live trade streams, market cap and liquidity checks, wallet balances and holder distribution for agents.
# Build AI Trading Agents with Bitquery Solana Data
## Recommended: Trading API feeds for agents (real-time + last ~30 days)
For live signals, point your agent at the [**Trading API**](/docs/trading/trading-data-overview) — **USD price, market cap, and supply on every row**, MEV-filtered. The chain-level queries below remain the right tool for **history older than ~30 days** or instruction context.
### Trending Solana tokens by USD volume
Run it [in the IDE](https://ide.bitquery.io/Trading-API-Trending-Tokens-Solana).
```graphql
{
Trading {
Tokens(
where: {
Interval: {Time: {Duration: {eq: 3600}}}
Token: {Network: {is: "Solana"}}
Block: {Time: {since_relative: {hours_ago: 2}}}
Volume: {Usd: {gt: 10000}}
}
limit: {count: 10}
orderBy: {descending: Volume_Usd}
) {
Token { Symbol Address Network }
Interval { Time { Start Duration } }
Volume { Base Usd }
Price { Ohlc { Open High Low Close } }
Supply { MarketCap FullyDilutedValuationUsd }
}
}
}
```
### Live Solana trade stream
Run it [in the IDE](https://ide.bitquery.io/Trading-API-Live-Trades-All-Chains) — scoped here to Solana; drop the `Network` filter to stream all 10 chains.
```graphql
subscription {
Trading {
Trades(where: {Pair: {Market: {Network: {is: "Solana"}}}}) {
Block { Time }
Price
PriceInUsd
AmountsInUsd { Base Quote }
Trader { Address }
Pair { Token { Symbol } QuoteToken { Symbol } Market { Protocol } }
}
}
}
```
In this section, we will explore how to use **Bitquery APIs and real-time streams** to build AI-enabled trading agents for the **Solana blockchain**.
**Use the [Bitquery MCP Server](/docs/mcp/mcp-server/)** for the hosted ClickHouse-backed MCP, or follow this [walkthrough on building MCPs with Bitquery](https://youtu.be/q-QL5EGfT5k).
For **ready-made [OpenClaw](https://openclaw.ai/) skills** that pipe Bitquery WebSocket feeds into an agent (Bitcoin price, multi-token USD charts, Pump.fun, Polymarket, Solana stablecoin transfers), install from [ClawHub](https://clawhub.ai/) and see the skill list and setup in [bitquery/openclaw-skills-master](https://github.com/bitquery/openclaw-skills-master). ClawHub usage: [ClawHub CLI docs](https://docs.openclaw.ai/tools/clawhub).
**Your AI Trading Agent's Mission:**
>You are a specialized trading agent operating on the Solana blockchain, you will optimize an existing portfolio by analyzing and trading trending tokens using Bitquery data. Your primary goal is to identify profitable tokens in the market, assess wallet balances, and execute calculated swap decisions to enhance portfolio value.
```
prompt = (
f"Analyze the following Solana token:\n"
f"Name: {token_data['name']}\n"
f"Symbol: {token_data['symbol']}\n"
f"Market Cap: {token_data['market_cap']}\n"
f"Liquidity (USD): {token_data['liquidity_usd']}\n"
f"Volatility: {token_data['volatility']}\n"
f"Top Holder Concentration (%): {token_data['holder_concentration']}\n"
"\nBased on this data, decide whether to 'Buy', 'Avoid', or 'Hold'. Only reply with one word: Buy, Avoid, or Hold."
)
```
### Trading Decision Process
This is a rough draft of what an AI agent can do using on-chain and off-chain data:
1. Use trending data to identify promising tokens with potential profit. Cross-check narratives with live category dashboards on [DEXrabbit](https://dexrabbit.bitquery.io/categories) — for example [AI Agents](https://dexrabbit.bitquery.io/categories/ai-agents), [Solana Meme Coins](https://dexrabbit.bitquery.io/categories/solana-meme-coins), or [Pump.fun](https://dexrabbit.bitquery.io/categories/pump-fun).
2. For each trending token, retrieve detailed information to evaluate its market cap, liquidity, volatility, and security.
3. Check the wallet balance to understand the available assets and decide on a safe percentage to invest.
4. Execute swaps to acquire trending tokens, ensuring the chosen amount.
5. Continuously monitor token performance and adjust holdings to maximize profits. For this you can use [Bitquery Shred Streams](/docs/streams/real-time-solana-data/#kafka-stream-by-bitquery) to monitor token prices, new token creation and other activities with sub-second latency.
## Code Structure and Logic: A Good Starting Point
Your code sets up a flexible AI trading agent framework, handling:
- backtesting : historical simulation.
- live mode: real-time trading/decision making
- Portfolio tracking (cash, positions, realized gains)
- Integration with an AI model (likely LLM) to guide trading decisions
- where the AI agent makes data-driven trading decisions based on Bitquery Solana data.
Below is a sample project structure:
```
ai_trading_agent/
├── main.py # Entry point for agent
├── bitquery_utils.py # Bitquery API functions
├── ai_decision.py # AI model logic for trade decisions
├── wallet_utils.py # Wallet balance + transaction logic
├── config.env # Store API keys securely
```
## Video Tutorial
## Key Bitquery Streams and Queries for Trading Agents
### 1. Top Trending Tokens
Detect tokens with rising popularity and trader activity.
**Docs:** [Top 10 Trending Solana Tokens](/docs/blockchain/Solana/solana-dextrades/#top-50-trending-solana-token-pairs-with-all-the-data)
Click to expand GraphQL query
```graphql
query TrendingTokens {
Solana(network: solana, dataset: realtime) {
DEXTradeByTokens(
limit: {count: 10}
orderBy: {descendingByField: "tradesCountWithUniqueTraders"}
where: {Trade: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112","11111111111111111111111111111111"]}}}}
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
}
tradesCountWithUniqueTraders: count(distinct: Transaction_Signer)
}
}
}
```
**Use:** Filter tokens with rising trader activity to shortlist tokens to buy.
### 3. Marketcap & Liquidity Pool Analysis
Evaluate token liquidity to avoid low-volume or illiquid tokens.
**Docs:** [Top Pools based on Liquidity](/docs/blockchain/Solana/Solana-DexPools-API/#get-top-pools-based-on-liquidity)
[Run Query](https://ide.bitquery.io/top-10-liquidity-pools_1)
Click to expand GraphQL query
```graphql
query GetTopPoolsByDex {
Solana {
DEXPools(
orderBy: { descending: Pool_Quote_PostAmount }
where: {
Block: { Time: { after: "2024-08-27T12:00:00Z" } }
Transaction: { Result: { Success: true } }
}
limit: { count: 10 }
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolName
ProtocolFamily
}
Quote {
PostAmount
PostAmountInUSD
PriceInUSD
}
Base {
PostAmount
}
}
}
}
}
```
#### Marketcap of a token
You can fetch Marketcap of a token using below query.
[Run Query](https://ide.bitquery.io/market-cap-of-token_1)
[Docs](/docs/blockchain/Solana/token-supply-cube/#marketcap-of-a-token)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
where: {TokenSupplyUpdate: {Currency: {MintAddress: {is: "6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui"}}}}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
TokenSupplyUpdate {
PostBalanceInUSD
}
}
}
}
```
**Use:** Focus on tokens with strong liquidity to ensure reliable entry and exit points.
### 4. Wallet Balances Monitoring
Review current portfolio composition before making swaps.
**Docs:** [Account Balances on Solana](/docs/blockchain/Solana/solana-balance-updates/#get-all-the-tokens-owned-by-an-address)
[Run Query](https://ide.bitquery.io/tokens-owned-by-an-address)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: { BalanceUpdate: { Account: { Owner: { is: "WALLET ADDRESS" } } } }
orderBy: { descendingByField: "BalanceUpdate_Balance_maximum" }
) {
BalanceUpdate {
Balance: PostBalance(maximum: Block_Slot)
Currency {
Name
Symbol
}
}
}
}
}
```
**Use:** Determine available assets and calculate safe investment amounts for token swaps.
### 5. DEX Trade Streams for Real-Time Trades
Subscribe to continuous streams of Solana DEX trades for live market intelligence.
[Solana Trade Stream Run](https://ide.bitquery.io/solana-trades-subscription_3)
The same stream can be obtained with lower latency via [Kafka containing Solana Shreds](/docs/streams/protobuf/chains/Solana-protobuf/).
Click to expand GraphQL Stream
```graphql
subscription {
Solana {
DEXTrades {
Block {
Time
Slot
}
Transaction {
Signature
Index
Result {
Success
}
}
Trade {
Index
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
MetadataAddress
Key
MintAddress
IsMutable
EditionNonce
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
PriceInUSD
Order {
LimitPrice
LimitAmount
OrderId
}
}
Market {
MarketAddress
}
Sell {
Account {
Address
}
Currency {
IsMutable
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
PriceInUSD
}
}
}
}
}
```
**Use:** React instantly to time-sensitive trades.
### 6. Token Holders Distribution (Security Check)
Check token decentralization to avoid risky, whale-dominated assets.
[Run Query](https://ide.bitquery.io/top-100-holders-of-USDC-token-on-Solana)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
BalanceUpdates(
orderBy: { descendingByField: "BalanceUpdate_Holding_maximum" }
where: {
BalanceUpdate: {
Currency: {
MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Transaction: { Result: { Success: true } }
}
) {
BalanceUpdate {
Currency {
Name
MintAddress
Symbol
}
Account {
Address
}
Holding: PostBalance(maximum: Block_Slot, selectWhere: { gt: "0" })
}
}
}
}
```
**Use:** Avoid tokens with highly concentrated ownership that may be vulnerable to manipulation.
### 7. Avoiding Bots with DEXRabbit (Built by Bitquery)
Your AI Trading Agent should monitor **bot activity** on DEXs. Bots can cause **sudden price spikes**, **wash trading**, or manipulate token prices, posing risks to human traders.
**[DexRabbit.com](https://dexrabbit.bitquery.io/)**, built on Bitquery data, offers charts and dashboards to detect bot activity in real-time.
### Key Bot Activity Indicators to Monitor:

| Indicator | Description |
| -------------------------------------- | --------------------------------------------------------------------- |
| **Highly repetitive trade patterns** | Identical trades happening in short intervals suggest bot activity. |
| **Large trade bursts at odd hours** | Bots often execute trades at low-liquidity times to influence price. |
| **Frequent pump-and-dump patterns** | Sharp price surges followed by rapid sell-offs indicate manipulation. |
| **Unusual token holder concentration** | Bots may use multiple wallets to appear as unique traders. |
## Calculating Trading Indicators
You can SMA, EMA, RSI etc with Bitquery data. A tutorial is available [here](/docs/usecases/trading-indicators/)
Your AI Agent can reconstruct price charts and calculate:
- SMA 50: Simple Moving Average over last 50 data points (could be trades, time intervals, etc.).
- SMA 200: Simple Moving Average over last 200 data points.
Detect crossovers:
- SMA 50 crosses above SMA 200 → Consider Buy.
- SMA 50 crosses below SMA 200 → Consider Sell.
This logic can be integrated into the AI Trading Loop along with the on-chain analysis.
## Building the AI Trading Loop
Your AI Trading Agent combines the above streams as follows:
1. Fetch Top Trending Tokens to shortlist candidates.
2. For each token:
- Analyze Liquidity, Volatility, and Holders Distribution.
3. Check Wallet Balances to calculate possible investment amount.
4. Use Real-Time Trade Streams to time the market entry.
5. Execute Swaps on high-potential tokens.
6. Continuously monitor market data and adjust holdings as needed.
## Next Steps
- Integrate these Bitquery APIs into your AI agent.
- Define risk management parameters, such as maximum percentage of balance per trade.
- Automate decision-making logic based on market data.
- Continuously refine and improve trading strategies using real-time data.
You can also integrate off-chain information like Twitter feeds to decide if a token is worth investing
- Combine with **NLP (Natural Language Processing)** to do **sentiment analysis** on tweets.
- Build **alert systems** based on specific keywords or sentiment spikes.
- Monitor tweets from key influencers and trigger trades based on their content.
- Use Twitter data as a factor in your **AI models' decision-making**.
---
_This material is for educational and informational purposes only and is not intended as investment advice. The content reflects the author's personal research and understanding. While specific investments and strategies are mentioned, no endorsement or association with these entities is implied. Readers should conduct their own research and consult with qualified professionals before making any investment decisions. Bitquery is not liable for any losses or damages resulting from the application of this information._
---
## DEXScreener API: Solana Pairs, Trades, OHLC, Live Streams
URL: https://docs.bitquery.io/docs/blockchain/Solana/DEXScreener/solana_dexscreener/
The public DEX Screener API has no OHLC, history or price WebSocket. Get the same Solana pair data with candles, history and live streams from Bitquery.
# DEXScreener API for Solana: Pairs, Trades, OHLC and Live Streams
DEX Screener publishes a public REST API. Its reference lists pair, token and search endpoints at 300 requests a minute and profile, boost and ad endpoints at 60 a minute, all returning the current state of a pair or token. It has no candle, OHLC or historical endpoint. Its WebSocket API streams token profiles, boosts, community takeovers and ads, not pair prices or trades. If that is enough, use it.
This page is for the rest: every number on the DEX Screener Solana dashboard, plus the history behind it, over Bitquery GraphQL, WebSocket subscriptions and Kafka streams. Live trades per pair, token prices, OHLC candles at any interval, buy and sell volume with makers, buyers and sellers, top pairs by activity, and trader profit and loss, across Raydium, Orca, Jupiter, PumpSwap and the other Solana DEXs. Every query below runs as written in the [Bitquery IDE](https://ide.bitquery.io) with a free trial key.
## What the official DEX Screener API covers
| Endpoint group in the DEX Screener reference | Rate limit | Returns |
|---|---|---|
| Pairs by chain and pair address, token pairs, tokens by address, search | 300 requests a minute | Current price, liquidity, volume and transaction counts for a pair or token |
| Token profiles, boosts, community takeovers and ads (REST, plus WebSocket feeds), orders and metas (REST) | 60 requests a minute | Listing and promotion metadata |
Two things are missing from that reference: candles (there is no OHLC or historical endpoint, so a chart has to be built by polling and storing snapshots yourself) and a push channel for market data (the WebSocket page lists only profile, boost, takeover and ad feeds, so live pair prices mean polling within the limit). The queries on this page fill both gaps, and add the aggregates a screener needs, such as distinct makers, buyers and sellers per window.
For EVM chains (Ethereum, BNB Chain, Arbitrum, Base, Polygon, Optimism) see the [DEXScreener EVM API page](/docs/blockchain/Ethereum/dextrades/DEXScreener/evm_dexscreener/).
## How the data is delivered
- **GraphQL API** for historical and current data with filtering and aggregation. Start at [Solana DEX Trades](/docs/blockchain/Solana/solana-dextrades).
- **WebSocket subscriptions** for live trades, new pools and price updates. See [Solana subscriptions](/docs/subscriptions/subscription).
- **Kafka streams** for high-throughput pipelines. See [Kafka streaming concepts](/docs/streams/kafka-streaming-concepts/).
- **Cloud datasets** as Parquet exports to S3, GCS, Snowflake or BigQuery for bulk history. See [cloud datasets](/docs/cloud/).
## Get trade transactions of a pair in real time
This subscription streams every trade on one Solana pair as it is confirmed. Open it in the IDE [here](https://ide.bitquery.io/Get-Solana-pair-trades-data-just-like-dexcsreener#).
```graphql
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}, Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Market: {MarketAddress: {is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"}}}, 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 the price of a token
This query returns the latest price of a token from the Trading API, with mean, estimate and moving-average prices alongside the OHLC of the latest one-second interval. Saved query [here](https://ide.bitquery.io/token-usd-price-using-trading-api_1).
```graphql
query MyQuery {
Trading {
Pairs(
where: {Token: {Id: {is: "bid:solana:So11111111111111111111111111111111111111112"}}, Interval: {Time: {Duration: {eq: 1}}}, Price: {IsQuotedInUsd: true}}
limit: {count: 10}
orderBy: {descending: Interval_Time_Start}
) {
Token {
Name
Address
Id
NetworkBid
}
Price {
Average {
Mean
Estimate
ExponentialMoving
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
```
## Get OHLC candles for a token pair
This is the candle endpoint DEX Screener does not have. It fetches Open, High, Low and Close prices in USD for a token pair across DEXs, at the interval you set in seconds. Put the base and quote token addresses in the `Token.Id` and `QuoteToken.Id` filters and set `Interval.Time.Duration` to the candle size (`3600` for one hour, `60` for one minute). The query returns the most recent candles sorted by interval start. Saved query [here](https://ide.bitquery.io/ohlc-of-a-solana-token-pair-1-hour-interval).
For long histories and other aggregate windows, see [Historical Solana data](/docs/blockchain/Solana/historical-aggregate-data).
```graphql
query MyQuery {
Trading {
Pairs(
where: {Token: {Id: {is: "bid:solana:So11111111111111111111111111111111111111112"}}, QuoteToken: {Id: {is: "bid:solana:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Interval: {Time: {Duration: {eq: 3600}}}, Price: {IsQuotedInUsd: true}}
limit: {count: 10}
orderBy: {descending: Interval_Time_Start}
) {
Token {
Name
Address
Id
NetworkBid
}
QuoteToken{
Name
Address
Id
NetworkBid
}
Price {
Average {
Mean
Estimate
ExponentialMoving
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
}
}
}
```
## Buy volume, sell volume, buys, sells, makers, buyers and sellers for a pair {#pair-stats}
This is the query behind a DEX Screener pair row: total and 5-minute buy and sell volume, trade counts, unique makers, buyers and sellers, and the price at the start of the window, five minutes ago, and now.
Two things make it reliable:
- **`since_relative` / `after_relative` instead of absolute timestamps.** The window is always "the last hour" and "the last 5 minutes" no matter when the query runs. A hardcoded date silently widens every day it sits in your code.
- **`Transaction: { Result: { Success: true } }`** drops failed transactions, which otherwise inflate trade counts and volume.
```graphql
query PairStats($token: String!, $side_token: String!, $pair_address: String!) {
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_relative: { hours_ago: 1 } } }
}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
price_start: PriceInUSD(minimum: Block_Time)
price_5min_ago: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
price_now: 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_relative: { minutes_ago: 5 } } } }
)
buyers: count(distinct: Transaction_Signer, if: { Trade: { Side: { Type: { is: buy } } } })
sellers: count(distinct: Transaction_Signer, if: { Trade: { Side: { Type: { is: sell } } } })
trades: count
trades_5min: count(if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
traded_volume: sum(of: Trade_Side_AmountInUSD)
traded_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
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 } } } })
buys: count(if: { Trade: { Side: { Type: { is: buy } } } })
sells: count(if: { Trade: { Side: { Type: { is: sell } } } })
}
}
}
```
Variables. This example uses the **WSOL/USDC Orca Whirlpool**, a long-lived pool that will still be there when you run it:
```json
{
"token": "So11111111111111111111111111111111111111112",
"side_token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"pair_address": "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"
}
```
:::tip Choosing a `pair_address`
Two traps here.
**Aggregators return an empty `MarketAddress`.** Routers such as Jupiter, dflow and Aquifer carry large volume but expose no single pool, so filtering by `Market.MarketAddress` on them yields nothing. Filter on an AMM pool (Whirlpool, Raydium, PumpSwap) instead.
**Memecoin pools are short-lived.** A pump.fun graduate can do eight figures of volume in one hour and almost nothing an hour later, so a mint that looks ideal today may be dead by the time you copy the query. Use [Get top pairs on Solana](#top-pairs) to find a currently active pool, then substitute its address here.
:::
## Get top pairs on Solana {#top-pairs}
This returns the top 10 Solana pairs by trade count over the last hour, with total trades, buys, sells, traded volume and buy volume, the data behind a screener leaderboard or a "trending" list. Use it to find a currently active pool to plug into the [pair stats query](#pair-stats) above.
`since_relative` keeps the window rolling, so there is no date to update.
Note you cannot run this as a WebSocket subscription: aggregate functions like `sum` do not work in `subscription`.
You can find the query [here](https://ide.bitquery.io/Dexscreener--All-in-One-query_1)
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}, Trade: {Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Block: {Time: {since_relative: {hours_ago: 1}}}}
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_relative: {minutes_ago: 5}}}}
)
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}}}})
}
}
}
```
## New pairs and new pools
DEX Screener's "new pairs" tab is a stream of pool creations. On Bitquery that is the DEXPools cube, which reports every new liquidity pool with its tokens and initial liquidity, and can be subscribed to over WebSocket. The queries live on the [Solana DEX Pools API page](/docs/blockchain/Solana/Solana-DexPools-API). Launchpad tokens that have not reached a pool yet are covered by the [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/).
---
## Trader-focused trade APIs (with USD price, market cap and supply)
The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which.
### Get all DEX trades on Solana with price, market cap and supply
Stream **all Solana DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Network: Solana`** to capture every swap across **Raydium**, **Orca**, **Jupiter**, **PumpSwap**, and other Solana DEXs in a single subscription.
You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-Solana-with-Price-Marketcap-supply).
Click to expand GraphQL query
```graphql
subscription {
Trading {
Trades(where: { Pair: { Market: { Network: { is: "Solana" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
```
### Top traders by PnL for a specific pool (last 30 minutes)
Rank traders by **`PnL`** on one pool: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **pool-specific trader analytics**. The example pool is the WSOL/USDC Orca Whirlpool; swap in any active pool address from the [top pairs query](#top-pairs).
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-pair#).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
limit: { count: 10 }
orderBy: [{ descendingByField: "PnL" }]
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Address: { is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE" }
}
}
}
) {
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" } })
}
}
}
```
---
## API key, trial and pricing
You need a Bitquery access token to run these outside the IDE. Create one at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/); there is no approval step. The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). How points and streams are billed is on [how billing works](/docs/plans/how-billing-works/), and plan prices are on the [pricing page](https://bitquery.io/pricing).
## DEX Screener API compared with Bitquery
| | DEX Screener public API | Bitquery |
|---|---|---|
| Access | Public REST, no key listed in the reference | Access token from account.bitquery.io, free trial |
| Rate limit | 300 requests a minute (pairs, tokens, search), 60 (profiles, boosts, ads) | 30, 90 or 240 requests a minute by plan, custom on Enterprise |
| Data shape | Current snapshot of a pair or token | Trades, pools, balances, transfers and aggregates, current and historical |
| Candles and history | Not in the reference | OHLC at any interval, full trade history |
| Real-time delivery | WebSocket for profiles, boosts and ads; polling for pair data | WebSocket subscriptions for trades, pools and prices, Kafka, gRPC |
| Screener aggregates | Volume and transaction counts per pair | Volume, trades, distinct makers, buyers and sellers per window, top pairs, trader PnL |
| Chains | Multi-chain | Solana plus the EVM chains on the [EVM page](/docs/blockchain/Ethereum/dextrades/DEXScreener/evm_dexscreener/) |
## Video tutorial on how to get Solana DEXTrades data just like DEXScreener from Bitquery API
## Video tutorial | How to get buys, sells, buy volume, sell volume, makers and trades for a specific Solana token pair
## Related pages
- [Solana API hub](/docs/blockchain/Solana/)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades)
- [Solana DEX Pools API](/docs/blockchain/Solana/Solana-DexPools-API)
- [Historical Solana data and OHLC](/docs/blockchain/Solana/historical-aggregate-data)
- [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [DEXScreener EVM API](/docs/blockchain/Ethereum/dextrades/DEXScreener/evm_dexscreener/)
- [How Bitquery compares with other APIs](/docs/api-comparison)
---
## FOMO App Trades API: Wallets, Tokens and Fees on Solana
URL: https://docs.bitquery.io/docs/blockchain/Solana/fomo-api/
Query FOMO app trades on Solana with Bitquery GraphQL: live trades, one wallet's trades, top tokens, active wallets, fees and daily activity. Not affiliated with FOMO.
# FOMO App Trades API: Wallets, Tokens and Fees on Solana
[FOMO](https://fomo.family) is a social trading app and website: users follow other traders and buy memecoins and other tokens without paying gas themselves. FOMO does not list a public API on fomo.family (checked 29 September 2026). This page shows how to read FOMO's Solana trades straight from the chain with Bitquery GraphQL. Bitquery is not affiliated with FOMO.
This page covers Solana only. FOMO also lets users buy tokens on EVM chains. On Robinhood Chain, which we checked, those orders are filled by Relay's solver and look like any other Relay fill; we could only tell them apart using Relay's own order records.
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## How Bitquery finds FOMO trades
FOMO uses one wallet to sign, and pay gas for, every trade its users make. Its fees arrive in USDC at a separate account:
| Role | Address |
| --- | --- |
| Signer and fee payer on every FOMO trade | `AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51` |
| FOMO fee account (USDC token account) | `HrTf9CzXR1dRH4Sof5QrpmGWwpwAf3qZzwCsEjQpXcSq` |
| Owner of the fee account | `R4rNJHaffSUotNmqSKNEfDcJE8A7zJUkaoM5Jkd7cYX` |
Bitquery identified these addresses from on-chain activity. FOMO has not published or confirmed them. If FOMO moves to new addresses, the queries on this page will return nothing, so run the check below first.
Three things to know before you read the results:
- **Not every signed transaction is a trade.** Between 12:00 and 13:00 UTC on 29 September 2026 the signer signed about 33,600 transactions, and about 26,000 of them contained a DEX trade. Count trades from DEX trade data, not from everything the signer signs.
- **Most FOMO trades go through the DFlow aggregator.** In that hour, about 22,000 of the 26,000 trades did. The DFlow row carries the user's own wallet in `Trade.Account.Owner`; in a sample of 1,166 trades it matched the wallet that paid the app's fee 94% of the time. Rows for the individual pools along the route can show a temporary token account instead, so the wallet queries on this page filter on DFlow.
- **Signer and fee payer fields always show FOMO.** FOMO pays the gas, so `Transaction.Signer` and `Transaction.FeePayer` never hold the user's wallet.
### Check that the signer is still active
This returns the latest transaction the signer has signed. A timestamp from the last few minutes means the signer is still in use.
Run it in the [IDE: signer check](https://ide.bitquery.io/fomo-signer-check).
```graphql
query FomoSignerCheck {
Solana {
Transactions(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}}
) {
Block {
Time
}
Transaction {
Signature
}
}
}
}
```
## How far back the data goes
- The trade-level queries on this page read Solana DEX trades, which cover about the last 12 hours.
- The daily query at the end uses the [Trading API](/docs/trading/trading-data-overview), which keeps about 30 days. It has no user wallet field: on every trade from the app its `Trader.Address` is the signer.
- Counts for a finished hour can still move by a few trades as recent data settles, so the figures on this page are rounded.
- The queries return USD values per trade, but this page quotes no USD totals. A single mispriced trade can distort a sum, so check outliers before you add values up.
## Latest trades
This returns the 10 most recent trades made in the app, with the token sold, the token bought and the user's wallet.
Run it in the [IDE: latest trades](https://ide.bitquery.io/fomo-latest-trades).
To stream new trades as they happen, change `query` to `subscription` and remove the `limit` and `orderBy` lines.
```graphql
query FomoLatestTrades {
Solana {
DEXTrades(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Trade: {Dex: {ProtocolName: {is: "dflow"}}}}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Buy {
Amount
AmountInUSD
Account {
Owner
}
Currency {
Symbol
MintAddress
}
}
Sell {
Amount
AmountInUSD
Currency {
Symbol
MintAddress
}
}
}
}
}
}
```
`Buy` is what the user received and `Sell` is what they paid. Most balances in the app are held in USDC, so one side is usually USDC.
## One wallet's trades
Paste a Solana wallet address into the `wallet` variable to list that wallet's recent trades in the app. The `not: ""` condition stops the query from matching trades with a blank owner if the wallet value is mistyped.
Run it in the [IDE: one wallet's trades](https://ide.bitquery.io/fomo-wallet-trades).
```graphql
query FomoWalletTrades($wallet: String) {
Solana {
DEXTrades(
limit: {count: 20}
orderBy: {descending: Block_Time}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Trade: {Dex: {ProtocolName: {is: "dflow"}}, Buy: {Account: {Owner: {is: $wallet, not: ""}}}}}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Buy {
Amount
Currency {
Symbol
MintAddress
}
}
Sell {
Amount
Currency {
Symbol
MintAddress
}
}
}
}
}
}
```
```json
{
"wallet": "PASTE_A_SOLANA_WALLET_ADDRESS"
}
```
## Top tokens bought
This ranks tokens by how many app users bought them in the last hour. USDC, which users pay with, and wrapped SOL are left out.
Run it in the [IDE: top tokens bought](https://ide.bitquery.io/fomo-top-tokens-bought).
```graphql
query FomoTopTokensBought {
Solana {
DEXTradeByTokens(
limit: {count: 10}
orderBy: {descendingByField: "buyers"}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Trade: {Dex: {ProtocolName: {is: "dflow"}}, Side: {Type: {is: buy}}, Currency: {MintAddress: {notIn: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "So11111111111111111111111111111111111111112"]}}}, Block: {Time: {since_relative: {hours_ago: 1}}}}
) {
Trade {
Currency {
Symbol
Name
MintAddress
}
}
buys: count(distinct: Transaction_Signature)
buyers: count(distinct: Trade_Account_Owner)
}
}
}
```
## Most active wallets
This lists the 10 wallets with the most trades in the app in the last hour, with how many different tokens each one traded.
Run it in the [IDE: most active wallets](https://ide.bitquery.io/fomo-most-active-wallets).
```graphql
query FomoMostActiveWallets {
Solana {
DEXTradeByTokens(
limit: {count: 10}
orderBy: {descendingByField: "trades"}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Trade: {Dex: {ProtocolName: {is: "dflow"}}}, Block: {Time: {since_relative: {hours_ago: 1}}}}
) {
Trade {
Account {
Owner
}
}
trades: count(distinct: Transaction_Signature)
tokens: count(distinct: Trade_Currency_MintAddress)
}
}
}
```
## Fees paid to the app
This counts the USDC fee payments that reached the fee account in the last hour, and how many wallets paid them. Some trades also send a second, smaller fee to another account, which this query does not include.
Run it in the [IDE: fees paid](https://ide.bitquery.io/fomo-fees).
```graphql
query FomoFees {
Solana {
Transfers(
where: {Transfer: {Receiver: {Address: {is: "HrTf9CzXR1dRH4Sof5QrpmGWwpwAf3qZzwCsEjQpXcSq"}}}, Block: {Time: {since_relative: {hours_ago: 1}}}}
) {
fee_payments: count
paying_wallets: count(distinct: Transfer_Sender_Owner)
usdc_total: sum(of: Transfer_Amount)
}
}
}
```
In that same 12:00 to 13:00 UTC hour on 29 September 2026, the fee account received about 25,900 payments, close to one per trade.
## Trades and traders per hour
This shows activity for each hour of the last 12. The first list counts all trades. The second counts distinct user wallets, using the DFlow rows.
Run it in the [IDE: activity per hour](https://ide.bitquery.io/fomo-hourly-activity).
```graphql
query FomoHourlyActivity {
Solana {
trades: DEXTradeByTokens(
orderBy: {descendingByField: "Block_Time"}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Block: {Time: {since_relative: {hours_ago: 12}}}}
) {
Block {
Time(interval: {in: hours, count: 1})
}
trades: count(distinct: Transaction_Signature)
}
traders: DEXTradeByTokens(
orderBy: {descendingByField: "Block_Time"}
where: {Transaction: {Signer: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Trade: {Dex: {ProtocolName: {is: "dflow"}}}, Block: {Time: {since_relative: {hours_ago: 12}}}}
) {
Block {
Time(interval: {in: hours, count: 1})
}
traders: count(distinct: Trade_Account_Owner)
}
}
}
```
## Trades per day
This uses the [Trading API](/docs/trading/trading-data-overview) to count trades and distinct tokens for each of the last 7 days. The Trading API can store more than one row per trade and repeats a small share of rows, so the query counts distinct transactions. The first day in the window is partial.
Run it in the [IDE: trades per day](https://ide.bitquery.io/fomo-daily-activity).
```graphql
query FomoDailyActivity {
Trading {
Trades(
orderBy: {descendingByField: "Block_Date"}
where: {Trader: {Address: {is: "AgmLJBMDCqWynYnQiPCuj9ewsNNsBJXyzoUhD9LJzN51"}}, Block: {Time: {since_relative: {days_ago: 7}}}}
) {
Block {
Date
}
trades: count(distinct: TransactionHeader_Hash)
tokens: count(distinct: Pair_Token_Id)
}
}
}
```
From 23 to 28 September 2026, the Trading API counted between about 925,000 and 1.21 million FOMO trades on Solana per day. For the 12:00 to 13:00 UTC hour on 29 September, this API counted about 25,600 trades against about 26,000 in the Solana DEX data above. The Trading API covers a curated set of DEXs, so expect it to run slightly lower.
## What this page cannot do
- **Link usernames to wallets.** Profiles live in the app, not on-chain.
- **Track the app's EVM-chain orders.** On Robinhood Chain they are filled by a bridge solver, and only the bridge's own records show which fills came from FOMO.
- **Show one wallet's history older than about 12 hours.** The Trading API keeps 30 days but records the app's signer as the trader, not the user.
## Related pages
- [Trading API overview](/docs/trading/trading-data-overview)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades)
- [Solana Transfers API](/docs/blockchain/Solana/solana-transfers)
- [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [GMGN Solana API](/docs/blockchain/Solana/solana-gmgn-api)
---
## GMGN Solana API | Trending Tokens
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-gmgn-api/
GMGN-style Solana data: trending tokens, real-time pair trades, buy and sell volume, top pairs, OHLC, wallet portfolios, and top buyers and sellers.
# GMGN Solana API
:::tip Need real-time GMGN-style 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**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) 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 GMGN-style trader data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Replicate **GMGN**-style **Solana** analytics with Bitquery: **trending tokens**, **top DEX pairs**, **aggregate stats** (buys, sells, buy/sell volume, makers, buyers, sellers), **live trades per pair**, **OHLC** for charts, **volume by token**, and **top traded pairs**. Uses **`DEXTradeByTokens`** and **`Solana`** GraphQL, some patterns work as **queries** only when they rely on heavy aggregates (see notes below).
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## Related APIs
- **[GMGN API for Ethereum & EVM](/docs/blockchain/Ethereum/dextrades/evm-gmgn-api)**: **GMGN**-style **trending pairs**, token stats, **OHLC**, and **liquidity** on **Ethereum** and other **EVM** chains.
- **[Solana DEX trades API](/docs/blockchain/Solana/solana-dextrades)**: Core **`DEXTrades`** / streaming patterns for **Solana** swaps and pair activity.
- **[Raydium DEX API](/docs/blockchain/Solana/Solana-Raydium-DEX-API)**: **Raydium** pools, trades, and liquidity, a common source for **Solana** screener UIs.
- **[Solana DEXScreener API](/docs/blockchain/Solana/DEXScreener/solana_dexscreener)**: **DEXScreener**-style Solana **pair** and **price** examples.
- **[Solana GeckoTerminal API](/docs/blockchain/Solana/solana-geckoterminal-api)**: **GeckoTerminal**-style charts and **OHLC** on **Solana**.
## GMGN Trending API
The query will give you the Top 10 trending tokens on GMGN in last 1 hour. You can find the query [here](https://ide.bitquery.io/gmgn-trending-api_1)
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since_relative: { hours_ago: 1 } } }
Transaction: { Result: { Success: true } }
Trade: {
Side: {
Currency: {
MintAddress: {
in: [
"So11111111111111111111111111111111111111112"
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
]
}
}
}
Currency: {
MintAddress: {
notIn: [
"So11111111111111111111111111111111111111112"
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"
]
}
}
}
}
limit: { count: 10 }
orderBy: { descendingByField: "trades_count" }
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Dex {
ProtocolName
ProtocolFamily
}
Market {
MarketAddress
}
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
trades_count: count
}
}
}
```
## Get Trade Transactions of GMGN for a particular pair in realtime
The query will subscribe you to real-time trade transactions for a Solana pair, providing a continuous stream of data as new trades are processed and recorded.
You can find the query [here](https://ide.bitquery.io/Get-Solana-pair-trades-data)
```graphql
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 GMGN
The below query gives you the essential stats for a token such as buy volume, sell volume, total buys, total sells, makers, total trade volume, buyers, sellers (in last 5 min, 1 hour) of a specific token.
You can run the query [here](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair)
```graphql
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":"token mint address",
"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 GMGN
The query will give the top 10 pairs on Solana network in descending order of their total trades happened in their pools in last 1 hour. This query will get you all the data you need such as total trades, total buys, total sells, total traded volume, total buy volume
Please change the `Block: {Time: {since: "2024-08-15T04:19:00Z"}}` accordingly when you try out the query.
Keep in mind you cannot use this as a websocket subscription becuase aggregate functions like `sum` doesn't work well in `subscription`.
You can find the query [here](https://ide.bitquery.io/GMGN--All-in-One-query_1)
```graphql
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
You can use the below query to build charts like how you see on BullX. You will get OHLC data for a token pair using below query. Test the API [here](https://ide.bitquery.io/Solana-OHLC-Query_5)
```graphql
{
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 query will give you top traded pairs data. You can find the query [here](https://ide.bitquery.io/top-trading-pairs?_gl=1*131rbu4*_ga*MTU0ODE3ODUxMy4xNzM5Nzg0Njcw*_ga_ZWB80TDH9J*MTc0MjQ2MjAwNi43Ny4xLjE3NDI0NjIwNDQuMC4wLjA.).
```graphql
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](/docs/trading/crypto-trades-api/trades-api/) 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](https://ide.bitquery.io/trade_volume_Solana#).
```graphql
{
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)
}
}
}
```
## Which DEX markets trade a token?
Lists **Solana DEX programs** where a mint trades against a **base** (e.g. **WSOL**), with **volume**, **trade count**, **unique counter-currencies**, and **price** snapshots. Swap the variable mint for your token.
[Run in Bitquery IDE](https://ide.bitquery.io/DEX-Markets-for-a-token)
```graphql
query (
$token: String
$base: String
$time_10min_ago: DateTime
$time_1h_ago: DateTime
$time_3h_ago: DateTime
) {
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "amount" }
where: {
Trade: {
Currency: { MintAddress: { is: $token } }
Side: {
Amount: { gt: "0" }
Currency: { MintAddress: { is: $base } }
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { after: $time_3h_ago } }
}
) {
Trade {
Dex {
ProtocolFamily
ProtocolName
}
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)
}
amount: sum(of: Trade_Side_Amount)
pairs: uniq(of: Trade_Side_Currency_MintAddress)
trades: count
}
}
}
```
```json
{
"token": "59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN",
"base": "So11111111111111111111111111111111111111112",
"time_10min_ago": "2024-09-19T10:45:46Z",
"time_1h_ago": "2024-09-19T09:55:46Z",
"time_3h_ago": "2024-09-19T07:55:46Z"
}
```
## SPL tokens owned by a wallet (portfolio)
**`BalanceUpdates`** for one **owner** address: current **post-balances** per mint, similar to a **wallet portfolio** view on explorers and terminal UIs.
[Run in Bitquery IDE](https://ide.bitquery.io/tokens-owned-by-an-address)
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Account: {
Owner: { is: "AtTjQKXo1CYTa2MuxPARtr382ZyhPU5YX4wMMpvaa1oy" }
}
}
}
orderBy: { descendingByField: "BalanceUpdate_Balance_maximum" }
) {
BalanceUpdate {
Balance: PostBalance(maximum: Block_Slot)
Currency {
Name
Symbol
}
}
}
}
}
```
## Top buyers of a token
Ranks **accounts** by **buy-side USD** for a fixed **mint** (example: **RAY**). Use for **whale / smart money** style leaderboards.
[Run in Bitquery IDE](https://ide.bitquery.io/top-buyers-of-a-token_2)
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "buy" }
where: {
Trade: {
Currency: {
MintAddress: { is: "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" }
}
}
Transaction: { Result: { Success: true } }
}
limit: { count: 10 }
) {
Trade {
Account {
Address
Token {
Owner
}
}
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
}
}
}
```
## Top sellers of a token
Same pattern as **top buyers**, ordered by **sell-side** flow for the same mint.
[Run in Bitquery IDE](https://ide.bitquery.io/top-sellers-of-a-token_2)
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "sell" }
where: {
Trade: {
Currency: {
MintAddress: { is: "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R" }
}
}
Transaction: { Result: { Success: true } }
}
limit: { count: 10 }
) {
Trade {
Account {
Address
Token {
Owner
}
}
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
}
}
}
```
## Video Tutorial
### Get GMGN Terminal Data with Bitquery API and Streams
---
## GeckoTerminal-style Solana API: Pair Trades, Buys, Sells, Makers, Top Pairs
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-geckoterminal-api/
GeckoTerminal-style Solana pool data with Bitquery GraphQL: live pair trades, buys, sells, makers and volume, 1-minute candles, pool reserves, and top pairs.
# GeckoTerminal-style Solana API: Pair Trades, Buys, Sells, Makers, Top Pairs
A GeckoTerminal pool page is a handful of numbers over one market: the trades scrolling in, buys against sells, how many wallets made them, the volume, the candles and the reserves. Each of those is one Bitquery query over the Solana `DEXTradeByTokens` and `DEXPools` cubes, filtered on the pool's market address, and the same queries cover every Solana DEX Bitquery indexes. The worked pool is the WSOL/USDC Orca Whirlpool at `Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE`, one of the busiest markets on the chain, so every example returns rows at any hour. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; Solana queries go to the `eap` endpoint. The [EVM version](/docs/blockchain/Ethereum/dextrades/evm-geckoterminal-api/) covers Ethereum and the other EVM chains.
## Recommended: Trading API queries (real-time + last ~30 days)
### Live trades with USD price, market cap and supply
Streams MEV-filtered trades across all 10 chains; add `Network: {is: "Solana"}` inside `Pair.Market` to scope to one chain. Run it [in the IDE](https://ide.bitquery.io/Trading-API-Live-Trades-All-Chains).
```graphql
subscription {
Trading {
Trades {
Block { Time }
Price
PriceInUsd
Amounts { Base Quote }
AmountsInUsd { Base Quote }
Trader { Address }
Pair {
Token { Symbol Network }
QuoteToken { Symbol }
Market { Protocol Network }
}
}
}
}
```
### Most accurate token price with 1-minute OHLC (top market)
Returns the token's price from its top-volume market via `Ranking: { Position: { eq: 1 } }`; swap the token address and network for your token. Run it [in the IDE](https://ide.bitquery.io/Trading-API-Token-Price-Top-Market-Rank-1).
```graphql
{
Trading {
Pairs(
where: {
Token: {Address: {is: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"}, Network: {is: "Solana"}}
Ranking: {Position: {eq: 1}}
Interval: {Time: {Duration: {eq: 60}}}
Price: {IsQuotedInUsd: true}
}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
Token { Symbol Address }
QuoteToken { Symbol }
Market { Protocol Address Network }
Price { IsQuotedInUsd Ohlc { Open High Low Close } Average { Mean } }
Volume { Base Usd }
Block { Time }
}
}
}
```
The chain-level queries below are the tool for history older than about 30 days and for per-pool detail.
## Live trades of a pool
Filter `Trade.Market.MarketAddress` and put the token you want priced under `Trade.Currency`. Each message is one swap with the amount, the price in the counter token and in USD, the side and the signer. Saved stream [here](https://ide.bitquery.io/Get-Solana-pair-trades-data-just-like-geckoTerminal_1).
```graphql
subscription {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Market: { MarketAddress: { is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE" } }
Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Currency {
Symbol
}
Amount
Price
PriceInUSD
Side {
Currency {
Symbol
}
Amount
Type
}
}
Transaction {
Maker: Signer
Signature
}
}
}
}
```
## Buys, sells, makers, buyers, sellers and volume of a pool
The stat block of a pool page in one query: the last hour with a five-minute sub-window on every metric. `Side.Type` names the counter-side of each trade, so WSOL was bought where the side was sold, and wallets are counted by transaction signer. Saved query [here](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair00_2).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Market: { MarketAddress: { is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE" } }
Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } }
}
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
) {
Trade {
Currency {
Symbol
MintAddress
}
Side {
Currency {
Symbol
}
}
start: PriceInUSD(minimum: Block_Slot)
min5: PriceInUSD(minimum: Block_Slot, if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
end: PriceInUSD(maximum: Block_Slot)
}
trades: count
trades5m: count(if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
buys: count(if: { Trade: { Side: { Type: { is: sell } } } })
sells: count(if: { Trade: { Side: { Type: { is: buy } } } })
makers: uniq(of: Transaction_Signer)
makers5m: uniq(of: Transaction_Signer, if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
buyers: uniq(of: Transaction_Signer, if: { Trade: { Side: { Type: { is: sell } } } })
sellers: uniq(of: Transaction_Signer, if: { Trade: { Side: { Type: { is: buy } } } })
volumeUsd: sum(of: Trade_Side_AmountInUSD)
volumeUsd5m: sum(of: Trade_Side_AmountInUSD, if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
buyVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } })
sellVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } })
}
}
}
```
## One-minute candles for the pool
Thirty one-minute candles with volume and trade count. `PriceAsymmetry` below 0.1 drops trades whose two sides disagree on price.
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Market: { MarketAddress: { is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE" } }
Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } }
PriceAsymmetry: { lt: 0.1 }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { minutes_ago: 30 } } }
}
limit: { count: 30 }
orderBy: { descendingByField: "Block_Timefield" }
) {
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
}
}
}
```
## Reserves of the pool
The newest `DEXPools` row for the market carries both reserves after the last change, with the quote side in USD.
```graphql
{
Solana {
DEXPools(
where: {
Pool: { Market: { MarketAddress: { is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE" } } }
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Block {
Time
}
Pool {
Dex {
ProtocolName
}
Market {
BaseCurrency {
Symbol
}
QuoteCurrency {
Symbol
}
}
Base {
PostAmount
}
Quote {
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
## Top pairs on Solana
The busiest WSOL-quoted markets of the last hour with the numbers a pair list shows. Aggregates only run as queries, so poll this rather than subscribing. Saved query [here](https://ide.bitquery.io/Get-Top-Pairs-on-Solana-on-GeckoTerminal_1).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }
}
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
orderBy: { descendingByField: "trades" }
limit: { count: 10 }
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Market {
MarketAddress
}
Dex {
ProtocolName
}
start: PriceInUSD(minimum: Block_Slot)
min5: PriceInUSD(minimum: Block_Slot, if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
end: PriceInUSD(maximum: Block_Slot)
}
makers: uniq(of: Transaction_Signer)
trades: count
volumeUsd: sum(of: Trade_Side_AmountInUSD)
buyVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } })
sellVolumeUsd: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } })
buys: count(if: { Trade: { Side: { Type: { is: sell } } } })
sells: count(if: { Trade: { Side: { Type: { is: buy } } } })
}
}
}
```
## Video Tutorial
### Get Gecko Terminal Data with Bitquery API and Streams
## Related pages
- [Solana DEX trades API](/docs/blockchain/Solana/solana-dextrades)
- [GeckoTerminal-style EVM API](/docs/blockchain/Ethereum/dextrades/evm-geckoterminal-api/)
- [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)
- [Solana API hub](/docs/blockchain/Solana/)
---
## GoonFi API: Solana Trades, Prices, OHLC and Volume
URL: https://docs.bitquery.io/docs/blockchain/Solana/goonfi-api/
GoonFi API on Solana: stream v2 swaps with USD price and market cap, read OHLC candles, top traders and pool volume through Bitquery GraphQL.
# GoonFi API: Solana Trades, Prices, OHLC and Volume
:::tip Need real-time GoonFi data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered GoonFi swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical GoonFi data older than ~30 days**, raw per-swap detail, or call / event context.
:::
## GoonFi Trades in Real-Time
This streams a message for every new GoonFi trade, carrying the buy and sell sides, the block and the transaction.
Open it in the [Bitquery IDE: realtime GoonFi trades](https://ide.bitquery.io/Real-time-trades-on-goonfi-DEX-on-Solana_1).
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Market cap (Trading API)
Use **Trading** **`Pairs`** with **`Market.Program`** **`goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE`** (GoonFi v2 DEX program) for aggregated **market cap**, **FDV**, **supply**, **price**, and **volume**. Replace **`solana:`** in **`Token.Id`** with your token.
### Get latest market cap for a specific GoonFi v2 token
**`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, **`Token.Id`** with **`includesCaseInsensitive`**, interval duration **> 1** second, **`Market.Program`** matching GoonFi v2.
Open it in the [Bitquery IDE: GoonFi token market cap](https://ide.bitquery.io/specific-goonfi-v2-token-latest-marketcap).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: {
Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" }
Network: { is: "Solana" }
}
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 1 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
### Stream GoonFi v2 tokens with market cap above $10K
Subscribe when the token is on **Solana**, **`Market.Program`** is GoonFi v2, **`Supply.MarketCap`** **> 10,000** (USD), and interval duration **> 1** second. Adjust **`gt`** to change the threshold.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-goonfi-v2-tokens-with-marketcap-above-10k-marketcap).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
## Latest Price of a Token on GoonFi
This returns the most recent trade for a token on GoonFi, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest price of a GoonFi token](https://ide.bitquery.io/latest-price-of-a-token-on-GoonFi_1).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Currency{
Name
Symbol
MintAddress
}
}
}
}
}
```
## Realtime Price feed of a Token on GoonFi
The same filter as a subscription pushes a message on every new trade, giving a live price feed instead of a single reading.
Open it in the [Bitquery IDE: GoonFi realtime price feed](https://ide.bitquery.io/Realtime-Price-feed-of-a-Token-on-GoonFi_1).
```graphql
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Currency{
Name
Symbol
MintAddress
}
}
}
}
}
```
## GoonFi OHLC API - query
For OHLC candles on a GoonFi pair, use [this endpoint](https://ide.bitquery.io/GoonFi-OHLC-API_1) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}, 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
}
}
}
```
## GoonFi Realtime OHLC, Price, Volume API - Crypto Price API
Below API will give you realtime prices, OHLC, and volume data for all GoonFi trading pairs. We have selected `1` sec as the interval for the OHLC, volume or moving average calculation. You can select any other interval as well like 5 sec, 30 sec, 60 sec, 3600 sec, etc.
Try the API [here](https://ide.bitquery.io/GoonFi-Realtime-OHLC-Price-Volume-API---Crypto-Price-API_1).
```graphql
subscription MyQuery {
Trading {
Pairs(
where: {Market: {Program: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}, Network: {is: "Solana"}}, Interval: {Time: {Duration: {eq: 1}}}}
) {
Interval {
Time {
Duration
Start
End
}
}
Market {
Name
Address
Program
}
Token {
Name
Symbol
Address
}
Price {
Average {
Estimate
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
QuoteToken {
Name
Symbol
Address
}
}
}
}
```
## Get the Top Traders of a specific Token on GoonFi DEX
This ranks the wallets trading a given token on GoonFi, here USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`). Run it as a plain request, not a WebSocket subscription: aggregates are recomputed per message on a subscription, so the totals come back wrong. Open it in the [Bitquery IDE: GoonFi top traders](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-Token-on-GoonFi-DEX_1).
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
```
## Get trading volume, buy volume, sell volume of a token on GoonFi
This uses the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price, and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. The pair is written WSOL/USDC because that is how the Trading cube orients this market; the USD total is the same either way, but the buy and sell split follows the base token. Widen `days_ago` for longer windows, and for spans beyond a few days prefer [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs/) with `sum(of: Volume_Usd)` over hourly intervals, which is pre-aggregated and much cheaper than scanning every trade.
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: {
Program: { is: "goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE" }
Network: { is: "Solana" }
}
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: 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)
}
}
}
```
---
## LetsBonk.Fun API - Solana - New Tokens, Trades, Live Prices
URL: https://docs.bitquery.io/docs/blockchain/Solana/letsbonk-api/
LetsBonk.fun on Solana: new tokens, bonding curve progress, about-to-graduate tokens, Raydium migrations, trades, prices, top buyers, OHLCV and liquidity.
# LetsBonk.Fun API - Solana - New Tokens, Trades, Live Prices
:::tip Need real-time LetsBonk.fun data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical LetsBonk.fun data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this document, we will explore several examples related to LetsBonk.fun. You can also check out our [Pump Fun API Docs](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) and [FourMeme API Docs](/docs/blockchain/BSC/four-meme-api/). For StonkFun launches on the same Raydium LaunchLab program, see the [StonkFun API](/docs/blockchain/Solana/stonkfun-api/) docs. For live DEX prices and volume across LetsBonk tokens, see [DEXrabbit's LetsBonk category](https://dexrabbit.bitquery.io/categories/letsbonk-fun-ecosystem).
:::note
**LetsBonk.fun tokens are created and traded on Raydium Launchlab.**
:::
Need zero-latency LetsBonk.fun data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## Track LetsBonk.fun Token Creation
Using [this](https://ide.bitquery.io/latest-token-created-on-letsbonk-fun-in-realtime_2) query, we can get the realtime created LetsBonk.fun tokens.
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { is: "initialize_v2" }
}
Accounts: {
includes: {
Address: { is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Bonding Curve Progress API
Below query will give you the Bonding curve progress percentage of a specific LetsBonk.fun Token.
### Bonding Curve Progress Formula
- **Formula**:
BondingCurveProgress = 100 - ((leftTokens \* 100) / initialRealTokenReserves)
Where:
- leftTokens = realTokenReserves - reservedTokens
- initialRealTokenReserves = totalSupply - reservedTokens
- **Definitions**:
- `initialRealTokenReserves` = `totalSupply` - `reservedTokens`
- `totalSupply`: 1,000,000,000 (LetsBonk.fun Token)
- `reservedTokens`: 206,900,000
- Therefore, `initialRealTokenReserves`: 793,100,000
- `leftTokens` = `realTokenReserves` - `reservedTokens`
- `realTokenReserves`: Token balance at the market address.
:::note
**Simplified Formula**:
BondingCurveProgress = 100 - (((balance - 206900000) \* 100) / 793100000)
:::
### Additional Notes
- **Balance Retrieval**:
- The `balance` is the token balance at the market address.
- Use this query to fetch the balance and then we use `expressions` to calculate the bonding curve progress percentage in the query itself: [Query Link](https://ide.bitquery.io/bonding-curve-progress-percentage-of-a-letsbonkfun-token).
Click to expand GraphQL query
```graphql
query GetBondingCurveProgressPercentage {
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Slot }
where: {
Pool: {
Market: {
BaseCurrency: {
MintAddress: {
is: "CctsjizSC6pwf2T8bhdHdZTEV4PEcfXoumjeK7FBbonk"
}
}
}
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
}
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100-((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
Balance: PostAmount
}
}
}
}
}
```
## Track LetsBonk.fun Tokens above 95% Bonding Curve Progress in realtime
We can use above Bonding Curve formulae and get the Balance of the Pool needed to get to 95% and 100% Bonding Curve Progress range. And then track liquidity changes which result in `Base{PostAmount}` to fall in this range. Run the query: [LetsBonk.fun tokens between 95–100% bonding-curve progress ➤](https://ide.bitquery.io/LetsBonkfun-Tokens-between-95-and-100-bonding-curve-progress_2).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
DEXPools(
where: {
Pool: {
Base: { PostAmount: { gt: "206900000", lt: "246555000" } }
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Top 100 About to Graduate LetsBonk.fun Tokens
We can use below query to get top 100 About to Graduate LetsBonk.fun Tokens. Run the query: [Top 100 tokens about to graduate (Raydium LaunchLab) ➤](https://ide.bitquery.io/Top-100-graduating-raydium-launchlab-tokens-in-last-5-minutes).
Click to expand GraphQL query
```graphql
{
Solana {
DEXPools(
limitBy: { by: Pool_Market_BaseCurrency_MintAddress, count: 1 }
limit: { count: 100 }
orderBy: { ascending: Pool_Base_PostAmount }
where: {
Pool: {
Base: { PostAmount: { gt: "206900000" } }
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { minutes_ago: 5 } } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount(maximum: Block_Time)
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Get all the instructions of Raydium LaunchLab
Below query will get you all the instructions that the Raydium LaunchLab Program has. Run the query: [All instructions of Raydium LaunchLab program ➤](https://ide.bitquery.io/all-the-instructions-of-Raydium-LaunchLab).
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}}}}
) {
Instruction {
Program {
Method
}
}
count
}
}
}
```
## Track LetsBonk.fun Token Migrations to Raydium DEX and Raydium CPMM in Realtime
Using above `get all instructions` api, you will figure out that there are 2 instructions `migrate_to_amm`, `migrate_to_cpswap` whose invocations migrate the Raydium LaunchLab Token to Raydium V4 AMM and Raydium CPMM Dexs respectively.
Thats why we have filtered for these 2 instructions in the below API, and tracking these. And `FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1` is the LetsBonk.fun Platform address, and we are filtering for the instructions where the above listed methods are invoked and the letsbonk.fun platform config address is present in Instruction Accounts Array.
Run the stream: [Track LetsBonk.fun token migrations to Raydium ➤](https://ide.bitquery.io/Track-letsBonkfun-Token-Migrations-to-Raydium-DEX-and-Raydium-CPMM-in-realtime).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm", "migrate_to_cpswap"]}}, Accounts: {includes: {Address: {is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1"}}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Program {
Method
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
}
Type
Name
}
Name
}
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Track LetsBonk.fun, Raydium Launchlab, Meteora DBC, Boop.fun and Moonshot Token Migrations in a single subscription
Use this single subscription to stream real-time token migration events across Boop.fun, Raydium Launchlab, Meteora DBC, and Moonshot. It filters by the respective program IDs and migration methods, returning block time, program details, involved accounts, and transaction signatures as events occur.
Try out the [API](https://ide.bitquery.io/Raydium-Launchlab-Meteora-DBC-BoopFun-Moonshot-LetsBonkfun-token-migrations-in-realtime_2) here on IDE.
Click to expand GraphQL query
```graphql
subscription{
Solana {
Instructions(
where: {any: [{Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {is: "initialize_v2"}}}}, {Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "graduate"}}}}, {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "migrateFunds"}}}}, {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}}}, {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm", "migrate_to_cpswap"]}}, Accounts: {includes: {Address: {is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1"}}}}}], Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Launchlab
# boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4 - boop.fun
# MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG - Moonshot/Moonit
# dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN - Meteora DBC
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Program Address and FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1(letsbonk.fun platform config addr) is present in Accounts array then its Letsbonk.fun migration
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Latest Trades of LetsBonk.fun Tokens using the Trading API
This query fetches the most recent LetsBonk.fun trades from the [Trading cube](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) — by filtering on the Raydium LaunchLab program address. Every row includes the USD price and market cap of the token at the time of the trade. To narrow it down to a single token, add `Currency: { Id: { is: "token Mint Address" } }` inside the `Pair` filter.
Run the query: [LetsBonk trades using Trading API ➤](https://ide.bitquery.io/Lets-bonk-using-Trading-API)
Click to expand GraphQL query
```graphql
query LatestLetsBonkTrades {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
}
}
}
orderBy: { descending: Block_Time }
limit: { count: 50 }
) {
Side
Block {
Time
}
Price
PriceInUsd
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
}
Trader {
Address
}
Pair {
Currency {
Symbol
Name
}
QuoteCurrency {
Symbol
}
Market {
Address
Program
Network
Protocol
}
}
}
}
}
```
Note that in `Trading.Trades`, `Price` and `PriceInUsd` are plain float fields with no sub-selection.
To get trades in real time, change `query` to `subscription` and remove the `orderBy` and `limit` arguments. The same can be tracked using [Bitquery Kafka Streams](/docs/streams/kafka-streaming-concepts/).
## Latest Price of a LetsBonk.fun Token on Raydium Lanchlab
This query provides the most recent price data for a specific LetsBonk.fun token `token Mint Address` launched on Raydium Launchpad. You can filter by the token’s `MintAddress`, and the query will return the last recorded trade price.
Run the query: [Latest price of a LetsBonk.fun token ➤](https://ide.bitquery.io/Latest-Price-of-a-LetsBonkfun-Token-on-Launchpad)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 1 }
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token Mint Address" } }
}
}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
PriceInUSD
Amount
Currency {
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
## Top Buyers of a LetsBonk.fun Token on LaunchPad
[This](https://ide.bitquery.io/top-buyers-of-a-letsbonkfun-token-on-launchpad) API endpoint returns the top 100 buyers for a token, which is `token Mint Address` in this case.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token Mint Address" } }
Side: { Type: { is: buy } }
}
}
orderBy: { descendingByField: "buy_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
buy_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## Top Sellers of a Token on LaunchPad
Using [this](https://ide.bitquery.io/top-sellers-of-a-letsbonkfun-token-on-launchpad_1) query top 100 sellers for the token with `Mint Address` as `token Mint Address` could be retrieved.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token Mint Address" } }
Side: { Type: { is: sell } }
}
}
orderBy: { descendingByField: "sell_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
sell_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## OHLCV for specific LetsBonk.fun Token on Raydium Launchlab
[This](https://ide.bitquery.io/ohlc-for-letsbonkfun-token) API end point returns the OHLCV vlaues for a LetsBonk.fun token with the currency `mint address` as `token mint address` when traded against WSOL.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token Mint Address" } }
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
Transaction: { Result: { Success: true } }
}
limit: { count: 100 }
orderBy: { descendingByField: "Block_Timefield" }
) {
Block {
Timefield: Time(interval: { count: 1, in: minutes })
}
Trade {
open: Price(minimum: Block_Slot)
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
close: Price(maximum: Block_Slot)
}
volumeInUSD: sum(of: Trade_Side_AmountInUSD)
count
}
}
}
```
## Get Pair Address for a LetsBonk.fun Token
[This](https://ide.bitquery.io/pool-address-for-letsbonkfun-token_1) query returns the pair address for the LetsBonk.fun token with `mint address` as `token Mint Address` on the LaunchPad exchange. The liquidity pool address is denoted by `MarketAddress`.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token Mint Address" } }
}
}
) {
Trade {
Market {
MarketAddress
}
Currency {
Name
Symbol
MintAddress
}
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
count
}
}
}
```
## Get Liquidity for a LetsBonk.fun Token Pair Address
Using [this](https://ide.bitquery.io/liquidity-for-a-Letsbonkfun-token-pair_2) query we can get the liquidity for a LaunchPad Token Pair, where `Base_PostBalance` is the amount of LaunchPad tokens present in the pool and `Quote_PostBalance` is the amount of WSOL present in the pool. For the purpose of filtering we are applying the condition that the `MarketAddress` is `insert pool address`.
Click to expand GraphQL query
```graphql
{
Solana {
DEXPools(
where: {
Pool: { Market: { MarketAddress: { is: "token pool address" } } }
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Pool {
Base {
PostAmount
}
Quote {
PostAmount
}
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
MintAddress
Name
Symbol
}
}
}
}
}
}
```
### Video Tutorial | How to get Bonding Curve Progress of any LetsBonk.fun Token
### Video Tutorial | How to track LetsBonk.fun Token Migrations to Raydium in realtime
### Video Tutorial | How to get Top 100 About to Graduate LetsBonk.fun tokens
---
## Manifest DEX API: Order Book Fills, Prices, 1-Minute OHLC and Top Traders
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-manifest-api/
Manifest, Solana's on-chain order book, via Bitquery GraphQL: live fills, USDT/USDC price and 1-minute candles, buy and sell volume and top traders.
# Manifest DEX API: Order Book Fills, Prices, 1-Minute OHLC and Top Traders
Manifest is an on-chain limit order book on Solana, program `MNFSTqtC93rEfYHB6hF82sKdZpUDFWkViLByLd1k1Ms`, and most of what trades on it is stablecoins: the USDT/USDC market at `8sjV1AqBFvFuADBCQHhotaRq5DFFYSjjg1jMyVWMqXvZ` is its busiest market by a wide margin. Because fills are matched orders rather than pool swaps, prices sit within a few basis points of parity and candles are tight, which makes Manifest a good reference market for stablecoin pricing. Bitquery records each fill in the Solana `DEXTrades` and `DEXTradeByTokens` cubes under `ProtocolFamily: "Manifest"` and `ProtocolName: "manifest"`. Every example runs in the [IDE](https://ide.bitquery.io) on a free account; Solana queries go to the `eap` endpoint. Aggregates such as candles and rankings are queries; subscriptions are for the live fill and price feeds.
## Live fills
Every Manifest fill as it lands, with both sides, the accounts and the market. Saved stream [here](https://ide.bitquery.io/manifest-dextrades).
```graphql
subscription {
Solana {
DEXTrades(where: { Trade: { Dex: { ProtocolFamily: { is: "Manifest" } } } }) {
Block {
Time
}
Trade {
Market {
MarketAddress
}
Buy {
Currency {
Symbol
MintAddress
}
Amount
AmountInUSD
Price
Account {
Address
}
}
Sell {
Currency {
Symbol
MintAddress
}
Amount
AmountInUSD
Account {
Address
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Price of USDT in USDC, right now
The newest fill in the market. `Price` is the quote per unit of the token and `PriceInUSD` its dollar value. Saved query [here](https://ide.bitquery.io/token-price-on-manifest).
```graphql
{
Solana {
DEXTradeByTokens(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Manifest" } }
Currency: { MintAddress: { is: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" } }
Side: { Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }
}
}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Market {
MarketAddress
}
}
}
}
}
```
As a subscription the same filter is a price feed that ticks on every fill. Saved stream [here](https://ide.bitquery.io/Realtime-Price-feed-of-a-Token-on-Manifest).
```graphql
subscription {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Manifest" } }
Currency: { MintAddress: { is: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" } }
Side: { Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }
}
}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Amount
}
}
}
}
```
## One-minute candles
USDT/USDC over the last hour, one row per minute with volume and fill count. `PriceAsymmetry` below 0.1 keeps fills whose two sides agree on price. Saved query [here](https://ide.bitquery.io/manifest-OHLC-API).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Manifest" } }
Currency: { MintAddress: { is: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" } }
Side: { Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }
PriceAsymmetry: { lt: 0.1 }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
limit: { count: 60 }
orderBy: { descendingByField: "Block_Timefield" }
) {
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
}
}
}
```
## Buy and sell volume of a token
Totals for USDT on Manifest over the last hour, in USD, split by direction. `Side.Type` describes the counter-side, so USDT was bought where the side was sold. Saved query [here](https://ide.bitquery.io/Get-trading-volume-buy-volume-sell-volume-of-a-token_7).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Manifest" } }
Currency: { MintAddress: { is: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" } }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
) {
trades: count
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } })
sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } })
}
}
}
```
## Top traders of a token
Rank signers by USD volume over a day. Saved query [here](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-Token-on-ManifestDEX).
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 50 }
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Manifest" } }
Currency: { MintAddress: { is: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" } }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Transaction {
Signer
}
trades: count
volumeUsd: sum(of: Trade_Side_AmountInUSD)
bought: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: sell } } } })
sold: sum(of: Trade_Amount, if: { Trade: { Side: { Type: { is: buy } } } })
}
}
}
```
## The busiest Manifest markets
Group the last day by market and token pair.
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: { Dex: { ProtocolFamily: { is: "Manifest" } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
orderBy: { descendingByField: "fills" }
limit: { count: 20 }
) {
Trade {
Market {
MarketAddress
}
Currency {
Symbol
MintAddress
}
Side {
Currency {
Symbol
MintAddress
}
}
}
fills: count
volumeUsd: sum(of: Trade_Side_AmountInUSD)
traders: uniq(of: Transaction_Signer)
}
}
}
```
## Related pages
- [Solana DEX trades API](/docs/blockchain/Solana/solana-dextrades)
- [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)
- [Solana API hub](/docs/blockchain/Solana/)
---
## Meteora DAMM v1 API: Dynamic AMM Trades and Pools
URL: https://docs.bitquery.io/docs/blockchain/Solana/Meteora-DYN-API/
Meteora DAMM v1 (Dynamic AMM) API on Solana: swaps with USD price, OHLC candles, top traders, volume and pool liquidity on the amm program via Bitquery.
# Meteora DAMM v1 API
Meteora DAMM v1 is the Dynamic AMM, Meteora's original constant-product pool program on Solana, at `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB`. It runs stable pools for pegged assets, LST pools for staked SOL, and full-range pools whose idle reserves can earn extra yield through Meteora's Dynamic Vaults. Bitquery reads its swaps, prices, candles, traders and reserves over GraphQL, WebSocket, Kafka and gRPC.
Meteora files DAMM v1 under legacy products. The pools that exist keep trading, and the deepest of them are still meaningful markets for staked SOL and stablecoins, but **new DAMM v1 pools are no longer being created**: new launches go to DAMM v2, and Dynamic Bonding Curve graduations now migrate into DAMM v2 as well. Plan integrations around the pools that exist rather than around pool creation.
:::note This page was previously published as the Meteora DYN API
"DYN" was our shorthand, not a Meteora product name. The program, the URL and every query here are unchanged; only the naming now matches [Meteora's own documentation](https://docs.meteora.ag/legacy-products/damm-v1/what-is-damm-v1).
:::
:::tip Start with the Trading API
The [**Trading API**](/docs/trading/trading-data-overview) answers most questions on this page fastest. [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) gives pre-aggregated OHLC per pool down to one second. Filter either with `Market: { Protocol: { is: "amm" } }` and `Network: { is: "Solana" }` for DAMM v1.
Drop to the chain-level cubes for pool reserves and for history older than about 30 days.
:::
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## What is the Meteora DAMM v1 program ID on Solana? {#track-latest-created-pools-on-meteora-dyn}
The Dynamic AMM program is `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` on Solana mainnet, and Meteora uses the same address on devnet. Two related programs sit beside it: Dynamic Vault at `24Uqj9JCLxUeoC3hGfh5W3s9FM9uCHDS2SG3LYwBpyTi`, which earns yield on idle reserves, and Farming at `FarmuwXPWXvefWUeqFAa5w6rifLkq5X6E8bimYvrhCB1`.
```
Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB
```
In the Trading cubes DAMM v1 is `Market.Protocol` `amm`. In the Solana chain-level cubes the rows carry `Dex.ProtocolName` `amm` and `Dex.ProtocolFamily` `Meteora`. Method names on this program are camelCase, as on DLMM: swaps are `swap`, liquidity moves are `addBalanceLiquidity` and `removeBalanceLiquidity`. DAMM v2 and DBC use snake_case instead, so do not copy method spellings between Meteora pages.
Meteora runs four trading programs on Solana, each with its own Bitquery page:
| Meteora program | Program ID | Protocol name | Bitquery page |
| --- | --- | --- | --- |
| DAMM v1, the legacy Dynamic AMM | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | `amm` | This page |
| DAMM v2, constant-product pools with position NFTs | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` | `cp_amm` | [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/) |
| DLMM, concentrated liquidity in price bins | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | `lb_clmm` | [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/) |
| Dynamic Bonding Curve, launches that graduate to a DAMM pool | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | `dynamic_bonding_curve` | [Meteora DBC API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/) |
## Does Meteora have an API?
Yes, for pool-level data. Meteora publishes a free REST [DAMM v1 Data API](https://docs.meteora.ag/developer-guides/damm-v1/api-reference/overview) at `https://damm-api.meteora.ag`, limited to 10 requests a second with no key, covering pool state and related vault data. It has no per-swap trade endpoint, no per-wallet swap history and no streaming. Bitquery reads the same activity from the chain: swaps as individual rows with the trader and a USD price, reserves after every liquidity change, and history back to mid-2024.
## Which DAMM v1 pools are still active
Since new pools are not being created, the useful starting point is a ranking of the pools that exist. This returns the busiest DAMM v1 markets over the last 24 hours by USD volume.
```graphql
{
Trading {
Pairs(
limit: { count: 25 }
orderBy: { descendingByField: "usd" }
where: {
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 3600 } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Market {
Address
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
usd: sum(of: Volume_Usd)
}
}
}
```
The examples below use JitoSOL (`J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn`), whose WSOL pool `ERgpKaq59Nnfm9YRVAAhnq16cZhHxGcDoDWCzXbhiaNw` is the deepest DAMM v1 market and one of the LST pools the program was built for.
## Meteora DAMM v1 trades in real time {#meteora-dyn-trades-in-real-time}
Stream every decoded DAMM v1 swap with the trader, both amounts and the USD price.
```graphql
subscription {
Trading {
Trades(
where: {
Pair: { Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } } }
}
) {
Block {
Time
}
Side
Price
PriceInUsd
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
TransactionHeader {
Hash
}
Pair {
Market {
Address
Protocol
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
}
}
}
}
```
Add `Pair: { Token: { Address: { is: "" } } }` to follow one token. For the lowest latency the same swaps are on the Kafka topic `solana.dextrades.proto` and the [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/); filter on `ProtocolName` `amm` in the consumer.
## Latest price of a token on Meteora DAMM v1 {#latest-price-of-a-token-on-meteora-dyn}
`Trading.Pairs` returns the latest interval for the pool with OHLC, average price and volume already computed. `Price: { IsQuotedInUsd: true }` matters: every market publishes each interval twice, once in USD and once in the quote token.
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn" } }
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
Average {
Mean
}
}
Volume {
Usd
Base
}
}
}
}
```
This is the price **on DAMM v1**. For a token's price across every venue, weighted to its deepest market, drop the protocol filter and add `Ranking: { Position: { eq: 1 } }` as described in [most accurate token price](/docs/trading/crypto-price-api/pairs/#most-accurate-token-price). On a legacy program the two often differ, because the token's main market has usually moved elsewhere.
## Real-time price feed of a token on Meteora DAMM v1 {#realtime-price-feed-of-a-token-on-meteora-dyn}
The same filter as a subscription, at one-second intervals.
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Address: { is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn" } }
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Block {
Time
}
Token {
Symbol
}
QuoteToken {
Symbol
}
Market {
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
}
}
}
}
```
## Meteora DAMM v1 OHLC API {#meteora-dyn-ohlc-api}
Candles come pre-built from `Trading.Pairs`. Set `Interval.Time.Duration` in seconds: 1, 60 or 3600.
```graphql
{
Trading {
Pairs(
limit: { count: 30 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn" } }
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 3600 } } }
}
) {
Block {
Time
}
Market {
Address
}
QuoteToken {
Symbol
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
Base
Quote
}
}
}
}
```
## Top traders of a token on Meteora DAMM v1 {#get-the-top-traders-of-a-specific-token-on-meteora-dyn-dex}
Ranks wallets by USD volume over the last 24 hours, one row per wallet, with the USD each bought and sold.
:::note
Run this as a query, not a subscription. Aggregates over WebSocket return partial results.
:::
```graphql
query TopTraders($token: String) {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "volumeUsd" }
where: {
Pair: {
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Token: { Address: { is: $token } }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Trader {
Address
}
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" } })
trades: count
}
}
}
{
"token": "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"
}
```
## Trading volume, buy volume and sell volume {#get-trading-volume-buy-volume-sell-volume-of-a-token}
Seven-day totals on DAMM v1: USD volume, the buy and sell split, trade counts and distinct wallets. Drop the `Token` filter for the whole program.
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { Protocol: { is: "amm" }, Network: { is: "Solana" } }
Token: {
Address: { is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: 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)
}
}
}
```
## Liquidity of a Meteora DAMM v1 pool
`DEXPools` records reserves after each swap, deposit or withdrawal it decodes. This returns the latest state of the JitoSOL/WSOL pool.
:::note
`DEXPools` is a realtime-only cube: it keeps roughly the last 12 hours and has no archive dataset. See [data coverage and retention](/docs/graphql/data-coverage-retention/).
:::
```graphql
{
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Pool: {
Market: {
MarketAddress: { is: "ERgpKaq59Nnfm9YRVAAhnq16cZhHxGcDoDWCzXbhiaNw" }
}
Dex: {
ProgramAddress: { is: "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB" }
}
}
}
) {
Block {
Time
}
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
MintAddress
}
QuoteCurrency {
Symbol
MintAddress
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
ChangeAmount
PostAmount
PostAmountInUSD
}
Quote {
ChangeAmount
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
Liquidity still moves on DAMM v1 through `addBalanceLiquidity` and `removeBalanceLiquidity`, though rarely. To watch it, subscribe to the same cube filtered by the program and keep rows where either reserve moved, using `any` over `Base` and `Quote`.
## Historical Meteora DAMM v1 trades
The Trading cubes hold about 30 days. For older data use `DEXTradeByTokens` with `dataset: archive`, which reaches back to mid-2024. This returns monthly trade counts and JitoSOL volume on DAMM v1.
:::caution Aggregate in native amounts on `archive` and `combined`, not USD
Summing `Trade_Side_AmountInUSD` on the Solana `archive` and `combined` datasets does not aggregate cleanly: adding it to a grouped query shatters one row per month into many partial rows, and `combined` also returns fewer trades than `realtime` over the same window. Aggregate `Trade_Amount` instead, and take USD figures from the Trading cubes.
:::
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_month" }
where: {
Block: { Time: { since: "2025-01-01T00:00:00Z" } }
Transaction: { Result: { Success: true } }
Trade: {
Currency: {
MintAddress: { is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn" }
}
Dex: {
ProgramAddress: { is: "Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB" }
}
}
}
) {
Block {
month: Time(interval: { in: months, count: 1 })
}
volume_jitosol: sum(of: Trade_Amount)
trades: count
}
}
}
```
## API key, free trial and pricing
Create an access token at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/). The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). Plan prices are on the [Solana DEX API product page](https://bitquery.io/products/solana-dex-api) and the [pricing page](https://bitquery.io/pricing).
## Related documentation
- [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/), the current AMM
- [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/)
- [Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)
- [Trading API overview](/docs/trading/trading-data-overview/), [Trades cube](/docs/trading/crypto-trades-api/trades-api/) and [Pairs cube](/docs/trading/crypto-price-api/pairs/)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)
- [Data coverage and retention](/docs/graphql/data-coverage-retention/)
- [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/) and [real-time Solana streams over Kafka](/docs/streams/real-time-solana-data/)
- [API Authorization](/docs/authorization/how-to-use/)
## Support
For technical support and questions contact our support team via telegram or create a ticket [here](https://support.bitquery.io/)
---
## Meteora DAMM v2 API: Trades, Prices, OHLC and Pools
URL: https://docs.bitquery.io/docs/blockchain/Solana/Meteora-DAMM-v2-API/
Meteora DAMM v2 API on Solana: cp_amm swaps with USD price and market cap, OHLC candles, new pools, top traders, volume and pool liquidity via Bitquery.
# Meteora DAMM v2 API
Meteora DAMM v2 is Meteora's current constant-product AMM on Solana, built on the `cp_amm` program at `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG`. Positions are NFTs, ranges can be concentrated, and the program carries an anti-sniper fee schedule. Bitquery reads its activity into GraphQL queries, WebSocket subscriptions, Kafka and gRPC streams: swaps with USD price and market cap, new pools, prices, OHLC candles, top traders, volume and pool reserves. Every query below runs as written in the [Bitquery IDE](https://ide.bitquery.io). Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only.
If you arrived looking for the DAMM v2 SDK or IDL, those build and sign transactions. This page is the other half: reading what those transactions did, across every DAMM v2 pool at once.
:::tip Start with the Trading API
Most questions on this page are answered fastest by the [**Trading API**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, across **10 chains in one API**, and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) gives pre-aggregated OHLC per pool down to one second. Filter either with `Pair: { Market: { Protocol: { is: "cp_amm" } } }` for DAMM v2.
Drop to the chain-level cubes further down when you need what the Trading API does not carry: **history older than about 30 days**, pool reserves, or per-instruction detail such as pool creation.
:::
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## What is the Meteora DAMM v2 program ID on Solana?
The Meteora DAMM v2 program, `cp_amm`, is deployed at `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` on Solana mainnet, and Meteora uses the same address on devnet. Its pool authority PDA is `HLnpSz9h2S4hiLQ43rnSD9XkcUThA7B8hQMKmDaiTLcC`.
```
cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG
```
In the Trading cubes DAMM v2 is `Market.Protocol` `cp_amm`. In the Solana chain-level cubes the same rows carry `Dex.ProtocolName` `cp_amm` and `Dex.ProtocolFamily` `Meteora`.
Meteora runs four trading programs on Solana, each with its own Bitquery page:
| Meteora program | Program ID | Protocol name | Bitquery page |
| --- | --- | --- | --- |
| DAMM v2, constant-product pools with position NFTs | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` | `cp_amm` | This page |
| DLMM, concentrated liquidity in price bins | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | `lb_clmm` | [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/) |
| DAMM v1, the legacy Dynamic AMM | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | `amm` | [Meteora DAMM v1 API](/docs/blockchain/Solana/Meteora-DYN-API/) |
| Dynamic Bonding Curve, launches that graduate to a DAMM pool | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | `dynamic_bonding_curve` | [Meteora DBC API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/) |
DAMM v2 method names keep the IDL's snake_case spelling, so pool creation is `initialize_pool`, not `initializePool`. DLMM is the odd one out with camelCase. Rows whose method starts with `Evt`, such as `EvtSwap2` and `EvtInitializePool`, are the program's event logs emitted as inner instructions beside the real instruction; they carry no account names, so read accounts from the instruction itself.
## Does Meteora have an API?
Yes, for pool-level data. Meteora publishes a free REST [DAMM v2 Data API](https://docs.meteora.ag/developer-guides/damm-v2/api-reference/overview) at `https://damm-v2.datapi.meteora.ag`, limited to 10 requests a second with no key, covering pools and pool groups, per-pool OHLCV and volume history, and protocol stats. It has no per-swap trade endpoint, no per-wallet swap history and no streaming. Bitquery reads the same activity from the chain: swaps as individual rows with the trader and a USD price, new pools the moment they are created, reserves after every liquidity change, and history back to mid-2024.
| | Meteora DAMM v2 Data API | Bitquery Meteora DAMM v2 API |
| --- | --- | --- |
| Access | REST, no key, 10 requests a second | GraphQL, WebSocket, Kafka and gRPC with an access token; seven-day free trial |
| Pools | Paginated pool list and single-pool state | New pools as they are created; reserves after each decoded swap, deposit or withdrawal |
| Trades | No per-swap endpoint | Swaps as individual rows with trader, amounts, USD price, market cap and signature |
| Candles and volume | Per-pool OHLCV and volume history | Pre-built candles from `Trading.Pairs`; any interval from `DEXTradeByTokens` |
| Traders | Not served | Top traders, buy and sell volume per wallet, PnL |
| History | Per-pool candles and volume | About 30 days on the Trading cubes, back to mid-2024 on the Solana archive |
| Rate limits | 10 requests a second | 30, 90 or 240 query requests a minute by plan, custom on Enterprise; streams metered separately |
## Real-time Meteora DAMM v2 trades
Stream every decoded DAMM v2 swap with the trader, both amounts, the USD price and the token's market cap and circulating supply. `Side` is the trader's own side. This is the query most integrations start from.
```graphql
subscription {
Trading {
Trades(
where: {
Pair: { Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } } }
}
) {
Block {
Time
}
Side
Price
PriceInUsd
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
CirculatingSupply
}
TransactionHeader {
Hash
}
Pair {
Market {
Address
Protocol
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
}
}
}
}
```
Add `Pair: { Token: { Address: { is: "" } } }` to follow one token, or `AmountsInUsd: { Base: { gt: 10000 } }` to watch only large trades. The same body runs as a query with `limit`, `orderBy: { descending: Block_Time }` and a `Block: { Time: { since_relative: { minutes_ago: 10 } } }` filter.
For the lowest latency the same swaps are on the Kafka topic `solana.dextrades.proto` and the [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/); filter on `ProtocolName` `cp_amm` in the consumer.
## Latest price and market cap of a token on Meteora DAMM v2
The token examples below use MET (`METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL`), Meteora's own token, which has traded on DAMM v2 since October 2025. `Trading.Pairs` returns the latest interval for the pool with OHLC, average price, volume and market cap already computed.
`Price: { IsQuotedInUsd: true }` matters: every market publishes each interval twice, once in USD and once in the quote token.
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL" } }
Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Address
Protocol
}
Price {
Ohlc {
Open
High
Low
Close
}
Average {
Mean
}
}
Volume {
Usd
Base
}
Supply {
MarketCap
FullyDilutedValuationUsd
}
}
}
}
```
This gives the price **on DAMM v2**, which is what you want on a venue page. For a token's price across every venue, weighted to its most liquid market, drop the protocol filter and add `Ranking: { Position: { eq: 1 } }` as described in [most accurate token price](/docs/trading/crypto-price-api/pairs/#most-accurate-token-price). The two differ whenever a token's deepest pool sits on another program: MET itself is priced from a DLMM pool by that measure.
## Real-time price feed of a token on Meteora DAMM v2
The same filter as a subscription. Each message is one interval of the MET pool on DAMM v2 with fresh OHLC and market cap.
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Address: { is: "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL" } }
Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Block {
Time
}
Token {
Symbol
}
QuoteToken {
Symbol
}
Market {
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
}
Supply {
MarketCap
}
}
}
}
```
## Meteora DAMM v2 OHLC API
`Trading.Pairs` serves candles at any interval you ask for, so there is nothing to aggregate. Set `Interval.Time.Duration` in seconds: 1 for one-second candles, 60 for one-minute, 3600 for hourly.
```graphql
{
Trading {
Pairs(
limit: { count: 30 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL" } }
Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 3600 } } }
}
) {
Block {
Time
}
Market {
Address
}
QuoteToken {
Symbol
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
Base
Quote
}
}
}
}
```
## Top traders of a token on Meteora DAMM v2
Ranks wallets by USD volume on DAMM v2 over the last 24 hours, one row per wallet, with the USD each bought and sold. `Trading.Trades` reports `Side` from the trader's point of view, so the split needs no field gymnastics.
:::note
Run this as a query, not a subscription. Aggregates over WebSocket return partial results.
:::
```graphql
query TopTraders($token: String) {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "volumeUsd" }
where: {
Pair: {
Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } }
Token: { Address: { is: $token } }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Trader {
Address
}
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" } })
trades: count
}
}
}
{
"token": "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL"
}
```
Subtracting `bought` from `sold` gives a rough realised PnL for the window. The [wallet PnL guide](/docs/trading/crypto-trades-api/wallet-pnl/) covers the full method.
## Trading volume, buy volume and sell volume on Meteora DAMM v2
Seven-day totals for MET on DAMM v2: USD volume, the buy and sell split, trade counts and the number of distinct wallets. Change `days_ago` for other windows, up to the roughly 30-day Trading window.
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { Protocol: { is: "cp_amm" }, Network: { is: "Solana" } }
Token: {
Address: { is: "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: 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)
}
}
}
```
Drop the `Token` filter to get the same totals for the whole DAMM v2 program.
## New Meteora DAMM v2 pools in real time
Pool creation is per-instruction detail, so this one uses the chain-level `Instructions` cube. DAMM v2 creates pools through three instructions: `initialize_pool_with_dynamic_config` carries most of the traffic, with `initialize_pool` and `initialize_customizable_pool` behind it. Match all three.
`Program.AccountNames` names each entry of `Instruction.Accounts` in order: `creator` and `payer` are the wallets, `pool` is the new pool address, `token_a_mint` and `token_b_mint` the pair, `token_a_vault` and `token_b_vault` the reserves, and `position_nft_mint` the NFT minted for the creator's opening position.
:::note
Filter the instructions, not the `EvtInitializePool` event. The event fires once per pool as well, but its row carries a single account and an empty `AccountNames` list, so you cannot read the mints or vaults off it.
:::
```graphql
subscription {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG" }
Method: {
in: [
"initialize_pool"
"initialize_pool_with_dynamic_config"
"initialize_customizable_pool"
]
}
}
}
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
Swap `subscription` for a query and add `Block: { Time: { since_relative: { hours_ago: 24 } } }` with `limit` to list the day's new pools instead of waiting for the next one.
## Liquidity of a Meteora DAMM v2 pool
`DEXPools` records a pool's reserves after each swap, deposit or withdrawal it decodes. `Base.PostAmount` and `Quote.PostAmount` are the balances after the event, `PostAmountInUSD` their USD value, and `ChangeAmount` the signed change that event caused. This returns the latest state of the MET/USDC pool.
:::note
`DEXPools` is a realtime-only cube: it keeps roughly the last 12 hours and has no archive dataset, so use it for current reserves and live liquidity events rather than TVL history. See [data coverage and retention](/docs/graphql/data-coverage-retention/).
:::
```graphql
{
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Pool: {
Market: {
MarketAddress: { is: "BnztueWcXv93mgW7yJe8WYpnCxpz34nujPhfjQT6SLu1" }
}
Dex: {
ProgramAddress: { is: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG" }
}
}
}
) {
Block {
Time
}
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
MintAddress
}
QuoteCurrency {
Symbol
MintAddress
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
ChangeAmount
PostAmount
PostAmountInUSD
}
Quote {
ChangeAmount
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
To stream liquidity changes across all DAMM v2 pools, subscribe to the same cube and keep rows where either reserve moved, using `any` over `Base` and `Quote`.
## Historical Meteora DAMM v2 trades
The Trading cubes hold about 30 days. For anything older, use the chain-level `DEXTradeByTokens` cube with `dataset: archive`, which reaches back to mid-2024. This returns monthly trade counts and volume in MET for the token on DAMM v2 since it started trading.
:::caution Aggregate in native amounts on `archive` and `combined`, not USD
Summing `Trade_Side_AmountInUSD` on the Solana `archive` and `combined` datasets does not aggregate cleanly: adding it to a grouped query shatters one row per month into hundreds of partial rows, and `combined` also returns fewer trades than `realtime` over the same window. Aggregate `Trade_Amount` instead, and take USD figures from the Trading cubes, where every row carries a vetted USD price.
:::
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_month" }
where: {
Block: { Time: { since: "2025-10-01T00:00:00Z" } }
Transaction: { Result: { Success: true } }
Trade: {
Currency: {
MintAddress: { is: "METvsvVRapdj9cFLzq4Tr43xK4tAjQfwX76z3n6mWQL" }
}
Dex: {
ProgramAddress: { is: "cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG" }
}
}
}
) {
Block {
month: Time(interval: { in: months, count: 1 })
}
volume_met: sum(of: Trade_Amount)
trades: count
}
}
}
```
The chain-level cubes also carry per-swap detail the Trading cubes leave out, such as the exact instruction that produced a swap and the token accounts on each side. The [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/) covers those fields, and [DEXTrades vs DEXTradeByTokens vs Trading.Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades/) explains when each one is the right tool.
## API key, free trial and pricing
Create an access token at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/). The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). Points and streams are explained on [how billing works](/docs/plans/how-billing-works/), and plan prices are on the [Solana DEX API product page](https://bitquery.io/products/solana-dex-api) and the [pricing page](https://bitquery.io/pricing). Kafka access is a separate line item from the GraphQL plan.
## Related documentation
- [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/)
- [Meteora DAMM v1 API](/docs/blockchain/Solana/Meteora-DYN-API/)
- [Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)
- [Trading API overview](/docs/trading/trading-data-overview/), [Trades cube](/docs/trading/crypto-trades-api/trades-api/) and [Pairs cube](/docs/trading/crypto-price-api/pairs/)
- [Wallet PnL](/docs/trading/crypto-trades-api/wallet-pnl/)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)
- [DEXTrades vs DEXTradeByTokens vs Trading.Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades/)
- [Data coverage and retention](/docs/graphql/data-coverage-retention/)
- [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/) and [real-time Solana streams over Kafka](/docs/streams/real-time-solana-data/)
- [Schema overview](/docs/schema/schema-intro/)
- [API Authorization](/docs/authorization/how-to-use/)
## Support
For technical support and questions contact our support team via telegram or create a ticket [here](https://support.bitquery.io/)
---
## Meteora DLMM API: Trades, Pools, Prices & OHLC on Solana
URL: https://docs.bitquery.io/docs/blockchain/Solana/Meteora-DLMM-API/
Meteora DLMM API on Solana: swaps, new pools, prices, OHLC candles, top traders, volume and pool liquidity via Bitquery GraphQL, WebSocket and Kafka.
# Meteora DLMM API
Meteora DLMM (Dynamic Liquidity Market Maker) is Meteora's concentrated-liquidity DEX on Solana. It runs on the `lb_clmm` program at `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo`, holds liquidity in discrete price bins, and raises fees when volatility rises. Bitquery reads that program's activity into GraphQL queries, WebSocket subscriptions, Kafka and gRPC streams: live swaps, new pools, token prices, OHLC candles, pool reserves, top traders and volume. Every query below runs as written in the [Bitquery IDE](https://ide.bitquery.io). Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. Meteora's own [DLMM Data API](#does-meteora-have-an-api) serves pool state, positions and per-pool candles but has no trade feed and no streaming; the queries below cover both, with history back to mid-2024.
:::tip Start with the Trading API
The [**Trading API**](/docs/trading/trading-data-overview) answers most questions on this page fastest. [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, across **10 chains in one API**, and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) gives pre-aggregated OHLC per DLMM pool down to one second.
Drop to the chain-level cubes further down for what the Trading API does not carry: **history older than about 30 days**, pool reserves, and per-instruction detail such as pool creation.
:::
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## What is the Meteora DLMM program ID on Solana?
The Meteora DLMM program, `lb_clmm`, is deployed at `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` on Solana mainnet, and Meteora uses the same address on devnet.
```
LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo
```
Filter the Solana trade cubes with `Trade: { Dex: { ProgramAddress: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" } } }` and the `Instructions` cube with `Instruction: { Program: { Address: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" } } }`. DLMM rows carry `ProtocolName` `lb_clmm` and `ProtocolFamily` `Meteora`; in the cross-chain Trading cube the venue is `Market.Protocol` `lb_clmm`.
Meteora runs four trading programs on Solana, each with its own Bitquery page:
| Meteora program | Program ID | `ProtocolName` / `Market.Protocol` | Bitquery page |
| --- | --- | --- | --- |
| DLMM, concentrated liquidity in price bins | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | `lb_clmm` | This page |
| DAMM v2, constant-product pools with position NFTs | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` | `cp_amm` | [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/) |
| DAMM v1, the legacy Dynamic AMM | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | `amm` | [Meteora DYN API](/docs/blockchain/Solana/Meteora-DYN-API/) |
| Dynamic Bonding Curve, token launches that graduate to a DAMM pool | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | `dynamic_bonding_curve` | [Meteora DBC API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/) |
Method names follow each program's IDL as Bitquery loaded it. DLMM methods are camelCase (`initializeLbPair2`, `swapExactOut2`) even though Meteora's current IDL file spells them `initialize_lb_pair2` and `swap_exact_out2`, while DBC and DAMM v2 methods are snake_case (`initialize_virtual_pool_with_spl_token`, `claim_position_fee`), so copy the spelling from the examples on each page. Rows named `Swap`, `LbPairCreate` or `EvtSwap` are the programs' event logs, emitted as inner instructions next to the real instruction. The trade cubes decode DLMM `swap` and `swap2` instructions wherever they run, including as inner instructions of aggregator routes through Jupiter and other routers, so filter trades by program address rather than by method.
## Does Meteora have an API?
Yes, for pool-level data. Meteora publishes a free REST [DLMM Data API](https://docs.meteora.ag/developer-guides/dlmm/api-reference/overview) at `https://dlmm.datapi.meteora.ag`, limited to 30 requests a second with no key, covering pools and pool groups, per-pool OHLCV and volume history, wallet portfolios, positions and PnL, limit orders and protocol stats. It has no per-swap trade endpoint, no per-wallet swap history and no streaming. The older `dlmm-api.meteora.ag` host and its `/pair/all` route have been superseded by it. Bitquery reads the same activity from the chain: swaps as individual rows, new pools the moment they are created, reserves after every liquidity change, and history back to mid-2024.
| | Meteora DLMM Data API | Bitquery Meteora DLMM API |
| --- | --- | --- |
| Access | REST, no key, 30 requests a second | GraphQL, WebSocket, Kafka and gRPC with an access token; seven-day free trial |
| Pools | Paginated pool list with search and windowed sorting; single-pool state | New pools as they are created; reserves after each decoded swap, deposit or withdrawal |
| Trades | No per-swap endpoint | Swaps as individual rows with trader, amounts, price, USD value and signature |
| Candles and volume | Per-pool OHLCV and volume history | OHLC at any interval from `DEXTradeByTokens`; pre-built candles from `Trading.Pairs` |
| Traders | Portfolio, positions and limit orders per wallet | Top traders, buy and sell volume per wallet, PnL from `Trading.Trades` |
| History | Per-pool candles and volume; depth not stated in the reference | `DEXTradeByTokens` back to mid-2024 on the `archive` dataset; realtime cubes hold hours to days |
| Rate limits | 30 requests a second | 30, 90 or 240 query requests a minute by plan, custom on Enterprise; streams are metered by stream entitlements, not per request |
## Real-time Meteora DLMM trades {#subscribe-to-realtime-dlmm-trades}
Stream every decoded DLMM swap with the trader, both amounts, the USD price and the token's market cap and circulating supply. `Side` is the trader's own side. This is where most integrations start.
```graphql
subscription {
Trading {
Trades(
where: {
Pair: { Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } } }
}
) {
Block {
Time
}
Side
Price
PriceInUsd
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
CirculatingSupply
}
TransactionHeader {
Hash
}
Pair {
Market {
Address
Protocol
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
}
}
}
}
```
Add `Pair: { Token: { Address: { is: "" } } }` to follow one token, or `AmountsInUsd: { Base: { gt: 10000 } }` to watch only large trades. The same body runs as a query with `limit`, `orderBy: { descending: Block_Time }` and a `Block: { Time: { since_relative: { minutes_ago: 10 } } }` filter.
For the lowest latency the same swaps are on the Kafka topic `solana.dextrades.proto` and the [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/); filter on `ProgramAddress` or on `ProtocolFamily` `Meteora` in the consumer. See the [Solana protobuf reference](/docs/streams/protobuf/chains/Solana-protobuf/) and [real-time Solana streams](/docs/streams/real-time-solana-data/).
:::note Some DLMM swaps are not decoded yet
The trade cubes decode DLMM `swap` and `swap2` instructions, including inside aggregator routes through Jupiter and other routers. Swaps sent as `swapExactOut`, `swapExactOut2` or `swapWithPriceImpact2` do not currently produce trade rows in either the chain-level or the Trading cubes, so DLMM volume read from any cube is lower than the on-chain total.
:::
## Latest price of a token on Meteora DLMM {#latest-price-of-a-token-on-meteora-dlmm}
The token examples below use TRUMP (`6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN`), which has traded on Meteora DLMM since its launch in January 2025; where a pool address is needed they use a TRUMP/USDC DLMM pool, `3C5YE97HADPDxZehYq9Cis8AXr9aNyrUsczKzE1nDbW9`. `Trading.Pairs` returns the latest interval for the pool with OHLC, average price, volume and market cap already computed.
`Price: { IsQuotedInUsd: true }` matters: every market publishes each interval twice, once in USD and once in the quote token.
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } }
Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Address
Protocol
}
Price {
Ohlc {
Open
High
Low
Close
}
Average {
Mean
}
}
Volume {
Usd
Base
}
Supply {
MarketCap
FullyDilutedValuationUsd
}
}
}
}
```
This gives the price **on DLMM**, which is what you want on a venue page. For a token's price across every venue, weighted to its deepest market, drop the protocol filter and add `Ranking: { Position: { eq: 1 } }` as described in [most accurate token price](/docs/trading/crypto-price-api/pairs/#most-accurate-token-price).
## Real-time price feed of a token {#realtime-price-feed-of-a-token-on-meteora-dlmm}
The same filter as a subscription, at one-second intervals.
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Address: { is: "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } }
Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Block {
Time
}
Token {
Symbol
}
QuoteToken {
Symbol
}
Market {
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
}
Supply {
MarketCap
}
}
}
}
```
## Meteora DLMM OHLC API {#meteora-dlmm-ohlc-api}
`Trading.Pairs` serves candles at whatever interval you ask for, so there is nothing to aggregate. Set `Interval.Time.Duration` in seconds: 1 for one-second candles, 60 for one-minute, 3600 for hourly.
```graphql
{
Trading {
Pairs(
limit: { count: 30 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } }
Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } }
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 3600 } } }
}
) {
Block {
Time
}
Market {
Address
}
QuoteToken {
Symbol
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
Base
Quote
}
}
}
}
```
## Top traders of a token on Meteora DLMM {#get-the-top-traders-of-a-specific-token-on-meteora-dlmm-dex}
Ranks wallets by USD volume on DLMM over the last 24 hours, one row per wallet, with the USD each bought and sold. `Trading.Trades` reports `Side` from the trader's point of view, so the split needs no field gymnastics.
:::note
Run this as a query, not a subscription. Aggregates over WebSocket return partial results.
:::
```graphql
query TopTraders($token: String) {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "volumeUsd" }
where: {
Pair: {
Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } }
Token: { Address: { is: $token } }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
) {
Trader {
Address
}
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" } })
trades: count
}
}
}
{
"token": "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN"
}
```
Subtracting `bought` from `sold` gives a rough realised PnL for the window. The [wallet PnL guide](/docs/trading/crypto-trades-api/wallet-pnl/) covers the full method.
## Trading volume, buy volume and sell volume of a token {#get-trading-volume-buy-volume-sell-volume-of-a-token}
Seven-day totals for TRUMP on DLMM: USD volume, the buy and sell split, trade counts and the number of distinct wallets. Change `days_ago` for other windows, up to the roughly 30-day Trading window. Drop the `Token` filter for the whole DLMM program.
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { Protocol: { is: "lb_clmm" }, Network: { is: "Solana" } }
Token: { Address: { is: "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } }
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: 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)
}
}
}
```
## Chain-level DLMM data
The sections above cover trades, prices, candles, traders and volume through the Trading cubes. Three things live only in the Solana chain-level cubes: pool creation, pool reserves, and history older than the roughly 30-day Trading window. See [DEXTrades vs DEXTradeByTokens vs Trading.Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades/) for the full comparison.
### New Meteora DLMM pools in real time {#latest-pool-creation-on-meteora-dlmm}
Every DLMM pool is an `LbPair` account created by one of the pool-creation instructions: `initializeLbPair2` for standard permissionless pools, `initializeCustomizablePermissionlessLbPair2` for pools with custom parameters, `initializePermissionLbPair` for permissioned launches, and the un-numbered legacy SPL-Token-only forms. This subscription emits one row per new pool. `Program.AccountNames` gives the meaning of each entry in `Instruction.Accounts` in order: the first account is the new pool address (`lbPair`), `tokenMintX` and `tokenMintY` are the two token mints, `reserveX` and `reserveY` the pool vaults, and `funder` the wallet that paid for the pool's creation. Pool creation is far less frequent than swaps, so expect this stream to stay quiet for minutes at a time. To list recent pools instead, run the same filter as a query with `Block: { Time: { since_relative: { hours_ago: 24 } } }`.
You can test the subscription [in the Bitquery IDE](https://ide.bitquery.io/Track-Latest-created-pools-on-Meteora-DLMM_1).
```graphql
subscription {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" }
Method: {
in: [
"initializeLbPair2",
"initializeCustomizablePermissionlessLbPair2",
"initializePermissionLbPair",
"initializeLbPair",
"initializeCustomizablePermissionlessLbPair"
]
}
}
}
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
### Liquidity of a Meteora DLMM pool
`DEXPools` records a pool's reserves after each swap, deposit or withdrawal it decodes. `Base.PostAmount` and `Quote.PostAmount` are the balances after the event, `PostAmountInUSD` their USD value, and `ChangeAmount` the signed change that event caused.
:::note
`DEXPools` is a realtime-only cube: it keeps roughly the last 12 hours and has no archive dataset, so use it for current reserves and live liquidity events rather than TVL history. See [data coverage and retention](/docs/graphql/data-coverage-retention/).
:::
```graphql
{
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Pool: {
Market: { MarketAddress: { is: "3C5YE97HADPDxZehYq9Cis8AXr9aNyrUsczKzE1nDbW9" } }
Dex: { ProgramAddress: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" } }
}
}
) {
Block {
Time
}
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
MintAddress
}
QuoteCurrency {
Symbol
MintAddress
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
ChangeAmount
PostAmount
PostAmountInUSD
}
Quote {
ChangeAmount
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
To stream liquidity changes across all DLMM pools, subscribe to the same cube and keep rows where either reserve moved. DLMM deposits are often one-sided, so filter on `Base` or `Quote` with `any` rather than on `Base` alone.
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: { Dex: { ProgramAddress: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" } } }
any: [
{ Pool: { Base: { ChangeAmount: { ne: "0" } } } }
{ Pool: { Quote: { ChangeAmount: { ne: "0" } } } }
]
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signature
}
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
MintAddress
}
QuoteCurrency {
Symbol
MintAddress
}
}
Base {
ChangeAmount
PostAmount
PostAmountInUSD
}
Quote {
ChangeAmount
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
### Historical Meteora DLMM trades
For anything older than the Trading window, use `DEXTradeByTokens` with `dataset: archive`, which reaches back to mid-2024. This returns monthly trade counts and TRUMP volume on DLMM.
:::caution Aggregate in native amounts on `archive` and `combined`, not USD
Summing `Trade_Side_AmountInUSD` on the Solana `archive` and `combined` datasets does not aggregate cleanly: adding it to a grouped query shatters one row per month into many partial rows, and `combined` also returns fewer trades than `realtime` over the same window. Aggregate `Trade_Amount` instead, and take USD figures from the Trading cubes, where every row carries a vetted USD price.
:::
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_month" }
where: {
Block: { Time: { since: "2025-01-01T00:00:00Z" } }
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: "6p6xgHyF7AeE6TZkSmFsko444wqoP15icUSqi2jfGiPN" } }
Dex: { ProgramAddress: { is: "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo" } }
}
}
) {
Block {
month: Time(interval: { in: months, count: 1 })
}
volume_trump: sum(of: Trade_Amount)
trades: count
}
}
}
```
The chain-level cubes also carry per-swap detail the Trading cubes leave out, such as the exact instruction behind a swap and the token accounts on each side; the [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/) documents those fields.
## API key, free trial and pricing
Create an access token at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/); there is no approval step. The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). Points and streams are explained on [how billing works](/docs/plans/how-billing-works/), and plan prices are on the [Solana DEX API product page](https://bitquery.io/products/solana-dex-api) and the [pricing page](https://bitquery.io/pricing). Kafka access is a separate line item from the GraphQL plan.
## Related documentation
- [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/)
- [Meteora DYN API (DAMM v1)](/docs/blockchain/Solana/Meteora-DYN-API/)
- [Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)
- [Trading API overview](/docs/trading/trading-data-overview/), [Trades cube](/docs/trading/crypto-trades-api/trades-api/) and [Pairs cube](/docs/trading/crypto-price-api/pairs/)
- [DEXTrades vs DEXTradeByTokens vs Trading.Trades](/docs/cubes/dextrades-dextradebytokens-trading-trades/)
- [Data coverage and retention](/docs/graphql/data-coverage-retention/)
- [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/) and [real-time Solana streams over Kafka](/docs/streams/real-time-solana-data/)
- [Believe API](/docs/blockchain/Solana/Believe-API/) and [Jupiter Studio API](/docs/blockchain/Solana/jupiter-studio-api/), launchpads that trade on Meteora DBC
- [Solana Token Holders API](/docs/blockchain/Solana/solana-token-holders/)
- [Schema overview](/docs/schema/schema-intro/)
- [API Authorization](/docs/authorization/how-to-use/)
## Support
For technical support and questions contact our support team via telegram or create a ticket [here](https://support.bitquery.io/)
---
## Meteora Dynamic Bonding Curve (DBC) API: Launches, Trades
URL: https://docs.bitquery.io/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/
Meteora Dynamic Bonding Curve API: stream DBC launches, curve trades with USD price and market cap, graduations to DAMM, top traders and migrations.
# Meteora Dynamic Bonding Curve API
The Meteora Dynamic Bonding Curve (DBC) is Meteora's launch program on Solana, at `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`. A team configures a curve, buyers trade against it, and once the quote threshold is met the token graduates into a DAMM pool. Launchpads including Jupiter Studio and Believe run on it. Bitquery reads that whole lifecycle: new launches, every curve trade with a USD price and market cap, graduations, top traders and migrations, over GraphQL, WebSocket, Kafka and gRPC.
Meteora publishes REST data APIs for DLMM, DAMM v1 and DAMM v2, but **none for the Dynamic Bonding Curve**. There is an SDK and an IDL for building transactions, and nothing that serves launches, trades or curve state. That gap is what this page fills.
:::tip Start with the Trading API
DBC tokens live and die in hours, so the fastest path is the [**Trading API**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered curve trades with USD price, market cap and supply on every row**, and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) gives OHLC and market cap per curve down to one second. Filter either with `Market: { Protocol: { is: "dynamic_bonding_curve" } }`.
Use the chain-level `Instructions` cube further down for the events the Trading cubes do not model: launches, graduations and migration checks.
:::
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## What is the Meteora DBC program ID on Solana?
The Dynamic Bonding Curve program is `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` on Solana mainnet, and Meteora uses the same address on devnet. Its pool authority PDA is `FhVo3mqL8PW5pH5U2CN4XE33DokiyZnUwuGpH2hmHLuM`.
```
dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN
```
In the Trading cubes DBC is `Market.Protocol` `dynamic_bonding_curve`. In the Solana chain-level cubes the rows carry `Dex.ProtocolName` `dynamic_bonding_curve` and `Dex.ProtocolFamily` `Meteora`. DBC method names keep the IDL's snake_case spelling. Rows whose method starts with `Evt`, such as `EvtSwap` and `EvtCurveComplete`, are event logs emitted beside the real instruction.
Meteora runs four trading programs on Solana, each with its own Bitquery page:
| Meteora program | Program ID | Protocol name | Bitquery page |
| --- | --- | --- | --- |
| Dynamic Bonding Curve, launches that graduate to a DAMM pool | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | `dynamic_bonding_curve` | This page |
| DAMM v2, constant-product pools with position NFTs | `cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG` | `cp_amm` | [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/) |
| DLMM, concentrated liquidity in price bins | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | `lb_clmm` | [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/) |
| DAMM v1, the legacy Dynamic AMM | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | `amm` | [Meteora DAMM v1 API](/docs/blockchain/Solana/Meteora-DYN-API/) |
## Picking an example token
Every query below that takes a mint uses a placeholder, because a bonding curve that is busy this hour is usually empty tomorrow. Run this first and paste one of the mints it returns into the examples.
```graphql
{
Trading {
Trades(
limit: { count: 10 }
orderBy: { descendingByField: "usd" }
where: {
Pair: {
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
}
Block: { Time: { since_relative: { minutes_ago: 10 } } }
}
) {
Pair {
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Address
}
}
usd: sum(of: AmountsInUsd_Base)
trades: count
}
}
}
```
`Pair.Token.Address` is the mint and `Pair.Market.Address` the curve.
## Meteora DBC trades in real time {#meteora-dbc-trades-in-real-time}
Stream every decoded curve trade with the trader, both amounts, the USD price and the token's market cap. This one subscription covers all DBC launches at once, so it is the usual starting point for launch bots and screeners.
```graphql
subscription {
Trading {
Trades(
where: {
Pair: {
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
}
}
) {
Block {
Time
}
Side
Price
PriceInUsd
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
CirculatingSupply
TotalSupply
}
TransactionHeader {
Hash
FeePayer
}
Pair {
Market {
Address
Protocol
}
Token {
Symbol
Name
Address
}
QuoteToken {
Symbol
Address
}
}
}
}
}
```
Add `AmountsInUsd: { Base: { gt: 1000 } }` to watch only meaningful size, or `Pair: { Token: { Address: { is: "" } } }` to follow one curve.
## Market cap and price of a Meteora DBC token {#market-cap-trading-api}
`Trading.Pairs` carries market cap, fully diluted valuation, supply, OHLC and volume per curve, already computed. Replace the mint with one from the [example query above](#picking-an-example-token).
`Price: { IsQuotedInUsd: true }` matters: every market publishes each interval twice, once in USD and once in the quote token. DBC curves are quoted in SOL, USDC, JUP and other tokens, so without that filter you may read a price in the wrong unit.
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "" } }
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Token {
Symbol
Name
Address
}
QuoteToken {
Symbol
}
Market {
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
Average {
Mean
}
}
Volume {
Usd
Base
}
Supply {
MarketCap
FullyDilutedValuationUsd
TotalSupply
}
}
}
}
```
### Stream Meteora DBC tokens above a market cap threshold
The screener query: every DBC curve whose market cap crosses your floor, live. Change `gt` to move the threshold.
```graphql
subscription {
Trading {
Pairs(
where: {
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
Price: { IsQuotedInUsd: true }
Supply: { MarketCap: { gt: 10000 } }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Token {
Symbol
Name
Address
}
QuoteToken {
Symbol
}
Market {
Address
}
Supply {
MarketCap
FullyDilutedValuationUsd
TotalSupply
}
Price {
Ohlc {
Close
}
}
Volume {
Usd
}
}
}
}
```
## Meteora DBC OHLC API {#meteora-dbc-ohlc-api}
`Trading.Pairs` serves candles at whatever interval you ask for, so there is nothing to aggregate. Set `Interval.Time.Duration` in seconds: 1 for one-second candles, 60 for one-minute. One-second candles matter on a bonding curve, where a token's whole life can be shorter than an hour.
```graphql
{
Trading {
Pairs(
limit: { count: 30 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "" } }
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
Price: { IsQuotedInUsd: true }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Block {
Time
}
Market {
Address
}
QuoteToken {
Symbol
}
Price {
Ohlc {
Open
High
Low
Close
}
}
Volume {
Usd
Base
}
}
}
}
```
## Top traders of a Meteora DBC token {#get-the-top-traders-of-a-specific-token-on-meteora-dbc}
Ranks wallets on one curve by USD volume, one row per wallet, with the USD each bought and sold and a realised PnL for the window. `Trading.Trades` reports `Side` from the trader's own point of view, so no field gymnastics are needed.
:::note
Run this as a query, not a subscription. Aggregates over WebSocket return partial results.
:::
```graphql
query TopTraders($token: String) {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "pnl" }
where: {
Pair: {
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
Token: { Address: { is: $token } }
}
}
) {
Trader {
Address
}
bought: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sold: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
pnl: calculate(expression: "$sold - $bought")
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
volumeUsd: sum(of: AmountsInUsd_Base)
}
}
}
{
"token": ""
}
```
`pnl` here is realised in the window only: a wallet still holding its bag shows a negative number. The [wallet PnL guide](/docs/trading/crypto-trades-api/wallet-pnl/) covers unrealised positions.
## Track new Meteora DBC launches {#track-latest-created-pools-on-meteora-dbc}
Launches are per-instruction detail, so this uses the chain-level `Instructions` cube. A curve is created by one of two instructions, and **you need both**: `initialize_virtual_pool_with_spl_token` for standard SPL tokens and `initialize_virtual_pool_with_token2022` for Token-2022 mints. Token-2022 launches are a large minority of DBC traffic, so filtering only the SPL variant silently hides a third of new tokens.
`Program.AccountNames` names each entry of `Instruction.Accounts` in order: `base_mint` is the new token, `quote_mint` the token the curve is priced in, `pool` the curve address, `creator` the launching wallet, and `base_vault` and `quote_vault` the reserves.
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: {
in: [
"initialize_virtual_pool_with_spl_token"
"initialize_virtual_pool_with_token2022"
]
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
}
}
Transaction {
Signature
Signer
FeePayer
}
}
}
}
```
## Track Meteora DBC graduations {#track-latest-migrated-meteora-dbc-tokens}
When a curve completes, a keeper migrates the liquidity into a DAMM pool. `migration_damm_v2` is the instruction in use today; `migrate_meteora_damm` is the older path into DAMM v1 and still appears in historical data, so keep both when querying the archive.
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { in: ["migration_damm_v2", "migrate_meteora_damm"] }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
Meteora runs the migration keepers itself, so the signer is usually a Meteora address rather than the token creator. Graduation thresholds are set per curve config; Meteora's published keeper `Asi5DTGEeiso6k7ya6ndDabEZ7DRCgfTpCBLPH5E3aQs` handles configs with a threshold of 10 SOL, 750 USDC or 1500 JUP.
## Track migrations across DBC, LetsBonk.fun, Raydium LaunchLab, Boop.fun and Moonit {#track-meteora-dbc-letsbonkfun-raydium-launchlab-boopfun-and-moonit-token-migrations-in-a-single-subscription}
One subscription covering graduations on five launchpads. Each branch matches that program's own migration method, and the LetsBonk.fun branch is identified by its platform config address appearing in the accounts of a Raydium LaunchLab migration.
```graphql
subscription {
Solana {
Instructions(
where: {
any: [
{
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { is: "initialize_v2" }
}
}
}
{
Instruction: {
Program: {
Address: { is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4" }
Method: { is: "graduate" }
}
}
}
{
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "migrateFunds" }
}
}
}
{
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { in: ["migrate_meteora_damm", "migration_damm_v2"] }
}
}
}
{
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { in: ["migrate_to_amm", "migrate_to_cpswap"] }
}
Accounts: {
includes: {
Address: { is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1" }
}
}
}
}
]
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
Read the program address on each row to tell the launchpads apart: `dbcij3…` is Meteora DBC, `LanMV9…` is Raydium LaunchLab, `boop8h…` is Boop.fun, `MoonCV…` is Moonit, and a LaunchLab row carrying `FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1` in its accounts is a LetsBonk.fun graduation.
## Check whether a list of tokens has graduated from Meteora DBC {#check-if-the-list-of-tokens-has-migrated-from-meteora-dbc}
Pass up to a few hundred mints and get back a row for each one that has migrated. Tokens with no row have not graduated. Add `Block: { Time: { since_relative: { days_ago: 7 } } }` to bound the scan.
```graphql
query MyQuery($tokenAddresses: [String!]) {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { in: ["migration_damm_v2", "migrate_meteora_damm"] }
}
Accounts: { includes: { Address: { in: $tokenAddresses } } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
Token {
Mint
}
}
Program {
AccountNames
Method
}
}
Transaction {
Signature
}
}
}
}
{
"tokenAddresses": ["", "", ""]
}
```
## Latest price of a token on Meteora DBC {#latest-price-of-a-token-on-meteora-dbc}
If you want a single price rather than a candle, read the last trade from `Trading.Trades`. `PriceInUsd` is the USD price of that print and `Supply.MarketCap` the market cap at that moment.
```graphql
{
Trading {
Trades(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Pair: {
Market: {
Protocol: { is: "dynamic_bonding_curve" }
Network: { is: "Solana" }
}
Token: { Address: { is: "" } }
}
}
) {
Block {
Time
}
Price
PriceInUsd
Side
Supply {
MarketCap
}
Pair {
Token {
Symbol
}
QuoteToken {
Symbol
}
Market {
Address
}
}
}
}
}
```
## Raw curve trades and history
The chain-level cubes carry per-swap detail the Trading cubes leave out, such as the exact instruction behind a trade and the token accounts on each side. `Solana.DEXTrades` keeps roughly 12 hours; `Solana.DEXTradeByTokens` keeps about 7 days on `realtime` and reaches back to mid-2024 on `archive`.
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Trade {
Dex {
ProgramAddress
ProtocolName
ProtocolFamily
}
Market {
MarketAddress
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
AmountInUSD
Account {
Address
Owner
}
Price
PriceInUSD
}
Sell {
Currency {
Name
Symbol
MintAddress
}
Amount
AmountInUSD
Account {
Address
Owner
}
Price
PriceInUSD
}
}
}
}
}
```
:::caution Aggregate in native amounts on `archive` and `combined`, not USD
Summing `Trade_Side_AmountInUSD` on the Solana `archive` and `combined` datasets does not aggregate cleanly: adding it to a grouped query shatters one row into many partial rows, and `combined` also returns fewer trades than `realtime` over the same window. Aggregate `Trade_Amount` instead, and take USD figures from the Trading cubes, where every row carries a vetted USD price.
:::
## API key, free trial and pricing
Create an access token at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/). The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). Points and streams are explained on [how billing works](/docs/plans/how-billing-works/), and plan prices are on the [Solana DEX API product page](https://bitquery.io/products/solana-dex-api) and the [pricing page](https://bitquery.io/pricing).
## Related documentation
- [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API/), where graduated DBC tokens land
- [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API/)
- [Meteora DAMM v1 API](/docs/blockchain/Solana/Meteora-DYN-API/)
- [Jupiter Studio API](/docs/blockchain/Solana/jupiter-studio-api/) and [Believe API](/docs/blockchain/Solana/Believe-API/), launchpads built on DBC
- [Trading API overview](/docs/trading/trading-data-overview/), [Trades cube](/docs/trading/crypto-trades-api/trades-api/) and [Pairs cube](/docs/trading/crypto-price-api/pairs/)
- [Wallet PnL](/docs/trading/crypto-trades-api/wallet-pnl/)
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)
- [Data coverage and retention](/docs/graphql/data-coverage-retention/)
- [gRPC DEX trades topic](/docs/grpc/solana/topics/dextrades/) and [real-time Solana streams over Kafka](/docs/streams/real-time-solana-data/)
- [API Authorization](/docs/authorization/how-to-use/)
## Support
For technical support and questions contact our support team via telegram or create a ticket [here](https://support.bitquery.io/)
---
## Orca DEX API — Solana Liquidity Pools & Trades
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-orca-dex-api/
Orca DEX on Solana: new pools, real-time trades, token prices, OHLC, add and remove liquidity, and fee and reward collection instructions.
# Orca DEX API
:::tip Need real-time Orca data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Orca swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Orca data older than ~30 days**, raw per-swap detail, or call / event context.
Orca is one of the venues covered by our [Solana DEX API](https://bitquery.io/products/solana-dex-api), which unifies Raydium, Orca, Meteora, Pump.fun and Jupiter trades in one schema.
:::
In this section, we'll show you how to access information about Orca DEX data using Bitquery APIs.
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## Latest Pools Created On Orca
To retrieve the newest pools created on Orca DEX, we will utilize the Solana instructions API/Websocket.
We will specifically look for the latest instructions from Orca's Whirlpool program, identified by the program ID `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc`.
Whenever a new pool is created on Orca, it triggers the `initializePool` instructions. The pool address can be obtained from the program addresses listed in the transaction's instructions.
For instance, Index 1 and 2 represent the tokens involved in the pool, while Index 4 is for the pool's address. Note that the indexing starts from 0.
You can run this query using this [link](https://ide.bitquery.io/Latest-pool-created-on-Orca---Websocket_1).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "initializePool" }
Address: { is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc" }
}
}
}
) {
Instruction {
Program {
Method
Arguments {
Name
Value {
__typename
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
Accounts {
Address
}
}
Transaction {
Signature
}
}
}
}
```
## Pair Creation Time For A Specific Pair
You can use the following query to get the pair creation time for a specific pair on Orca DEX on Solana. But you need to use the keyword `query`.
You can run this query using [this link](https://ide.bitquery.io/pair-creation-time-for-a-specific-pair-on-Orca).
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Method: {is: "initializePool"}, Address: {is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"}}, Accounts: {includes: {Address: {is: "Bg8rob51iTgMBi1hmRhZV8hzaHU5zP77Pd61UpbzyzGd"}}}}, Transaction: {Result: {Success: true}}}
) {
Transaction {
Signature
}
Block {
Time
}
}
}
}
```
## Realtime Trades On Orca DEX API
To access a real-time stream of trades for Solana Orca DEX, [check out this GraphQL subscription (WebSocket)](https://ide.bitquery.io/Orca-DEX-Trades-Websocket).
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
}
}
}
) {
Transaction {
Signature
}
Block {
Time
}
Trade {
Dex {
ProgramAddress
ProtocolName
ProtocolFamily
}
Buy {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
Name
}
Price
PriceInUSD
}
Sell {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
Name
}
Price
PriceInUSD
}
}
}
}
}
```
## Latest Trades For A Specific Currency On Solana Orca DEX
If you want to monitor [trades for a specific currency on Orca DEX](https://ide.bitquery.io/Orca-DEX-Trades-for-a-specific-currency-Websocket), you can use the stream provided. Input the currency's mint address; for example, in the query below, we use the WSOL token's Mint address to fetch buys of the WSOL token.
By setting the limit to 1, you will receive the most recent trade, which reflects the latest price of the token.
Execute this query [by following this link](https://ide.bitquery.io/Orca-DEX-Trades-for-a-specific-currency-Websocket).
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
}
Buy: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
}
) {
Transaction {
Signature
}
Block {
Time
}
Trade {
Dex {
ProgramAddress
ProtocolName
ProtocolFamily
}
Buy {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
Name
}
Price
PriceInUSD
}
Sell {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
Name
}
Price
PriceInUSD
}
}
}
}
}
```
## Latest Price Of A Token
You can use the following query to get the latest price of a token, we have used WSOL address here in the below example. We are getting realtime price of WSOL on Orca DEX on Solana in different pools.
You can run this query using [this link](https://ide.bitquery.io/Price-of-a-token-on-Orca).
```graphql
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}, Dex: {ProgramAddress: {is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"}}}}
) {
Block {
Time
}
Trade {
Amount
PriceAgainstSideCurrency: Price
Currency {
Symbol
Name
MintAddress
}
Side {
Amount
Currency {
Symbol
Name
MintAddress
}
}
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Market {
MarketAddress
}
Order {
LimitAmount
LimitPrice
OrderId
}
}
}
}
}
```
## Orca OHLC APIs
If you want to get OHLC data for any specific currency pair on Orca DEX, you can use [this api](https://ide.bitquery.io/Orca-OHLC-for-specific-pair_5).
Only use this API as `query` and not `subscription` websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: {
MintAddress: { is: "token mint address" }
}
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Dex: {
ProgramAddress: {
is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
}
PriceAsymmetry: { lt: 0.1 }
}
}
) {
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
}
}
}
```
## Track Latest Add Liquidity Transactions On Orca DEX
You can also track Add Liquidity transactions in real time on Orca DEX from Orca API using instructions. Firstly, you can use this [query](https://ide.bitquery.io/Get-all-methods-of-Orca-Program#) to get all the methods of Orca program to deduce which program method is responsible for add liquidity transactions. The method we want to filter for turns out to be `increaseLiquidity`.
If you want to track latest liquidity additions in Orca pools, you can use [this Websocket api](https://ide.bitquery.io/Websocket-for-add-Liquidity-instruction-on-Solana-Orca-DEX_3).
In the response, mint under 6th and 7th addresses in the Accounts array gives you the Token A and Token B respectively of the pool in which liquidity is added.
```graphql
subscription {
Solana {
Instructions(
orderBy: { descending: Block_Time }
where: {
Instruction: {
Program: {
Address: {
in: [
"whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
"increaseLiquidityV2"
]
}
Method: { is: "increaseLiquidity" }
}
}
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
InternalSeqNumber
Index
ExternalSeqNumber
Depth
CallerIndex
Data
CallPath
BalanceUpdatesCount
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Name
Method
Parsed
}
}
Transaction {
Signature
}
}
}
}
```
## Track Latest Remove Liquidity Transactions On Orca DEX
You can also track Remove Liquidity transactions in real time on Orca DEX from Orca API using instructions. Firstly, you can use this [query](https://ide.bitquery.io/Get-all-methods-of-Orca-Program#) to get all the methods of Orca program to deduce which program method is responsible for remove liquidity transactions. The method we want to filter for turns out to be `decreaseLiquidity`.
If you want to track latest liquidity removals in Orca pools, you can use [this Websocket api](https://ide.bitquery.io/Websocket-for-remove-Liquidity-instruction-on-Solana-Orca-DEX_1#).
In the response, mint under 6th and 7th addresses in the Accounts array gives you the Token A and Token B respectively of the pool in which liquidity is removed.
```graphql
subscription {
Solana {
Instructions(
orderBy: { descending: Block_Time }
where: {
Instruction: {
Program: {
Address: { is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc" }
Method: { is: "decreaseLiquidity" }
}
}
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
InternalSeqNumber
Index
ExternalSeqNumber
Depth
CallerIndex
Data
CallPath
BalanceUpdatesCount
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Name
Method
Parsed
}
}
Transaction {
Signature
}
}
}
}
```
## Track Collect Fees Instruction Calls On Orca DEX
Using the query below you can get the addresses in the `Instruction Accounts[]` array for the `Collect Fees` instruction calls on Orca DEX.
You can test the query [here](https://ide.bitquery.io/Websocket-for-collect-fees-instruction-on-Solana-Orca-DEX_1).
```graphql
subscription {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"}, Method: {is: "collectFees"}}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
InternalSeqNumber
Index
ExternalSeqNumber
Depth
CallerIndex
Data
CallPath
BalanceUpdatesCount
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Name
Method
Parsed
}
}
Transaction {
Signature
}
}
}
}
```
## Track Update Fees And Rewards Instruction Calls On Orca DEX
Using the query below you can get the addresses in the `Instruction Accounts[]` array for the `Update Fees and Rewards` instruction calls on Orca DEX.
You can test the query [here](https://ide.bitquery.io/Websocket-for-update-fees-and-rewards-instruction-on-Solana-Orca-DEX_1).
```graphql
subscription {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"}, Method: {is: "updateFeesAndRewards"}}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
InternalSeqNumber
Index
ExternalSeqNumber
Depth
CallerIndex
Data
CallPath
BalanceUpdatesCount
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Name
Method
Parsed
}
}
Transaction {
Signature
}
}
}
}
```
## Track Collect Reward Instruction Calls On Orca DEX
Using the query below you can get the addresses in the `Instruction Accounts[]` array for the `Collect Reward` instruction calls on Orca DEX.
You can test the query [here](https://ide.bitquery.io/Websocket-for-collectReward-and-rewards-instruction-on-Solana-Orca-DEX).
```graphql
subscription {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"}, Method: {is: "collectReward"}}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
InternalSeqNumber
Index
ExternalSeqNumber
Depth
CallerIndex
Data
CallPath
BalanceUpdatesCount
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Name
Method
Parsed
}
}
Transaction {
Signature
}
}
}
}
```
## Video Tutorial | How To Track Latest Trades, Latest Price Of A Token On Solana Orca DEX
## Video Tutorial | How To Track Latest Created Liquidity Pools, OHLC Data Of A Specific Pair On Solana Orca DEX
## Video Tutorial | How To Track Add Liquidity And Remove Liquidity Transactions On Solana Orca DEX
---
## Pump.fun Guides: Trades, Bonding Curve, PumpSwap
URL: https://docs.bitquery.io/docs/blockchain/Solana/Pumpfun/
Start here for Pump.fun data on Solana. Pick the Bitquery page for trades, bonding curve and market cap, PumpSwap pools, migration, gRPC streams or cloud exports.
# Pump.fun Guides: Trades, Bonding Curve, PumpSwap
:::tip Want structured trades, OHLC and market cap? Start with the Trading API
The [**Trading API**](/docs/trading/trading-data-overview) is the fastest path to clean Pump.fun and PumpSwap market data. [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, across **10 chains in one API**. Pre-aggregated OHLC down to one second comes from [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs), so you never build candles yourself.
Reach for the chain-level Pump.fun pages below when you need what the Trading API deliberately does not carry: **history older than the Trading window**, **bonding-curve internals**, or raw per-instruction detail.
:::
### Which Pump.fun page do I need?
| You want | Go to |
| --- | --- |
| Trades, new launches, prices, OHLCV, top traders, holders | [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) |
| Market cap, FDV, circulating supply, bonding-curve progress | [Marketcap & Bonding Curve API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-Marketcap-Bonding-Curve-API/) |
| Detect tokens graduating from the curve to the AMM | [Pump.fun to PumpSwap migration](/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/) |
| PumpSwap AMM trades, pools and liquidity | [PumpSwap API](/docs/blockchain/Solana/Pumpfun/pump-swap-api/) |
For the product overview, delivery channels (gRPC, Kafka, WebSocket), pricing and the free trial, see the [Pump.fun API product page](https://bitquery.io/products/pumpfun-api).
To get started, [sign up](https://account.bitquery.io/auth/signup?redirect_to=https%3A%2F%2Fide.bitquery.io%2F) with Bitquery and generate your [access token](https://account.bitquery.io/user/api_v2/access_tokens) by following [these steps](/docs/authorization/how-to-generate/).
If you need help getting data on PumpFun, reach out to [support](https://t.me/Bloxy_info).
For live DEX prices and 24h volume across graduated Pump.fun tokens, see [DEXrabbit's Pump.fun category](https://dexrabbit.bitquery.io/categories/pump-fun).
## What Pump.fun data can I get?
The Bitquery PumpFun API helps you fetch on-chain data for PumpFun, including:
- **Token Trades**
- **Trade Prices**
- **Token Creation**
- **Creator Holdings**
- **Token Holdings**
- **Bonding Curve Progress**
- **Migration to PumpSwap**
- **Trades of a User**
- **Trade Metrics**: volume, trades, sellers and buyers
- **Token Liquidity**
- **Token Price Change**
- **Historical Data for Aggregated Metrics**
## How is Bitquery different from Solana RPC?
The Bitquery PumpFun APIs are based on GraphQL and are highly flexible. You can fetch trades, token creation, token holdings, bonding curve progress, and migration information for a specific token or wallet over a given time period, and join the results with other on-chain data.
**Solana RPC**
- JSON-RPC endpoint exposing raw on-chain state & transactions
- No built-in history or analytics; you build or outsource any indexing and aggregation
- Ideal for submitting transactions
**Bitquery Solana API**
- GraphQL endpoint over pre-indexed, parsed Solana data (token transfers, DEX trades, NFTs, etc.)
- Historical data, joins, aggregations & real-time subscriptions
- Great for real-time data and historical backtesting without running your own indexer
## What is the difference between Solana Geyser and Bitquery Kafka streams?
**Solana Geyser stream**
- **Data & Protocol**: Runs as a plugin in your own Solana validator, emitting raw on-chain events (account updates, slot status changes, processed transactions, block metadata) over binary or gRPC feeds.
- **Infra & Maintenance**: You must host, scale, and secure the node yourself, parse and index all raw data client-side, and deal with only basic filtering. Latency and reliability depend entirely on your setup, and there is no built-in historical querying.
**Bitquery Kafka Stream**
- **Data & Protocol**: Provides fully managed Kafka topics (`solana.dextrades.proto`, `solana.tokens.proto` and `solana.transactions.proto`) delivering pre-parsed, enriched Protocol-Buffers events (DEX trades, token transfers, supply/balance updates, instructions, blocks, etc.).
- **Infra & Maintenance**: Enterprise-grade, auto-scaling Kafka streams with sub-second latency, schema-based filtering, instruction-level balance updates, built-in replication and failover. No node ops or custom parsing needed.
Read more in [Real-time Solana data streams](/docs/streams/real-time-solana-data/) and contact sales via [Telegram](https://t.me/Bloxy_info) or [form](https://bitquery.io/forms/api) for a **Trial**.
## Does Bitquery support PumpFun WebSockets and Webhooks?
Yes. Bitquery supports both WebSockets and webhooks. You can convert most of the GraphQL APIs into **GraphQL streams** by changing `query` to `subscription` and monitor the data over a WebSocket. More information and [code samples are available here](/docs/subscriptions/websockets/).
## All Pump.fun guides
- [Pump Fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Pump Swap API](/docs/blockchain/Solana/Pumpfun/pump-swap-api/)
- [Marketcap Bonding Curve API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-Marketcap-Bonding-Curve-API/)
- [Pump Fun to Pump Swap](/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/)
- [Pump.fun gRPC streams](/docs/grpc/solana/examples/pump-fun-grpc-streams/)
- [Pump.fun data in Snowflake, AWS S3 and BigQuery](/docs/cloud/pumpfun/)
- [Pump.fun token sniffer](/docs/usecases/pumpfun-token-sniffer/)
- [Pump.fun launch pulse (MCP example)](/docs/mcp/trading/examples/pumpfun-launch-pulse/)
## Related Solana APIs
- [Solana Dex Trades](/docs/blockchain/Solana/solana-dextrades)
- [Solana Transactions](/docs/blockchain/Solana/solana-transactions)
- [Solana Transfers](/docs/blockchain/Solana/solana-transfers)
- [Solana Balance Updates](/docs/blockchain/Solana/solana-balance-updates)
- [Solana Instructions](/docs/blockchain/Solana/solana-instructions)
- [Solana Fees API](/docs/blockchain/Solana/solana_fees_api)
- [Building an AI Trading Agent on Solana](/docs/blockchain/Solana/ai-agent-solana-data)
## Videos
### Video Tutorial | Get Live Prices, Metadata, OHLCV, Trading Pair Stats and Charts
### Video Tutorial | How to Get the OHLC Data & Price of a Token on Pump Fun DEX in Realtime
### Video Tutorial | How to Track PumpFun DEX Trades and Newly Launched Tokens in Realtime
### Video Tutorial | How to get Token Holders and Trading Volume for a PumpFun Token
### Video Tutorial | How to track the PumpFun Tokens which are about to Graduate to PumpSwap in Realtime
---
## Pump.fun Marketcap & Bonding Curve API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Pumpfun/Pump-Fun-Marketcap-Bonding-Curve-API/
Stream Pump.fun market cap, FDV, circulating supply and bonding curve progress on Solana with the Bitquery Trading GraphQL API.
# Pump.fun Marketcap & Bonding Curve API
:::tip Need real-time Pump.fun market-cap data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Pump.fun market-cap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Pump.fun market-cap data older than ~30 days**, raw per-swap detail, or call / event context.
:::
For delivery channels, pricing and the free trial, see the [Pump.fun API product page](https://bitquery.io/products/pumpfun-api).
In this document, we explore examples that retrieve market cap, bonding curve progress, and whether a token has migrated to PumpSwap. The fully exhaustive Pump.fun API documentation is available [here](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/). The Moonshot API is also available — you can access its documentation [here](/docs/blockchain/Solana/Moonshot-API/).
These APIs can also be delivered through different streams, including Kafka, for zero-latency requirements. Please contact us on Telegram.
:::note
The `Trade Side Account` field is not available for aggregate queries in the Archive and Combined datasets.
:::
## Get Latest Marketcap of a PumpFun Token
Use **Trading API** **`Pairs`**: latest row per token with **`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, **`Token.Id`** matching your mint (**`solana:`**), **`Market.ProtocolFamily`** **Pumpfun**, and interval duration **> 1** second. The response includes **`Supply.MarketCap`**, **FDV**, **OHLC**, **volume**, and **token** metadata.
Test the query [here](https://ide.bitquery.io/specific-pumpfun-token-latest-marketcap).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: {
Id: {
includesCaseInsensitive: "solana:7GMB7XbtTdvnHkPjH6yEwTUB3HYf5dqC3FKyr2sueMEh"
}
}
Interval: { Time: { Duration: { gt: 1 } } }
Market: { ProtocolFamily: { is: "Pumpfun" } }
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Market {
Program
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Price {
Average {
Mean
}
Ohlc {
Open
Low
High
Close
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
}
}
}
```
## Get Tokens with a specific MarketCap
Stream **Trading** **`Pairs`** in real time for **Solana** tokens on **Pumpfun** when **`Supply.MarketCap`** is above a threshold (example below: **> $10,000** USD). Change **`Supply.MarketCap.gt`** to tune the floor. Interval duration must be **> 1** second.
Try it with this [stream link](https://ide.bitquery.io/realtime-stream-pumpfun-tokens-with-marketcap-above-10k-marketcap#).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { ProtocolFamily: { is: "Pumpfun" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
You can also use **`TokenSupplyUpdates`** for supply-driven views; see the [token supply cube](/docs/blockchain/Solana/token-supply-cube/).
## Top Pump.fun tokens by market cap change in the last 1 hour
**Trading** **`Pairs`** with **1-hour** OHLC (`Duration: { eq: 3600 }`), **`Market.ProtocolFamily`** **Pumpfun**, **`Token.Network`** **Solana**, ordered by **`change_mcap`**: **(close − open) × total supply**. Up to **50** rows; adjust **`limit`** as needed.
Test the query [here](https://ide.bitquery.io/Top-pump-fun-tokens-by-Marketcap-change-in-last-1-hr).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 50 }
orderBy: { descendingByField: "change_mcap" }
where: {
Market: { ProtocolFamily: { is: "Pumpfun" } }
Interval: { Time: { Duration: { eq: 3600 } } }
Token: { Network: { is: "Solana" } }
}
) {
Currency {
Id
Name
Symbol
}
Token {
Network
Symbol
Address
}
Supply {
MarketCap
FullyDilutedValuationUsd
CirculatingSupply
TotalSupply
MaxSupply
}
change_mcap: calculate(
expression: "($Price_Ohlc_Close-$Price_Ohlc_Open) * Supply_TotalSupply"
)
Price {
Ohlc {
Open
Close
}
}
}
}
}
```
## Track Pump Fun Token Migrations to PumpSwap in Realtime - Subscription
Stream successful PumpSwap **`create_pool`** instructions (**`pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`**) at **depth 1**, excluding placeholder mint **`11111111111111111111111111111111`** in instruction arguments. Migrated pair details appear under **`Instruction.Accounts`**.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/pumpfun-migration-stream_4#).
Click to expand GraphQL subscription
```graphql
subscription {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Depth: { eq: 1 }
Program: {
Method: { is: "create_pool" }
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
Arguments: {
includes: [{ Value: { Address: { notIn: ["11111111111111111111111111111111"] } } }]
}
}
}
}
) {
Migrate_Time: Block {
Time
}
Instruction {
Program {
Name
Method
AccountNames
Arguments {
Name
Value {
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
CallerIndex
Depth
CallPath
}
Transaction {
Signature
Signer
Fee
}
}
}
}
```
## Latest Pump Fun Token Migrations to PumpSwap - Query
Same filters as the subscription, with **`limit: { count: 20 }`** and **`orderBy: { descending: Block_Slot }`** for recent migrations.
Run the query [in the Bitquery IDE](https://ide.bitquery.io/pumpfun-migration-query#).
Click to expand GraphQL query
```graphql
query {
Solana {
Instructions(
limit: { count: 20 }
orderBy: { descending: Block_Slot }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Depth: { eq: 1 }
Program: {
Method: { is: "create_pool" }
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
Arguments: {
includes: [{ Value: { Address: { notIn: ["11111111111111111111111111111111"] } } }]
}
}
}
}
) {
Migrate_Time: Block {
Time
}
Instruction {
Program {
Name
Method
AccountNames
Arguments {
Name
Value {
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
CallerIndex
Depth
CallPath
}
Transaction {
Signature
Signer
Fee
}
}
}
}
```
## Pumpfun Token Migrations on a specific date - Historical
Retrieve Pump.fun token migrations on a specific date. The API returns transfers to the PumpSwap migration receiver address for the given date.
[Try the query](https://ide.bitquery.io/pumpfun-transfers-type-v1-to-pumpfun-migrations_1)
Click to expand GraphQL query
```graphql
{
solana {
transfers(
options: { limit: 500 }
date: { is: "2024-10-18" }
currency: { not: "SOL" }
externalProgramId: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
transferType: { in: transfer }
receiverAddress: { is: "39azUYFWPz3VHgKCf3VChUwbpURdCHRxjWVowf5jUJjg" }
) {
block {
height
timestamp {
iso8601
}
}
instruction {
action {
name
}
callPath
external
externalAction {
name
type
}
program {
name
id
}
externalProgram {
id
name
}
}
currency {
name
symbol
address
}
date {
date
}
amount
sender {
address
mintAccount
type
}
receiver {
address
mintAccount
type
}
transaction {
signature
signer
}
transferType
}
}
}
```
## Check if the Pump Fun Token has migrated to PumpSwap - API
To check if a Pump Fun Token has migrated to PumpSwap, we can use the below query. In this query we are checking if this token `6SmgaPU4LMd8eWhamtpTtArr7JYPKZSF8AKK2Uy5pump` has migrated to PumpSwap. You can run the query [here](https://ide.bitquery.io/check-if-a-pump-fun-token-has-migrated_1).
Click to expand GraphQL query
```graphql
query ($token: String) {
Solana {
Instructions(
where: {
Instruction: {
Accounts: { includes: { Address: { is: $token } } }
Program: {
Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
}
Logs: { includes: { includes: "Migrate" } }
}
Transaction: { Result: { Success: true } }
}
) {
Migrate_Time: Block {
Time
}
Instruction {
Program {
Name
Method
Arguments {
Name
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Address
AccountNames
}
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
}
Transaction {
Signature
}
joinInstructions(
join: any_inner
Transaction_Index: Transaction_Index
Transaction_Signature: Transaction_Signature
where: {
Instruction: {
Program: {
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
Method: { is: "create_pool" }
}
}
}
) {
Instruction {
Program {
Name
Method
Arguments {
Value {
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
}
Type
Name
}
AccountNames
}
Accounts {
Address
Token {
Owner
Mint
}
}
}
}
}
}
}
```
```json
{
"token":"6SmgaPU4LMd8eWhamtpTtArr7JYPKZSF8AKK2Uy5pump"
}
```
## Bonding Curve Progress API
Below query will give you the Bonding curve progress percentage of a specific Pump Fun Token.
### Bonding Curve Progress Formula
- **Formula**:
BondingCurveProgress = 100 - ((leftTokens \* 100) / initialRealTokenReserves)
Where:
- leftTokens = realTokenReserves - reservedTokens
- initialRealTokenReserves = totalSupply - reservedTokens
- **Definitions**:
- `initialRealTokenReserves` = `totalSupply` - `reservedTokens`
- `totalSupply`: 1,000,000,000 (Pump Fun Token)
- `reservedTokens`: 206,900,000
- Therefore, `initialRealTokenReserves`: 793,100,000
- `leftTokens` = `realTokenReserves` - `reservedTokens`
- `realTokenReserves`: Token balance at the market address.
:::note
**Simplified Formula**:
BondingCurveProgress = 100 - (((balance - 206900000) \* 100) / 793100000)
:::
### Additional Notes
- **Balance Retrieval**:
- The `balance` is the token balance at the market address.
- Use this query to fetch the balance and then we use `expressions` to calculate the bonding curve progress percentage in the query itself: [Query Link](https://ide.bitquery.io/get-the-bonding-curve-progress-percentage_1).
Click to expand GraphQL query
```graphql
query GetBondingCurveProgressPercentage {
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Slot }
where: {
Pool: {
Market: {
BaseCurrency: {
MintAddress: {
is: "3j3fKH9Nw9cPZsZSPvE5qNgLWnxGk6tBHM9kX3qopump"
}
}
}
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
}
}
) {
Bonding_Curve_Progress_percentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
Balance: PostAmount
}
}
}
}
}
```
## Track Pump Fun Tokens above 95% Bonding Curve Progress in realtime
We can use above Bonding Curve formulae and get the Balance of the Pool needed to get to 95% and 100% Bonding Curve Progress range. And then track liquidity changes which result in `Base{PostAmount}` to fall in this range. You can run and test the saved query [here](https://ide.bitquery.io/Pump-Fun-Tokens-between-95-and-100-bonding-curve-progress_3).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
DEXPools(
where: {
Pool: {
Base: { PostAmount: { gt: "206900000", lt: "246555000" } }
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Top 100 About to Graduate Pump Fun Tokens
We can use below query to get top 100 About to Graduate Pump Fun Tokens. You can run and test the saved query [here](https://ide.bitquery.io/Top-100-graduating-pump-fun-tokens-in-last-5-minutes_2).
Click to expand GraphQL query
```graphql
{
Solana {
DEXPools(
limitBy: { by: Pool_Market_BaseCurrency_MintAddress, count: 1 }
limit: { count: 100 }
orderBy: { ascending: Pool_Base_PostAmount }
where: {
Pool: {
Base: { PostAmount: { gt: "206900000" } }
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { minutes_ago: 5 } } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount(maximum: Block_Time)
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Video Tutorials
### Video Tutorial | How to get Bonding Curve Progress of any Pump Fun Token
### Video Tutorial | How to track Pump Fun Token Migrations to PumpSwap in realtime
### Video Tutorial | How to get Top Pump Fun Tokens by Marketcap Value
### Video Tutorial | How to track the Pump Fun Tokens which are about to Graduate in Realtime
---
## Pump.fun Token API Documentation: Trades, Prices, OHLCV
URL: https://docs.bitquery.io/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/
Pump.fun has no hosted API. Query Pump.fun trades, launches, prices, OHLCV, bonding curves and graduations on Solana over GraphQL, WebSocket, gRPC and Kafka.
# Pump.fun Token API Documentation: Trades, Prices, OHLCV
Pump.fun does not run a hosted data API. It publishes program documentation and IDLs for its on-chain programs on GitHub ([pump-public-docs](https://github.com/pump-fun/pump-public-docs)), and the hosts its web app calls are undocumented, so there is no supported endpoint for trades, prices, candles or new launches. This page is the query reference for the Bitquery Pump.fun API, which reads that activity from the chain: live trades, new token launches, prices and OHLCV, bonding curve progress, graduations to PumpSwap, holders and top traders, over GraphQL, WebSocket, gRPC and Kafka, filtered by the Pump.fun program address `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`. Every query runs as written in the [Bitquery IDE](https://ide.bitquery.io). Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. Delivery options, latency and pricing are on the [Pump.fun API product page](https://bitquery.io/products/pumpfun-api).
:::tip Want structured trades, OHLC and market cap? Start with the Trading API
The [**Trading API**](/docs/trading/trading-data-overview) is the fastest path to clean Pump.fun market data. [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) returns **MEV-filtered swaps with USD price, market cap and supply on every row**, across **10 chains in one API**, and [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) gives pre-aggregated OHLC down to one second, so you never build candles yourself. Worked Pump.fun examples are in [Trader-Focused Trade APIs](#trader-focused-trade-apis-with-usd-price-market-cap--supply) below.
Reach for the raw chain-level queries on this page when you need what the Trading API deliberately does not carry: **history older than the Trading window**, **bonding-curve internals**, per-instruction detail, or call / event context.
:::
For data points not covered here, ask [support](https://t.me/Bloxy_info).
:::tip **Try Our PumpFun Token Sniffer**
Want to screen Pump.fun mints for phishing risk? Check out our [**PumpFun Token Sniffer**](https://pumpfun-token-sniffer.vercel.app/), a proof-of-concept tool that helps identify suspicious token behavior by analyzing transfers and trades.
:::
Need zero-latency Pump.fun data? [Read about our Shred Streams and contact us for a trial](/docs/streams/real-time-solana-data/). For gRPC streaming, see [Pump.fun gRPC Streams →](/docs/grpc/solana/examples/pump-fun-grpc-streams/).
You may also be interested in:
- [LetsBonk.fun APIs ➤](/docs/blockchain/Solana/letsbonk-api/)
- [StonkFun APIs ➤](/docs/blockchain/Solana/stonkfun-api/)
- [PumpSwap APIs ➤](/docs/blockchain/Solana/Pumpfun/pump-swap-api/)
- [Moonshot APIs ➤](/docs/blockchain/Solana/Moonshot-API/)
- [FourMeme APIs ➤](/docs/blockchain/BSC/four-meme-api/)
- [DEXrabbit Pump.fun category](https://dexrabbit.bitquery.io/categories/pump-fun): live multi-chain DEX prices and 24h volume
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## What is the Program Address for Pump.fun on Solana?
The Pump.fun program address on Solana mainnet is `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`. Use Bitquery's GraphQL API to filter DEX trades, mintn creation, and bonding curve data by this program ID.
```
6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P
```
Use this program ID when filtering Solana instructions or supply updates for Pump.fun mints. All examples below reference this program. For bonding curve data, token creation, and migration tracking, use the queries in this guide with `Program: { Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" } }`.
Mints that complete the bonding curve graduate to PumpSwap, pump.fun's own AMM, at program address `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` (see the [PumpSwap API page](/docs/blockchain/Solana/Pumpfun/pump-swap-api/)). In the trade cubes the two venues appear as `Dex.ProtocolName` `pump` for the bonding curve and `pump_amm` for PumpSwap (family `Pumpswap`). Curve mints trade for hours, not months, so the examples here that need a market still alive when you read them use PUMP (`pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn`), pump.fun's own token, which trades on PumpSwap. For a token still on the curve, switch the filter to `pump` and take a live mint from [tokens traded in the last hour](#how-do-i-get-all-tokens-traded-on-pumpfun-in-the-last-1-hour).
## Token Creation & Metadata
### How do I get newly created Pump.fun tokens?
Subscribe to `TokenSupplyUpdates` filtered by the Pump.fun program's `create` or `create_v2` method for metadata, supply and dev address as each mint appears.
[New Pump.fun mints: run it ➤](https://ide.bitquery.io/newly-created-PF-token-dev-address-metadata_8)
Show the GraphQL
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
Method: { in: ["create", "create_v2"] }
}
}
}
) {
Block {
Time
}
Transaction {
Signer
}
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
```
### How do I get creation time and dev address of a Pump.fun token?
[Try Pump.Fun Dev Address & Creation Time Query ➤](https://ide.bitquery.io/PumpFun-Token-creation-time--creator_2)
Show the GraphQL
```graphql
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Accounts: { includes: { Address: { is: "token mint address" } } }
Program: {
Name: { is: "pump" }
Method: { in: ["create", "create_v2"] }
}
}
}
) {
Block {
Time
}
Transaction {
Signer
Signature
}
Instruction {
Accounts {
Address
}
}
}
}
}
```
### How do I monitor Pump.fun new token launches in real time?
Use Bitquery's GraphQL subscription on `Instructions` filtered by the Pump.fun program and `create`/`create_v2` methods. This returns creation events with mint address, bonding curve, metadata, creator, name, symbol, and URI.
[Track launches in realtime: stream it ➤](https://ide.bitquery.io/Track-new-token-launches-on-Pump-Fun-in-realtime0_7)
Show the GraphQL
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { in: ["create", "create_v2"] }
Name: { is: "pump" }
}
}
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
Transaction {
Signature
}
}
}
}
```
### How do I get all Pump.fun tokens created by a specific address?
[Everything created by an address: run it ➤](https://ide.bitquery.io/all-Pump-fun-tokens-created-by-an-address_3)
:::tip
Want to analyze the funding history and transaction patterns of a creator? Connect the [Bitquery MCP server](https://mcp.bitquery.io/) and ask an AI agent to trace the creator's funding in plain English ([AI Investigations](https://bitquery.io/solutions/ai-investigations)), or use our [Money Flow API](https://docs.bitquery.io/v1/docs/Examples/coinpath/money-flow-api#funding-history-of-address) to query fund movements directly.
:::
Show the GraphQL
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
Transaction: {
Result: { Success: true }
Signer: { is: "ADD CREATOR ADDRESS HERE" }
}
Instruction: {
Program: {
Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
Method: { in: ["create", "create_v2"] }
}
}
}
) {
Block {
Time
}
TokenSupplyUpdate {
Amount
Currency {
Uri
UpdateAuthority
Symbol
Name
MintAddress
MetadataAddress
Fungible
Decimals
}
PostBalance
}
Transaction {
Signature
Signer
}
}
}
}
```
### How do I get Pump.fun tokens created by a wallet from historical data?
Use the **v1 Solana transfers API** to list what a wallet created on Pump.fun over a date range.
Replace the `signer` value and the `date` range in the query with your target wallet and desired window. For **aggregates** (e.g. total count of mints created by a wallet), use the dedicated count query below.
- **[Run query: list mints created by a wallet](https://ide.bitquery.io/Pumpfun-tokens-created-by-a-wallet-historical#)**
- **[Run query: count of mints created by a wallet](https://ide.bitquery.io/Count-of-Pumpfun-tokens-created-by-a-wallet-historical#)**
Show the GraphQL
```graphql
{
solana {
transfers(
options: { limit: 100, desc: "block.height" }
date: { since: "2025-02-08", till: "2025-06-08" }
externalProgramId: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
transferType: { is: mint }
signer: { is: "Ddu1xqgNHBRBiJrissrpLtevq2A7KAHjgiDzECoNL8HG" }
) {
block {
height
timestamp {
iso8601
}
}
instruction {
action {
name
}
callPath
external
externalAction {
name
type
}
program {
name
id
}
externalProgram {
id
name
}
}
currency {
name
symbol
address
}
date {
date
}
amount
receiver {
address
mintAccount
type
}
transaction {
signature
signer
}
transferType
}
}
}
```
### How do I get token metadata, dev address, and creation time for a specific Pump.fun token?
Each new launch arrives with its dev address, metadata and supply.
`PostBalance` carries the current supply.
[New mints with dev and metadata: stream it ➤](https://ide.bitquery.io/newly-created-PF-token-dev-address-metadata_9)
Show the GraphQL
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {Instruction: {Program: {Address: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}, Method: {in: ["create","create_v2"]}}}}
) {
Block{
Time
}
Transaction{
Signer
}
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
```
## Pump.fun Mayhem Mode Tokens
Below APIs are related to Pump.fun tokens which were launched within Mayhem mode.
To check whether an older mint was created with Mayhem mode `true` or `false`, use this [Bitquery Solana v1 API](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers#check-if-a-pump-fun-token-was-launched-in-mayhem-mode---historical-query), in v1 we have all the solana transfers data so we check for the 1 Billion token transfer to Mayhem Autonomous AI agent if theres a transfer we can say that the token was a Mayhem token.
### How do I track Mayhem mode enabled Pump.fun tokens in real time?
Streams mints created with Mayhem mode enabled, as they launch.
Try the API [here](https://ide.bitquery.io/Track-Mayhem-Mode-enabled-Pumpfun-Tokens-in-realtime).
Show the GraphQL
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}, Method: {in: ["create", "create_v2"]}, Arguments: {includes: {Value: {Boolean: true}}}}}, Transaction: {Result: {Success: true}}}
) {
Instruction {
Program {
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Transaction {
Signature
}
}
}
}
```
### How do I check Mayhem mode of a Pump.fun token?
Now you can check if a pump fun token is in Mayhem mode or not, we will be checking if it was launched with the `is_mayhem_mode` as `true` or `false`.
[Check Mayhem mode: run it ➤](https://ide.bitquery.io/check-mayhem-mode-of-a-pump-fun-token_1)
Show the GraphQL
```graphql
query MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}, Method: {in: ["create", "create_v2"]}}, Accounts: {includes: {Address: {is: "TOKEN_ADDRESS_TO_CHECK"}}}}, Transaction: {Result: {Success: true}}}
) {
Instruction {
Program {
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Transaction {
Signature
}
}
}
}
```
### How do I check if a Pump.fun token was launched in Mayhem mode? (Historical)
To determine if a Pump.fun token was launched in Mayhem mode, we use the Solana v1 Transfers API. The following query checks transfers of exactly 1,000,000,000,000,000 units (which equals 1 billion tokens when adjusted for 6 decimal places).
- If the resulting count is **2**, the token was launched in Mayhem mode.
- If the count is **1**, the token was launched in standard mode.
This method reliably identifies whether a token's initial mint followed the Mayhem mode process.
[Try out the API](https://ide.bitquery.io/token-mayhem-mode-or-not_1)
Show the GraphQL
```graphql
{
solana {
transfers(
date: { since: "2025-01-01" }
amount: { is: 1000000000000000 }
currency: { is: "EEhQvi54Rwme2z84gG6qQmuaWjnZ6b9AMgq5aGkKpump" }
) {
count
}
}
}
```
## Token Pricing & Market Data
### How do I get the latest price of a Pump.fun token?
We launched the [Price Index](/docs/trading/crypto-price-api/) in August 2025, allowing you to track price of any token trading onchain.
Here's an example of tracking prices. It uses PUMP on PumpSwap; for a mint still on the bonding curve, filter `Market.Program` to `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` instead.
PumpFun Token prices against SOL Stream
[Latest price in USD: run it ➤](https://ide.bitquery.io/solana-token-price-using-price-api)
Show the GraphQL
```graphql
{
Trading {
Pairs(
where: {
Market: { Network: { is: "Solana" } }
Token: {
Address: { is: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn" }
}
Interval: { Time: { Duration: { eq: 60 } } }
}
limit: { count: 1 }
orderBy: { descending: Block_Time }
) {
Market {
Address
Network
Program
Protocol
ProtocolFamily
}
Price {
IsQuotedInUsd
Average {
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Close
High
Low
Open
}
}
Token {
Address
Name
Symbol
}
QuoteToken {
Address
Name
Symbol
}
Volume {
Base
Usd
}
}
}
}
```
### How do I track the price of a Pump.fun token in real time?
Live stream of token price updates on Pump.fun
[Track price in real time: stream it ➤](https://ide.bitquery.io/Price-of-a-pump-fun-token-using-price-index-in-usd)
Show the GraphQL
```graphql
subscription {
Trading {
Pairs(
where: {
Token: {
Address: { is: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn" }
}
Price: { IsQuotedInUsd: true }
Market: {
Network: { is: "Solana" }
Program: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
}
}
) {
Market {
Address
Network
Program
Protocol
ProtocolFamily
}
Price {
Average {
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
Ohlc {
Close
High
Low
Open
}
}
Token {
Address
Name
Symbol
}
QuoteToken {
Address
Name
Symbol
}
Volume {
Base
Usd
}
}
}
}
```
### How do I get top 10 Pump.fun tokens by price change in the last 5 minutes?
Returns the ten biggest price moves on Pump.fun over the last 5 minutes. Open it in the [Bitquery IDE: biggest 5-minute movers](https://ide.bitquery.io/Top-10-pump-fun-tokens-by-Price-change-in-last-5min_1).
Show the GraphQL
```graphql
{
Trading {
Pairs(
limit: {count: 10}
limitBy: {count: 1, by: Token_Address}
orderBy: {descendingByField: "Price_Change_5min"}
where: {Interval: {Time: {Duration: {eq: 1}}}, Block: {Time: {since_relative: {minutes_ago: 5}}}, Price: {IsQuotedInUsd: true}, Market: {Network: {is: "Solana"}, Program: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}}}
) {
Market {
Address
Network
Program
Protocol
ProtocolFamily
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
min5Ago: Mean(
minimum: Block_Time
if: {Block: {Time: {since_relative: {minutes_ago: 5}}}}
)
}
}
Price_Change_5min: calculate(expression: "(( $Price_Average_currentPrice - $Price_Average_min5Ago ) / $Price_Average_min5Ago) * 100")
Token {
Address
Name
Symbol
}
Market{
Address
}
QuoteToken {
Address
Name
Symbol
}
}
}
}
```
### How do I get Pump.fun token OHLCV data historically?
Use Bitquery's `DEXTradeByTokens` with `Block.Time(interval: minutes, count: 1)` to fetch open-high-low-close (OHLC) data. Filter by token mint and Pump.fun program `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P`. For history, use `dataset: archive`; some fields such as `Trade_Side` are not served there.
[OHLC on Pump.fun: run it ➤](https://ide.bitquery.io/OHLC-for-a-token-on-Pump-Fun0_8)
:::note
Trade Side Account field will not be available for aggregate queries in Archive and Combined Datasets
:::
Show the GraphQL
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
limit: { count: 10 }
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: {
MintAddress: { is: "66VR6bjEV5DPSDhYSQyPAxNsY3dgmH6Lwgi5cyf2pump" }
}
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
}
}
) {
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
}
}
}
```
### How do I get a token's all-time high (ATH) price on Pump.fun?
Use Bitquery's `DEXTradeByTokens` with `dataset: archive`, `Trade.PriceInUSD(maximum: Trade_PriceInUSD)`, and `quantile(of: Trade_PriceInUSD, level: 0.98)` to get ATH price. Market cap = ATH price × 1 billion (Pump.fun tokens have 1B supply). Pass token mint addresses in `Trade.Currency.MintAddress.in`.
[ATH price and market cap in timeframe: run it ➤](https://ide.bitquery.io/ATH-Market-Cap-of-Pump-Fun-Tokens-in-a-Specific-Timeframe)
Show the GraphQL
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
limitBy: { by: Trade_Currency_MintAddress, count: 1 }
where: {
Trade: {
Currency: {
MintAddress: {
in: [
"639g7XEn1fMf7ZpHhKWUiHywY4PpQ5QPm6VMsw8Cpump"
"FXMCWau8etMkKZnyn4pi9qMM3NVfrCHFM4KKnJvNpump"
]
}
}
Side: {
Currency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Block: { Time: { since: "2025-05-03T06:37:00Z" } }
}
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
PriceInUSD(maximum: Trade_PriceInUSD)
Side {
Currency {
Symbol
}
}
}
max: quantile(of: Trade_PriceInUSD, level: 0.98)
ATH_Marketcap: calculate(expression: "$max * 1000000000")
}
}
}
```
### How do I get token price change over time (delta from X minutes back)?
Useful for tracking % change by comparing first/last prices
[Price change over time: run it ➤](https://ide.bitquery.io/price-change-over-x-minutes)
Show the GraphQL
```graphql
query PumpFunRecentTrades {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since_relative: { minutes_ago: 60 } } }
Trade: {
Currency: {
MintAddress: { is: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn" }
}
Dex: { ProtocolName: { is: "pump_amm" } }
}
Transaction: { Result: { Success: true } }
}
) {
Trade {
Market {
MarketAddress
}
Currency {
Symbol
Name
MintAddress
}
lastPrice: Price(maximum: Block_Slot)
prePrice: Price(minimum: Block_Slot)
}
Price_change: calculate(
expression: "(( $Trade_lastPrice - $Trade_prePrice ) / $Trade_prePrice) * 100"
)
}
}
}
```
### How do I get a wallet's PnL on Pump.fun tokens? {#how-do-i-get-a-wallets-pnl-on-pumpfun-tokens}
Bitquery does not return a single “PnL” field for Pump.fun: derive it from **historical buys and sells** for that wallet and mint. Query **`Solana.DEXTrades`** or **`DEXTradeByTokens`** with **`Dex.ProtocolName: pump`**, the token **`MintAddress`**, **`Transaction.Signer`** or buy/sell accounts, and a time window; then compute realized PnL from USD volumes (see the **[Realised PnL example on Solana DEX Trades](/docs/blockchain/Solana/solana-dextrades/#realised-pnl-avg-buy-price-buy-volume-sell-volume)**). Use the **Crypto Price API** if you need mark-to-market for open positions.
## Trade Activity & Volume
### How do I get live trades from Pump.fun using Bitquery?
Use Bitquery's `DEXTrades` GraphQL subscription filtered by `ProtocolName: "pump"` to stream live Pump.fun trades including buy/sell sides, amounts, accounts, and methods. For gRPC or Kafka, see [Pump.fun gRPC Streams](/docs/grpc/solana/examples/pump-fun-grpc-streams/).
[Pump.fun real-time trades: stream it ➤](https://ide.bitquery.io/Pumpfun-DEX-Trades-stream)
Show the GraphQL
```graphql
subscription MyQuery {
Solana {
DEXTrades(
where: {
Trade: { Dex: { ProtocolName: { is: "pump" } } }
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
Price
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
PriceInUSD
Price
}
}
Transaction {
Signature
}
}
}
}
```
### How do I get the latest trades for a Pump.fun token?
Retrieves recent trades with detailed price, amount, and sides
[Latest trades for one mint: run it ➤](https://ide.bitquery.io/get-latest-trades-of-a-pump-fun-token_6)
Show the GraphQL
```graphql
query pumpfunTokenLatestTrades($token: String) {
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: {
Currency: { MintAddress: { is: $token } }
Price: { gt: 0 }
Dex: { ProtocolName: { is: "pump_amm" } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
allTime: Time
}
Trade {
Account {
Address
Owner
}
Side {
Type
}
Price
Amount
Side {
AmountInUSD
Amount
}
}
}
}
}
```
```json
{
"token": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn"
}
```
### How do I get the volume of a Pump.fun token for the last 7 days?
Use Bitquery's `DEXTradeByTokens` with `sum(of: Trade_Amount)` and a `Block.Time.since` filter (e.g. 7 days ago) to aggregate trading volume. Filter by token mint address and `ProtocolName` (`pump_amm` for PumpSwap, as in the PUMP example, or `pump` for the bonding curve).
[Trading volume for one mint: run it ➤](https://ide.bitquery.io/trade-volume-7-days)
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: { is: "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn" }
}
Dex: { ProtocolName: { is: "pump_amm" } }
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Dex {
ProtocolName
ProtocolFamily
}
}
TradeVolumeRaw: sum(of: Trade_Amount)
TradeVolumeUSD: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
In addition, you can get the last 7 days of trading volume using the [Crypto Price API](/docs/trading/crypto-price-api/). Example:
[Last 7 days of volume: run it ➤](https://ide.bitquery.io/Last-7-days-of-volume-for-any-token_2)
```graphql
{
Trading {
Tokens(
where: {
Block: { Date: { since_relative: { days_ago: 7 } } }
Interval: { Time: { Duration: { eq: 3600 } } }
Token: {
Address: { is: "cbbtcf3aa214zXHbiAZQwf4122FBYbraNdFqgw4iMij" }
}
}
) {
sum(of: Volume_Usd)
}
}
}
```
### How do I get all tokens traded on Pump.fun in the last 1 hour?
To list everything traded on Pump.fun in the last hour, filter trades by the protocol and a block time inside that window. This provides a list of tokens that have had at least one trade during this window, along with associated token and market details. Each token record includes its mint address, name, symbol, and network.
The sample GraphQL query below retrieves all Pump.fun tokens traded in the last hour on Solana:
[Everything traded in the last hour: run it ➤](https://ide.bitquery.io/all-tokens-traded-on-Pumpfun-in-the-last-1-hour_1)
Show the GraphQL
```graphql
{
Trading {
Pairs(
limitBy: { by: Token_Address, count: 1 }
where: {
Market: {
Program: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
}
Token: { Network: { is: "Solana" } }
Block: { Time: { since_relative: { minutes_ago: 60 } } }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Token {
Address
Id
IsNative
Name
Network
Symbol
TokenId
}
Market {
Address
Program
Name
}
}
}
}
```
### How do I get tokens that reached a specific market cap on Pump.fun?
To find mints that crossed a market-cap threshold, use the following example. It filters for tokens with a market cap greater than or equal to a provided value (for example, $10,000) on Solana within the last minute. Adjust the `ge` value in `MarketCap` to your chosen threshold.
[Mints that reached a market cap: run it ➤](https://ide.bitquery.io/How-do-I-get-tokens-that-reached-a-specific-market-cap-on-Pumpfun)
Show the GraphQL
```graphql
{
Trading {
Pairs(
limitBy: { by: Token_Address, count: 1 }
where: {
Market: {
Program: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
}
Token: { Network: { is: "Solana" } }
Supply: { MarketCap: { ge: 10000 } }
Block: { Time: { since_relative: { minutes_ago: 1 } } }
Interval: { Time: { Duration: { eq: 1 } } }
}
) {
Token {
Address
Id
IsNative
Name
Network
Symbol
TokenId
}
Price {
Average {
Mean
ExponentialMoving
SimpleMoving
WeightedSimpleMoving
}
}
Supply {
MarketCap
FullyDilutedValuationUsd
TotalSupply
}
Market {
Address
Program
Name
}
}
}
}
```
### How do I get detailed trade stats (volume, buys, sells, makers, buyers, sellers)?
Includes 5-minute and 1-hour metrics for deep token analytics. The windows use `since_relative` and `after_relative`, so they roll forward with no date to update; the example pair is the PUMP/USDC PumpSwap pool.
[Detailed trade stats: run it ➤](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair_10)
Show the GraphQL
```graphql
query PairStats($token: String!, $pair_address: String!) {
Solana(dataset: realtime) {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: $token } }
Market: { MarketAddress: { is: $pair_address } }
}
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
start: PriceInUSD(minimum: Block_Time)
min5: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
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_relative: { minutes_ago: 5 } } } }
)
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_relative: { minutes_ago: 5 } } }
}
)
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_relative: { minutes_ago: 5 } } }
}
)
trades: count
trades_5min: count(if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } })
traded_volume: sum(of: Trade_Side_AmountInUSD)
traded_volume_5min: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { after_relative: { minutes_ago: 5 } } } }
)
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_relative: { minutes_ago: 5 } } }
}
)
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_relative: { minutes_ago: 5 } } }
}
)
buys: count(if: { Trade: { Side: { Type: { is: buy } } } })
buys_5min: count(
if: {
Trade: { Side: { Type: { is: buy } } }
Block: { Time: { after_relative: { minutes_ago: 5 } } }
}
)
sells: count(if: { Trade: { Side: { Type: { is: sell } } } })
sells_5min: count(
if: {
Trade: { Side: { Type: { is: sell } } }
Block: { Time: { after_relative: { minutes_ago: 5 } } }
}
)
}
}
}
```
```json
{
"token": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
"pair_address": "2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd"
}
```
### How do I get the first 100 buyers of a Pump.fun token?
Gets the first 100 wallets that bought. DEXTrades on Solana keeps only the recent window, so pick a mint launched inside it.
[First 100 buyers: run it ➤](https://ide.bitquery.io/get-first-100-buyers-of-a-token_1)
Show the GraphQL
```graphql
query MyQuery {
Solana {
DEXTrades(
where: {
Trade: {
Buy: {
Currency: {
MintAddress: {
is: "token mint address"
}
}
}
}
}
limit: { count: 100 }
orderBy: { ascending: Block_Time }
) {
Trade {
Buy {
Amount
Account {
Token {
Owner
}
}
}
}
}
}
}
```
### How do I check if the first 100 buyers are still holding?
Pass the owner addresses from the above query to evaluate holdings
[Holdings of first 100 buyers: run it ➤](https://ide.bitquery.io/balance-of-a-specific-token-at-the-specific-account-address)
Show the GraphQL
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Account: {
Token: {
Owner: {
in: [
"ApRJBQEKfmcrViQkH94BkzRFUGWtA8uC71DXu6USdd3n"
"9nG4zw1jVJFpEtSLmbGQpTnpG2TiKfLXWkkTyyRvxTt6"
]
}
}
}
Currency: { MintAddress: { is: "token mint address" } }
}
}
) {
BalanceUpdate {
Account {
Token {
Owner
}
}
balance: PostBalance(maximum: Block_Slot)
}
}
}
}
```
## Token Liquidity, Pools & Pairs
### How do I get all trading pairs of a Pump.fun token?
Lists all markets where the token is traded, including pair addresses
[All trading pairs for one mint: run it ➤](https://ide.bitquery.io/get-all-the-trading-pairs-of-a-specific-token)
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: { Currency: { MintAddress: { is: "token mint address" } } }
}
) {
count
Trade {
Market {
MarketAddress
}
Dex {
ProgramAddress
ProtocolName
ProtocolFamily
}
Currency {
MintAddress
Symbol
}
}
}
}
}
```
### How do I get liquidity of Pump.fun tokens?
Gets pool token balances for liquidity estimation across multiple known pool accounts
[Pools and balances: run it ➤](https://ide.bitquery.io/Get-Liquidity-of-Pumpfun-Pools)
Show the GraphQL
```graphql
{
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Currency: { Native: false }
PostBalance: { gt: "0" }
Account: {
Owner: {
in: [
"7jVYY8nUjbt5gzLt3tZJaHD9NSMyaTuvPhJLfazmjjyy"
"7iDwUGUDLccKdWN5hUppoqxLeUMjw7BieQAFdTwj3F5V"
]
}
}
}
} # add pool address here
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
BalanceUpdate {
Account {
Token {
Owner
}
Owner
Address
}
Currency {
MintAddress
Native
}
Liquidity: PostBalance(maximum: Block_Slot)
}
}
}
}
```
### How do I get bonding curve progress for a Pump.fun token?
Use Bitquery's `DEXPools` with Pump.fun market address to get pool balances. Bonding curve progress = 100 - (((base_balance - 206900000) × 100) / 793100000). Combine with `DEXTradeByTokens` for volume and `TokenSupplyUpdates` for market cap. **Please change the timestamp in the query to recent ones; the saved query might have outdated numbers.**
[Market cap, liquidity, bonding curve, volume: run it ➤](https://ide.bitquery.io/mcap-liquidity-bonding-curve-volume-supply-of-a-token-in-time-frame_1)
Show the GraphQL
```graphql
query MyQuery($time_1h_ago: DateTime, $token: String, $pairAddress: String) {
Solana {
volume: DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: $token } }
Market: { MarketAddress: { is: $pairAddress } }
}
Block: { Time: { since: $time_1h_ago } }
Transaction: { Result: { Success: true } }
}
) {
VolumeInUSD: sum(of: Trade_Side_AmountInUSD)
}
liquidity_and_BondingCurve: DEXPools(
where: {
Pool: { Market: { MarketAddress: { is: $pairAddress } } }
Transaction: { Result: { Success: true } }
}
limit: { count: 1 }
orderBy: { descending: Block_Time }
) {
Pool {
Market {
BaseCurrency {
Name
Symbol
}
QuoteCurrency {
Name
Symbol
}
}
Base {
Balance: PostAmount
PostAmountInUSD
}
Quote {
PostAmount
PostAmountInUSD
}
}
}
marketcap_and_supply: TokenSupplyUpdates(
where: {
TokenSupplyUpdate: { Currency: { MintAddress: { is: $token } } }
Transaction: { Result: { Success: true } }
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
orderBy: { descending: Block_Time }
) {
TokenSupplyUpdate {
MarketCap: PostBalanceInUSD
Supply: PostBalance
Currency {
Name
MintAddress
Symbol
}
}
}
Price: DEXTradeByTokens(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: $token } }
Market: { MarketAddress: { is: $pairAddress } }
}
}
) {
Trade {
Price
PriceInUSD
}
}
}
}
```
```json
{
"time_1h_ago": "2025-06-01T11:00:00Z",
"token": "EskuW9PhydSiMTxnWbvYBLVvwWV9pKhG4yYM9SwFPump",
"pairAddress": "BkivJgUrXRQtJyePt5MzJJe9Y2JXhUaFhpCJcgxkisD"
}
```
### How do I get the last Pump.fun trade before a token graduates to PumpSwap AMM?
Finds the final pool trade before a mint moves to PumpSwap. DEXPools keeps only the recent window, so it must have graduated inside it; drop the `Market` filter to list every recent graduation.
[Last Pump.fun trade before PumpSwap: run it ➤](https://ide.bitquery.io/pump-fun-token-graduating-to-pumpswap)
Show the GraphQL
```graphql
{
Solana {
DEXPools(
where: {
Pool: {
Dex: { ProtocolName: { is: "pump" } }
Base: { PostAmount: { eq: "206900000" } }
Market: {
BaseCurrency: {
MintAddress: {
is: "token mint address"
}
}
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
) {
Transaction {
Signer
Signature
}
Instruction {
Program {
Method
}
}
Pool {
Base {
ChangeAmount
PostAmount
}
Quote {
ChangeAmount
ChangeAmountInUSD
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Market {
BaseCurrency {
Name
Symbol
MintAddress
}
MarketAddress
QuoteCurrency {
Name
Symbol
MintAddress
}
}
}
}
}
}
```
## Token Holder & Trader Insights
### How do I get dev's holdings of a Pump.fun token?
Returns the developer's current token holdings
[Developer holdings: run it ➤](https://ide.bitquery.io/trading-volume-of-a-token-pump-fun)
Show the GraphQL
```graphql
query MyQuery($dev: String, $token: String) {
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Account: { Owner: { is: $dev } }
Currency: { MintAddress: { is: $token } }
}
}
) {
BalanceUpdate {
balance: PostBalance(maximum: Block_Slot)
}
}
}
}
```
```json
{
"dev": "8oTWME5BPpudMksqEKfn562pGobrtnEpNsG66hBBgx92",
"token": "token mint address"
}
```
### How do I get top 10 token holders of a Pump.fun token?
Returns wallet addresses and holdings of top 10 token holders
[Top 10 holders: run it ➤](https://ide.bitquery.io/top-token-holders-for-a-pump-fun-token)
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: realtime) {
BalanceUpdates(
limit: { count: 10 }
orderBy: { descendingByField: "BalanceUpdate_Holding_maximum" }
where: {
BalanceUpdate: {
Currency: { MintAddress: { is: "token mint address" } }
}
Transaction: { Result: { Success: true } }
}
) {
BalanceUpdate {
Currency {
Name
MintAddress
Symbol
}
Account {
Address
}
Holding: PostBalance(maximum: Block_Slot)
}
}
}
}
```
### How do I get top traders of a Pump.fun token?
Use Bitquery's `DEXTradeByTokens` with `orderBy: descendingByField: "volumeUsd"`, `limit: 100`, and `sum(of: Trade_Side_AmountInUSD)` grouped by `Trade.Account.Owner` to rank top wallets by USD volume for a Pump.fun token.
[Top traders: run it ➤](https://ide.bitquery.io/top-traders-of-a-pump-fun-token_2)
Show the GraphQL
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
where: {
Trade: { Currency: { MintAddress: { is: $token } } }
Transaction: { Result: { Success: true } }
}
) {
Trade {
Account {
Owner
}
}
bought: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
sold: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
```json
{
"token": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
"pool": "5Ezr4oK1vTV4m8f7g8P1Be1uwtzczhf21AztwNxWcmwM"
}
```
### How do I get top Pump.fun token creators?
Find wallet addresses of top creators by number of tokens launched
[Top creators: run it ➤](https://ide.bitquery.io/Top-pump-fun-token-creators_2)
:::tip
Want to dive deeper into a creator's background? Ask an AI agent via the [Bitquery MCP server](https://mcp.bitquery.io/) to trace the source of funds for any Pump.fun creator ([AI Investigations](https://bitquery.io/solutions/ai-investigations)), or use our [Money Flow API](https://docs.bitquery.io/v1/docs/Examples/coinpath/money-flow-api#funding-history-of-address) to analyze funding history directly.
:::
Show the GraphQL
```graphql
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Program: {
Name: { is: "pump" }
Method: { in: ["create", "create_v2"] }
}
}
}
orderBy: { descendingByField: "tokens_count" }
) {
tokens_count: count
Transaction {
Signer
}
}
}
}
```
## Token Security & Analysis
### How do I check if a Pump.fun token is phishy?
This uses two queries to flag a possibly phishy mint, by comparing transfers against trades.
It surfaces wallets that received a balance without ever buying, a common pattern in phishing and airdrop scams.
#### How It Works
The detection method works by:
1. **First Query**: get the first transfers to each address, giving the timestamp when each wallet first received a balance.
2. **Second Query**: Check if those addresses ever bought the token and when - pass the address list from the first query as a variable to check their purchase history.
3. **Analysis**: Compare transfer times and trade times in your code:
- If an address **never bought** the token, it's suspicious.
- If an address's **first buy time is later than the first transfer time**, it indicates the token was received before being purchased, which is a red flag for phishing behavior.
That pattern means someone else sent them the balance, which is suspicious: devs often push supply to well-known accounts in crypto space to misguide traders.
Pick a token launched within the recent window, since the Transfers and DEXTrades cubes on Solana keep no archive. Whether it is phishy is not decided here, as we are not running the timestamp comparison. Here we are just demonstrating that how you can get data from Bitquery and later run basic analysis on it.
#### Query 1: Get First Transfers of a Token to Addresses
This retrieves the first transfer to each address, with the timestamp when that wallet first received a balance.
[Run Query](https://ide.bitquery.io/first-transfers-of-a-pump-fun-token_1#)
Show the GraphQL
```graphql
query MyQuery($token: String, $bonding_curve: String) {
Solana {
Transfers(
limit: { count: 1000 }
orderBy: { ascendingByField: "Block_first_transfer" }
where: {
Transfer: {
Receiver: { Token: { Owner: { not: $bonding_curve } } }
Currency: { MintAddress: { is: $token } }
}
Transaction: { Result: { Success: true } }
}
) {
Transfer {
Receiver {
Token {
Owner
}
}
}
Block {
first_transfer: Time(minimum: Block_Time)
}
total_transferred_amount: sum(of: Transfer_Amount)
}
}
}
```
```json
{
"token": "token mint address",
"bonding_curve": "bonding curve address"
}
```
#### Query 2: Get First Buys of an Address List for a Specific Token
This query checks if the addresses from Query 1 ever bought the token and when. Pass the address array from Query 1 as a variable to this query.
[Run Query](https://ide.bitquery.io/get-first-buys-of-an-address-list-of-a-specific-pump-fun-token#)
Show the GraphQL
```graphql
query MyQuery($token: String!, $buyersList: [String!]) {
Solana {
DEXTradeByTokens(
orderBy: { ascendingByField: "Block_first_buy" }
where: {
Trade: {
Account: { Token: { Owner: { in: $buyersList } } }
Currency: { MintAddress: { is: $token } }
Dex: {
ProgramAddress: {
is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
}
}
Side: { Type: { is: buy } }
}
Transaction: { Result: { Success: true } }
}
) {
Trade {
Account {
Token {
Owner
}
}
Currency {
Name
Symbol
MintAddress
}
Side {
Type
}
}
Block {
first_buy: Time(minimum: Block_Time)
}
total_bought_amount: sum(of: Trade_Amount)
}
}
}
```
```json
{
"token": "token mint address",
"buyersList": [ PASS THE ADDRESS LIST YOU GOT FROM QUERY 1 HERE ]
}
```
#### Implementation Notes
- Extract the address list and first transfer timestamps from Query 1
- Pass the address array as a variable to Query 2
- Compare the timestamps for all addresses:
- If `firstTransferTime < firstBuyTime` or `firstBuyTime` is null → **Phishy indicator**
- If `firstBuyTime <= firstTransferTime` → **Normal behavior**
- You can implement this logic in your application code to automatically flag suspicious tokens
## Token Rankings & Filters
### How do I get top Pump.fun tokens by market cap?
Use **Trading API** **`Pairs`**: rank by **`Supply.MarketCap`** over the last **24 hours**, **1s** interval, **`Market.ProtocolFamily`** **Pumpfun**, **`Volume.Usd`** **> 1000**, Solana tokens, **`limitBy`** one row per **`Token_Id`**, up to **50** results.
[Top mints by market cap: run it ➤](https://ide.bitquery.io/top-pump-fun-tokens-by-marketcap)
Show the GraphQL
```graphql
{
Trading {
Pairs(
limit: { count: 50 }
limitBy: { count: 1, by: Token_Id }
orderBy: { descending: Supply_MarketCap }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Interval: { Time: { Duration: { eq: 1 } } }
Market: { ProtocolFamily: { is: "Pumpfun" } }
Volume: { Usd: { gt: 1000 } }
Token: { Network: { is: "Solana" } }
}
) {
Currency {
Id
Name
Symbol
}
Price {
Average {
Mean(maximum: Block_Time)
}
}
Volume {
Base(maximum: Block_Time)
Quote(maximum: Block_Time)
Usd(maximum: Block_Time)
}
Token {
Network
Symbol
Address
}
Supply {
MarketCap(maximum: Block_Time)
FullyDilutedValuationUsd(maximum: Block_Time)
TotalSupply(maximum: Block_Time)
}
}
}
}
```
### How do I get all Pump.fun tokens above 10K market cap?
Subscribe to **Trading** **`Pairs`** when the token is on **Solana**, **`Market.ProtocolFamily`** is **Pumpfun**, **`Supply.MarketCap`** **> 10,000** (USD), and interval duration **> 1** second.
[Mints above 10K market cap: stream it ➤](https://ide.bitquery.io/realtime-stream-pumpfun-tokens-with-marketcap-above-10k-marketcap#)
Show the subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { ProtocolFamily: { is: "Pumpfun" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
### How do I track "King of the Hill" Pump.fun tokens (30K–35K market cap)?
Tokens in the **$30K–$35K** **`Supply.MarketCap`** band on **Pumpfun** (see [Pump.fun on King of the Hill](https://x.com/pumpdotfun/status/1760103287397793933)). Subscribe to **Trading** **`Pairs`** with **`MarketCap`** between **30,000** and **35,000** USD.
[“King of the Hill” mints: stream it ➤](https://ide.bitquery.io/realtime-stream-of-King-of-the-Hill-Pumpfun-tokens-30K35K-market-cap#)
Show the subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 30000, lt: 35000 } }
Market: { ProtocolFamily: { is: "Pumpfun" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
---
## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply)
The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which.
### Get All DEX Trades on PumpFun With Price, Market Cap, and Supply
Stream **all PumpFun DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.ProtocolFamily: Pumpfun`** to capture every swap across Pumpfun in a single subscription.
You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/Get-All-DEX-Trades-on-Pumpfun-With-Price-Market-Cap-and-Supply).
Show the GraphQL
```graphql
subscription {
Trading {
Trades(where: { Pair: { Market: { ProtocolFamily: { is: "Pumpfun" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
Currency {
Symbol
Id
Name
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
```
### Top Traders by PnL for a Specific PumpFun Token (Last 30 Minutes)
Rank traders by **`PnL`** on one pool: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **pool-specific trader analytics**. The example pool is the PUMP/USDC PumpSwap pool; for a bonding curve, use the curve's market address from the [latest trades query](#how-do-i-get-the-latest-trades-for-a-pumpfun-token).
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-pumpfun-token-curve).
Show the GraphQL
```graphql
{
Trading {
Trades(
limit: { count: 10 }
orderBy: { descendingByField: "PnL" }
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Address: { is: "2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd" }
}
}
}
) {
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" } })
}
}
}
```
### Get Latest Creator Fee Transfers on Pump.fun
Retrieve the 10 most recent **creator fee collections** on the Pump.fun bonding curve program. Filter **`Instruction.Program.Method: "collect_creator_fee"`** and **`Instruction.Program.Address: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"`** to get balance updates showing who collected, how much, and from which token.
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/latest-creator-fees-pumpfun#).
Show the GraphQL
```graphql
{
Solana(network: solana) {
InstructionBalanceUpdates(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Instruction: {Program: {Method: {is: "collect_creator_fee"}, Address: {is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"}}}, Transaction: {Result: {Success: true}}}
) {
Transaction {
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
}
Block {
Time
Hash
}
BalanceUpdate {
Account {
Address
Owner
Token {
Owner
}
}
Amount
AmountInUSD
Currency {
Name
MintAddress
Symbol
}
PreBalance
PostBalance
}
}
}
}
```
---
## Does pump.fun have an official API?
Not a hosted one. Pump.fun publishes program documentation and IDLs on GitHub for the bonding curve program, PumpSwap and its fee program, which is what you need to build and sign transactions. It publishes no data API: the hosts its web app calls have no reference, no published rate limits, no schema and no stability promise, so anything built on them can break without notice. The queries on this page read the same on-chain activity through Bitquery, with a documented schema, plan-based rate limits, and streaming over WebSocket, gRPC and Kafka.
| | Pump.fun | Bitquery Pump.fun API |
|---|---|---|
| Documentation | Program docs and IDLs on GitHub; no data API reference | Schema, examples and IDE links on this page |
| Trades, prices, candles, launches | Served to the pump.fun web app by undocumented hosts | GraphQL queries, WebSocket subscriptions, gRPC and Kafka streams |
| History | None published | Historical datasets for trades and token creation, realtime window for pools and transfers, Parquet exports through [cloud datasets](/docs/cloud/pumpfun) |
| Rate limits | Unpublished | 30, 90 or 240 requests a minute by plan, custom on Enterprise |
| Access | No key or documented third-party access | Access token, seven-day free trial |
## API key, free trial and pricing
Create an access token at [account.bitquery.io](https://account.bitquery.io/) and follow [how to generate a token](/docs/authorization/how-to-generate/); there is no approval step. The free trial runs for seven days and includes 1,000 API points, 100 MCP credits and two simultaneous streams. Request rate limits by plan are 30 a minute on Personal, 90 on Pro and 240 on Scale, with custom limits on Enterprise; see [rate limits](/docs/plans/rate-limits/). Points and streams are explained on [how billing works](/docs/plans/how-billing-works/), and plan prices are on the [Pump.fun API product page](https://bitquery.io/products/pumpfun-api) and the [pricing page](https://bitquery.io/pricing).
## Video Tutorials
#### Pump.Fun API | Get Live Prices, Metadata, OHLCV, Trading Pair Stats, Charts
#### Video Tutorial on Getting Pump.fun Trades
#### Video Tutorial | How to Get the OHLC Data & Price of a Token on Pump.fun DEX in Realtime
#### Video Tutorial | How to get Top Token Holders and Trading Volume for a Pump.fun Token
#### Video Tutorial | How to get Top Traders of a Token on Solana Pump.fun DEX
#### Video Tutorial | How to get first 100 Buyers of a Pump.fun Token
#### Video Tutorial | How to get Top Token Creators on Pump.fun
#### Video Tutorial | How to get Newly Created Pump.fun Tokens, Dev Address, Creation Time, Metadata
#### Video Tutorial | How to get all Pump.fun Tokens created by a Dev
#### Video Tutorial | How to get Liquidity of a Pump.fun Token
#### Video Tutorial | Pump.fun Mayhem Mode API
### Why does my Pump.fun query return "columns not available in combined dataset"? {#why-does-my-pumpfun-query-return-columns-not-available-in-combined-dataset}
Fields like `Trade.Side` are only available with `dataset: realtime`. For historical queries use `dataset: archive` (on Solana `combined` returns the same rows) and avoid `Trade_Side`, `Trade_Side_Type`, and similar realtime-only fields.
---
## Pump.fun to PumpSwap API - Token Migration Tracking
URL: https://docs.bitquery.io/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/
Track Pump.fun tokens graduating to PumpSwap on Solana: detect migration events, the final bonding-curve trade, and post-migration AMM activity.
# Understanding Pump.fun: From Launchpad to PumpSwap
:::tip Need real-time Pump.fun & PumpSwap data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Pump.fun & PumpSwap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Pump.fun & PumpSwap data older than ~30 days**, raw per-swap detail, or call / event context.
Post-migration AMM activity is covered end-to-end by the [PumpSwap API](https://bitquery.io/products/pumpswap-api) — the product page lists swaps, pools and OHLCV coverage with plans.
:::
For the productized feed of these migration events — channels, pricing, free trial — see the [Pump.fun API product page](https://bitquery.io/products/pumpfun-api).
Pump.fun is a Solana-based memecoin launchpad that has reshaped how tokens are created and traded. At its core is a bonding curve model that lets anyone launch a token with a fixed supply of 1 billion tokens, of which around 800 million are made available for bonding.
As traders buy into the curve, the price increases non-linearly—early buyers benefit the most. The bonding curve progress, a very useful metric for developers and traders, can be computed as:
:::note
**Simplified Formula**:
BondingCurveProgress = 100 - (((balance - 206900000) \* 100) / 793100000)
:::
where `balance` is the balance of the bonding curve for that specific token.
This helps identify tokens nearing sell-out, a common signal for tokens “about to pump.”
Once a token reaches full bonding (100%), it automatically migrates to PumpSwap, Pump.fun’s native AMM DEX. From there, it trades like any other Solana token—no manual listing is needed; the system handles everything.
To help developers, traders, and analysts follow this journey, Bitquery offers a comprehensive real-time API suite that spans the entire lifecycle of a Pump.fun token. Let’s walk through it:
## Track New Token Creations in Real-Time
Every token on Pump.fun starts with a launch event. You can track these launches in real time using a streaming API:
- [Track Pump.fun Token Creations in Real-Time Using a Subscription](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-newly-created-pumpfun-tokens)
This API streams metadata such as token name, symbol, mint, creator address, and timestamp the moment a new token is created.
## Follow Real-Time Market Data as Tokens Trade on Pump.fun
Pump.fun tokens are actively traded as they climb the bonding curve. Traders need up-to-the-second price feeds and trade streams:
- [Track Price of a Token in Real-Time](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-track-the-price-of-a-pumpfun-token-in-real-time)
- [Get Real-Time Trades on Pump Fun](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-live-trades-from-pumpfun-using-bitquery)
- [Get OHLC Data of a Token](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-pumpfun-token-ohlcv-data-historically)
These APIs provide:
- Price ticks per trade
- Trade sides (buy/sell)
- Volume and trader addresses
- 1-minute OHLC data for charting and analysis
## Analyze Token Performance
For deeper insights and analytics, developers can extract:
- [Token Price Change Over Time (Delta from X Minutes Back)](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-token-price-change-over-time-delta-from-x-minutes-back)
- [ATH Market Cap in a Specific Timeframe](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-a-tokens-all-time-high-ath-price-on-pumpfun)
- [Get Market Cap, Price, Liquidity, Bonding Curve, and Volume](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-bonding-curve-progress-for-a-pumpfun-token)
- [Get Detailed Trade Stats: Volume, Buys, Sells, Makers, Buyers, Sellers](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-detailed-trade-stats-volume-buys-sells-makers-buyers-sellers)
These endpoints help answer questions like:
- What’s the token’s current liquidity?
- Has it reached its all-time high market cap?
- How many unique wallets are buying/selling?
## Identify Hot Tokens and Dev Insights
Traders constantly seek trending tokens or insider holds:
- [Top Pump Fun Tokens by Market Cap](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-top-pumpfun-tokens-by-market-cap)
- [Track “King of the Hill” Tokens (30K–35K Market Cap)](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-track-king-of-the-hill-pumpfun-tokens-30k35k-market-cap)
- [Get Dev’s Holdings of a Token](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#how-do-i-get-devs-holdings-of-a-pumpfun-token)
These tools surface:
- Top-performing memecoins
- Tokens nearing PumpSwap graduation (30k–35k cap)
- Developer-controlled balances
## Graduation to PumpSwap and Further Trading
A Pump.fun token graduates (i.e., migrates to PumpSwap) when its bonding curve is fully sold out, meaning 100% of the 800 million tradable tokens have been bought.
Here’s what triggers graduation:
- Total tokens sold reaches the maximum sellable limit (excluding the reserved ~200M tokens)
- The market cap typically approaches $30K–$35K, depending on SOL price and trading dynamics
- The Pump.fun platform then automatically creates a PumpSwap liquidity pool for the token; no manual action is needed
Once graduated:
- Token trading stops on Pump.fun
- Trading resumes on PumpSwap as an AMM pair
You can track these graduation events in real-time using Bitquery’s API:
- [Track Pump Fun Token Migrations to PumpSwap](/docs/blockchain/Solana/Pumpfun/Pump-Fun-Marketcap-Bonding-Curve-API/#track-pump-fun-token-migrations-to-pumpswap-in-realtime---subscription)
Post-migration, tokens trade as standard AMM pairs. Bitquery continues to offer real-time data support:
- [Latest Trades for a Token on Pumpswap - Websocket](/docs/blockchain/Solana/Pumpfun/pump-swap-api/#latest-trades-for-a-token-on-pumpswap---websocket)
- [Get Buy Volume, Sell Volume, Buys, Sells, Makers, Total Trade Volume, Buyers, Sellers of a Specific Token](/docs/blockchain/Solana/Pumpfun/pump-swap-api/#get-buy-volume-sell-volume-buys-sells-makers-total-trade-volume-buyers-sellers-of-a-specific-token)
## Tracking a Pump.fun Token’s Journey with Bitquery Shred Streams
Bitquery’s Kafka streams offer ultra-low-latency access to blockchain data by tapping directly into Solana’s Shred-level architecture. On Solana, a shred is the smallest fragment of a block—and it’s the first unit of data propagated between validators.
Bitquery’s Shred Streams capture transactions as they’re broadcast to validators, often before the block is finalized and even before timestamps are attached. This means you receive transaction data faster than any traditional block-based solution, giving you a true edge in latency-sensitive use cases such as arbitrage, sniping, and real-time analytics.
**You can use this to track Pump.fun tokens as shown in [this tutorial](https://youtu.be/UlqZ8DgzNLc).**
Bitquery offers three main Kafka topics for Solana:
- `solana.dextrades.proto` — includes all trade and liquidity pool change data
- `solana.tokens.proto` — covers token transfers, supply changes, and balance updates at both the account and instruction level
- `solana.transactions.proto` — delivers detailed data for blocks, transactions, and instructions
You can find more details about the Solana Shred Streams provided by Bitquery [here](/docs/streams/protobuf/chains/Solana-protobuf/) and Python code examples [here](/docs/streams/protobuf/kafka-protobuf-python/).
## Conclusion
Pump.fun has become the meme-fueled engine of Solana’s token economy. It has launched millions of tokens, introduced a playful but potent market dynamic, and evolved into a serious arena for real-time trading.
For developers and analysts who want to build tools around this phenomenon, Bitquery offers a plug-and-play data layer that covers every phase of a Pump.fun token’s lifecycle—from minting to AMM trading.
Whether you’re building dashboards, bots, trading tools, or alpha groups, these APIs let you track the entire journey without writing indexers or running infrastructure.
Start querying. Stay real-time. And ride the next pump.
---
## PumpSwap API - Solana - Tokens, Trades, Live Prices
URL: https://docs.bitquery.io/docs/blockchain/Solana/Pumpfun/pump-swap-api/
Query and stream PumpSwap AMM activity on Solana: live trades, new pools, token prices and liquidity, over GraphQL, WebSocket or Kafka.
# PumpSwap API
:::tip Need real-time PumpSwap data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered PumpSwap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical PumpSwap data older than ~30 days**, raw per-swap detail, or call / event context.
:::
For delivery channels, pricing and the free trial, see the [PumpSwap API product page](https://bitquery.io/products/pumpswap-api).
Bitquery’s **PumpSwap API** exposes the PumpSwap AMM on Solana through GraphQL: **live and historical trades**, **prices**, **OHLC**, **volume**, **pool creation**, and **Pump.fun → PumpSwap migrations**. Use **queries** for snapshots, **subscriptions** to track PumpSwap trades in real time, and **`dataset: combined`** when you need more history than **`dataset: realtime`** (~recent window). Filter trades with **`Dex.ProgramAddress: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"`**. For live DEX prices across Pump.fun tokens, see [DEXrabbit's Pump.fun category](https://dexrabbit.bitquery.io/categories/pump-fun).
For other data points, reach out to [support](https://t.me/Bloxy_info).
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
- You can also explore [Pump Fun Data documentation ➤](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- Also check out [LetsBonk.fun APIs ➤](/docs/blockchain/Solana/letsbonk-api/)
- Need zero-latency PumpSwap data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
Join us on [Telegram](https://t.me/Bloxy_info) for support and integration help.
## What is the PumpSwap program address on Solana? {#what-is-the-pumpswap-program-address-on-solana}
The PumpSwap AMM program on Solana mainnet is **`pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`**. Use this value in **`Trade.Dex.ProgramAddress`** or **`Instruction.Program.Address`** filters in Bitquery GraphQL so results are limited to PumpSwap (not other Solana DEXs).
## How do I get newly created PumpSwap pools in real time? {#get-newly-created-pools-on-pumpswap-dex-in-realtime}
Subscribe to **`Instructions`** where the program method is **`create_pool`** and the program address is the PumpSwap AMM ID above. Each event reflects a new pool on PumpSwap; use account and argument fields for pair and liquidity details.
[Run in Bitquery IDE — newly created PumpSwap pools (stream)](https://ide.bitquery.io/pumpSwap-new-pools-Stream)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {Instruction: {Program: {Method: {is: "create_pool"}, Address: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}}}
) {
Instruction {
Program {
Address
Name
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
AccountNames
Json
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
BalanceUpdatesCount
AncestorIndexes
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
TokenBalanceUpdatesCount
}
Transaction {
Fee
FeeInUSD
Signature
Signer
FeePayer
Result {
Success
ErrorMessage
}
}
Block {
Time
Height
}
}
}
}
```
## How do I track Pump.fun pool migrations to PumpSwap in real time? {#track-pools-that-are-migrated-to-pumpswap}
Subscribe to **`create_pool`** instructions on the PumpSwap program when they follow a Pump.fun **`migrate`** flow. **`Instruction.Accounts[]`** carries pool and token accounts; argument **`Value`** fields include liquidity added. Pair with the [Pump Fun to PumpSwap](/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/) guide for full migration logic.
[Run in Bitquery IDE — Pump.fun → PumpSwap migrations](https://ide.bitquery.io/pumpfun-migration-stream_2#)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
CallerIndex: { eq: 2 }
Depth: { eq: 1 }
CallPath: { includes: { eq: 2 } }
Program: {
Method: { is: "create_pool" }
Address: { is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA" }
}
}
}
) {
Instruction {
Program {
Address
Name
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
AccountNames
Json
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
BalanceUpdatesCount
AncestorIndexes
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
Index
InternalSeqNumber
TokenBalanceUpdatesCount
}
Transaction {
Fee
FeeInUSD
Signature
Signer
FeePayer
Result {
Success
ErrorMessage
}
}
Block {
Time
Height
}
}
}
}
```
## How do I get the latest PumpSwap trades? {#latest-trades-on-pumpswap}
Use **`DEXTrades`** with **`Solana(network: solana, dataset: realtime)`** and filter **`Trade.Dex.ProgramAddress`** to the PumpSwap AMM. This returns the most recent successful swaps on PumpSwap (snapshot query, not a live stream). For continuous updates, use the subscription in the next section.
[Run in Bitquery IDE — latest PumpSwap trades](https://ide.bitquery.io/Pumpswap-latest-Trades-API)
Click to expand GraphQL query
```graphql
{
Solana(network: solana, dataset: realtime) {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
}
}
}
}
limit: { count: 100 }
orderBy: { descending: Block_Time }
) {
Block {
Time
}
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
ProgramAddress
}
Buy {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Address
Owner
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Owner
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
Signer
FeePayer
}
}
}
}
```
## How do I track PumpSwap trades in real time? {#latest-trades-on-pumpswap-websocket}
Use a GraphQL **`subscription`** on **`DEXTrades`** with the same PumpSwap **`ProgramAddress`** filter. Bitquery pushes each new PumpSwap trade over WebSocket as it is indexed—this is the primary way to **track PumpSwap trades in real time** for dashboards and bots.
[Run in Bitquery IDE — real-time PumpSwap trades (WebSocket)](https://ide.bitquery.io/pumpswap-trades)
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
}
}
}
}
) {
Trade {
Dex {
ProtocolName
}
Sell {
Currency {
Symbol
}
}
Buy {
Currency {
Symbol
}
}
}
Transaction {
Signature
}
Instruction {
ExternalSeqNumber
InternalSeqNumber
}
}
}
}
```
## How do I get OHLC data for a PumpSwap token? {#ohlc-for-pumpswap-token}
Use **`DEXTradeByTokens`** with PumpSwap **`ProgramAddress`**, your token mint, and the quote side (e.g. WSOL) to aggregate **`open` / `high` / `low` / `close`** and volume per time bucket. **`Trade Side Account`** is not available on combined/archive aggregates—see the note below.
[Run in Bitquery IDE — OHLC for a PumpSwap token](https://ide.bitquery.io/ohlc-for-pumpswap)
:::note
Note: The `Trade Side Account` field is **not available** in aggregate queries across archive or combined datasets.
:::
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}, Currency: {MintAddress: {is: "6qN87akZ3Ghs3JbGmnNMYP2rCHSBDwtiXttBV4Hspump"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Transaction: {Result: {Success: true}}}
limit: {count: 100}
orderBy: {descendingByField: "Block_Timefield"}
){
Block{
Timefield: Time(interval:{count:1 in:minutes})
}
Trade{
open: Price(minimum:Block_Slot)
high: Price(maximum:Trade_Price)
low: Price(minimum:Trade_Price)
close: Price(maximum:Block_Slot)
}
volumeInUSD: sum(of:Trade_Side_AmountInUSD)
count
}
}
}
```
## How do I get the latest PumpSwap trades by a trader? {#latest-trades-by-a-trader}
Query **`DEXTrades`** with **`Transaction.Signer`** equal to the wallet and **`Trade.Dex.ProgramAddress`** set to PumpSwap. Returns recent buys/sells and signatures for that trader on PumpSwap only.
[Run in Bitquery IDE — latest trades by a trader on PumpSwap](https://ide.bitquery.io/Pumpswap-latest-Trade-for-a-trader-api_1)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTrades(
orderBy: [{descending: Block_Time}, {descending: Transaction_Index}, {descending: Trade_Index}]
limit: {count: 10}
where: {
Transaction:{
Signer:{is:"78mgMi3caj9CY5EdAW9FHhUoLcWB5suyfDF8dsQ2CNHR"}
}
Trade: {Dex: {ProgramAddress: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}}}
) {
Block {
Time
}
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
ProgramAddress
}
Buy {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Address
Owner
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Owner
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
Signer
FeePayer
}
}
}
}
```
## How do I track a trader’s PumpSwap trades in real time? {#latest-trades-by-a-trader---get-data-in-real-time-via-a-websocket}
Use a **`subscription`** on **`DEXTrades`** with the same **`Signer`** and PumpSwap **`ProgramAddress`** filters. New trades for that wallet on PumpSwap stream as they are confirmed.
[Run in Bitquery IDE — real-time trades by a trader (PumpSwap)](https://ide.bitquery.io/Pumpswap-latest-Trade-for-a-trader-stream_1)
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {Transaction: {Signer: {is: "78mgMi3caj9CY5EdAW9FHhUoLcWB5suyfDF8dsQ2CNHR"}}, Trade: {Dex: {ProgramAddress: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}}}
) {
Block {
Time
}
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
ProgramAddress
}
Buy {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Address
Owner
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Price
PriceInUSD
Amount
AmountInUSD
Account {
Owner
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
Signer
FeePayer
}
}
}
}
```
## How do I get the latest trades for a token on PumpSwap? {#latest-trades-for-a-token-on-pumpswap}
Use **`DEXTradeByTokens`** with PumpSwap **`ProgramAddress`** and the token **`MintAddress`**. Replace the placeholder mint with your token. Returns recent fills, price, and side for that token on PumpSwap.
[Run in Bitquery IDE — latest trades for a token on PumpSwap](https://ide.bitquery.io/Solana-trade-for-a-token_2)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex:{
ProgramAddress:{
is:"pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
}
}
Currency:
{MintAddress: {is: "token mint address"}}}}
limit: {count: 20}
orderBy: [{descending: Block_Time}, {descending: Transaction_Index}, {descending: Trade_Index}]
) {
Instruction {
Program {
Method
}
}
Trade {
Currency {
Name
Symbol
MintAddress
}
Price
PriceInUSD
Amount
AmountInUSD
Price
PriceInUSD
Side {
Type
Amount
AmountInUSD
Currency {
Symbol
Name
MintAddress
}
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
}
Block {
Time
Height
Slot
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## How do I track PumpSwap trades for a specific token in real time? {#latest-trades-for-a-token-on-pumpswap---websocket}
Subscribe to **`DEXTradeByTokens`** with PumpSwap **`ProgramAddress`** and the token mint. Each update is a new trade involving that token on PumpSwap—use this to stream per-token activity without polling.
[Run in Bitquery IDE — real-time trades for a token (PumpSwap)](https://ide.bitquery.io/Latest-Trades-for-a-token-on-Pumpswap)
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress:
{is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}},
Currency: {MintAddress:
{is: "token mint address"}}}}
) {
Instruction {
Program {
Method
}
}
Trade {
Currency {
Name
Symbol
MintAddress
}
Price
PriceInUSD
Amount
AmountInUSD
Price
PriceInUSD
Side {
Type
Amount
AmountInUSD
Currency {
Symbol
Name
MintAddress
}
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
}
Block {
Time
Height
Slot
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## How do I get top traders on PumpSwap? {#top-trader-on-pumpswap}
Aggregate **`DEXTradeByTokens`** by **`Transaction.Signer`** with **`limitBy`** and **`orderBy`** on trade count or volume (USD). Filter **`Dex.ProgramAddress`** to PumpSwap and optionally WSOL as the side currency to rank active wallets on the AMM.
[Run in Bitquery IDE — top traders on PumpSwap](https://ide.bitquery.io/top-traders-on-pumpswap_2)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
limitBy: {count: 1, by: Transaction_Signature}
limit: {count: 10}
where: {Trade: {Dex: {ProgramAddress: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}, Transaction: {Result: {Success: true}}}
orderBy: {descendingByField: "total_trades"}
) {
Transaction {
Signer
}
total_trades: count
total_traded_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## How do I get buy/sell volume and maker stats for a PumpSwap token? {#get-buy-volume-sell-volume-buys-sells-makers-total-trade-volume-buyers-sellers-of-a-specific-token}
Use **`DEXTradeByTokens`** with **`dataset: realtime`**, token mint, **`Market.MarketAddress`**, and time variables for **5-minute** and **1-hour** windows. The query returns buyers, sellers, makers, trade counts, and USD volume splits—ideal for live token dashboards on PumpSwap pairs.
[Run in Bitquery IDE — token stats (buys, sells, makers, volume)](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair0_4)
Click to expand GraphQL query
```graphql
query MyQuery($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}}, 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}}}
)
}
}
}
```
**Variables (example):**
```json
{
"token": "token mint address",
"pair_address": "48oGgzAdYJ5nzMmNz2Jvv5qvX4HXhNgp27tmdEM5n2EF",
"time_5min_ago": "2025-03-25T09:14:00Z",
"time_1h_ago": "2025-03-25T08:19:00Z"
}
```
## How do I track a token’s price on PumpSwap in real time? {#track-price-of-a-token-in-realtime-on-pumpswap}
Subscribe to **`DEXTradeByTokens`** filtered by PumpSwap **`ProgramAddress`** and the token **`MintAddress`**. Each event includes **`Price`** and **`PriceInUSD`** for the latest leg—use it as a live price feed for that token on PumpSwap.
[Run in Bitquery IDE — real-time price of a PumpSwap token](https://ide.bitquery.io/realtime-price-of-a-pumpswap-token)
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
}
}
Currency: { MintAddress: { is: "token mint address" } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Currency {
MintAddress
Name
Symbol
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Side {
Currency {
MintAddress
Symbol
Name
}
}
Price
PriceInUSD
}
Transaction {
Signature
}
}
}
}
```
## How do I get the latest price of a token on PumpSwap? {#get-latest-price-of-a-token-on-pumpswap}
Query **`DEXTradeByTokens`** with **`orderBy: descending Block_Time`** and **`limit`** on PumpSwap **`ProgramAddress`** plus the token mint. Returns the most recent trade-based price without keeping a subscription open.
[Run in Bitquery IDE — latest price of a PumpSwap token](https://ide.bitquery.io/Price-of-a-pumpswap-token_1)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 10 }
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"
}
}
Currency: { MintAddress: { is: "token mint address" } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Currency {
MintAddress
Name
Symbol
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Side {
Currency {
MintAddress
Symbol
Name
}
}
Price
PriceInUSD
}
Transaction {
Signature
}
}
}
}
```
## How do I get trading volume for a PumpSwap token in a time range? {#get-the-trading-volume-of-a-specific-token-on-pumpswap-dex}
Use **`DEXTradeByTokens`** with **`Block.Time`** **`since` / `till`** and **`sum(of: Trade_Side_AmountInUSD)`** (and token volume) for the window. **Use a `query` only**—aggregates such as **`sum`** are not valid on subscriptions; a WebSocket subscription would return incorrect aggregates.
[Run in Bitquery IDE — trading volume of a PumpSwap token](https://ide.bitquery.io/trading-volume-of-a-token-pumpSwap)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: "token mint address" } }
Dex: { ProtocolFamily: { is: "Pumpswap" } }
}
Block: {
Time: { since: "2025-03-25T09:30:00Z", till: "2025-03-25T10:30:00Z" }
}
}
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Dex {
ProtocolName
ProtocolFamily
}
}
TradeVolume_USD: sum(of: Trade_Side_AmountInUSD)
TradeVolume: sum(of: Trade_Amount)
}
}
}
```
## How do I get the latest creator fee transfers on PumpSwap? {#latest-creator-fee-transfers-on-pumpswap}
Query **`InstructionBalanceUpdates`** where the program method is **`collect_coin_creator_fee`** and the program address is the PumpSwap AMM ID. This returns the 10 most recent creator fee collection events with balance changes, currency details, and transaction metadata.
[Run in Bitquery IDE — latest creator fee transfers on PumpSwap](https://ide.bitquery.io/latest-creator-fee-transfers-on-pumpfun-amm)
Click to expand GraphQL query
```graphql
{
Solana(network: solana) {
InstructionBalanceUpdates(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Instruction: {Program: {Method: {is: "collect_coin_creator_fee"}, Address: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}}, Transaction: {Result: {Success: true}}}
) {
Transaction {
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
}
Block {
Time
Hash
}
BalanceUpdate {
Account {
Address
Owner
Token {
Owner
}
}
Amount
AmountInUSD
Currency {
Name
MintAddress
Symbol
}
PreBalance
PostBalance
}
}
}
}
```
## How do I track creator fee transfers on PumpSwap in real time? {#track-creator-fee-transfers-on-pumpswap-in-realtime}
Subscribe to **`InstructionBalanceUpdates`** with the same **`collect_coin_creator_fee`** method and PumpSwap program address filter. Each event streams a new creator fee collection as it happens—use this to monitor creator revenue on PumpSwap tokens in real time.
[Run in Bitquery IDE — track creator fee transfers on PumpSwap (WebSocket)](https://ide.bitquery.io/track-creator-fee-transfers-on-pumpfun-amm#)
Click to expand GraphQL query
```graphql
subscription {
Solana(network: solana) {
InstructionBalanceUpdates(
where: {Instruction: {Program: {Method: {is: "collect_coin_creator_fee"}, Address: {is: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"}}}, Transaction: {Result: {Success: true}}}
) {
Transaction {
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
}
Block {
Time
Hash
}
BalanceUpdate {
Account {
Address
Owner
Token {
Owner
}
}
Amount
AmountInUSD
Currency {
Name
MintAddress
Symbol
}
PreBalance
PostBalance
}
}
}
}
```
## Frequently asked questions (PumpSwap) {#frequently-asked-questions-pumpswap}
### How do I track PumpSwap trades in real time?
Use a GraphQL **`subscription`** on **`DEXTrades`** (all PumpSwap trades) or **`DEXTradeByTokens`** (one token) with **`Trade.Dex.ProgramAddress: "pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA"`**. See [How do I track PumpSwap trades in real time?](#latest-trades-on-pumpswap-websocket) and [per-token stream](#latest-trades-for-a-token-on-pumpswap---websocket). For a one-off snapshot, use a **`query`** with **`dataset: realtime`** instead.
### What is the PumpSwap program address on Solana?
**`pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`** — use it on every PumpSwap trade and pool filter. [Details above](#what-is-the-pumpswap-program-address-on-solana).
### Why do I only see recent PumpSwap data with `dataset: realtime`?
**`dataset: realtime`** covers a **rolling recent window** (roughly the last several hours of activity). For **full history**, use **`dataset: combined`** (or archive where applicable) on **`Solana`**, as described in [historical aggregate data](/docs/blockchain/Solana/historical-aggregate-data/).
### Can I run PumpSwap volume or OHLC aggregates as a subscription?
**No.** **`sum`**, **`count`**, and bucketed OHLC require **queries**, not **`subscription`**. Use subscriptions for **raw trades** or **per-trade prices**, and run **aggregates in your app** or via **scheduled queries**.
### Where can I get Pump.fun data before a token moves to PumpSwap?
Use the [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) and [Pump Fun to PumpSwap](/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/) guides. This page focuses on **PumpSwap** only after migration.
## I can only get 8 hours of PumpSwap data with dataset: realtime — how do I get older data? {#pumpswap-realtime-vs-combined-history}
**`dataset: realtime`** on Solana only covers a **rolling recent window** (on the order of **hours**). For **older PumpSwap history**, switch to **`dataset: combined`** or **`dataset: archive`** on your **`Solana { ... }`** query so archive-backed rows are included. See [Historical Solana aggregate data](/docs/blockchain/Solana/historical-aggregate-data/) and the **OHLC / volume** examples later on this page.
---
## PumpSwap video tutorials {#pumpswap-video-tutorials}
### Video Tutorial | How to get Trades, Trades of a token and Trades of a trader on PumpSwap DEX in realtime
### Video Tutorial | How to get Top Traders on PumpSwap AMM
---
## Raydium DEX API - Solana Trades, Pools, OHLC
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-Raydium-DEX-API/
Query Raydium on Solana with Bitquery GraphQL: new liquidity pools over WebSocket, pair creation times, historical pairs, token prices and OHLC candles.
# Raydium DEX API - Solana Trades, Pools, OHLC
:::tip Need real-time Raydium data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Raydium swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Raydium data older than ~30 days**, raw per-swap detail, or call / event context.
For an overview of what the [Raydium API](https://bitquery.io/products/raydium-api) covers — AMM, CLMM and CPMM trades, pools and OHLC — with plans and trial access, see the product page.
:::
In this section, we will see how to get Raydium information using Bitquery APIs.
For gRPC streaming of Raydium DEX trades: [Solana gRPC Streams (CoreCast) →](/docs/grpc/solana/introduction/)
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## New Liquidity Pools Created on Solana Raydium DEX (Using Websocket)
You can subscribe to newly created Solana Raydium liquidity pools using the GraphQL subscription (WebSocket).
You can try this GraphQL subscription [using this link](https://ide.bitquery.io/Latest-Radiyum-V4-pools-created_1).
In the results, you can get pool and token details using instructions.
### Pool Address
You can find the pool address using the following result: Note that the array index starts from 0. Therefore, it will be the 5th entry.
Instructions -> Instruction -> Accounts[4] -> Address
### Token A
You can get the 1st token address using the following result: Note that the array index starts from 0. Therefore, it will be the 9th entry.
Instructions -> Instruction -> Accounts[8] -> Address
### Token B
You can get the 2nd token address using the following result.
Instructions -> Instruction -> Accounts[9] ->. Address
You can run the following query at [Bitquery IDE](https://ide.bitquery.io/Latest-Radiyum-V4-pools-created_5).
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Method: { is: "initialize2" }
Address: { is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" }
}
}
}
) {
Block {
Time
Date
}
Transaction {
Signature
}
Instruction {
AncestorIndexes
CallerIndex
Depth
Data
ExternalSeqNumber
InternalSeqNumber
Index
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
CallPath
Logs
Program {
AccountNames
Method
Json
Name
Arguments {
Type
Name
Value {
__typename
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
}
}
}
```
## Pair Creation time for a specific pair
You can use the following query to get the pair creation time for a specific pair on Raydium DEX on Solana. But you need to use keyword `query` obviously.
You can run this query using [this link](https://ide.bitquery.io/Specific-pair-creation-time-on-Raydium-Solana_1).
Click to expand GraphQL query
```{
Solana {
Instructions(
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Method: {is: "initializeUserWithNonce"}, Address: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}, Accounts: {includes: {Address: {is: "CSyP9JXCVuVoobWrdtBqQeq7s7VWwNAJ7FFBhLnLFUCE"}}}}}
) {
Block {
Time
}
Transaction {
Signature
}
}
}
}
```
## Get the historical Created pairs on any Solana DEX
This query will return information about the historical created pairs according to the selected date frame.
You can find the query [here](https://ide.bitquery.io/Solana-Raydium-New-Pairs_2)
Click to expand GraphQL query
```graphql
query{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
ProtocolFamily: {
is: "Raydium"
}
}
}
}
limit: {
count: 100
}) {
Block {
Date(minimum: Block_Date
selectWhere: {
since: "2024-10-01"
till: "2024-11-01"
})
}
Trade {
Dex {
ProtocolFamily
}
Market{
MarketAddress
}
Currency {
Symbol
MintAddress
}
Side {
Currency {
Symbol
MintAddress
}
}
}
}
}
}
```
## Latest price of a token
You can use the following query to get the latest price of a token on Raydium DEX on Solana.
You can run this query using [this link](https://ide.bitquery.io/live-price-of-token-on-raydium---updated).
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}, Currency: {MintAddress: {is: "token mint address"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Latest Trades on Solana Raydium DEX
To subscribe to the real-time trades stream for Solana Raydium DEX, [try this GraphQL subscription (WebSocket)](https://ide.bitquery.io/Updated-Real-time-trades-on-Raydium-DEX-on-Solana_1).
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
MintAddress
Decimals
Symbol
ProgramAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
MintAddress
Decimals
Symbol
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## Latest Trades for a specific currency on Solana Raydium DEX
Let's say you want to receive [trades only for a specific currency on Raydium DEX](https://ide.bitquery.io/Updated-Real-time-buy-and-sell-of-specific-currency-on-Raydium-DEX-on-Solana_1). You can use the following stream.
Use currency's mint address; for example, in the following query, we are using Ray token's Mint address to get buy and sells of Ray token.
If you limit it to 1, you will get the latest price of the token because the latest trade = the Latest Price.
Run this query [using this link](https://ide.bitquery.io/Updated-Real-time-buy-and-sell-of-specific-currency-on-Raydium-DEX-on-Solana_1).
Click to expand GraphQL query
```graphql
subscription {
Solana {
Buyside: DEXTrades(
where: {
Trade: {
Buy: {
Currency: {
MintAddress: {
is: "token mint address"
}
}
}
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
Sellside: DEXTrades(
limit: { count: 10 }
where: {
Trade: {
Sell: {
Currency: {
MintAddress: {
is: "token mint address"
}
}
}
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## Raydium OHLC API
If you want to get OHLC data for any specific currency pair on Raydium DEX, you can use [this api](https://ide.bitquery.io/Raydium-OHLC-for-specific-pair_5).
Only use this API as `query` and not `subscription` websocket as Aggregates and Time Intervals don't work well with subscriptions.
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: {
MintAddress: { is: "token mint address" }
}
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
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
}
}
}
```
## Track Latest Add Liquidity Transactions on Raydium DEX
You can also track Add Liquidity transactions in real time on Raydium DEX from Raydium API using instructions. Firstly, you can use this [query](https://ide.bitquery.io/Get-all-methods-of-Raydium-V4-Program#) to get all the methods of Raydium V4 program to deduce which program method is triggered for add liquidity transactions. The method we want to filter for turns out to be `setPositionStopLoss`.
If you want to track latest liquidity additions in Raydium pools, you can use [this Websocket api](https://ide.bitquery.io/Track-Add-Liquidity-Transactions-on-Solana-Raydium-DEX).
In the response, mint under 7th and 8th addresses in the Accounts array gives you the Token A and Token B respectively of the pool in which liquidity is added.
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" }
Method: { is: "setPositionStopLoss" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
AncestorIndexes
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
Logs
InternalSeqNumber
Index
ExternalSeqNumber
Program {
Address
AccountNames
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
}
}
}
```
## Track Latest Remove Liquidity Transactions on Raydium DEX
You can also track Remove Liquidity transactions in real time on Raydium DEX from Raydium API using instructions. Firstly, you can use this [query](https://ide.bitquery.io/Get-all-methods-of-Raydium-V4-Program#) to get all the methods of Raydium V4 program to deduce which program method is triggered for remove liquidity transactions. The method we want to filter for turns out to be `setPositionRangeStop`.
If you want to track latest liquidity removals in Raydium pools, you can use [this Websocket api](https://ide.bitquery.io/Track-Remove-Liquidity-Transactions-on-Solana-Raydium-DEX#).
In the response, mint under 7th and 8th addresses in the Accounts array gives you the Token A and Token B respectively of the pool in which liquidity is removed.
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" }
Method: { is: "setPositionRangeStop" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
AncestorIndexes
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
Logs
InternalSeqNumber
Index
ExternalSeqNumber
Program {
Address
AccountNames
Method
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
}
}
}
```
## Track Raydium DEXTrades enabled by OpenBook Protocol
You can track Raydium DEXTrades which are enabled by OpenBook Protocol in real time on Raydium DEX from Raydium API using instructions. So OpenBook is an Order Book Protocol which Raydium has integrated in its constant product amm. If you want a full explaination of this API, watch our [Youtube Video](https://www.youtube.com/watch?v=aYARyvvItHA).
If you want to track latest Raydium DEXTrades enabled by OpenBook order book Protocol, you can use [this Websocket api](https://ide.bitquery.io/Raydium-dextrades-through-OpenBook-order-book#).
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: { Dex: { ProtocolFamily: { is: "Raydium" } } }
Instruction: {
Accounts: {
includes: {
Address: { is: "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX" }
}
}
}
}
) {
Trade {
Buy {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
}
Price
PriceInUSD
}
Market {
MarketAddress
}
Dex {
ProtocolFamily
ProtocolName
ProgramAddress
}
Sell {
Account {
Address
}
Amount
AmountInUSD
Currency {
MintAddress
Symbol
}
Price
PriceInUSD
}
}
Transaction {
Signature
}
}
}
}
```
## Video Tutorial | How to Track Latest Trades, Latest Price of a Token on Solana Raydium DEX
## Video Tutorial | How to Track Latest Created Liquidity Pools, OHLC data of a specific pair on Solana Raydium DEX
## Video Tutorial | How to Track Add Liquidity and Remove Liquidity Transactions on Raydium DEX
## Video Tutorial | How to track Raydium DEXTrades enabled by OpenBook Protocol using Bitquery API
---
## Raydium Launchpad API
URL: https://docs.bitquery.io/docs/blockchain/Solana/launchpad-raydium/
Raydium Launchpad API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Works with WebSocket live subscriptions.
# Raydium Launchpad API
:::tip Need real-time Raydium Launchpad data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Raydium Launchpad swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Raydium Launchpad data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section we see how to get data on Launchpad by Raydium. This includes token creation, latest trades by trader, for a token etc. You can also check out our [Pump Fun API Docs](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) and [LetsBonk.fun API Docs](/docs/blockchain/Solana/letsbonk-api/).
These APIs can be provided through different streams including Kafka for zero latency requirements. Please contact us on telegram.
## Latest Pools Created on Launchpad
We will use the `PoolCreateEvent` method to filter latest pools on Launchpad. The `Argument` filed includes more information about the pool like `base_mint_param`( token details), `curve_param`( bonding curve details) and `vesting_param` ( cliff period, amount locked etc). Token address is at the 7th entry in Accounts Array.
You can run the query [here](https://ide.bitquery.io/Raydium-Launchpad-pool-creations_1)
Click to expand GraphQL query
```graphql
subscription {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { is: "initialize_v2" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signer
Signature
}
Instruction {
Accounts {
Address
}
Program {
Name
Method
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
}
}
}
```
## Get all the instructions of Raydium LaunchLab
Below query will get you all the instructions that the Raydium LaunchLab Program has. You can test the API [here](https://ide.bitquery.io/all-the-instructions-of-Raydium-LaunchLab).
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}}}}
) {
Instruction {
Program {
Method
}
}
count
}
}
}
```
## Track Token Migrations to Raydium DEX and Raydium CPMM in Realtime
Using above `get all instructions` api, you will figure out that there are 2 instructions `migrate_to_amm`, `migrate_to_cpswap` whose invocations migrate the Raydium LaunchLab Token to Raydium V4 AMM and Raydium CPMM Dexs respectively.
Thats why we have filtered for these 2 instructions in the below API, and tracking these.
Test out the API [here](https://ide.bitquery.io/Track-Token-Migrations-to-Raydium-DEX-and-Raydium-CPMM-in-realtime).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm","migrate_to_cpswap"]}}}, Transaction: {Result: {Success: true}}}
) {
Block{
Time
}
Instruction {
Program {
Method
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
}
Type
Name
}
Name
}
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Track Raydium Launchlab, Meteora DBC, Boop.fun, LetsBonk.fun and Moonshot Token Migrations in a single subscription
Use this single subscription to stream real-time token migration events across Boop.fun, Raydium Launchlab, Meteora DBC, and Moonshot. It filters by the respective program IDs and migration methods, returning block time, program details, involved accounts, and transaction signatures as events occur.
Try out the [API](https://ide.bitquery.io/Raydium-Launchlab-Meteora-DBC-BoopFun-Moonshot-LetsBonkfun-token-migrations-in-realtime_2) here on IDE.
Click to expand GraphQL query
```graphql
subscription{
Solana {
Instructions(
where: {any: [{Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {is: "initialize_v2"}}}}, {Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "graduate"}}}}, {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "migrateFunds"}}}}, {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}}}, {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm", "migrate_to_cpswap"]}}, Accounts: {includes: {Address: {is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1"}}}}}], Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Launchlab
# boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4 - boop.fun
# MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG - Moonshot/Moonit
# dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN - Meteora DBC
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Program Address and FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1(letsbonk.fun platform config addr) is present in Accounts array then its Letsbonk.fun migration
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Market cap (Trading API)
Use **Trading** **`Pairs`** with **`Market.Protocol`** **`raydium_launchpad`** for aggregated **market cap**, **FDV**, **supply**, **price**, and **volume** on Solana launchpad pairs. Replace **`solana:`** in **`Token.Id`** with your token.
### Get latest market cap for a specific Raydium Launchpad token
**`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, **`Token.Id`** with **`includesCaseInsensitive`**, interval duration **> 1** second, **`Market.Protocol`** **`raydium_launchpad`**.
Run the query [in the Bitquery IDE](https://ide.bitquery.io/specific-raydium-launchpad-token-latest-marketcap).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: {
Id: {
includesCaseInsensitive: "solana:7GMB7XbtTdvnHkPjH6yEwTUB3HYf5dqC3FKyr2sueMEh"
}
}
Interval: { Time: { Duration: { gt: 1 } } }
Market: { Protocol: { is: "raydium_launchpad" } }
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Market {
Program
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Price {
Average {
Mean
}
Ohlc {
Open
Low
High
Close
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
}
}
}
```
### Stream Raydium Launchpad tokens with market cap above $10K
Subscribe when the token is on **Solana**, **`Market.Protocol`** is **`raydium_launchpad`**, **`Supply.MarketCap`** **> 10,000** (USD), and interval duration **> 1** second. Adjust **`gt`** to change the threshold.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-raydium-launchpad-tokens-with-marketcap-above-10k-marketcap#).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { Protocol: { is: "raydium_launchpad" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
## Bonding Curve Progress API
Below query will give you the Bonding curve progress percentage of a specific Raydium Launchlab Token.
### Bonding Curve Progress Formula
- **Formula**:
BondingCurveProgress = 100 - ((leftTokens \* 100) / initialRealTokenReserves)
Where:
- leftTokens = realTokenReserves - reservedTokens
- initialRealTokenReserves = totalSupply - reservedTokens
- **Definitions**:
- `initialRealTokenReserves` = `totalSupply` - `reservedTokens`
- `totalSupply`: 1,000,000,000 (Raydium Launchlab Token)
- `reservedTokens`: 206,900,000
- Therefore, `initialRealTokenReserves`: 793,100,000
- `leftTokens` = `realTokenReserves` - `reservedTokens`
- `realTokenReserves`: Token balance at the market address.
:::note
**Simplified Formula**:
BondingCurveProgress = 100 - (((balance - 206900000) \* 100) / 793100000)
:::
### Additional Notes
- **Balance Retrieval**:
- The `balance` is the token balance at the market address.
- Use this query to fetch the balance and then we use `expressions` to calculate the bonding curve progress percentage in the query itself: [Query Link](https://ide.bitquery.io/bonding-curve-progress-percentage-of-a-letsbonkfun-token).
Click to expand GraphQL query
```graphql
query GetBondingCurveProgressPercentage {
Solana {
DEXPools(
limit: { count: 1 }
orderBy: { descending: Block_Slot }
where: {
Pool: {
Market: {
BaseCurrency: {
MintAddress: {
is: "CctsjizSC6pwf2T8bhdHdZTEV4PEcfXoumjeK7FBbonk"
}
}
}
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
}
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100-((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
Balance: PostAmount
}
}
}
}
}
```
## Track Raydium Launchlab Tokens above 95% Bonding Curve Progress in realtime
We can use above Bonding Curve formulae and get the Balance of the Pool needed to get to 95% and 100% Bonding Curve Progress range. And then track liquidity changes which result in `Base{PostAmount}` to fall in this range. You can run and test the saved query [here](https://ide.bitquery.io/LetsBonkfun-Tokens-between-95-and-100-bonding-curve-progress_2).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
DEXPools(
where: {
Pool: {
Base: { PostAmount: { gt: "206900000", lt: "246555000" } }
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Top 100 About to Graduate Raydium Launchlab Tokens
We can use below query to get top 100 About to Graduate Raydium Launchlab Tokens. You can run and test the saved query [here](https://ide.bitquery.io/Top-100-graduating-raydium-launchlab-tokens-in-last-5-minutes).
Click to expand GraphQL query
```graphql
{
Solana {
DEXPools(
limitBy: { by: Pool_Market_BaseCurrency_MintAddress, count: 1 }
limit: { count: 100 }
orderBy: { ascending: Pool_Base_PostAmount }
where: {
Pool: {
Base: { PostAmount: { gt: "206900000" } }
Dex: {
ProgramAddress: {
is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
}
}
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"11111111111111111111111111111111"
"So11111111111111111111111111111111111111112"
]
}
}
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { minutes_ago: 5 } } }
}
) {
Bonding_Curve_Progress_precentage: calculate(
expression: "100 - ((($Pool_Base_Balance - 206900000) * 100) / 793100000)"
)
Pool {
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
QuoteCurrency {
MintAddress
Name
Symbol
}
}
Dex {
ProtocolName
ProtocolFamily
}
Base {
Balance: PostAmount(maximum: Block_Time)
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
}
}
}
}
```
## Latest Trades on Launchpad
This query fetches the most recent trades on the Raydium Launchpad.
You can run the query [here](https://ide.bitquery.io/Latest-Trades-on-Launchpad)
Click to expand GraphQL query
```graphql
query LatestTrades {
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: { Trade: { Dex: { ProtocolName: { is: "raydium_launchpad" } } } }
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
PriceInUSD
Amount
Currency {
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
Similarly, you can subscribe to trades on launchpad in real-time using [subscription query](https://ide.bitquery.io/Subscribe-to-Trades-on-Launchpad). The same can be tracked using [Bitquery Kafka Streams](/docs/streams/kafka-streaming-concepts/)
## Latest Price of a Token on Launchpad
This query provides the most recent price data for a specific token launched on Raydium Launchpad. You can filter by the token’s `MintAddress`, and the query will return the last recorded trade price.
You can run the query [here](https://ide.bitquery.io/Latest-Price-of-a-Token-on-Launchpad)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 1 }
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token mint address" } }
}
}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
PriceInUSD
Amount
Currency {
Name
}
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
## Latest Trades of an User on Launchpad
[This](https://ide.bitquery.io/trades-by-user-on-launchpad_1) query returns the latest trades by a user on Launchpad by filtering on the basis of `Transaction_Signer`. [This](https://ide.bitquery.io/trades-by-user-on-launchpad-stream) stream of data allows to monitor the trade activities of the user on Launchpad in real time.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: { Dex: { ProtocolName: { is: "raydium_launchpad" } } }
Transaction: {
Signer: { is: "8KjdBwz6Q3EYUDYmqfg33em3p9GFcP48v3ghJmw2KDNe" }
}
}
orderBy: { descending: Block_Time }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
Market {
MarketAddress
}
usd_price: PriceInUSD
sol_price: Price
Side {
Currency {
Symbol
Name
MintAddress
}
Type
}
}
}
}
}
```
## Top Buyers of a Token on LaunchPad
[This](https://ide.bitquery.io/top-buyers-of-a-token-on-launchpad) API endpoint returns the top 100 buyers for a token, which is `8CgTj1bVFPVFN9AgY47ZfXkMZDRwXawQ2vckp1ziqray` in this case.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token mint address" } }
Side: { Type: { is: buy } }
}
}
orderBy: { descendingByField: "buy_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
buy_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## Top Sellers of a Token on LaunchPad
Using [this](https://ide.bitquery.io/top-sellers-of-a-token-on-launchpad_1) query top 100 sellers for the token with `Mint Address` as `8CgTj1bVFPVFN9AgY47ZfXkMZDRwXawQ2vckp1ziqray` could be retrieved.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token mint address" } }
Side: { Type: { is: sell } }
}
}
orderBy: { descendingByField: "sell_volume" }
limit: { count: 100 }
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
Transaction {
Signer
}
sell_volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## OHLCV for LaunchPad Tokens
[This](https://ide.bitquery.io/ohlc-for-launchpad-token) API end point returns the OHLCV vlaues for a LaunchPad token with the currency `mint address` as `72j7mBkX54KNH7djeJ2mUz5L8VoDToPbSQTd24Sdhray` when traded against WSOL.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token mint address" } }
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
Transaction: { Result: { Success: true } }
}
limit: { count: 100 }
orderBy: { descendingByField: "Block_Timefield" }
) {
Block {
Timefield: Time(interval: { count: 1, in: minutes })
}
Trade {
open: Price(minimum: Block_Slot)
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
close: Price(maximum: Block_Slot)
}
volumeInUSD: sum(of: Trade_Side_AmountInUSD)
count
}
}
}
```
## Get Liquidity Pool Address for a LaunchPad Token
[This](https://ide.bitquery.io/pool-address-for-launchpad-token) query returns the pair address for the LaunchPad token with `mint address` as `72j7mBkX54KNH7djeJ2mUz5L8VoDToPbSQTd24Sdhray` on the LaunchPad exchange. The liquidity pool address is denoted by `MarketAddress`.
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: { ProtocolName: { is: "raydium_launchpad" } }
Currency: { MintAddress: { is: "token mint address" } }
}
}
) {
Trade {
Market {
MarketAddress
}
Currency {
Name
Symbol
MintAddress
}
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
count
}
}
}
```
## Get Liquidity for a LaunchPad Token Pair Address
Using [this](https://ide.bitquery.io/liquidity-for-a-launchpad-token-pair) query we can get the liquidity for a LaunchPad Token Pair, where `Base_PostBalance` is the amount of LaunchPad tokens present in the pool and `Quote_PostBalance` is the amount of WSOL present in the pool. For the purpose of filtering we are applying the condition that the `MarketAddress` is `H5875KoMLaWAovsjjXuTtHZv9otmH7EgJ2nXMovykZvp`.
Click to expand GraphQL query
```graphql
{
Solana {
DEXPools(
where: {
Pool: {
Market: {
MarketAddress: {
is: "H5875KoMLaWAovsjjXuTtHZv9otmH7EgJ2nXMovykZvp"
}
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Pool {
Base {
PostAmount
}
Quote {
PostAmount
}
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
MintAddress
Name
Symbol
}
}
}
}
}
}
```
[This](https://ide.bitquery.io/liquidity-for-a-launchpad-token-pair-stream) subscription could be utilised to monitor updates in liquidity pools in real time.
## Video Tutorial | How to track Raydium LaunchPad Token Migrations to Raydium V4 and Raydium CPMM Dex
## Video Tutorial | How to Track Raydium Launchpad Newly Launched Tokens in Realtime
## Video Tutorial | How to track Dex Trades of a Traders on Raydium LaunchPad in Realtime
## Video Tutorial | How to get OHLCV of a token on Raydium LaunchLab
## Video Tutorial | How to get Top Buyers and Sellers of a Raydium LaunchLab Token
---
## Solana API - DEX Trades, Token Data, Real-Time Streams
URL: https://docs.bitquery.io/docs/blockchain/Solana/
Solana data API hub: DEX trades, token data, PumpFun, Raydium and Meteora APIs, gRPC (CoreCast) and Kafka streams, WebSocket support and how it compares to RPC.
# Solana API - DEX Trades, Token Data, Real-Time Streams
:::tip Building a trading app or DEX UI on Solana?
For **real-time trades and prices on Solana** (and the last ~30 days), use the curated [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. For **historical Solana data older than ~30 days**, use the chain-level `DEXTrades` / `DEXTradeByTokens` APIs documented below.
:::
Access data from **[Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)**, **[Raydium DEX API](/docs/blockchain/Solana/Solana-Raydium-DEX-API)**, **[Orca API](/docs/blockchain/Solana/solana-orca-dex-api)**, **[DEXScreener API](/docs/blockchain/Solana/DEXScreener/solana_dexscreener/)**, **[Jupiter API](/docs/blockchain/Solana/solana-jupiter-api)**, **[Meteora](/docs/blockchain/Solana/Meteora-DLMM-API)**, **[GMGN](/docs/blockchain/Solana/solana-gmgn-api)**, **[Phoenix](/docs/blockchain/Solana/Solana-Phoenix-api)**, and more via GraphQL APIs and Streams.
> **Before you start**: Not sure when to use Transfers vs DEX Trades vs other data primitives? Read our [Mental Model guide](/docs/start/mental-model-transfers-events-calls) to understand which primitive to use for your use case.
If you need help getting data on Solana,reach out to [support](https://t.me/Bloxy_info)
## What is Solana API?
Bitquery Solana APIs help you fetch onchain data by writing a graphQL query. Bitquery **V2** exposes **Solana** through GraphQL on `streaming.bitquery.io` with **`Solana { … }`** queries: **DEX trades** (Pump.fun, Raydium, Orca, Jupiter, and more), **token transfers**, **balances**, **transactions**, **NFTs**, and **aggregates** (`dataset: combined`, `realtime`, `archive`—see [datasets](/docs/graphql/dataset/combined/)). You also get **WebSocket subscriptions**, **Kafka** topics, and **Solana gRPC (CoreCast)** for low-latency streams. Start from the links below or [historical aggregate data](/docs/blockchain/Solana/historical-aggregate-data/) for OHLC-style queries.
## What are capabilities of Bitquery Solana API?
Bitquery Solana APIs are very flexible, you can fetch trade, transaction, balance information for a period, for a specific wallet and join with other information.
## Difference between Solana RPC and Bitquery Solana API?
**Solana RPC**
- JSON-RPC endpoint exposing raw on-chain state & transactions
- No built-in history or analytics—any indexing/aggregation you build or outsource
- Ideal for submitting transactions
**Bitquery Solana API**
- GraphQL endpoint over pre-indexed, parsed Solana data (token transfers, DEX trades, NFTs, etc.)
- Historical data, joins, aggregations & real-time subscriptions
- Great for real-time data and historical backtesting without running your own indexer
## Difference between Solana Geyser stream and Bitquery Kafka Stream?
**Solana Geyser stream**
- **Data & Protocol**: Runs as a plugin in your own Solana validator, emitting raw on-chain events (account updates, slot status changes, processed transactions, block metadata) over binary or gRPC feeds.
- **Infra & Maintenance**: You must host, scale, and secure the node yourself, parse and index all raw data client-side, and deal with only basic filtering—latency and reliability depend entirely on your setup; no built-in historical querying.
**Bitquery Kafka Stream**
- **Data & Protocol**: Provides fully managed Kafka topics—`solana.dextrades.proto`, `solana.tokens.proto`, and `solana.transactions.proto`—delivering pre-parsed, enriched Protocol-Buffers events (DEX trades, token transfers, supply/balance updates, instructions, blocks, etc.).
- **Infra & Maintenance**: Enterprise-grade, auto-scaling Kafka streams with sub-second latency, schema-based filtering, instruction-level balance updates, built-in replication/failover—no node ops or custom parsing needed.
Read more [here](/docs/streams/real-time-solana-data/) and contact sales via [Telegram](https://t.me/Bloxy_info) or [form](https://bitquery.io/forms/api) for a **Trial**.
## Solana gRPC Streams (CoreCast)
Bitquery **[Solana gRPC Streams](/docs/grpc/solana/introduction/)** (CoreCast) provide ultra-low-latency, real-time data over gRPC with protobuf encoding. Subscribe to DEX trades, transfers, transactions, balances, and more with context-aware filtering — ideal for trading bots, copy trading, and high-frequency applications.
- **[CoreCast Introduction](/docs/grpc/solana/introduction/)** — Topics, filters, and quick start
- **[Pump.fun gRPC Streams](/docs/grpc/solana/examples/pump-fun-grpc-streams/)** — Real-time Pump.fun trades
- **[Copy Trading Bot](/docs/grpc/solana/examples/grpc-copy-trading-bot/)** — Build a Solana copy trading bot with gRPC
## Does Bitquery support Solana Websocket and Solana Webhooks?
Bitquery supports websocket and webhooks, you can convert most of the graphQL APIs into graphQL streams by changing the word `query` to `subscription`. You can monitor this data via a websocket. More and [code samples available here](/docs/subscriptions/websockets/)
## PumpFun
- [DEXrabbit Pump.fun tokens](https://dexrabbit.bitquery.io/categories/pump-fun) — live DEX prices and 24h volume
- [Pump Fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Pump Swap API](/docs/blockchain/Solana/Pumpfun/pump-swap-api/)
- [Marketcap Bonding Curve API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-Marketcap-Bonding-Curve-API/)
- [Pump Fun to Pump Swap](/docs/blockchain/Solana/Pumpfun/pump-fun-to-pump-swap/)
## Raydium
- [Raydium Launchpad](/docs/blockchain/Solana/launchpad-raydium)
- [Raydium DEX API](/docs/blockchain/Solana/Solana-Raydium-DEX-API)
- [Raydium CLMM API](/docs/blockchain/Solana/raydium-clmm-API)
- [Raydium CPMM API](/docs/blockchain/Solana/raydium-cpmm-API)
## Meteora
- [Meteora DAMM v2 API](/docs/blockchain/Solana/Meteora-DAMM-v2-API)
- [Meteora DLMM API](/docs/blockchain/Solana/Meteora-DLMM-API)
- [Meteora DAMM v1 API](/docs/blockchain/Solana/Meteora-DYN-API)
- [Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api)
## Solana DEX APIs
- [Solana Dex Trades](/docs/blockchain/Solana/solana-dextrades)
- [Solana Trader API](/docs/blockchain/Solana/solana-trader-API)
- [Historical Aggregate Data](/docs/blockchain/Solana/historical-aggregate-data)
- [Solana Zeta](/docs/blockchain/Solana/solana-zeta)
- [Solana Jupiter API](/docs/blockchain/Solana/solana-jupiter-api)
- [Solana GMGN API](/docs/blockchain/Solana/solana-gmgn-api)
- [Solana BullX API](/docs/blockchain/Solana/solana-bullx-api)
- [Solana Photon API](/docs/blockchain/Solana/solana-photon-api)
- [Moonshot API](/docs/blockchain/Solana/Moonshot-API)
- [Solana Aldrin AMM API](/docs/blockchain/Solana/Solana-AldrinAmm-api)
- [Solana DEX Orders API](/docs/blockchain/Solana/Solana-DEX-Orders-API)
- [Solana Dex Pools API](/docs/blockchain/Solana/Solana-DexPools-API)
- [Solana Jito Bundle API](/docs/blockchain/Solana/Solana-Jito-Bundle-api)
- [Solana Lifinity DEX API](/docs/blockchain/Solana/Solana-Lifinity-dex-api)
- [Believe API](/docs/blockchain/Solana/Believe-API)
- [Solana OpenBook API](/docs/blockchain/Solana/Solana-OpenBook-api)
- [Solana Phoenix API](/docs/blockchain/Solana/Solana-Phoenix-api)
- [SolFi API](/docs/blockchain/Solana/SolFi-api)
- [Orbic API](/docs/blockchain/Solana/Orbic-API)
- [DEX Screener (Solana)](/docs/blockchain/Solana/DEXScreener/solana_dexscreener/)
## Other Solana APIs
- [Solana Balance Updates](/docs/blockchain/Solana/solana-balance-updates)
- [Solana Token Price API](/docs/blockchain/Solana/solana-token-price-api)
- [Token Supply Cube](/docs/blockchain/Solana/token-supply-cube)
- [Solana Instructions](/docs/blockchain/Solana/solana-instructions)
- [Solana Transactions](/docs/blockchain/Solana/solana-transactions)
- [Solana Transfers](/docs/blockchain/Solana/solana-transfers)
- [Solana Fees API](/docs/blockchain/Solana/solana_fees_api)
- [Boop Fun API](/docs/blockchain/Solana/Boop-Fun-API)
- [BonkSwap API](/docs/blockchain/Solana/BonkSwap-API)
- [LetsBonk.fun API](/docs/blockchain/Solana/letsbonk-api)
- [StonkFun API](/docs/blockchain/Solana/stonkfun-api)
- [Solana Logs](/docs/blockchain/Solana/solana-logs)
- [Solana NFT](/docs/blockchain/Solana/solana-nft)
- [Solana Orca DEX API](/docs/blockchain/Solana/solana-orca-dex-api)
- [Solana Rewards](/docs/blockchain/Solana/solana-rewards)
- [Solana Search Tokens](/docs/blockchain/Solana/solana-search-tokens)
- [Historical Solana Transfer Data](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers)
- [Building an AI Trading Agent on Solana](/docs/blockchain/Solana/ai-agent-solana-data)
## Videos
### Pump.Fun API | Get Live Prices, Metadata, OHLCV, Trading Pair Stats, Charts
### Video Tutorial on Getting Pump Fun Trades
### Video Tutorial | How to Get the OHLC Data & Price of a Token on Pump Fun DEX in Realtime
### Video Tutorial on Solana Transfers API | How to get NFT, SPL Transfers data on Solana in Realtime
### Video Tutorial | How to Track Latest Trades, Latest Price of a Token on Solana Raydium DEX
### Video Tutorial | How to Track Latest Created Liquidity Pools, OHLC data of a specific pair on Solana Raydium DEX
## More guides
- [Data Coverage & Retention](/docs/graphql/data-coverage-retention/) — how far back Solana data goes
- [Common errors and what to do](/docs/start/errors/) — empty results, dataset, and quota errors
- [Kafka Operations Cookbook](/docs/streams/kafka-operations/)
- [Plans, Points & Limits](/docs/plans/how-billing-works/)
---
## Solana Aldrinamm API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-AldrinAmm-api/
AldrinAmm DEX on Solana: real-time trades, latest token price, OHLC candles, top traders of a token, buy and sell volume, and pair volatility.
# AldrinAmm DEX API
:::tip Need real-time AldrinAmm data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered AldrinAmm swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical AldrinAmm data older than ~30 days**, raw per-swap detail, or call / event context.
:::
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## AldrinAmm Trades in Real-Time
This streams a message for every new Aldrin AMM trade, carrying the buy and sell sides, the block and the transaction.
Open it in the [Bitquery IDE: realtime Aldrin AMM trades](https://ide.bitquery.io/Real-time-trades-on-AldrinAmm-DEX-on-Solana_4).
```graphql
subscription {
Solana {
DEXTrades(
where: { Trade: { Dex: { ProtocolFamily: { is: "AldrinAmm" } } } }
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Latest Price of a Token on AldrinAmm
This returns the most recent trade for a token on Aldrin AMM, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest Aldrin AMM token price](https://ide.bitquery.io/live-price-of-token-on-aldrinAmm).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProtocolFamily: {is: "AldrinAmm"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## AldrinAmm OHLC API
If you want to get OHLC data for any specific currency pair on AldrinAmm, you can use this api. Only use [this API](https://ide.bitquery.io/AldrinAmm-OHLC-for-specific-pair) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProtocolFamily: {is: "AldrinAmm"}}, 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 the Top Traders of a specific Token on AldrinAmm DEX
This ranks the wallets trading one token on Aldrin AMM, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on Aldrin AMM](https://ide.bitquery.io/top-traders-of-a-token-on-aldrinAmm_2)
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProtocolFamily: {is: "AldrinAmm"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
}
```
## Get trading volume, buy volume, sell volume of a token
This reads the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. The example follows the WSOL/USDC market on Aldrin AMM; swap the two addresses for the pair you want. Open it in the [Bitquery IDE: Aldrin AMM trade volume](https://ide.bitquery.io/trade_volume_aldrinAmm).
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: {
ProtocolFamily: { is: "AldrinAmm" }
Network: { is: "Solana" }
}
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
## Volatility of a Pair on AldrinAmm
Volatility is an important factor in trading world as it determines the fluctuation in price that implies the possibility of profit and risk of loss. Lesser volatility denotes that the pair is stable.
Open the [Bitquery IDE: Aldrin AMM pair volatility](https://ide.bitquery.io/Volatility-of-WSOL-USDC-Pair-on-AldrinAmm-Dex-on-Solana_1) to read volatility for a pair over the last 24 hours.
```graphql
query Volatilityon {
Solana {
DEXTrades(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "AldrinAmm" } }
Buy: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Sell: {
Currency: {
MintAddress: {
is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
}
Block: { Time: { after: "2025-03-18T00:00:00Z" } }
}
) {
volatility: standard_deviation(of: Trade_Buy_Price)
}
}
}
```
---
## Solana Balance & Balance Updates API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-balance-updates/
Solana Balance & Balance Updates API: fetch current and historical Solana balances with Bitquery GraphQL balance queries.
# Solana Balance & Balance Updates API
In this section we will see how to monitor real-time balance changes across the Solana blockchain using our BalanceUpdates API.
Note - Our [V1 APIs](https://docs.bitquery.io/v1/docs/category/examples) do support solana and you can get balances from there. However they do not have historical balance.
## 🔗 Related Solana APIs
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track transfers that cause balance changes
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Monitor instructions that affect balances
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Track trading activities that impact balances
- **[Solana Fees API](/docs/blockchain/Solana/solana_fees_api/)** - Analyze fees that reduce balances
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Monitor supply changes affecting balances
## Get all the Tokens owned by an address
The below query retrieves the token addresses and their balances owned by a particular account address You can access the query [here](https://ide.bitquery.io/tokens-owned-by-an-address).
For tracking the transfers that cause these balance changes, see our **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)**.
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Owner: {is: "AtTjQKXo1CYTa2MuxPARtr382ZyhPU5YX4wMMpvaa1oy"}}}}
orderBy: {descendingByField: "BalanceUpdate_Balance_maximum"}
) {
BalanceUpdate {
Balance: PostBalance(maximum: Block_Slot)
Currency {
Name
Symbol
}
}
}
}
}
```
## Get Latest Balance Updates
The query will subscribe you to real-time updates for balance changes on the Solana blockchain, providing a continuous stream of data as new transactions are processed and recorded.
You can find the query [here](https://ide.bitquery.io/active-address-balance-update)
The balance update does not inherently include transaction fees. Therefore, to get the actual balance after all transactions and fees, you need to subtract the total transaction fees from the balance updates.
```graphql
subscription {
Solana(network: solana) {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Address: {is: "DzYV9AFEbe9eGc8GRaNvsGjnt7coYiLDY7omCS1jykJU"}}}}
) {
Transaction {
Signature
}
BalanceUpdate {
Amount
Currency {
Name
MintAddress
}
PostBalance
PostBalanceInUSD
Account {
Address
}
Type
}
Block {
Slot
}
}
}
}
```
## Get Token Holdings and Holding time of an address
Get the token holdings of an address and calculate the holding time using `first_buy_time` and `latest_balance_update_time`; test this query [here](https://ide.bitquery.io/token-holdings-of-an-address_2).
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Currency:{MintAddress:{is:"FSJYiGZhJ1wDPNhHbSHm49yJkzbFp7FykNB2SZFipump"}} Account: {Owner: {is: "CECN4BW4DKnbyddkd9FhWVR5dotzKhQr5p7DUPhQ55Du"}}}}
) {
Block{
first_buy_time:Time(minimum:Block_Slot)
latest_balance_update_time:Time(maximum: Block_Slot)
}
BalanceUpdate {
First_Buy: PostBalance(minimum:Block_Slot)
Balance: PostBalance(maximum: Block_Slot)
Currency {
Name
Symbol
MintAddress
}
}
}
}
}
```
## Get All Token Holders of a Particular Token
[This query](https://ide.bitquery.io/top-100-holders-of-USDC-token-on-Solana) returns all token holders of a particular token after a
given time.
```graphql
query MyQuery {
Solana {
BalanceUpdates(
orderBy: {descendingByField: "BalanceUpdate_Holding_maximum"}
where: {BalanceUpdate: {Currency: {MintAddress:
{is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}},
}, Transaction: {Result: {Success: true}}}
) {
BalanceUpdate {
Currency {
Name
MintAddress
Symbol
}
Account {
Address
}
Holding: PostBalance(maximum: Block_Slot selectWhere:{gt:"0"})
}
}
}
}
```
## Get Balance Updates of a Particular Wallet
To focus on the balance changes of a particular Solana wallet, [this](https://ide.bitquery.io/balance-updates-of-a-wallet_4) query filters the data stream to include only those updates relevant to the specified address. This is especially useful for wallet owners or services tracking specific accounts.
```graphql
subscription{
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Address: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}}}
) {
Transaction {
Index
FeePayer
Fee
Signature
Result {
Success
ErrorMessage
}
}
Block {
Time
Hash
Height
}
BalanceUpdate {
Account {
Address
}
Amount
Currency {
Decimals
CollectionAddress
Name
Key
IsMutable
Symbol
}
}
}
}
}
```
## Track NFT Balance Updates in Real-Time
For those interested in the NFT market, this query is tailored to track balance updates involving non-fungible tokens (NFTs) on the Solana blockchain.
You can find the query [here](https://ide.bitquery.io/Solana-NFT-Balance-Updates_1)
```graphql
subscription {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Currency: {Fungible: false}}}
) {
Transaction {
Index
FeePayer
Fee
Signature
Result {
Success
ErrorMessage
}
}
Block {
Time
Hash
Height
}
BalanceUpdate {
Account {
Address
Token {
Owner
}
}
Amount
Currency {
Decimals
CollectionAddress
Name
Key
IsMutable
Symbol
}
}
}
}
}
```
## Latest Balance of an Address on Solana
The query will subscribe you to real-time updates for balance changes on the Solana blockchain for the address `675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8`, The `PostBalance` field will give you the native SOL balance in this case after the balance update.
You can find the query [here](https://ide.bitquery.io/Balance-of-the-raydium-liquidity-pool-address)
```graphql
subscription {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Address: {is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"}}}}
) {
BalanceUpdate {
Account {
Address
}
Amount
Currency {
Decimals
CollectionAddress
Name
Key
IsMutable
Symbol
}
PreBalance
PostBalance
}
}
}
}
```
## How do I get historic SOL balance of a wallet?
You can use Solana v1 Transfer API to get historical solana balances.https://docs.bitquery.io/v1/docs/Examples/Solana/transfers
## Using Pre-Made Aggregates in Solana Balance Updates
When querying Solana balance updates, you can use pre-made aggregates to optimize performance. The `aggregates` flag provides three options to control the use of these aggregates:
- **`aggregates: only`**: This option uses only the pre-made aggregates, which can significantly increase the speed of the response.
- **`aggregates: yes`**: This option uses both pre-made aggregates and individual transaction data.
- **`aggregates: no`**: This option does not use any pre-made aggregates.
> When using the aggregates: only option, you need to include the Owner field in the response to ensure proper aggregation and filtering.
```graphql
{
Solana(aggregates: only) {
BalanceUpdates(
where: {BalanceUpdate: {Account: {Address: {is: "HEL1USMZKAL2odpNBj2oCjffnFGaYwmbGmyewGv1e2TU"}}}}
) {
BalanceUpdate {
Account {
Owner
}
Currency {
Decimals
CollectionAddress
Name
Key
IsMutable
Symbol
}
}
sum(of: BalanceUpdate_AmountInUSD)
}
}
}
```
## Video Tutorial on How to get Balance Updates for Wallets on Solana in Realtime
## Video Tutorial on Getting Top 100 Solana Token Holders
---
## Solana Blocks API - Slots, Height & Skipped Slots
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-blocks-api/
Query and stream Solana blocks: slot to timestamp lookup, block height vs slot, transaction counts per block, and detecting skipped slots.
# Solana Blocks API
The `Blocks` cube is the chain's clock. Use it to convert a slot to a timestamp, watch the
chain tip, measure throughput, or detect skipped slots.
```
Block {
Slot the slot this block occupies
Height block height (not the same number as Slot, see below)
ParentSlot the slot of the previous block
Time block timestamp
Date block date
Hash block hash
ParentHash previous block hash
TxCount transactions in the block
RewardsCount reward entries in the block
}
```
## Slot is not height
This trips people up constantly, so it is worth stating plainly: on Solana `Slot` and `Height`
are different numbers, and the gap between them grows over time.
A slot is a scheduled time window for a leader to produce a block. When a leader fails to
produce one, the slot is **skipped**: no block ever exists at that slot, and height does not
advance. Height counts blocks that exist; slot counts opportunities that were scheduled.
If you are storing "block number" for Solana, decide which one you mean. Anything time-based
should key on `Slot`, since it maps to the network's schedule. Anything counting blocks should
use `Height`.
## Latest blocks
```graphql
query LatestSolanaBlocks {
Solana {
Blocks(limit: { count: 10 }, orderBy: { descending: Block_Slot }) {
Block {
Slot
Height
ParentSlot
Time
TxCount
RewardsCount
Hash
}
}
}
}
```
## Stream the chain tip
`Blocks` is one of the cleaner streams to consume: one message per block, at Solana's block
cadence, with no filter required.
```graphql
subscription SolanaChainTip {
Solana {
Blocks {
Block {
Slot
Height
Time
TxCount
ParentSlot
}
}
}
}
```
Useful as a heartbeat. If this stream goes quiet, the problem is your connection or the
network, not your filter, which is a helpful thing to be able to distinguish when a busier
subscription stops delivering.
## Detect skipped slots
`Slot - ParentSlot` is 1 when no slot was skipped. Anything larger means the leader for those
slots produced nothing.
```graphql
subscription SkippedSlots {
Solana {
Blocks {
Block {
Slot
ParentSlot
Time
}
}
}
}
```
Compute the gap client-side:
```js
const skipped = Number(block.Slot) - Number(block.ParentSlot) - 1;
if (skipped > 0) console.log(`${skipped} slot(s) skipped before ${block.Slot}`);
```
A rising skip rate means leaders are failing to produce, which usually shows up as degraded
confirmation times before it shows up anywhere else. It is a cheap network-health signal, and
one you cannot get from trade or transfer data.
## Look up the timestamp for a slot
```graphql
query SlotToTime {
Solana {
Blocks(limit: { count: 1 }, where: { Block: { Slot: { eq: "436918084" } } }) {
Block {
Slot
Height
Time
TxCount
}
}
}
}
```
Replace the slot with the one you are looking up.
:::note An empty result usually means retention, not a bad slot
If a slot returns no rows, it is most often outside the history your plan retains rather than a
slot that does not exist. Check a recent slot first to confirm the query shape, then widen. A
genuinely skipped slot also returns nothing, so the two cases look identical — use
`ParentSlot` on the surrounding blocks to tell them apart.
:::
## Throughput per day
`TxCount` aggregates, so block and transaction throughput is one query rather than a scan over
transactions.
```graphql
query SolanaDailyThroughput {
Solana {
Blocks(limit: { count: 14 }, orderBy: { descending: Block_Date }) {
Block {
Date
}
blocks: count
transactions: sum(of: Block_TxCount)
rewards: sum(of: Block_RewardsCount)
}
}
}
```
Dividing `transactions` by `blocks` gives average transactions per block, which is a better
load measure than raw TPS because it is not distorted by skipped slots.
## Related
- [Solana Transactions API](/docs/blockchain/Solana/solana-transactions/)
- [Solana Rewards API](/docs/blockchain/Solana/solana-rewards/)
- [Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)
- [Which cubes support subscriptions](/docs/subscriptions/which-cubes-stream/)
---
## Solana Boop Fun API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Boop-Fun-API/
Boop.fun on Solana: latest token creations, buys, sells and migrations, plus one subscription for Raydium Launchlab, Meteora DBC, LetsBonk.fun and Moonshot.
# Boop Fun API
:::tip Need real-time Boop.fun data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Boop.fun data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this document, we will explore several examples related to Boop fun data. We also have [Raydium Launchpad APIs](/docs/blockchain/Solana/launchpad-raydium/).
Additionally, you can also check out our [Moonshot APIs](/docs/blockchain/Solana/Moonshot-API/), [FourMeme APIs](/docs/blockchain/BSC/four-meme-api/).
These APIs can be provided through different streams including Kafka for zero latency requirements. Please contact us on [telegram](https://t.me/Bloxy_info).
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## Get the latest Boop.Fun token migrations
Below query can be used to track Boop.fun token migrations. In this query we are getting 10 latest Boop.fun migrations. Change the `query` keyword to `subscription` keyword then it will act as a websocket and will keep on running and give you the realtime migrations.
Try the query [here](https://ide.bitquery.io/Boopfun-token-migrations)
```graphql
query MyQuery {
Solana {
Instructions(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "graduate"}}}}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Accounts {
IsWritable
Address
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
}
}
}
```
## Latest Boop.fun token buys
You can track latest buy trades on Boop.Fun using the below API. Try the API [here](https://ide.bitquery.io/latest-boopfun-token-buys#).
```graphql
query MyQuery {
Solana {
Instructions(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "buy_token"}}}}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Accounts {
IsWritable
Address
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
}
}
}
```
## Latest Boop.fun token sells
You can track latest sell trades on Boop.Fun using the below API. Try the API [here](https://ide.bitquery.io/latest-boopfun-token-sells#).
```graphql
query MyQuery {
Solana {
Instructions(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "sell_token"}}}}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Accounts {
IsWritable
Address
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
}
}
}
```
## Latest Boop.fun token creation
You can track latest token launches on Boop.Fun using the below API. Try the API [here](https://ide.bitquery.io/latest-boopfun-token-creations#).
```graphql
query MyQuery {
Solana {
Instructions(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "create_token"}}}}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Accounts {
IsWritable
Address
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
}
}
}
```
## Track Boop.fun, Raydium Launchlab, Meteora DBC, LetsBonk.fun and Moonshot Token Migrations in a single subscription
Use this single subscription to stream real-time token migration events across Boop.fun, Raydium Launchlab, Meteora DBC, and Moonshot. It filters by the respective program IDs and migration methods, returning block time, program details, involved accounts, and transaction signatures as events occur.
Try out the [API](https://ide.bitquery.io/Raydium-Launchlab-Meteora-DBC-BoopFun-Moonshot-LetsBonkfun-token-migrations-in-realtime_2) here on IDE.
```graphql
subscription{
Solana {
Instructions(
where: {any: [{Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {is: "initialize_v2"}}}}, {Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "graduate"}}}}, {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "migrateFunds"}}}}, {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}}}, {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm", "migrate_to_cpswap"]}}, Accounts: {includes: {Address: {is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1"}}}}}], Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Launchlab
# boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4 - boop.fun
# MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG - Moonshot/Moonit
# dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN - Meteora DBC
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Program Address and FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1(letsbonk.fun platform config addr) is present in Accounts array then its Letsbonk.fun migration
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
---
## Solana Bullx API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-bullx-api/
Build a BullX-style Solana terminal with Bitquery: live pair trades, token stats, top pairs, OHLC charts and per-token traded value.
# BullX Solana API
:::tip Need real-time BullX-style 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**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) 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.
:::note
`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](https://ide.bitquery.io/Get-Solana-pair-trades-data).
```graphql
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](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair).
```graphql
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](https://ide.bitquery.io/BullX--All-in-One-query_1).
``` graphql
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](https://ide.bitquery.io/Solana-OHLC-Query_5?_gl=1*1simohi*_ga*MTU0ODE3ODUxMy4xNzM5Nzg0Njcw*_ga_ZWB80TDH9J*MTc0MjQ2MjAwNi43Ny4xLjE3NDI0NjIwNDQuMC4wLjA.)
``` graphql
{
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](https://ide.bitquery.io/top-trading-pairs?_gl=1*131rbu4*_ga*MTU0ODE3ODUxMy4xNzM5Nzg0Njcw*_ga_ZWB80TDH9J*MTc0MjQ2MjAwNi43Ny4xLjE3NDI0NjIwNDQuMC4wLjA.).
```graphql
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](/docs/trading/crypto-trades-api/trades-api/) 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](https://ide.bitquery.io/trade_volume_Solana#).
```graphql
{
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)
}
}
}
```
---
## Solana Byreal API
URL: https://docs.bitquery.io/docs/blockchain/Solana/byreal-api/
Byreal on Solana: real-time trades and prices, market cap, latest price, OHLC, top traders, and buy and sell volume for a token.
# Byreal API
:::tip Need real-time Byreal data or anything from the last ~30 days?
Use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) for swap-level rows and [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) for **OHLC**, **volume**, and **market cap**. Both include **USD price and supply** on every row. For **historical data older than ~30 days** and **historical aggregates** (OHLC, volume, top traders), see [Historical Solana aggregate data](/docs/blockchain/Solana/historical-aggregate-data/).
:::
Bitquery provides real-time and historical data APIs and streams for **Byreal**, a Solana trading protocol. For **prices, OHLC, volume, market cap, and trader analytics** over the **last ~30 days**, use the [**Crypto Price API**](/docs/trading/crypto-price-api/) (`Trading.Pairs`) and [**Crypto Trades API**](/docs/trading/crypto-trades-api/trades-api) (`Trading.Trades`), filtering by **`Market.Program`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`**.
For **historical aggregates** going back to **May 2024** — OHLC candlesticks, volume, and time-bucketed analytics on **`DEXTradeByTokens`** with **`dataset: combined`** or **`dataset: archive`** — see [Historical Solana aggregate data](/docs/blockchain/Solana/historical-aggregate-data/). Filter those queries by **`Trade.Dex.ProgramAddress`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`** for Byreal-specific history.
Need zero-latency Byreal data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## Byreal Trades in Real-Time — Crypto Trades API
Stream new Byreal swaps via **`Trading.Trades`** with **USD price**, **market cap**, **FDV**, **supply**, **trader address**, and **transaction metadata** on every row. Filter by **`Pair.Market.Program`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`**.
For schema details, see the [**Crypto Trades API**](/docs/trading/crypto-trades-api/trades-api) and [**Supply fields**](/docs/trading/crypto-price-api/supply-fields).
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/Real-time-trades-on-Byreal-DEX-on-Solana).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
}
) {
Side
Price
PriceInUsd
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Trader {
Address
}
TransactionHeader {
Hash
Fee
FeePayer
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Time
Timestamp
}
Pair {
Market {
Address
Program
Protocol
ProtocolFamily
Network
}
Token {
Address
Id
Symbol
Network
}
QuoteToken {
Address
Id
Symbol
Network
}
}
}
}
}
```
### Stream live prices for a specific Byreal token
Lock onto one token with **`Pair.Token.Id`** (e.g. **`bid:solana:`**) and the Byreal program address.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/Byreal-token-live-prices-using-trades-api).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Side
Price
PriceInUsd
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Trader {
Address
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Time
}
Pair {
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
}
}
}
}
```
## Market cap — Crypto Price API
Use **`Trading.Pairs`** with **`Market.Program`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`** for aggregated **market cap**, **FDV**, **supply**, **price**, and **volume**. Replace **`solana:`** in **`Token.Id`** with your token.
See the [**Pairs cube**](/docs/trading/crypto-price-api/pairs) for full field reference.
### Get latest market cap for a specific Byreal token
Run the query [in the Bitquery IDE](https://ide.bitquery.io/Sandisk---Backpack-Securities-MCAP).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: { Address: { is: "token address here" } }
Interval: { Time: { Duration: { gt: 1 } } }
Market: {
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Market {
Program
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
### Stream Byreal tokens with market cap above $10K
Subscribe when the token is on **Solana**, **`Market.Program`** is Byreal, **`Supply.MarketCap`** **> 10,000** (USD), and interval duration **> 1** second. Adjust **`gt`** to change the threshold.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-byreal-tokens-with-marketcap-above-10k).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: {
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
## Latest Price of a Token on Byreal — Crypto Price API
Returns the latest **OHLC close**, **average price**, and **volume** for a Byreal pair via **`Trading.Pairs`**. Replace **`token Mint Address`** with your SPL mint. Adjust **`Interval.Time.Duration`** for the candle size (e.g. `60` for 1-minute bars).
Run the query [in the Bitquery IDE](https://ide.bitquery.io/latest-price-of-a-token-on-Byreal).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Address: { is: "token Mint Address" } }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Market {
Address
Program
Protocol
ProtocolFamily
}
Token {
Address
Name
Symbol
}
QuoteToken {
Address
Symbol
}
Price {
IsQuotedInUsd
Average {
Mean
}
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
Supply {
MarketCap
FullyDilutedValuationUsd
TotalSupply
}
}
}
}
```
## Byreal OHLC API — Crypto Price API
Fetch historical **OHLC candles** for a Byreal pair. Set **`Interval.Time.Duration`** to your bar size in seconds (`60` = 1 minute, `3600` = 1 hour). Use as a **query** for historical bars; use a **subscription** for live candle updates.
Run the query [in the Bitquery IDE](https://ide.bitquery.io/Byreal-OHLC-API).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 100 }
orderBy: { descending: Block_Time }
where: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Address: { is: "token Mint Address" } }
Interval: { Time: { Duration: { eq: 60 } } }
}
) {
Block {
Time
}
Interval {
Time {
Start
End
Duration
}
}
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
Price {
IsQuotedInUsd
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
}
}
}
```
## Get the Top Traders of a specific Token on Byreal — Crypto Trades API
Ranks wallets by **quoted USD volume** on Byreal for a given token. Use as a **query** only — aggregates do not work correctly over subscriptions.
Run the query [in the Bitquery IDE](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-Token-on-Byreal-DEX).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "Total_Volume" }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Trades_count: count
Total_Volume: sum(of: AmountsInUsd_Quote)
buy_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
Trader {
Address
}
}
}
}
```
## Get Trading Volume, Buy Volume, Sell Volume of a Token on Byreal
Run the query [in the Bitquery IDE](https://ide.bitquery.io/Get-trading-volume-buy-volume-sell-volume-of-a-token-on-Byreal-DEX).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: {
Network: { is: "Solana" }
Program: { is: "REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2" }
}
Token: { Id: { is: "bid:solana:token Mint Address" } }
}
}
) {
Trades_count: count
total_volume: sum(of: AmountsInUsd_Quote)
buy_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
Pair {
Token {
Address
Symbol
}
QuoteToken {
Address
Symbol
}
}
}
}
}
```
## Historical data and aggregates
The **Trading APIs** on this page cover **real-time streams** and roughly the **last ~30 days** of Byreal trades, prices, and OHLC.
For **older Byreal history** and **historical aggregates** — OHLC candlesticks, volume buckets, and time-series analytics from **May 2024** onward — use chain-level queries on **`Solana(dataset: combined)`** or **`Solana(dataset: archive)`** with **`DEXTradeByTokens`**. Filter by **`Trade.Dex.ProgramAddress`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`**.
See the full guide with working examples: [Historical Solana aggregate data](/docs/blockchain/Solana/historical-aggregate-data/).
For a Byreal-specific historical OHLC starting point, try [Byreal historical OHLC — DEXTradeByTokens](https://ide.bitquery.io/Byreal-historical-OHLC-DEXTradeByTokens) in the IDE (uses **`Solana(dataset: combined)`** and **`Trade.Dex.ProgramAddress`** **`REALQqNEomY6cQGZJUGwywTBD2UmDT32rZcNnfxQ5N2`**).
:::note
Historical aggregate queries use **`query`** only — **`sum`**, **`count`**, and interval-based OHLC do not work reliably as **`subscription`** websockets.
:::
## Related Documentation
- [Crypto Trades API](/docs/trading/crypto-trades-api/trades-api)
- [Crypto Price API — Pairs](/docs/trading/crypto-price-api/pairs)
- [Crypto Price API — OHLC](/docs/trading/crypto-price-api/crypto-ohlc-candle-k-line-api)
- [Traders API](/docs/trading/crypto-trades-api/traders-api)
- [Historical Solana aggregate data](/docs/blockchain/Solana/historical-aggregate-data/)
- [Real-time Solana Data Streams](/docs/streams/real-time-solana-data/)
- [API Authorization](/docs/authorization/how-to-use/)
---
## Solana DEX Orders API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-DEX-Orders-API/
Solana DEX orders: real-time order stream, latest orders for a token, orders above a limit price, open orders, and OpenBook DEX orders.
# Solana DEX Orders API
:::tip Need real-time Solana DEX orders data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Solana DEX orders swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Solana DEX orders data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section, you'll learn how to access Solana-based decentralized exchange (DEX) trading data using our DEX Orders API.
## Get Solana DEX Orders in Real-Time
This query provides real-time updates on order events, including details about the DEX, market, and order specifics. You can run the query [here](https://ide.bitquery.io/Copy-of-Solana-DEX-trades-API)
```graphql
subscription {
Solana {
DEXOrders {
Instruction {
Index
Program {
Address
AccountNames
Name
Method
}
}
OrderEvent {
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Index
Market {
MarketAddress
CoinToken {
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
Symbol
TokenCreator {
Share
Address
}
Name
Key
Fungible
CollectionAddress
}
PriceToken {
Wrapped
VerifiedCollection
Uri
TokenStandard
Native
Name
MetadataAddress
Key
Fungible
Decimals
CollectionAddress
}
}
Order {
BuySide
Account
Payer
OrderId
Owner
}
Type
}
}
}
}
```
## Latest DEX Orders of a Token
To fetch the most recent orders for a specific token, filter using the token's `MintAddress`. Replace the example address in the query with the target token's address.
You can run the query [here](https://ide.bitquery.io/Latest-DEXOrders-for-token-on-Solana)
```graphql
{
Solana(dataset: realtime) {
DEXOrders(
where: {OrderEvent: {Market: {BaseCurrency: {MintAddress: {is: "6kdU2J4pSxG2w1sBLqrtE8BCisQwa3t12hRdkb13JGeu"}}}}}
orderBy: {descending: Block_Time}
) {
OrderEvent {
Dex {
ProtocolName
ProgramAddress
}
Index
Market {
MarketAddress
QuoteCurrency {
Name
Symbol
MintAddress
}
BaseCurrency {
Name
MintAddress
}
}
Order {
Account
BuySide
LimitPrice
LimitAmount
OrderId
}
}
}
}
}
```
## DEX Orders Above a Limit Price
You can filter orders based on specific price conditions, such as all orders with a `LimitPrice` greater than a specified value. Modify the price threshold and token address as needed.
You can run the query [here](https://ide.bitquery.io/LimitPrice-DEXOrders-for-token-on-Solana)
```graphql
{
Solana(dataset: realtime) {
DEXOrders(
where: {OrderEvent: {Market: {BaseCurrency: {MintAddress: {is: "6kdU2J4pSxG2w1sBLqrtE8BCisQwa3t12hRdkb13JGeu"}}}, Order: {LimitPrice: {gt: "0.068"}}}}
orderBy: {descending: Block_Time}
) {
OrderEvent {
Dex {
ProtocolName
ProgramAddress
}
Index
Market {
MarketAddress
QuoteCurrency {
Name
Symbol
MintAddress
}
BaseCurrency {
Name
MintAddress
}
}
Order {
Account
BuySide
LimitPrice
LimitAmount
OrderId
}
}
}
}
}
```
## Latest Open Orders on Solana
This query retrieves the latest open orders on Solana-based DEXs. Open orders are those that have been created but not yet executed or canceled.
You can run the query [here](https://ide.bitquery.io/Latest-Open-DEX-Orders-Solana)
```graphql
{
Solana(dataset: realtime) {
DEXOrders(
where: {OrderEvent: {Type: {is: Open}}}
orderBy: {descending: Block_Time}
) {
OrderEvent {
Dex {
ProtocolName
ProgramAddress
}
Index
Market {
MarketAddress
QuoteCurrency {
Name
Symbol
MintAddress
}
BaseCurrency {
Name
MintAddress
}
}
Order {
Account
BuySide
LimitPrice
LimitAmount
OrderId
}
}
}
}
}
```
## Latest OpenBook DEX Orders
This query fetches the latest orders from the OpenBook DEX on Solana, providing comprehensive information about the DEX protocol, market, order specifics, and transaction details. OpenBook is an exchange protocol offering central limit orderbook for top Solana DeFi protocols.
You can run the query [here](https://ide.bitquery.io/Latest-Openbook-DEX-Orders#)
```graphql
{
Solana(dataset: realtime) {
DEXOrders(
where: {OrderEvent: {Dex: {ProgramAddress: {is: "srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"}}}}
orderBy: {descending: Block_Time}
) {
OrderEvent {
Dex {
ProtocolName
ProgramAddress
}
Type
Order {
Account
BuySide
LimitPrice
LimitAmount
OrderId
}
Market {
MarketAddress
QuoteCurrency {
Name
Symbol
MintAddress
}
BaseCurrency {
Name
MintAddress
}
}
Index
}
Transaction {
Signature
}
Block {
Time
Hash
}
}
}
}
```
## Video Tutorials
---
## Solana DEX Pools API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-DexPools-API/
Query Solana liquidity pools with Bitquery GraphQL: pool updates in real time, tokens above a liquidity threshold, per-token pools and latest reserves.
# Solana DEX Pools API
:::tip Need real-time Solana DEX pool data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Solana DEX pool swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Solana DEX pool data older than ~30 days**, raw per-swap detail, or call / event context.
Pool and liquidity data ships with the [Solana DEX API](https://bitquery.io/products/solana-dex-api) — the product page covers venues, plans and real-time delivery.
:::
In this section we will see how to get Solana DEX Pools information using our API.
## Get all Liquidity Pools updates on Solana
To get all Liquidity pools updates on solana use [this stream](https://ide.bitquery.io/solana-dex-pools-update-stream).
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools {
Block {
Time
}
Pool {
Base {
ChangeAmount
PostAmount
Price
PriceInUSD
}
Quote {
ChangeAmount
PostAmount
Price
PriceInUSD
}
Dex {
ProgramAddress
ProtocolFamily
}
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
MintAddress
Name
Symbol
}
MarketAddress
}
}
}
}
}
```
## Get Tokens which have liquidity over 1 Million USD
You can use the below query to get the tokens which are getting traded and have liquidity over 1 million USD. Try out the query [here](https://ide.bitquery.io/Search-tokens-with-liquidity-over-1-million#).
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
DEXPools(
where: {Pool: {Base: {PostAmountInUSD: {ge: "1000000"}}, Market: {QuoteCurrency: {MintAddress: {in: ["11111111111111111111111111111111", "So11111111111111111111111111111111111111112"]}}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Transaction {
Signature
}
Pool {
Base {
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Quote{
PostAmount
PostAmountInUSD
}
Market {
MarketAddress
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
Name
MintAddress
Symbol
}
}
Dex {
ProtocolFamily
ProgramAddress
ProtocolName
}
Market {
MarketAddress
BaseCurrency {
MintAddress
Name
Symbol
}
QuoteCurrency {
Name
MintAddress
Symbol
}
}
}
}
}
}
```
## Get All Liquidity Pools info for a particular token
This query will give you the information on all the liquidity pools of a particular token `EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm`.
You can find the query [here](https://ide.bitquery.io/get-all-the-liquidity-pools-info-for-a-particular-token_1)
Click to expand GraphQL query
```graphql
query ($token: String) {
Solana {
DEXPools(
orderBy: {descendingByField: "Pool_Quote_PostAmountInUSD_maximum"}
where: {Pool: {Market: {BaseCurrency: {MintAddress: {is: $token}}}}}
) {
Pool {
Market {
QuoteCurrency {
Symbol
Name
MintAddress
}
MarketAddress
}
Dex {
ProtocolFamily
}
Base {
PostAmount(maximum: Block_Slot)
PostAmountInUSD(maximum: Block_Slot)
}
Quote {
PostAmount(maximum: Block_Slot)
PostAmountInUSD(maximum: Block_Slot)
}
}
}
}
}
{
"token": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm"
}
```

Check data here on [DEXrabbit](https://dexrabbit.bitquery.io/solana/token/EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm#pools).
## Get Latest Liquidity for All Pools of a Token
Use this query to get latest liquidity snapshots for all pools where a token appears either on the base side or quote side.
Try the query [here](https://ide.bitquery.io/liqidity-of-all-pools-of-a-token)
Click to expand GraphQL query
```graphql
query GetLatestLiquidityForPool {
Solana(dataset: realtime) {
DEXPools(
where: {
Pool: {
Market: {
BaseCurrency: { Name: { not: "" } }
QuoteCurrency: { Name: { not: "" } }
}
}
any: [
{
Pool: {
Market: {
BaseCurrency: {
MintAddress: {
is: "F5tfztTnE4sYsMhZT5KrFpWvHmYSfJZoRjCuxKPbpump"
}
}
}
}
}
{
Pool: {
Market: {
QuoteCurrency: {
MintAddress: {
is: "F5tfztTnE4sYsMhZT5KrFpWvHmYSfJZoRjCuxKPbpump"
}
}
}
}
}
]
Transaction: { Result: { Success: true } }
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount(maximum: Block_Slot)
PostAmountInUSD(maximum: Block_Slot)
}
Base {
PostAmount(maximum: Block_Slot)
PostAmountInUSD(maximum: Block_Slot)
}
}
}
}
}
```
## Latest Price of Token Based on Liqudity
[This](https://ide.bitquery.io/latest-price-based-on-liquidity_2) subscription given below returns the latest and real-time price and other info related to the token, DEX and market for the following token `LMFzmYL6y1FX8HsEmZ6yNKNzercBmtmpg2ZoLwuUboU`.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Market: {
BaseCurrency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Pool {
Base {
ChangeAmount
PostAmount
Price
PriceInUSD
}
Dex {
ProgramAddress
ProtocolFamily
}
Market {
BaseCurrency {
MintAddress
Name
Symbol
}
MarketAddress
}
}
}
}
}
```
## Get Latest Liquidity of any Liquidity Pool
This query gets you the liquidity/balance of the Quote Currency `WSOL` and Base Currency `SOLANADOG` for this particular pool address `BDQnwNhTWc3wK4hhsnsEaBBMj3sD4idGzvuidVqUw1vL`. THe liquidity value of the currencies will be in `Quote{PostAmount}` and `Base{PostAmount}`.
You can find the query [here](https://ide.bitquery.io/Get-LP-Latest-liqudity-on-Solana)
Click to expand GraphQL query
```graphql
query GetLatestLiquidityForPool {
Solana(dataset: realtime) {
DEXPools(
where: {
Pool: {
Market: {
MarketAddress: {
is: "HktfL7iwGKT5QHjywQkcDnZXScoh811k7akrMZJkCcEF"
}
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Slot }
limit: { count: 1 }
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PostAmountInUSD
}
Base {
PostAmount
}
}
}
}
}
```
## Get Locked Liquidity of a Pool on Solana
This query retrieves the locked liquidity of a pool on Solana by querying balance updates for a specific pool account owner and currency. The locked liquidity is calculated as twice the balance of WSOL in USD (since pools typically have two tokens locked). You can find the query [here](https://ide.bitquery.io/get-locked-liquidity-of-a-pool-on-Solana).
Click to expand GraphQL query
```graphql
query MyQuery {
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Account: {
Owner: { is: "FPY1pAp1xLq2hihs1Tm2tE2F8VQThXhLBvvZnvdfHCTb" }
}
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
orderBy: { descendingByField: "BalanceUpdate_Balance_maximum" }
) {
BalanceUpdate {
Balance: PostBalanceInUSD(maximum: Block_Slot)
Currency {
Name
Symbol
MintAddress
}
}
locked_liquidity: calculate(expression: "$BalanceUpdate_Balance*2")
}
}
}
```
## Get Top Pools Based on Liquidity
[This](https://ide.bitquery.io/top-10-liquidity-pools_1) query retrieves the top liquidity pools on the Solana blockchain, sorted by their total liquidity (PostAmount). The query is filtered for pools that have been active since a specific time period. The results are limited to the top 10 pools based on their liquidity.
Click to expand GraphQL query
```graphql
query GetTopPoolsByDex {
Solana {
DEXPools(
orderBy: { descending: Pool_Quote_PostAmount }
where: {
Block: { Time: { after: "2024-08-27T12:00:00Z" } }
Transaction: { Result: { Success: true } }
}
limit: { count: 10 }
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolName
ProtocolFamily
}
Quote {
PostAmount
PostAmountInUSD
PriceInUSD
}
Base {
PostAmount
}
}
}
}
}
```
## Liquidity Add Events Tracked Using Instructions
This query tracks liquidity addition events on Solana DEX pools by monitoring specific instructions.
[ Run query](https://ide.bitquery.io/All-liquidity-add-instructions-track-on-Solana#)
Click to expand GraphQL query
```graphql
{
Solana(network: solana) {
DEXPools(
limit: {count: 20}
orderBy: {descending: Block_Time}
where: {Instruction: {Program: {Method: {in: ["add_liquidity", "addLiquidity", "increase_liquidity", "increaseLiquidity", "increase_liquidity_v2", "deposit", "depositAllTokenTypes", "join", "provide_liquidity"]}}}}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
Name
MintAddress
}
QuoteCurrency {
Symbol
Name
MintAddress
}
}
Base {
ChangeAmount
ChangeAmountInUSD
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Quote {
ChangeAmount
ChangeAmountInUSD
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Dex {
ProtocolName
ProtocolFamily
}
}
Block {
Time
}
Transaction {
Signature
}
}
}
}
```
## Liquidity Remove Events Tracked Using Withdraw Instruction
This query tracks liquidity removal events on Solana DEX pools by monitoring withdraw instructions.
[ Run query](https://ide.bitquery.io/Copy-of-Solana-DEXPools-withdraw)
Click to expand GraphQL query
```graphql
{
Solana(network: solana) {
DEXPools(
limit: {count: 20}
orderBy: {descending: Block_Time}
where: {Instruction: {Program: {Method: {is: "withdraw"}}}}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
Name
MintAddress
}
QuoteCurrency {
Symbol
Name
MintAddress
}
}
Base {
ChangeAmount
ChangeAmountInUSD
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Quote {
ChangeAmount
ChangeAmountInUSD
PostAmount
PostAmountInUSD
Price
PriceInUSD
}
Dex {
ProtocolName
ProtocolFamily
}
}
Block {
Time
}
Transaction {
Signature
}
}
}
}
```
## Liquidity Events for Raydium Pairs
In this section, we will discover data streams that provides us with the real time events of liquidity addition and liquidity removal for the Raydium DEX, which has `675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8` as the Program Address.
### Liquidity addition for Raydium Pairs
[This](https://ide.bitquery.io/liquidity-addition-for-Raydium_1) subscription returns the real-time liquidity addition event details for the Raydium Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
Base: { ChangeAmount: { gt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
### Liquidity removal for Raydium Pairs
[This](https://ide.bitquery.io/liquidity-removal-for-Raydium_1) subscription returns the real-time liquidity addition event details for the Raydium Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: {
ProgramAddress: {
is: "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"
}
}
Base: { ChangeAmount: { lt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
## Liquidity Events for Orca Whirlpool Pairs
In this section, we will discover data streams that provides us with the real time events of liquidity addition and liquidity removal for the Orca Whirlpool DEX, which has `whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc` as the Program Address.
### Liquidity addition for Orca Whirlpool Pairs
[This](https://ide.bitquery.io/liquidity-addition-for-orca-whirlpool_1) subscription returns the real-time liquidity addition event details for the Orca Whirlpool Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: {
ProgramAddress: {
is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
}
Base: { ChangeAmount: { gt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
### Liquidity removal for Orca Whirlpool Pairs
[This](https://ide.bitquery.io/liquidity-removal-for-orca-whirlpool_1) subscription returns the real-time liquidity addition event details for the Orca Whirlpool Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: {
ProgramAddress: {
is: "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
}
}
Base: { ChangeAmount: { lt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
## Liquidity Events for Meteora Pairs
In this section, we will discover data streams that provides us with the real time events of liquidity addition and liquidity removal for the Meteora DEX, which has `Meteora` as the Protocol Family.
### Liquidity addition for Meteora Pairs
[This](https://ide.bitquery.io/liquidity-addition-for-meteora_1) subscription returns the real-time liquidity addition event details for the Meteora Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: { ProtocolFamily: { is: "Meteora" } }
Base: { ChangeAmount: { gt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
### Liquidity removal for Meteora Pairs
[This](https://ide.bitquery.io/liquidity-removal-for-meteora_1) subscription returns the real-time liquidity addition event details for the Meteora Pairs.
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXPools(
where: {
Pool: {
Dex: { ProtocolFamily: { is: "Meteora" } }
Base: { ChangeAmount: { lt: "0" } }
}
}
) {
Pool {
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
Name
}
QuoteCurrency {
MintAddress
Symbol
Name
}
}
Dex {
ProtocolFamily
ProtocolName
}
Quote {
PostAmount
PriceInUSD
PostAmountInUSD
}
Base {
ChangeAmount
PostAmount
}
}
}
}
}
```
## How DEXPools Values Are Calculated
What `PostAmount` measures, when its USD value is priced, and how to order updates that land in the same slot. Read this before feeding `DEXPools` into a simulator, bot or risk model.
### What `Base.PostAmount` and `Quote.PostAmount` represent
`PostAmount` is the pool's **vault balance** of that token after the event, read from the on-chain token balances. `Base.PostAmount + Quote.PostAmount` is therefore everything the pool holds, not just the liquidity that is currently tradable.
For concentrated-liquidity pools (Raydium CLMM `amm_v3`, Orca Whirlpool, Meteora DLMM) this includes liquidity in positions that are out of range. It is not the active in-range liquidity at the current tick. For constant-product pools (Raydium `raydium_amm`, `raydium_cp_swap`, PumpSwap) the vault balances are the reserves the swap formula uses.
`ChangeAmount` is the signed change that event caused: positive when tokens entered the pool, negative when they left.
### How `PostAmountInUSD` is priced
`PostAmountInUSD` = `PostAmount` × the token's USD price from the Bitquery [price index](/docs/trading/crypto-price-api/price-index-algorithm). The same rule fills `ChangeAmountInUSD`.
The price is looked up at the block's timestamp: you get the latest index price at or before `Block.Time`, never a later one. Every row in the same block uses the same USD price for a given token.
The index price is a volume-weighted blend of the token's pools over a rolling 1-hour window, with recent trades weighted more. Stablecoins take their USD price from an external spot source instead. If the index has no price for a token, its `PostAmountInUSD` is `0`. USD values carry about 7 significant digits, so use `PostAmount` when you need exact amounts.
### How fresh the USD price is
The response has no field for the timestamp or source of the price used in the conversion. For actively traded tokens the index updates every few seconds. For thinly traded tokens the last index price can be minutes old, because pools stay in the 1-hour blend after they stop trading.
If your system needs a strict freshness limit, take the native `PostAmount` from `DEXPools` and price it yourself with [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) or [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) at a 1-second interval. Every Trading row carries its own `Block.Time`, so you can reject prices older than your limit.
### `PriceInUSD` vs `PostAmountInUSD`
The two fields use different prices, so dividing `PostAmountInUSD` by `PostAmount` will not match `PriceInUSD`.
- `Base.PriceInUSD` / `Quote.PriceInUSD` is the pool's own price, from its reserves after the event, converted to USD with the other token's price.
- `PostAmountInUSD` uses the price index described above, which blends all of the token's pools.
For a token's market price across all venues, use the [Trading cube](/docs/trading/trading-data-overview).
### Ordering multiple updates within one slot
A busy pool can change several times in one slot. Sort by these four fields to get a deterministic order:
1. `Block.Slot`
2. `Transaction.Index`: position of the transaction in the block
3. `Instruction.Index`: position of the instruction in the transaction
4. `Instruction.InternalSeqNumber`: tie-breaker for inner instructions
Sorted descending on all four, the first row is the pool's latest state. The query below returns the latest 20 updates of one pool, newest first. For only the latest state, see [Get Latest Liquidity of any Liquidity Pool](#get-latest-liquidity-of-any-liquidity-pool).
Click to expand GraphQL query
```graphql
query PoolUpdatesInOrder($market: String) {
Solana(dataset: realtime) {
DEXPools(
limit: { count: 20 }
orderBy: [
{ descending: Block_Slot }
{ descending: Transaction_Index }
{ descending: Instruction_Index }
{ descending: Instruction_InternalSeqNumber }
]
where: {
Pool: { Market: { MarketAddress: { is: $market } } }
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
Slot
}
Transaction {
Index
Signature
}
Instruction {
Index
InternalSeqNumber
}
Pool {
Base {
PostAmount
PostAmountInUSD
}
Quote {
PostAmount
PostAmountInUSD
}
}
}
}
}
```
```json
{
"market": "DmAsjXoceoL5vTKZbYpTpXPo7MKm16FMfNMm3PJFiUha"
}
```
---
## Solana DEX Trades API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-dextrades/
Stream Solana DEX swaps, prices, and OHLC for Raydium, Jupiter, and more using Bitquery GraphQL queries and live streams.
# Solana DEX Trades API
:::tip Need real-time Solana DEX data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API** (filter with `Pair.Market.Network: Solana`). Use this page when you need **historical Solana data older than ~30 days** (with `dataset: archive`), raw per-swap detail, or call / event context.
Everything on this page is part of the [Solana DEX API](https://bitquery.io/products/solana-dex-api). The product page summarizes venues, OHLCV, pools and streaming latency.
:::caution On Solana, `combined` adds nothing and both aggregate datasets run short
`Solana(dataset: archive)` executes normally on both endpoints, but on this chain it returns the same rows as `dataset: archive`: it does not merge the realtime tail. Both also return fewer trades than `realtime` over a window all three cover, measured at roughly a fifth to a quarter short on several busy markets, with volume short by a similar margin. The queries below therefore name `archive`. When a total has to be exact for the last 30 days, read it from the [Trading API](/docs/trading/crypto-trades-api/trades-api/) instead. See [data coverage & retention](/docs/graphql/data-coverage-retention/).
:::
:::
Bitquery provides Solana DEX trade data through APIs, Streams, and Data Dumps.
The GraphQL APIs and subscriptions below are examples of the real-time and historical trade data you can access across [Raydium](/docs/blockchain/Solana/Solana-Raydium-DEX-API/), [Orca](/docs/blockchain/Solana/solana-orca-dex-api/), [Phoenix](/docs/blockchain/Solana/Solana-Phoenix-api/), [Meteora](/docs/blockchain/Solana/Meteora-DAMM-v2-API/), [Jupiter](/docs/blockchain/Solana/solana-jupiter-api/), and other Solana-based DEXs.
Read [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) to get a better understanding on when to use which cube.
:::note RFQ and prop-AMM trades
From 29 September 2026, 15:06 UTC, this cube includes Jupiter Z RFQ fills (`ProtocolName: "order_engine"`) and swaps on the prop AMMs Tessera V (`tessera_v`), HumidiFi (`humidifi`), QuantumAMM (`quantum_amm`) and Scorch (`scorch`). Earlier trades on these venues are not here. Jupiter Limit Order v2, Mayan Swift and ZeroFi still return zero rows. The [Solana RFQ API](/docs/blockchain/Solana/solana-rfq-api/) covers all of them, with ready-made queries.
:::
If you have questions or need custom data, reach out to [support](https://t.me/Bloxy_info).
Need zero-latency Solana DEX trade data?
[Read about our Shred Streams and contact us for a trial ➤](/docs/streams/real-time-solana-data/)
For gRPC streaming: [Solana gRPC Streams (CoreCast) →](/docs/grpc/solana/introduction/)
## 🔗 Related Solana APIs
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Track real-time instructions and token creation events
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor wallet balance changes from trades
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track token transfers and movements
- **[Solana Fees API](/docs/blockchain/Solana/solana_fees_api/)** - Analyze trading fees and transaction costs
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Monitor token supply changes from trading activities
You may also be interested in:
- [PumpSwap APIs ➤](/docs/blockchain/Solana/Pumpfun/pump-swap-api/)
- [Moonshot APIs ➤](/docs/blockchain/Solana/Moonshot-API/)
- [FourMeme APIs ➤](/docs/blockchain/BSC/four-meme-api/)
- [DEXrabbit Categories](https://dexrabbit.bitquery.io/categories): curated token groups with live multi-chain DEX prices (memes, LSTs, stablecoins, launchpads)
## How do I get trades made by a specific wallet on a DEX?
Query `Solana.DEXTrades` (or `DEXTradeByTokens`) with `where` on the wallet as **`Trade.Buy.Account`**, **`Trade.Sell.Account`**, or **`Transaction.Signer`** depending on how the protocol records the user. Filter **`Transaction.Result.Success`** and the DEX program or protocol name if needed. See [latest trades by account patterns](#subscribe-to-latest-solana-trades) and [Realised PnL / trader windows](#realised-pnl-avg-buy-price-buy-volume-sell-volume) on this page for aggregated trader stats.
## How do I get historical OHLCV for a Solana token? {#how-do-i-get-historical-ohlcv-for-a-solana-token}
For candles further back than the realtime window, daily history since June 2024 and a CSV export script, see [Historical Solana data and OHLCV](/docs/blockchain/Solana/historical-aggregate-data#historical-ohlc-on-solana).
For **OHLC**, use the **[Crypto Price API](/docs/trading/crypto-price-api/)** first (`Trading.Tokens` / `Pairs` with **`Token.Network: solana`**) and [second-level OHLC](#solana-second-level-ohlc-k-line-api) on this page when you want **1-second-style** streams.
For **historical OHLC** from on-chain DEX trades, use **`Solana(dataset: archive)`** with **`DEXTradeByTokens`**: filter **`Trade.Currency.MintAddress`** (and usually **`Trade.Side.Currency`** for the quote, e.g. WSOL/USDC), set **`Block.Time`** range, and bucket with **`Block { Time(interval: { count, in: minutes | hours | days }) }`**. Compute OHLC with **`PriceInUSD`** / **`Trade_Price`** minima and maxima or **`median`/`quantile`** as in [Solana OHLC API](#solana-ohlc-api).
:::note
To query or stream data via GraphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
## Live DEX swap stream (Solana) {#crypto-trades-live-stream}
[Crypto Trades API](/docs/trading/crypto-trades-api/trades-api): one row per swap, with USD and supply. Filter **`Pair.Market.Network: Solana`**. [When to use this vs chain DEX APIs](/docs/cubes/dextrades-dextradebytokens-trading-trades).
Run this subscription [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-Solana-with-Price-Marketcap-supply).
```graphql
subscription {
Trading {
Trades(where: { Pair: { Market: { Network: { is: "Solana" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
```
## Subscribe to Latest Solana Trades {#subscribe-to-latest-solana-trades}
This example uses the chain-specific **DEXTrades** cube via `Solana { DEXTrades }` (good for signer/account filters). USD can be thin on some tokens. For swap rows with stronger USD, use the [stream at the top](#crypto-trades-live-stream). Fees: [Solana Fees API](/docs/blockchain/Solana/solana_fees_api/).
Open it in the [Bitquery IDE: realtime Solana trades](https://ide.bitquery.io/solana-trades-subscription_3).
Show the GraphQL
```graphql
subscription {
Solana {
DEXTrades {
Block{
Time
Slot
}
Transaction{
Signature
Index
Result{
Success
}
}
Trade {
Index
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
MetadataAddress
Key
MintAddress
IsMutable
EditionNonce
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
PriceInUSD
Order {
LimitPrice
LimitAmount
OrderId
}
}
Market {
MarketAddress
}
Sell {
Account {
Address
}
Currency {
IsMutable
Decimals
CollectionAddress
Fungible
Symbol
Native
Name
}
Price
PriceInUSD
}
}
}
}
}
```
## Get Price of a Token Against WSOL
This query retrieves the latest price of a token against Wrapped SOL (WSOL) on Solana.
Specify the token pair:
- MintAddress of the token to query: "CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump"
- MintAddress for WSOL: "So11111111111111111111111111111111111111112"
You can run the query [here](https://ide.bitquery.io/Price-of-a-Token-Against-WSOL)
Show the GraphQL
```graphql
query LatestTrades {
Solana {
DEXTradeByTokens(
orderBy: {descending: Block_Time}
limit: {count: 1}
where: {Trade: {Currency: {MintAddress: {is: "CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
allTime: Time
}
Transaction {
Signature
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
AmountInUSD
Price
PriceInUSD
Amount
Side {
Type
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
## Get Latest Trades of a token
This query will return information about the most recent trades executed for this token `CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump` on Solana's DEX platforms.
Open it in the [Bitquery IDE: latest TRUMP trades](https://ide.bitquery.io/Latest-Trades-of-Trump-COin).
Show the GraphQL
```graphql
query LatestTrades($token: String, $base: String) {
Solana {
DEXTradeByTokens(
orderBy: {descending: Block_Time}
limit: {count: 50}
where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $base}}}, Currency: {MintAddress: {is: $token}}, Price: {gt: 0}}, Transaction: {Result: {Success: true}}}
) {
Block {
allTime: Time
}
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Account {
Owner
}
Side {
Type
Account {
Address
Owner
}
}
Price
Amount
Side {
Currency {
Symbol
MintAddress
Name
}
AmountInUSD
Amount
}
}
}
}
}
```
```json
{
"token": "CzLSujWBLFsSjncfkh59rUFqvafWcY5tzedWJSuypump",
"base": "So11111111111111111111111111111111111111112"
}
```

See this pair's live board on [DEXrabbit](https://dexrabbit.bitquery.io/solana/pair/59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN/So11111111111111111111111111111111111111112#pair_latest_trades).
## Calculate Price Surge of a Token
While the V2 API does not support expressions yet you can get the price data between two timestamps and compute the price surge in your system.
Below query gets the price of a token at the starting and ending of a period ( open and close).
You can run the query [here](https://ide.bitquery.io/Price-change-of-a-token-on-Solana)
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: realtime) {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Trade {
Dex {
ProtocolName
}
open: Price(minimum: Block_Time)
close: Price(maximum: Block_Time)
}
surge: calculate(expression: "($Trade_open/$Trade_close)* 100")
}
}
}
```
## Get Buy Pressure, Sell Pressure and Net Volume of a Pair
[Run Query](https://ide.bitquery.io/Copy-of-vol-change-percent-of-a-pair)
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: realtime) {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: "2qEHjDLDLbuBgRYvsxhc5D6uDWAivNFZGan56P1tpump" } }
Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }
Market: { MarketAddress: { is: "4AZRPNEfCJ7iw28rJu5aUyeQhYcvdcNm8cswyL51AY9i" } }
}
Block: { Time: { since: "2024-11-06T14:18:00Z" } }
}
) {
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: "2024-11-06T15:13:00Z" } }
}
)
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: "2024-11-06T15:13:00Z" } }
}
)
vol_Change: calculate(
expression: "(($buy_volume - $sell_volume) / $buy_volume) * 100"
)
vol_Change_5min: calculate(
expression: "(($buy_volume_5min - $sell_volume_5min) / $buy_volume_5min) * 100"
)
}
}
}
```
## Price change 5min, 1hr, 6hr precentage of a specific token {#price-change-5min-1hr-6hr-precentage-of-a-specific-token}
Use below query to calculate the price change percentage for a specific token in last 5 min, 1 hr, 6hr. Test the query [here](https://ide.bitquery.io/Price-change-5min-1hr-6hr-precentage-of-a-specific-token_2).
Show the GraphQL
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Trade: {
Currency: { MintAddress: { is: "vLieQF5eDqUuuk8RzRaqgAHkXr7bSEBZaWk9Zfibonk" } }
Market: { MarketAddress: { is: "9qppy1KXRTFEeWkFaysYHD7eu9GLg5pGXdLkdL51p7EX" } }
}
Block: { Time: { since_relative: { hours_ago: 6 } } }
}
) {
Trade {
Price_5min_ago: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } }
)
Price_1h_ago: PriceInUSD(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
Price_6h_ago: PriceInUSD(minimum: Block_Time)
CurrentPrice: PriceInUSD(maximum: Block_Time)
}
volume_5min: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { since_relative: { minutes_ago: 5 } } } }
)
volume_1h: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
volume_6h: sum(
of: Trade_Side_AmountInUSD
if: { Block: { Time: { since_relative: { hours_ago: 6 } } } }
)
Price_Change_5min: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100"
)
Price_Change_1h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100"
)
Price_Change_6h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100"
)
}
}
}
```
## Top 10 solana tokens by price change in last 1 hr
Use the below query to get top 10 solana tokens by price change in last 1 hr. Test the query [here](https://ide.bitquery.io/Top-10-solana-tokens-by-price-change-in-last-1-hr_4)
Show the GraphQL
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
limit: {count: 10}
orderBy: {descendingByField: "Price_Change_1h"}
where: {Block: {Time: {since_relative: {hours_ago: 6}}}, Transaction: {Result: {Success: true}}, Trade: {Side: {Currency: {MintAddress: {in: ["So11111111111111111111111111111111111111112","EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}}}}
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Price_5min_ago: PriceInUSD(
minimum: Block_Time
if: {Block: {Time: {since_relative: {minutes_ago: 5}}}} selectWhere:{ne:0}
)
Price_1h_ago: PriceInUSD(
minimum: Block_Time
if: {Block: {Time: {since_relative: {hours_ago: 1}}}} selectWhere:{ne:0}
)
Price_6h_ago: PriceInUSD(minimum: Block_Time selectWhere:{ne:0})
CurrentPrice: PriceInUSD(maximum: Block_Time)
Side {
Currency {
Name
Symbol
MintAddress
}
}
Market {
MarketAddress
}
}
Price_Change_5min: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_5min_ago) / $Trade_Price_5min_ago) * 100"
)
Price_Change_1h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_1h_ago) / $Trade_Price_1h_ago) * 100"
)
Price_Change_6h: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_6h_ago) / $Trade_Price_6h_ago) * 100"
)
}
}
}
```
## Get Trade Summary of a Trade
A lot of times a trade is implemented using multiple swaps. The summary of these trades are the token originally sold and the token finally purchased.
To get the summary for such trades use [this](https://ide.bitquery.io/trade-summary_1) query.
Show the GraphQL
```graphql
{
Solana {
DEXTrades(
where: {
Transaction: {
Signer: { is: "9B4okPpQcz1MSt8cLLb7YGo2NKvgsw82pEhHqKsKW9uS" }
Result: { Success: true }
}
}
orderBy: { descending: Block_Time }
) {
Trade {
Buy {
Amount
PriceInUSD
Currency {
Decimals
Name
MintAddress
Symbol
}
Account {
Address
Owner
}
}
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Sell {
Amount
Price
Currency {
Name
Symbol
MintAddress
Decimals
}
}
Index
}
Transaction {
Signature
Result {
Success
}
}
Block {
Time
}
}
}
}
```
The response of the query is given below. Given multiple trades with same `Block Time`, the summary is
given by the `sell currency` for the lowest Trade Index and the `buy currency` for the highest Trade Index.
Click to expand query JSON response
```json
{
"Block": {
"Time": "2024-11-12T05:56:55Z"
},
"Trade": {
"Buy": {
"Account": {
"Address": "FJnivW3jSXVuR2P6Z6e9iRkVHEyEzppHcnUdMgsLBSgY",
"Owner": "4xDsmeTWPNjgSVSS1VTfzFq3iHZhp77ffPkAmkZkdu71"
},
"Amount": "7599.73089",
"Currency": {
"Decimals": 5,
"MintAddress": "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
"Name": "Bonk",
"Symbol": "Bonk"
},
"PriceInUSD": 0.000028919810335657223
},
"Dex": {
"ProgramAddress": "LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo",
"ProtocolFamily": "Meteora",
"ProtocolName": "lb_clmm"
},
"Index": 0,
"Sell": {
"Amount": "0.219833",
"Currency": {
"Decimals": 6,
"MintAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"Name": "USD Coin",
"Symbol": "USDC"
},
"Price": 34570.47345030091
}
},
"Transaction": {
"Result": {
"Success": true
},
"Signature": "43aymSmr2op2aEnCiMfzkqqfpWwSofWk8EBcUWhKEUsHRrZV4KpTGW4iuxLxJyS1HKoLS7gTamzuqKiwi3e3z4Li"
}
},
```
## Get the historical Created pairs on any Solana DEX
This finds pairs whose **first ever** trade falls inside a date range: `Date(minimum: Block_Date)` takes each pair's earliest trade and `selectWhere` keeps only the pairs where that date lands in the window.
Because "first ever" is defined against the whole history, the scan cannot be bounded by a `Block.Time` filter without changing what the query means, and against a protocol family as large as Raydium it regularly exceeds the request timeout. Narrow it to a single `Trade.Market.MarketAddress` or a smaller protocol, or run first-trade analysis over a [cloud export](/docs/cloud/solana) where a full-history scan is the normal shape of the job.
Open it in the [Bitquery IDE: new Raydium pairs](https://ide.bitquery.io/Solana-Raydium-New-Pairs_2).
Show the GraphQL
```graphql
query{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
ProtocolFamily: {
is: "Raydium"
}
}
}
}
limit: {
count: 100
}) {
Block {
Date(minimum: Block_Date
selectWhere: {
since: "2024-10-01"
till: "2024-11-01"
})
}
Trade {
Dex {
ProtocolFamily
}
Market{
MarketAddress
}
Currency {
Symbol
MintAddress
}
Side {
Currency {
Symbol
MintAddress
}
}
}
}
}
}
```
## Get Buy Volume, Sell Volume, Buys, Sells, Makers, Total Trade Volume, Buyers, Sellers of a specific Token
The below query gives you the essential stats for a token such as buy volume, sell volume, total buys, total sells, makers, total trade volume, buyers, sellers (in last 5 min, 1 hour) of a specific token.
You can run the query [here](https://ide.bitquery.io/Buys-Sells-BuyVolume-SellVolume-Makers-TotalTradedVolume-PriceinUSD-for-solana-token-pair)
Show the GraphQL
```graphql
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 ATH Market Cap of Tokens {#get-ath-market-cap-of-tokens}
This query returns the ATH (All-Time High) market cap, starting market cap, and related price metrics for multiple tokens. It calculates market cap using a 1 billion token supply and uses quantile to find the ATH price.
You can run it [here](https://ide.bitquery.io/Marketcap-of-tokens)
```graphql
query GetAthMarketCap($tokens: [String!]!) {
Solana(dataset: archive) {
DEXTradeByTokens(
limitBy: { by: Trade_Side_Currency_MintAddress, count: 1 }
where: {
Trade: {
Currency: { MintAddress: { in: $tokens } }
}
}
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
PriceInUSD(maximum: Trade_PriceInUSD)
Starting_Price: PriceInUSD(minimum: Block_Slot)
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
max: quantile(of: Trade_PriceInUSD, level: 0.98)
quantile_price_ATH_Marketcap: calculate(expression: "$max * 1000000000")
Real_maximum_price_ATH_Marketcap: calculate(
expression: "$Trade_PriceInUSD_maximum * 1000000000"
)
Starting_Marketcap: calculate(
expression: "$Trade_Starting_Price * 1000000000"
)
}
}
}
```
```json
{
"tokens": ["8SAwv8EKMKaKnupTsYjoQdgBuWxJdo3ouA178UU7pump"]
}
```
## Top 50 Trending Solana Token Pairs with all the data
[This](https://ide.bitquery.io/top-50-trading-pairs-with-trades-count-volume-buys-sells-makers-marketcap-supply-and-liquidity_1) query returns the top 10 trending token pairs on Solana across all DEXs based on the number of trades happened in the last hour. Along with token pair info you will also get latest price, total traded volume, buy volume, sell volume, buys, sells, buyers, sellers, makers, marketcap, liquidity, supply.
Show the GraphQL
```graphql
query ($time_1h_ago: DateTime) {
Solana {
DEXTradeByTokens(
where: {
Transaction: { Result: { Success: true } }
Block: { Time: { since: $time_1h_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: "trades_count_1h" }
limit: { count: 50 }
) {
Trade {
Currency {
Symbol
Name
MintAddress
}
Latest_Price: PriceInUSD(maximum: Block_Time)
Market {
MarketAddress
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
}
makers: count(distinct: Transaction_Signer)
buyers: count(
distinct: Transaction_Signer
if: { Trade: { Side: { Type: { is: buy } } } }
)
sellers: count(
distinct: Transaction_Signer
if: { Trade: { Side: { Type: { is: sell } } } }
)
traded_volume: sum(of: Trade_Side_AmountInUSD)
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 } } } }
)
buys: count(if: { Trade: { Side: { Type: { is: buy } } } })
sells: count(if: { Trade: { Side: { Type: { is: sell } } } })
trades_count_1h: count
liquidity: joinDEXPools(
join: inner
Pool_Market_MarketAddress: Trade_Market_MarketAddress
where: { Transaction: { Result: { Success: true } } }
) {
Pool {
Market {
BaseCurrency {
Name
Symbol
}
QuoteCurrency {
Name
Symbol
}
}
Base {
Balance: PostAmount(maximum: Block_Slot)
Base_Liquidity_USD: PostAmountInUSD(maximum: Block_Slot)
}
Quote {
PostAmount(maximum: Block_Slot)
Quote_Liquidity_USD: PostAmountInUSD(maximum: Block_Slot)
}
}
}
marketcap_and_supply: joinTokenSupplyUpdates(
join: inner
TokenSupplyUpdate_Currency_MintAddress: Trade_Currency_MintAddress
where: { Transaction: { Result: { Success: true } } }
) {
TokenSupplyUpdate {
MarketCap: PostBalanceInUSD(maximum: Block_Slot)
Supply: PostBalance(maximum: Block_Slot)
Currency {
Name
MintAddress
Symbol
}
}
}
}
}
}
```
```json
{
"time_1h_ago": "2025-07-03T08:05:00Z"
}
```
You can also checkout how such queries are used as a base to completed features such as [DEXrabbit Solana Trends](https://dexrabbit.bitquery.io/solana/token) as shown in the image below.

## Get DEX Markets for a Token
This query will give you Solana DEXs on which the token `59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN` is getting traded.
Open it in the [Bitquery IDE: DEX markets for a token](https://ide.bitquery.io/DEX-Markets-for-a-token).
Show the GraphQL
```graphql
query ($token: String, $base: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "amount"}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Side: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $base}}}}, Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_3h_ago}}}
) {
Trade {
Dex {
ProtocolFamily
ProtocolName
}
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)
}
amount: sum(of: Trade_Side_Amount)
pairs: uniq(of: Trade_Side_Currency_MintAddress)
trades: count
}
}
}
{
"token": "59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN",
"base": "So11111111111111111111111111111111111111112",
"time_10min_ago": "2024-09-19T10:45:46Z",
"time_1h_ago": "2024-09-19T09:55:46Z",
"time_3h_ago": "2024-09-19T07:55:46Z"
}
```

The same pair, with its markets broken out, is on [DEXrabbit](https://dexrabbit.bitquery.io/solana/pair/59VxMU35CaHHBTndQQWDkChprM5FMw7YQi5aPE5rfSHN/So11111111111111111111111111111111111111112#pair_dex_list).
## Get Token creation date
You can use the below query to get any token's creation time. Note that we are providing first trade time which in most of the cases is around creation time only. Try the query on ide [here](https://ide.bitquery.io/Token-creation-time_1)
Show the GraphQL
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "94vNH3HhLv42gfkF93n9EQq9vyHPKRZ5XG6U3HmDpump"}}}}
) {
Block {
Time(minimum: Block_Time)
}
}
}
}
```
## Get Volume changes for trading pairs in last 2mins
You can use the below stream to get the volume changes in last 2 minutes. Try the query on ide [here](https://ide.bitquery.io/volume-change-in-last-2-minutes)
Show the GraphQL
```graphql
{
Solana(dataset: realtime) {
DEXTradeByTokens(
limitBy: {by: Trade_Market_MarketAddress, count: 2}
orderBy: [{descending:Trade_Market_MarketAddress} {descendingByField: "Block_Time"} ]
where: {Trade: {Side: {Currency: {MintAddress:
{in: ["11111111111111111111111111111111",
"So11111111111111111111111111111111111111112",
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
"JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN",
"EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm"]}}}}, Block: {Time: {since: "2025-07-08T09:38:52.000Z"}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time(interval: {count: 2, in: minutes})
}
Trade {
Currency {
MintAddress
Symbol
Name
}
Market {
MarketAddress
}
}
volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## Get Solana Price in Realtime
You can use the below stream to get the Solana price. Try the query on ide [here](https://ide.bitquery.io/solana-price-stream)
Show the GraphQL
```graphql
subscription {
Solana {
DEXTrades(
where: {Trade: {Sell: {Currency: {MintAddress: {in: ["So11111111111111111111111111111111111111112", "11111111111111111111111111111111"]}}}}}
) {
Block {
Time
}
Trade {
Buy {
Price
PriceInUSD
Currency {
Name
Symbol
MintAddress
}
}
}
}
}
}
```
## Get Top Bought Tokens on Solana
This query will give you most bought Solana Tokens on Raydium.
Open it in the [Bitquery IDE: most bought Solana tokens](https://ide.bitquery.io/Top-Bought-Solana-Tokens).
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "buy"}
where: {Trade: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}, Dex: {ProtocolFamily: {is: "Raydium"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 100}
) {
Trade {
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
```
Ranked by `bought - sold`, the same ordering [DEXrabbit](https://dexrabbit.bitquery.io/solana) uses for net buying.

See the live net-buying board on [DEXrabbit](https://dexrabbit.bitquery.io/solana).
## Get Top Sold Tokens on Solana
This query will give you most sold Solana Tokens on Raydium.
Open it in the [Bitquery IDE: most sold Solana tokens](https://ide.bitquery.io/Top-sold-Solana-Tokens).
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "sell"}
where: {Trade: {Currency: {MintAddress: {notIn: ["So11111111111111111111111111111111111111112", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}}, Dex: {ProtocolFamily: {is: "Raydium"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 100}
) {
Trade {
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
```
Ranked by `sold - bought`, the mirror of the section above.

See the live net-selling board on [DEXrabbit](https://dexrabbit.bitquery.io/solana).
## Get Top Traded Pairs in terms of volume
This query will give you top traded pairs data.
Open it in the [Bitquery IDE: top trading pairs](https://ide.bitquery.io/top-trading-pairs).
Show the GraphQL
```graphql
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"
}
```

Browse every Solana pair on [DEXrabbit](https://dexrabbit.bitquery.io/solana/pair).
## Get Top DEXs information
This query will give you top DEXs info.
Open it in the [Bitquery IDE: busiest Solana DEXs](https://ide.bitquery.io/top-dexs).
Show the GraphQL
```graphql
query DexMarkets {
Solana {
DEXTradeByTokens {
Trade {
Dex {
ProtocolFamily
}
}
traders: uniq(of: Trade_Account_Owner)
count(if: {Trade: {Side: {Type: {is: buy}}}})
}
DEXPools {
Pool {
Dex {
ProtocolFamily
}
}
pools: uniq(of: Pool_Market_MarketAddress)
}
}
}
```

Compare Solana DEX markets on [DEXrabbit](https://dexrabbit.bitquery.io/solana/dex_market).
## Get All Traded Pairs Info of a Token
This query will give you the information on all the traded pairs of a particular token `EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm`.
Open it in the [Bitquery IDE: traded pairs of a token](https://ide.bitquery.io/traded-pairs-of-a-token).
Show the GraphQL
```graphql
query ($token: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "usd"}
where: {Trade: {Currency: {MintAddress: {is: $token}}}, Transaction: {Result: {Success: true}}, Block: {Time: {after: $time_3h_ago}}}
limit: {count: 200}
) {
Trade {
Currency {
Symbol
Name
MintAddress
Fungible
}
Side {
Currency {
Symbol
Name
MintAddress
}
}
price_usd: PriceInUSD(maximum: Block_Slot)
price_last: Price(maximum: Block_Slot)
price_10min_ago: Price(
maximum: Block_Slot
if: {Block: {Time: {before: $time_10min_ago}}}
)
price_1h_ago: Price(
maximum: Block_Slot
if: {Block: {Time: {before: $time_1h_ago}}}
)
price_3h_ago: PriceInUSD(minimum: Block_Slot)
}
usd: sum(of: Trade_AmountInUSD)
count
}
}
}
{
"token": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"time_10min_ago": "2024-09-19T12:02:23Z",
"time_1h_ago": "2024-09-19T11:12:23Z",
"time_3h_ago": "2024-09-19T09:12:23Z"
}
```

See this token's page on [DEXrabbit](https://dexrabbit.bitquery.io/solana/token/EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm).
## Get all DEXes
To get the list of all DEXes operating within the Solana ecosystem, use the following query.
Find the query [here](https://ide.bitquery.io/Solana-DEXs)
Show the GraphQL
```graphql
query MyQuery {
Solana {
DEXTrades(limitBy: {by: Trade_Dex_ProtocolFamily, count: 1}, limit: {count: 10}) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
}
}
}
}
```
## Latest USD Price of a Token {#latest-usd-price-of-a-token}
The below query retrieves the USD price of a token on Solana by setting `MintAddress: {is: "J5FAZ6bV7CCGHcU4CTXWVG6nnKHcwD9Pn4DntY93pump"}` and `Side: {Currency: {MintAddress: {is: "11111111111111111111111111111111"}}}` . Check the field `PriceInUSD` for the USD value. You can access the query [here](https://ide.bitquery.io/Get-Latest-Price-of-SOL-in--USD-Real-time#).
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descending: Block_Time}
where: {Trade: {Currency: {MintAddress: {is: "J5FAZ6bV7CCGHcU4CTXWVG6nnKHcwD9Pn4DntY93pump"}}, Side: {Currency: {MintAddress: {is: "11111111111111111111111111111111"}}}}}
limit: {count: 1}
) {
Block{
Time
}
Trade{
Currency{
Name
Symbol
MintAddress
}
Price
PriceInUSD
Side{
Currency{
Name
MintAddress
}
}
}
}
}
}
```
## Stablecoin Peg Health (Latest Price Across All Markets)
Get the **latest price of a stablecoin across all Solana DEXs/markets**. Returns one row per market with the most recent trade price. Useful for monitoring peg health and identifying which exchanges have the stablecoin trading closest to its target peg (e.g., $1.00 for USD-pegged stablecoins).
Browse multi-chain stablecoin DEX prices on [DEXrabbit's Stablecoins category](https://dexrabbit.bitquery.io/categories/stablecoins).
[Run in Bitquery IDE](https://ide.bitquery.io/Latest-Price-of-a-Token-on-all-exchanges_1)
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limitBy: { count: 1, by: Trade_Market_MarketAddress }
where: {
Trade: {
Currency: {
MintAddress: { is: "CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s" }
}
}
}
) {
Block {
Time
}
Transaction {
Signature
}
Trade {
Amount
AmountInUSD
Price
PriceInUSD
Currency {
Name
MintAddress
Symbol
}
Market {
MarketAddress
}
Dex {
ProtocolName
ProtocolFamily
}
Side {
Type
Currency {
Name
MintAddress
Symbol
}
AmountInUSD
Amount
}
}
}
}
}
```
## Get the Token details like Update Authority, decimals, URI, is Mutable or not
The below query retrieves the token details such as update authority for a particular token and also checks if a token's data is mutable or not. You can access the query [here](https://ide.bitquery.io/Solana-currency-details).
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Trade: {Currency: {MintAddress: {is: "AREn4LyUS4pNUGzwXcks7oefjT751G1XwYZ4GLTppump"}}}, Transaction: {Result: {Success: true}}}
orderBy: {descending: Block_Time}
limit: {count: 1}
) {
Trade {
Currency {
Uri
UpdateAuthority
Name
IsMutable
}
}
}
}
}
```
The `uri` field returns the following url - [`https://ipfs.io/ipfs/QmXGGo38devA7Ghw6dT4rXfL8sREsEdv3FzkPdziE9V4oN`](https://ipfs.io/ipfs/QmXGGo38devA7Ghw6dT4rXfL8sREsEdv3FzkPdziE9V4oN).
Offchain token metadata such as social urls and image could be accessed from this link.
## Top Buyers of a Token
This query retrieves top buyers of the token `4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R`. Try the query [here](https://ide.bitquery.io/top-buyers-of-a-token_2).
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "buy"}
where: {Trade: {Currency: {MintAddress: {is: "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
) {
Trade {
Account{
Address
Token{
Owner
}
}
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
```
## Top Sellers of a Token
This query retrieves top sellers of the token `4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R`. Try the query [here](https://ide.bitquery.io/top-sellers-of-a-token_2).
Show the GraphQL
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "sell"}
where: {Trade: {Currency: {MintAddress: {is: "4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
) {
Trade {
Account{
Address
Token{
Owner
}
}
Currency {
Symbol
Name
MintAddress
}
}
buy: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
sell: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
}
}
}
```
## Trades of a wallet
You can use this API to fetch trades of a specific wallet address `tRadEVu2Va7WsVHqmGSiRHspkBoDQ9Qnjp42TiJirYA`. Change the wallet address as per your needs. Try the query [here](https://ide.bitquery.io/trades-of-a-wallet_8)
Show the GraphQL
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Transaction: {Signer: {is: "tRadEVu2Va7WsVHqmGSiRHspkBoDQ9Qnjp42TiJirYA"}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
){
Block{
Time
}
Trade{
Account{
Address
Token{
Owner
}
}
Currency{
MintAddress
Name
Symbol
}
Price
PriceInUSD
Side{
Account{
Address
Token{
Owner
}
}
Currency{
Name
Symbol
MintAddress
}
Type
}
}
Transaction{
Signature
Signer
}
}
}
}
```
## Get trading volume, buy volume, sell volume of a token
This query fetches you the traded volume, buy volume and sell volume of a token `J4JbUQRaZMxdoQgY6oEHdkPttoLtZ1oKpBThic76pump`. Try out the API [here](https://ide.bitquery.io/trade_volume_Solana#).
Show the GraphQL
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Block: {Time: {since: "2025-02-10T07:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "J4JbUQRaZMxdoQgY6oEHdkPttoLtZ1oKpBThic76pump"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Trade {
Currency {
MintAddress
Decimals
}
Side {
Currency {
Name
MintAddress
}
}
}
traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
traded_volume: sum(of: Trade_Amount)
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}}}})
}
}
}
```
## Realised PnL, avg buy price, buy volume, sell volume
Get realised PnL, average buy price, buy volume, and sell volume for a token on Solana of a trader for over a time window.
[Run in Bitquery IDE](https://ide.bitquery.io/Realised-Pnl-avg-buy-price-Buy-volume-Sell-Volume-Solana_2)
Show the GraphQL
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: { is: "4iLKj7fkZF2rSpgSD8W6UFq4fkKXkkbJMGXMz3B8pump" }
}
Account: {
Owner: { is: "2vqBfRdhX8sHmVFo1TY1yBdFXkHMe4LgifrxvHBpXUAK" }
}
Dex: { ProtocolName: { notIn: ["jupiter", "dex_solana_v3"] } }
}
Transaction: { Result: { Success: true } }
Block: { Date: { since: "2026-03-11", till: "2026-03-13" } }
}
) {
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_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
buy_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
buy_volume: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
RealizedPnL: calculate(expression: "$sell_volume_usd - $buy_volume_usd")
trades: count
avg_buy_price: calculate(expression: "$buy_volume_usd / $buy_volume")
}
}
}
```
## Solana Second-level OHLC / K-line API {#solana-second-level-ohlc-k-line-api}
For this we will use the new [Crypto Price APIs](/docs/trading/crypto-price-api/)
You can get OHLC data at 1-second intervals via a subscription query, which can then be monitored via a WebSocket.
Below is an example. You can read more on [quantiles here](/docs/graphql/metrics/quantile/)
Test the subscription query [here](https://ide.bitquery.io/seconds-oHLC-realtime-solana-usd)
Show the GraphQL
```graphql
subscription{
Trading {
Tokens(
where: {Currency: {Id: {is: "bid:solana"}}, Interval: {Time: {Duration: {eq: 1}}}}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
Token {
Address
Id
IsNative
Name
Network
Name
Symbol
TokenId
}
Block {
Date
Time
Timestamp
}
Interval {
Time {
Start
Duration
End
}
}
Volume {
Base
Quote
Usd
}
Price {
IsQuotedInUsd
Ohlc {
Close
High
Low
Open
}
Average {
ExponentialMoving
Mean
SimpleMoving
WeightedSimpleMoving
}
}
}
}
}
```
## Solana OHLC API {#solana-ohlc-api}
You can query OHLC data in for any Solana token. In the below query we are fetching OHLC information for the pair WSOL-USDC by using the smart contract addresses in the `MintAddress` filter. Only use this API as `query` and not `subscription` websocket as Aggregates and Time Intervals don't work well with subscriptions.
You can run and test the [saved query here](https://ide.bitquery.io/query_ohlc_quantile___1).
:::note
The `Trade Side Account` field is **not available** in aggregate queries across archive or combined datasets.
:::
Show the GraphQL
```graphql
query TradesSolToken($ca: String!, $currencies: [String!], $dataset: dataset_arg_enum, $interval: Int) {
Solana(dataset: $dataset) {
DEXTradeByTokens(
limit:{count:10}
orderBy: {ascendingByField: "Block_Time"}
where: {Trade: {Amount: {gt: "0"}, Currency: {MintAddress: {is: $ca}}, Side: {Currency: {MintAddress: {in: $currencies}}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time(interval: {count: $interval, in: days})
}
min: quantile(of: Trade_Price, level: 0.05)
max: quantile(of: Trade_Price, level: 0.95)
close: median(of: Trade_Price)
open: median(of: Trade_Price)
volume: sum(of: Trade_Side_Amount)
Trade {
Currency{
Name
Symbol
}
Side {
Currency {
Name
Symbol
}
}
}
}
}
}
{
"interval": 1,
"dataset": "combined",
"ca": "So11111111111111111111111111111111111111112",
"currencies": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]
}
```

See this market's live board on [DEXrabbit](https://dexrabbit.bitquery.io/solana/pair/9Fv7n7HuA5EzjCRSvprBMx2Qhd1VL3hPEXKhTUKPm1Qh/So11111111111111111111111111111111111111112).
## Why does my per-minute OHLC query return hundreds of rows for one token? {#dextradebytokens-side-currency-grain}
Three things about `DEXTradeByTokens` aggregates that are easy to miss:
- **On the pre-aggregated path, price measures are grouped by side currency.** By default (`aggregates: yes`) a `DEXTradeByTokens` query on `dataset: realtime` that selects only `Block.Time(interval: …)`, price measures and `count` is served from a per-minute pre-aggregated table. On that table any `Trade { PriceInUSD(minimum: ...) }` or `PriceInUSD(maximum: ...)` selector adds `Trade.Side.Currency.MintAddress` to the grouping key even if you do not select it, because USD conversion is stored per side currency (`Trade { Price(...) }` groups by the side currency's `Decimals` instead). A minute in which WSOL traded against 797 different tokens returns 797 rows. The rows do not overlap and `count` stays additive. This table also stores `Block.Time` at minute resolution and its extremes are not the raw fill extremes.
- **`aggregates: no` selects the raw trades.** `Solana(dataset: realtime, aggregates: no)` serves the same query from the raw fills: one row per token and interval across all side currencies, exact highest and lowest fill (dust trades included), `Block.Time` at second resolution, and `Block.Slot(minimum/maximum: ...)` and `uniq(...)` available. Selecting one of those raw-only fields switches to the raw path even without the flag. The raw path is not available on `dataset: combined`, and it keeps a much shorter window than the pre-aggregated table (hours to about a day, against roughly 7 days), so collect promptly.
- **Use `before`, not `till`, for the end of a candle.** `till` is inclusive. On the pre-aggregated path `till: "…T02:35:00Z"` matches every trade in the 02:35 minute; on the raw path it adds the fills at second 02:35:00. `since` + `before` gives the half-open interval `[since, end)` on both.
For a price series, pin the side currency to the quote currencies you care about (for WSOL: USDC and USDT; for other tokens add WSOL), because unpriced side currencies push the all-side USD extremes to absurd values. Count activity separately, across all side currencies, with a `count`-only query. One candle per token, minute and quote currency from raw trades, half-open interval:
Show the GraphQL
```graphql
query SolMinuteOHLC($token: String!, $quotes: [String!]!, $since: DateTime!, $end: DateTime!) {
Solana(dataset: realtime, aggregates: no) {
DEXTradeByTokens(
where: {
Block: {Time: {since: $since, before: $end}}
Transaction: {Result: {Success: true}}
Trade: {Currency: {MintAddress: {is: $token}}, Side: {Currency: {MintAddress: {in: $quotes}}}}
}
orderBy: {ascendingByField: "Block_bucket"}
limit: {count: 5000}
) {
Block {
bucket: Time(interval: {count: 1, in: minutes})
firstSlot: Slot(minimum: Block_Slot)
lastSlot: Slot(maximum: Block_Slot)
}
Trade {
Side { Currency { MintAddress } }
open: PriceInUSD(minimum: Block_Slot)
high: PriceInUSD(maximum: Trade_PriceInUSD)
low: PriceInUSD(minimum: Trade_PriceInUSD)
close: PriceInUSD(maximum: Block_Slot)
}
fills: count
transactions: uniq(of: Transaction_Signature)
}
}
}
{
"token": "So11111111111111111111111111111111111111112",
"quotes": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"],
"since": "2026-09-10T02:34:00Z",
"end": "2026-09-10T02:35:00Z"
}
```
Selecting `Side { Currency }` gives one row per quote currency; fills add up across those rows, but `uniq` of transaction signatures does not, because a routed transaction can fill against both quotes. Count transactions with one `uniq` over the union filter. `count` is the number of DEX fills in which the token is one side; a routed swap with several fills counts each of them. `open` and `close` pick one fill from the first and last slot; when several fills share that slot the choice is not defined by transaction order. For a strict first and last, query the raw trades of those two slots and sort by `Block.Slot`, `Transaction.Index`, `Trade.Index` (add `Instruction.Index` and `Instruction.InternalSeqNumber` as further tie-breakers). If you want a single all-venue candle without choosing quote currencies, use the [Trading API](/docs/trading/crypto-price-api/) `Trading { Tokens }` cube (price index, about 30 days of history).
## Solana Real time prices from multiple Markets
You can retrieve data from multiple Solana DEX markets using our APIs or streams.
The [following query](https://ide.bitquery.io/latest-price-for-more-than-1-markets-on-solana_1) demonstrates how to do this.
However, there's a caveat: since we are not specifying the buy or sell currency in the filters, the query will display both currencies on the buy side (or sell side).
This happens because both currencies are traded within the pool. If you want the price of only one asset, you can define it in the filter.
ere is [an example](https://ide.bitquery.io/latest-price-for-more-than-1-markets-on-solana-for-specific-currencies) from the same markets, where we specified that we need trades when the buy currency is defined.
Show the GraphQL
```graphql
subscription {
Solana {
DEXTrades(
where: {Transaction: {Result: {Success: true}}, Trade: {Market: {MarketAddress: {in: ["5qrvgpvr55Eo7c5bBcwopdiQ6TpvceiRm42yjHTbtDvc", "FpCMFDFGYotvufJ7HrFHsWEiiQCGbkLCtwHiDnh7o28Q"]}}}}
) {
average(of: Trade_Buy_Price)
Trade {
Buy {
Currency {
Name
Symbol
MintAddress
}
}
}
}
}
}
```
## Using Pre-Made Aggregates in Solana DEX Trades
When querying Solana DEXTradeByTokens, you can use pre-made aggregates to optimize performance. The `aggregates` flag provides three options to control the use of these aggregates:
- **`aggregates: only`**: This option uses only the pre-made aggregates, which can significantly increase the speed of the response.
- **`aggregates: yes`**: This option uses both pre-made aggregates and individual transaction data.
- **`aggregates: no`**: This option does not use any pre-made aggregates.
> When using the aggregates: only option, you need to include the mintaddress field in the response to ensure proper aggregation and filtering.
Show the GraphQL
```graphql
{
Solana(aggregates: only) {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
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)
Currency {
MintAddress
}
}
count
}
}
}
```
## Finding Trades that Executed the Trade a Custom Program
You want to track or filter DEX trades that interacted with a specific Solana program (e.g., one you deployed or are monitoring).
This query uses the [graphQL joins](/docs/graphql/capabilities/joins/) feature to join Solana DEX trades with instructions executed by a specific program address.
Run this query [here](https://ide.bitquery.io/find-all-trades-interacting-with-a-program)
Show the GraphQL
```graphql
{
Solana {
DEXTrades(limit: {count: 100}) {
Trade {
Dex {
ProtocolName
}
Sell {
Currency {
Symbol
}
}
Buy {
Currency {
Symbol
}
}
}
Transaction {
Signature
}
Instruction {
ExternalSeqNumber
InternalSeqNumber
}
joinInstructions(
join: inner
Block_Slot: Block_Slot
Transaction_Signature: Transaction_Signature
where: {
Instruction: {
Program: {
Address: { is: "fat2dUTkypDNDT86LtLGmzJDK11FSJ72gfUW35igk7u" }
}
}
}
) {
Instruction {
Program {
Address
}
}
Transaction {
Signature
}
}
}
}
}
```
### How It Works
- `DEXTrades`: Retrieves recent DEX trades on Solana.
- `joinInstructions`: Performs an **inner join** between trades and instructions within the same **block slot** and **transaction signature**.
- Filters are applied to the **Instruction.Program.Address**, targeting your custom program.
- Ensures only trades where your program was involved are included.
## Aggregated Token Data (Volume & Price, Last 24h)
Get up to 100 tokens with aggregated USD volume and average price over the last 24 hours, plus volume and price for 1h, 4h, and 24h via conditional metrics (Trading API; includes Solana and other chains).
▶️ [Aggregated Token Data](https://ide.bitquery.io/aggregated-data)
```graphql
{
Trading {
Tokens(
limit: { count: 100 }
limitBy: { count: 1, by: Token_Id }
where: { Block: { Time: { since_relative: { hours_ago: 24 } } } }
) {
Token {
Address
Id
IsNative
Name
Network
Symbol
TokenId
}
Volume {
Usd
H1VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 1 } } } })
H4VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 4 } } } })
H24VAgo: Usd(if: { Block: { Time: { since_relative: { hours_ago: 24 } } } })
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
H4Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }
)
H24Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { since_relative: { hours_ago: 24 } } } }
)
}
}
}
}
}
```
## Volume of Multiple Tokens Across Different Chains
Get volume and price change data for multiple tokens trading on different chains (Solana, Ethereum, BSC, Tron) in a single query using the Trading API. Returns volume for 1h, 4h, and 24h periods, plus price change percentages for the same intervals.
:::note EVM address format
For **EVM chains** (Ethereum, BSC, etc.) in the Trading API, use **all lowercase addresses** in the token ID format (e.g., `bid:eth:0x...` with lowercase hex). Mixed-case addresses may not match.
:::
[Run in Bitquery IDE](https://ide.bitquery.io/volume-of-a-token_1)
Show the GraphQL
```graphql
query {
TokenAsBase: Trading {
Pairs(
where: {
Interval: { Time: { Duration: { eq: 1 } } }
Block: { Time: { since_relative: { hours_ago: 24 } } }
Price: { IsQuotedInUsd: true }
Token: {
Id: {
in: [
"bid:solana:CZzgUBvxaMLwMhVSLgqJn3npmxoTo6nzMNQPAnwtHF3s"
"bid:eth:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78"
"bid:bsc:0xfaf0cee6b20e2aaa4b80748a6af4cd89609a3d78"
"bid:tron:TXL6rJbvmjD46zeN1JssfgxvSo99qC8MRT"
]
}
}
Market: { Protocol: { notIn: ["jupiter", "dex_solana_v3"] } }
}
) {
Token {
Name
Symbol
Id
}
Price {
Average {
currentPrice: Mean(maximum: Block_Time)
H1Ago: Mean(
maximum: Block_Time
if: { Block: { Time: { till_relative: { hours_ago: 1 } } } }
)
H4Ago: Mean(
maximum: Block_Time
if: { Block: { Time: { till_relative: { hours_ago: 4 } } } }
)
H24Ago: Mean(
minimum: Block_Time
if: { Block: { Time: { after_relative: { hours_ago: 24 } } } }
)
}
}
Price_change_1h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H1Ago ) / $Price_Average_H1Ago ) * 100"
)
Price_change_4h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H4Ago ) / $Price_Average_H4Ago ) * 100"
)
Price_change_24h: calculate(
expression: "( ( $Price_Average_currentPrice - $Price_Average_H24Ago ) / $Price_Average_H24Ago ) * 100"
)
v1h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 1 } } } }
)
v4h: sum(
of: Volume_Usd
if: { Block: { Time: { since_relative: { hours_ago: 4 } } } }
)
v24h: sum(of: Volume_Usd)
}
}
}
```
---
## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply)
The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which.
### Get All DEX Trades on Solana With Price, Market Cap, and Supply
Stream **all Solana DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Network: Solana`** to capture every swap across **Raydium**, **Orca**, **Jupiter**, **PumpSwap**, and other Solana DEXs in a single subscription.
The full runnable subscription lives in the canonical section on the Trades API page: [How Do I Get All DEX Trades on Solana With Price, Market Cap, and Supply?](/docs/trading/crypto-trades-api/trades-api/#how-do-i-get-all-dex-trades-on-solana-with-price-market-cap-and-supply), or run it directly [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-Solana-with-Price-Marketcap-supply).
### Top Traders by PnL for a Specific Pool (Last 30 Minutes)
Rank traders by **`PnL`** on one pool: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **pool-specific trader analytics**.
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-pair#).
Show the GraphQL
```graphql
{
Trading {
Trades(
limit: { count: 10 }
orderBy: [{ descendingByField: "PnL" }]
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Address: { is: "2axyccPzS7Ei57c7ESEq7tBpo4HxtpfCR9gKxh5uNUpu" }
}
}
}
) {
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" } })
}
}
}
```
---
## Video Tutorial on Solana DEXTrades API | How to get Decentralized Exchange Data with DEX Trades API
## Video Tutorial on Solana DEXTrades API | How to get Top Solana tokens by Price Change 5min, 1h, 6h
---
## Solana Fee Anatomy - Base, Priority and Jito Tips
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-fee-anatomy/
Break a Solana transaction fee into base fee and priority fee, find what a wallet spends on fees, and understand why Jito tips are not part of the fee.
# Solana fee anatomy
A Solana transaction costs money in up to three ways, and only two of them appear in
`Transaction.Fee`:
| Component | In `Transaction.Fee`? | What it is |
|---|---|---|
| **Base fee** | Yes | 5,000 lamports per signature, fixed by the protocol |
| **Priority fee** | Yes | compute unit price × compute units requested, set by the sender |
| **Jito tip** | **No** | a normal SOL transfer to a Jito tip account |
That third row is the one that causes miscounting. A Jito tip is a transfer instruction, not a
fee, so it never shows up in `Fee`. Add it separately from
[the Jito Bundle API](/docs/blockchain/Solana/Solana-Jito-Bundle-api/) if you want true
all-in cost.
## Splitting base from priority
The cube exposes the total `Fee` but not its components, so you derive the split. Base fee is
5,000 lamports per signature, so for a single-signature transaction:
```
priority_lamports = fee_lamports - 5000
```
```js
const feeLamports = Math.round(Number(tx.Fee) * 1e9);
const signatures = 1; // see the caveat below
const baseFee = 5000 * signatures;
const priorityFee = Math.max(0, feeLamports - baseFee);
```
:::caution Signature count is not exposed, so the split is inexact
`Transactions` does not return the number of signatures, and a two-signature transaction with
no priority fee costs exactly the same as a one-signature transaction paying 5,000 lamports of
priority. In a sample of recent successful transactions, fees cluster hard on 5,000 and 10,000
lamports, which are one and two signatures at zero priority.
Treat `fee - 5000` as an **upper bound** on the priority fee for an unknown transaction, and as
exact only where you know the transaction is single-signature.
:::
## How much priority is actually being paid
Quantiles answer this in one query, without pulling rows:
```graphql
query SolanaFeeDistribution {
Solana {
Transactions(where: { Transaction: { Result: { Success: true } } }, limit: { count: 1 }) {
transactions: count
p25: quantile(of: Transaction_Fee, level: 0.25)
median: median(of: Transaction_Fee)
p75: quantile(of: Transaction_Fee, level: 0.75)
p99: quantile(of: Transaction_Fee, level: 0.99)
maxFee: quantile(of: Transaction_Fee, level: 0.999)
}
}
}
```
The shape of the answer is consistent even as the numbers move: the median sits **at the base
fee**, the quartiles sit at or barely above it, and the distribution only lifts in the last
percentile or two. Most Solana transactions pay no meaningful priority fee at all; a small
minority bidding for block position accounts for nearly all of the priority spend.
This matters when you size a fee strategy. Comparing your fee against the mean puts you against
a number dragged upward by a handful of bots. Compare against the median and the p99 instead,
and decide which population you are competing with.
## Transactions that paid real priority
Filter on `Fee` to isolate the bidders:
```graphql
query HighPriorityTransactions {
Solana {
Transactions(
where: { Transaction: { Result: { Success: true }, Fee: { gt: "0.0001" } } }
orderBy: { descending: Block_Time }
limit: { count: 25 }
) {
Block {
Time
}
Transaction {
Signature
Fee
FeeInUSD
FeePayer
InstructionsCount
}
}
}
}
```
`0.0001` SOL is 100,000 lamports, twenty times the base fee, so anything returned is paying to
be included early rather than merely to be included.
## What a wallet spends on fees
Group by `FeePayer` to rank fee spend, which is a good proxy for who is running bots:
```graphql
query TopFeePayers {
Solana {
Transactions(
where: { Transaction: { Result: { Success: true } } }
orderBy: { descendingByField: "totalFee" }
limit: { count: 25 }
) {
Transaction {
FeePayer
}
totalFee: sum(of: Transaction_Fee)
totalFeeUsd: sum(of: Transaction_FeeInUSD)
transactions: count
avgFee: average(of: Transaction_Fee)
}
}
}
```
Drop the success filter and add `Transaction { Result { Success } }` to the selection to see how
much of a payer's spend goes on transactions that never landed.
## Failed transactions still cost money
Grouping by result is the query most worth running once:
```graphql
query FeeSpentOnFailures {
Solana {
Transactions(limit: { count: 4 }) {
Transaction {
Result {
Success
}
}
transactions: count
totalFee: sum(of: Transaction_Fee)
avgFee: average(of: Transaction_Fee)
}
}
}
```
Two things fall out of it, and both hold across runs:
- **Failed transactions pay a higher average fee than successful ones.** That is not a paradox.
Priority fees are highest exactly where competition is fiercest, and most racers lose.
- **A substantial share of all fees paid on Solana is spent on transactions that fail.** If you
are estimating the cost of a strategy from successful transactions alone, you are
understating it, and the gap widens the more aggressively you bid.
This is also the honest counterweight to any landing-rate comparison: a venue that fails often
is not merely slower, it is charging you for the failures.
## Related
- [Jito Bundle API](/docs/blockchain/Solana/Solana-Jito-Bundle-api/) — tips, which sit outside `Fee`
- [Solana Fees API](/docs/blockchain/Solana/solana_fees_api/) — fees attached to trades and transfers
- [Solana Transactions API](/docs/blockchain/Solana/solana-transactions/)
- [Solana Blocks API](/docs/blockchain/Solana/solana-blocks-api/)
---
## Solana Fees API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana_fees_api/
Solana Fees API: analyze Solana transaction fees and costs with Bitquery GraphQL queries and streams. Scale further with Kafka or gRPC streams.
# Solana Fees API
In this document, we will explore several examples related to Solana Fees data.
We also have [PumpFun APIs](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) to track Pump Fun token swaps, [PumpSwap APIs](/docs/blockchain/Solana/Pumpfun/pump-swap-api/) if you want to track the token after it has been migrated to PumpSwap AMM.
Additionally, you can also check out our [Moonshot APIs](/docs/blockchain/Solana/Moonshot-API/), [FourMeme APIs](/docs/blockchain/BSC/four-meme-api/).
These APIs can be provided through different streams including Kafka for zero latency requirements. Please contact us on telegram.
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## Get Trades with Transaction fees
Get a list of successful DEX trades on Solana along with the transaction fee details for each trade.
You can test the query [here](https://ide.bitquery.io/trades-with-transaction-fees#).
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Block {
Time
Slot
}
Trade {
Account {
Address
Token {
Owner
}
}
AmountInUSD
Amount
PriceInUSD
Price
Dex {
ProtocolName
}
Currency {
MintAddress
Name
}
Side {
Account {
Address
Token {
Owner
}
}
Type
AmountInUSD
Amount
Currency {
Name
MintAddress
}
}
}
Transaction {
Signer
Signature
FeeInUSD
Fee
FeePayer
}
}
}
}
```
## Get Transfers by an address and Transaction fees paid for the transfer
Track wallet token transfers and get the fees paid for each by the address.
You can test the query [here](https://ide.bitquery.io/wallet-transfers-with-transaction-fees-paid#).
```graphql
query MyQuery {
Solana {
Transfers(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {Transaction: {Result: {Success: true}, FeePayer: {is: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"}}}
) {
Block {
Time
}
Transfer {
Currency {
Name
MintAddress
Symbol
}
Sender {
Address
}
Receiver {
Address
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signer
Signature
}
}
}
}
```
## Total transaction fees paid by an account
Get the total fees (in SOL and USD) paid by a specific Solana account across all transfers.
You can test the query [here](https://ide.bitquery.io/total-txn-fees-paid-by-the-Account#).
```graphql
query MyQuery {
Solana {
Transfers(
where: {Transaction: {Result: {Success: true}, FeePayer: {is: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"}}}
) {
Total_fees_paid_in_USD:sum(of:Transaction_FeeInUSD)
Total_fees_paid_in_SOL:sum(of:Transaction_Fee)
}
}
}
```
## Transaction fees paid by an account for each currency transfers
Get total fees paid by a Solana account for transferring each type of token.
You can test the query [here](https://ide.bitquery.io/Transaction-fees-paid-by-Account-aggregated-by-currency#).
```graphql
query MyQuery {
Solana {
Transfers(
where: {Transaction: {Result: {Success: true}, FeePayer: {is: "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM"}}}
) {
Transfer{
Currency{
Name
Symbol
}
}
Total_fees_paid_in_USD:sum(of:Transaction_FeeInUSD)
Total_fees_paid_in_SOL:sum(of:Transaction_Fee)
}
}
}
```
## Video Tutorial | How to get Total Fees paid by a Account on Solana
## 🔗 Related Solana APIs
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Monitor trading activities and their fees
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track transfer fees and costs
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor balance changes including fees
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Track instruction execution fees
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Monitor supply-related transaction fees
---
## Solana Heaven DEX API
URL: https://docs.bitquery.io/docs/blockchain/Solana/heaven-dex-api/
Heaven DEX on Solana: track token creation, market cap, latest price, latest trades, OHLC candles, top traders and buy and sell volume for Heaven tokens.
# Heaven DEX API
:::tip Need real-time Heaven DEX data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Heaven DEX swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Heaven DEX data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this document, we will explore several examples related to Heaven Dex. You can also check out our [Pump Fun API Docs](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) and [FourMeme API Docs](/docs/blockchain/BSC/four-meme-api/).
Need zero-latency Heaven DEX data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## Track Heaven DEX Token Creation
Using [this](https://ide.bitquery.io/Track-Heaven-DEX-Token-Creation_1) query, we can get the realtime created Heaven DEX tokens.
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o" }
Method: { is: "create_standard_liquidity_pool" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Market cap (Trading API)
Use **Trading** **`Pairs`** with **`Market.Protocol`** **`Heaven`** for aggregated **market cap**, **FDV**, **supply**, **price**, and **volume**. Replace **`solana:`** in **`Token.Id`** with your token.
### Get latest market cap for a specific Heaven DEX token
**`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, **`Token.Id`** with **`includesCaseInsensitive`**, interval duration **> 1** second, **`Market.Protocol`** **`Heaven`**.
Run the query [in the Bitquery IDE](https://ide.bitquery.io/specific-heaven-dex-token-latest-marketcap).
Click to expand GraphQL query
```graphql
{
Trading {
Pairs(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: {
Id: {
includesCaseInsensitive: "solana:7GMB7XbtTdvnHkPjH6yEwTUB3HYf5dqC3FKyr2sueMEh"
}
}
Interval: { Time: { Duration: { gt: 1 } } }
Market: { Protocol: { is: "Heaven" } }
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Market {
Program
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Price {
Average {
Mean
}
Ohlc {
Open
Low
High
Close
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
}
}
}
```
### Stream Heaven DEX tokens with market cap above $10K
Subscribe when the token is on **Solana**, **`Market.Protocol`** is **`Heaven`**, **`Supply.MarketCap`** **> 10,000** (USD), and interval duration **> 1** second. Adjust **`gt`** to change the threshold.
Run the subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-heaven-tokens-with-marketcap-10k).
Click to expand GraphQL subscription
```graphql
subscription {
Trading {
Pairs(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 10000 } }
Market: { Protocol: { is: "Heaven" } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Market {
Protocol
ProtocolFamily
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
## Latest price of a token on Heaven DEX
This returns the most recent trade for a token on the venue, with the price in the quote token and in USD.
You can run this query using [this link](https://ide.bitquery.io/live-price-of-token-on-heaven-dex).
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"}}, Currency: {MintAddress: {is: "G9z2bN7rqxdoN526H4XzdLNWt8Wy8GdbqwNFSrpMv777"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Latest Trades on Solana Heaven
To subscribe to the real-time trades stream for Solana Heaven DEX, [try this GraphQL subscription (WebSocket)](https://ide.bitquery.io/Real-time-trades-on-Heaven-DEX-on-Solana).
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
MintAddress
Decimals
Symbol
ProgramAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
MintAddress
Decimals
Symbol
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## Latest Trades for a specific currency on Solana Heaven DEX
Let's say you want to receive [trades only for a specific currency on Heaven DEX](https://ide.bitquery.io/Real-time-buy-and-sell-of-specific-currency-on-Heaven-DEX-on-Solana_3). You can use the following stream.
Use currency's mint address; for example, in the following query, we are using Ray token's Mint address to get buy and sells of Ray token.
If you limit it to 1, you will get the latest price of the token because the latest trade = the Latest Price.
Run this query [using this link](https://ide.bitquery.io/Real-time-buy-and-sell-of-specific-currency-on-Heaven-DEX-on-Solana_2).
Click to expand GraphQL query
```graphql
subscription {
Solana {
Buyside: DEXTrades(
where: {
Trade: {
Buy: {
Currency: {
MintAddress: {
is: "G9z2bN7rqxdoN526H4XzdLNWt8Wy8GdbqwNFSrpMv777"
}
}
}
Dex: {
ProgramAddress: {
is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
Sellside: DEXTrades(
where: {
Trade: {
Sell: {
Currency: {
MintAddress: {
is: "G9z2bN7rqxdoN526H4XzdLNWt8Wy8GdbqwNFSrpMv777"
}
}
}
Dex: {
ProgramAddress: {
is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Decimals
Symbol
MintAddress
Name
}
PriceAgaistBuyCurrency: Price
}
}
Block {
Time
Height
}
Transaction {
Signature
FeePayer
Signer
}
}
}
}
```
## Heaven OHLC API
If you want to get OHLC data for any specific currency pair on Heaven DEX, you can use [this api](https://ide.bitquery.io/Heaven-OHLC-for-specific-pair).
Only use this API as `query` and not `subscription` websocket as Aggregates and Time Intervals don't work well with subscriptions.
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: {
MintAddress: { is: "G9z2bN7rqxdoN526H4XzdLNWt8Wy8GdbqwNFSrpMv777" }
}
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Dex: {
ProgramAddress: {
is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"
}
}
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 the Top Traders of a specific Token on Heaven DEX
This ranks the wallets trading one token on the venue. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on Heaven](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-Token-on-Heaven-DEX)
Click to expand GraphQL query
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "G9z2bN7rqxdoN526H4XzdLNWt8Wy8GdbqwNFSrpMv777"
}
```
## Get trading volume, buy volume, sell volume of a Heaven DEX token
This reads the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. Tokens here are short lived, so the example uses the LIGHT/WSOL market that was trading when this page was checked; swap the base mint for the token you want. Open it in the [Bitquery IDE: trade volume](https://ide.bitquery.io/Get-trading-volume-buy-volume-sell-volume-of-a-heaven-dex-token).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { ProtocolFamily: { is: "Heaven" }, Network: { is: "Solana" } }
Token: { Address: { is: "LiGHtkg3uTa9836RaNkKLLriqTNRcMdRAhqjGWNv777" } }
QuoteToken: {
Address: { is: "So11111111111111111111111111111111111111112" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
## Video Tutorials
### Get Unlimited Bags FM Token Data Using Bitquery API
---
## Solana Historical Data API: OHLCV, Trades and Archive
URL: https://docs.bitquery.io/docs/blockchain/Solana/historical-aggregate-data/
Solana historical data: OHLCV candles by mint or pair, aggregate trade history from June 2024, 30-day trade rows, transfers to genesis, CSV and Parquet export.
# Solana Historical Data API: OHLCV, Trades and Archive
Solana history on Bitquery comes in four layers, and the right one depends on how far back you need to go. Aggregate trade history (OHLCV, volume, ATH, first buyers, PnL) runs on the `DEXTradeByTokens` cube with `dataset: archive` or `combined` and starts on 1 June 2024. Per-trade rows with USD prices for the last month come from the [Trading API](/docs/trading/crypto-trades-api/trades-api/). SPL transfers back to the chain's genesis are on the [V1 endpoint](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers). Bulk history for backtesting ships as Parquet through [cloud datasets](/docs/cloud/solana). Every query on this page runs as written in the [Bitquery IDE](https://ide.bitquery.io). The free trial and paid self-service plans cover real-time data only, so the `archive` and `combined` queries need a Solana archive pack from the [pricing page](https://bitquery.io/pricing).
| Layer | Where | How far back | Use it for |
|---|---|---|---|
| Aggregate history | `Solana(dataset: archive)` or `combined`, `DEXTradeByTokens` | From 1 June 2024 | OHLCV, volume, ATH, first buyers, trader PnL |
| Recent per-trade rows | `Trading.Trades`, with built candles in `Trading.Tokens` and `Trading.Pairs` | About the last 30 days | Trade-level rows with USD prices, candles down to one second |
| Realtime | `Solana(dataset: realtime)` cubes | About 7 days on `DEXTradeByTokens`, hours on the other cubes | Live filters, including the USD fields the aggregate datasets reject |
| Transfers to genesis | V1 GraphQL endpoint | Full chain history | SPL transfer history |
| Bulk exports | Cloud datasets as Parquet on S3, GCS, Snowflake or BigQuery | Full history per dataset | Backtesting and warehouses |
Retention per cube is on the [data coverage and retention](/docs/graphql/data-coverage-retention) page.
:::caution Archive is deep but not complete
On Solana the `archive` and `combined` datasets return the same rows as each other, and both return fewer trades than `realtime` over a window all three cover: measured on several busy markets, archive came back roughly a fifth to a quarter short, with volume short by a similar margin. Use archive for depth, and read the last 30 days from the [Trading API](/docs/trading/crypto-trades-api/trades-api/) when the totals have to be exact. The examples below name `archive` rather than `combined`, since on this chain `combined` adds nothing.
Expect these to be slow. An unbounded ATH or all-time OHLCV scan runs for tens of seconds against the aggregate tables, and on a busy mint such as WSOL it can exceed the gateway timeout and return a 502 instead of rows. Add a `Block: { Time: { since: ... } }` bound whenever you do not genuinely need the full range.
:::
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## Filter limitations on aggregate datasets
On `Solana` with `dataset: archive` or `dataset: combined`, `DEXTradeByTokens` is served from
pre-aggregated tables. **USD-denominated fields and `PriceAsymmetry` cannot be used inside `where:`.**
A query that filters on them fails outright with an error such as
`no table can query DEXTradeByToken` or `database schema not defined for archive cube`. It does not
silently return different numbers. The same USD fields work normally as **output measures**.
| Field | As a `where:` filter | As a measure / projection |
|---|---|---|
| `Trade.Amount`, `Trade.Side.Amount` | works | works |
| `Trade.Price` | works | works |
| `Trade.Currency`, `Trade.Side.Currency` | works | works |
| `Trade.Account.Address` | works | works |
| `Trade.Side.Type`, `Trade.Dex`, `Block.Time` | works | works |
| `Trade.PriceAsymmetry` | **error** | not available |
| `Trade.Side.AmountInUSD`, `Trade.AmountInUSD` | **error** | works, as `sum(of: Trade_Side_AmountInUSD)` |
| `Trade.PriceInUSD` | **error** | works, as `quantile(of: Trade_PriceInUSD)` |
| `Trade.Side.Account` | **error** | **error** |
All of these filters work on `dataset: realtime`, which covers a rolling recent window (hours).
To filter by USD amount or `PriceAsymmetry` over history, use the
[Trading API](/docs/trading/crypto-trades-api/trades-api/), which carries USD price and supply on every row.
## Historical Trades for Solana
**Historical trades for upto past 30 days could be retrieved via Trading API. Docs available [here](/docs/trading/crypto-trades-api/trades-api/).**
The [Bitquery IDE: Solana trades over the last 30 days](https://ide.bitquery.io/historical-Solana-trades_1) example reads per-trade rows for that window through the Trading API.
```graphql
query MyQuery {
Trading {
Trades(
where: {Pair: {Market: {Network: {is: "Solana"}}}, Block: {Date: {before_relative: {days_ago: 25}, after_relative: {days_ago: 27}}}}
orderBy: {ascending: Block_Date}
limit: {count: 100}
) {
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Time
}
Pair {
Market {
Address
Program
}
Pool {
Address
Id
}
QuoteToken {
Name
Symbol
Address
}
Token {
Name
Symbol
Address
}
}
Price
PriceInUsd
Ranking {
Position
Weight
}
Side
Supply {
MarketCap
FullyDilutedValuationUsd
CirculatingSupply
}
Trader {
Address
}
TransactionHeader {
Fee
Hash
}
}
}
}
```
The example asks for a two-day slice at the far end of the window and caps the rows with `limit`. An unbounded request over the whole month can time out.
## Historical OHLCV candles for a Solana token pair {#historical-ohlc-on-solana}
[This](https://ide.bitquery.io/Historical-OHLC-for-Solana-archive) query returns daily open, high, low and close prices for a pair, with volume and trade count per candle. `Trade.Currency` is the token by mint address, `Trade.Side.Currency` is the quote token, and `Time(interval: ...)` sets the candle size in seconds, minutes, hours or days. The example is USDC against WSOL, a pair that will still be trading when you run it. For one token across every pair, drop the `Side` filter.
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } }
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
}
}
limit: { count: 10 }
) {
Block {
Timefield: Time(interval: { in: days, 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
}
}
}
```
### Export the candles to CSV
The same query from a script, written to a CSV file. Only the Python standard library is used; set `BITQUERY_TOKEN` to your access token first.
```python
TOKEN = os.environ["BITQUERY_TOKEN"] # your Bitquery access token
QUERY = """
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } }
Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }
}
}
limit: { count: 365 }
) {
Block { Timefield: Time(interval: { in: days, 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
}
}
}
"""
req = urllib.request.Request(
"https://streaming.bitquery.io/graphql",
data=json.dumps({"query": QUERY}).encode(),
headers={"Content-Type": "application/json", "Authorization": f"Bearer {TOKEN}"},
)
rows = json.load(urllib.request.urlopen(req))["data"]["Solana"]["DEXTradeByTokens"]
with open("usdc_wsol_daily.csv", "w", newline="") as f:
w = csv.writer(f)
w.writerow(["time", "open", "high", "low", "close", "volume", "trades"])
for r in rows:
t = r["Trade"]
w.writerow([r["Block"]["Timefield"], t["open"], t["high"], t["low"], t["close"], r["volume"], r["count"]])
print(f"wrote {len(rows)} candles")
```
Swap the mint addresses, the interval and the `limit` for other pairs and candle sizes. For whole-history exports across many tokens, [cloud datasets](/docs/cloud/solana) deliver the same data as Parquet.
:::note Important Considerations
- Each OHLC data point is calculated independently per time interval (e.g., daily). There’s no enforcement to make the `Close` of one candle match the `Open` of the next.
- **Gaps are possible**: Since the data is based on actual trades, if no trades occur exactly at the start or end of a day, the nearest trades before and after those timestamps will define the open and close. For instance:
- Last trade on April 14: `23:58:12`
- First trade on April 15: `00:03:45`
These would represent the _close_ of April 14 and _open_ of April 15 respectively, leaving a gap in between.
- **Derived from block time**: All time-based grouping (daily, hourly, etc.) depends on block timestamps.
- **No `PriceAsymmetry` filter on archive/combined**: this query cannot exclude asymmetric prints, so
`high` and `low` take raw extremes and may include outlier trades. For cleaner candles over the last
~30 days use the [Trading API](/docs/trading/crypto-price-api/crypto-ohlc-candle-k-line-api/), which
serves USD OHLC directly. See [Filter limitations](#filter-limitations-on-aggregate-datasets).
**Alternative approach**: You can get all trades and calculate OHLC locally in your own system. Complete guide [here](/docs/usecases/ohlcv-complete-guide/)
:::
## First 24 Hours Trade Volume for a Solana Token
[This](https://ide.bitquery.io/first-24-hr-volume-for-a-token) query returns the trade volume for a Solana Token in the first 24 hours of its launch.
We are using `13WvP5LC5ETUpFipYM2f9AQzg6QA9S5opxGp2Scpump` in this case.
```graphql
query MyQuery {
Solana(dataset: archive, aggregates: yes) {
DEXTradeByTokens(
orderBy: { ascendingByField: "Block_TimeFeild" }
limit: { count: 1 }
where: {
Trade: {
Currency: {
MintAddress: { is: "13WvP5LC5ETUpFipYM2f9AQzg6QA9S5opxGp2Scpump" }
}
}
}
) {
Block {
TimeFeild: Time(interval: { count: 24, in: hours })
}
sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## Top 100 traders of a token
[This](https://ide.bitquery.io/top-traders-for-a-specific-token) query returns the top token traders for a specific token by USD volume over a date range. The example uses token mint `98sMhvDwXj1RQi5c5Mndm3vPe9cBqPrbLaufMXFNMh5g` paired with SOL (`So11111111111111111111111111111111111111112`) and the combined dataset for 2026-01-01 to 2026-01-02. You get trader address (Owner), buy/sell counts, buy/sell volume, total volume, and trade count per trader.
```graphql
{
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
}
}
}
```
## Tokens Traded by an Account
[This](https://ide.bitquery.io/tokens-traded-by-an-address) query returns the list of tokens traded by the wallet address over a period
of time. The list is sorted by the amount of tokens traded, and returns token info such as mint address, name and symbol along with the
total amount of tokens traded and the number of trades involving that token.
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { descendingByField: "tokens" }
where: {
Trade: {
Account: {
Owner: { is: "3CgvbiM3op4vjrrjH2zcrQUwsqh5veNVRjFCB9N6sRoD" }
}
}
}
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
}
tokens: sum(of: Trade_Amount)
trades: count
}
}
}
```
## Change in Liquidity Over a Month
[This](https://ide.bitquery.io/liquidity-change-in-recent-month) query returns the change in `liquidity` for a particular token
pair over the last month. For this example the parameters listed below are used.
1. Primary Token - `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` (USDC).
2. Secondary Token - `So11111111111111111111111111111111111111112` (WSOL),
3. Pool Address - `Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE` (the USDC/WSOL Orca Whirlpool)
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } }
Side: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Market: {
MarketAddress: {
is: "Czfq3xZZDmsdGdUyrNLtRhGc47cXcZtLG4crryfu44zE"
}
}
}
}
orderBy: { descendingByField: "Block_Timefield" }
limit: { count: 1 }
) {
tokenLiquidity: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
wsolLiquidity: sum(
of: Trade_Side_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
Block {
Timefield: Time(interval: { in: months, count: 1 })
}
Trade {
Market {
MarketAddress
}
}
}
}
}
```
## Get ATH (All-Time High) of a Token
In this query we use the 95th percentile (`level: 0.95`) to find the highest price of a token.
The 95th percentile is itself outlier-resistant, which matters here because `PriceAsymmetry` and
`AmountInUSD` **cannot be used as filters** on aggregate datasets. See
[Filter limitations on aggregate datasets](#filter-limitations-on-aggregate-datasets). On
`dataset: realtime` you can add both filters for stricter outlier control.
Read more about quantiles [here](/docs/graphql/metrics/quantile/)
You can run the query [here](https://ide.bitquery.io/Price-ATH-query)
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Trade: {Side: {Currency: {MintAddress: {in: ["11111111111111111111111111111111", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "So11111111111111111111111111111111111111112"]}}}, Currency: {MintAddress: {is: "2tnA2ZmwmgUZLyYLi97zbwsFBXAqpMEcHu9Cv9JW6m26"}}}}
limit: {count: 1}
orderBy: {descendingByField: "aATH"}
) {
aATH: quantile(of: Trade_PriceInUSD, level: 0.95)
}
}
}
```
## Get ATH Price, ATH Date, Price Change percentage in 24h, 7d, 30d
Fetches a Solana token’s ATH price, ATH date, and price change percentages over the past 24h, 7d, and 30d using Bitquery Solana APIs.
Try the [query to get ATH price, ATH date, price change](https://ide.bitquery.io/ATH-with-price-delta-Solana).
```graphql
query ($token: String) {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Trade: {Side: {Currency: {MintAddress: {in: ["11111111111111111111111111111111", "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v", "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB", "So11111111111111111111111111111111111111112"]}}}, Currency: {MintAddress: {is: $token}}}, Transaction: {Result: {Success: true}}}
limit: {count: 1}
) {
Trade {
Price_24h_ago: PriceInUSD(
minimum: Block_Slot
if: {Block: {Time: {since_relative: {hours_ago: 24}}}}
)
Price_7d_ago: PriceInUSD(
minimum: Block_Slot
if: {Block: {Time: {since_relative: {days_ago: 7}}}}
)
Price_30d_ago: PriceInUSD(
minimum: Block_Slot
if: {Block: {Time: {since_relative: {days_ago: 30}}}}
)
CurrentPrice: PriceInUSD(maximum: Block_Slot)
}
change24hr: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_24h_ago) / $Trade_Price_24h_ago) * 100"
)
change7d: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_7d_ago) / $Trade_Price_7d_ago) * 100"
)
change30d: calculate(
expression: "(($Trade_CurrentPrice - $Trade_Price_30d_ago) / $Trade_Price_30d_ago) * 100"
)
aATH: quantile(of: Trade_PriceInUSD, level: 0.95)
Block {
Time
}
}
}
}
```
Variables:
```json
{
"token": "2tnA2ZmwmgUZLyYLi97zbwsFBXAqpMEcHu9Cv9JW6m26"
}
```
## Get First 100 buyers of a Token
[This](https://ide.bitquery.io/first-100-buyer-of-a-token) API returns the first 100 buyers for a particular token.
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
orderBy: { ascending: Block_Time }
limit: { count: 100 }
limitBy: { count: 1, by: Trade_Account_Owner }
where: {
Block: { Date: { since: "2025-07-13", till: "2025-07-14" } }
Trade: {
Side: { Type: { is: sell } }
Currency: {
MintAddress: { is: "pumpeALaQHVP7mCdjmhFkAnesZj3vXMJhD4rFffYDfn" }
}
}
}
) {
Trade {
Account {
Owner
}
}
}
}
}
```
The window is the token's launch day. Scanning from an arbitrary earlier date makes the request time out, so find the first trade date first (`Block { Time(minimum: Block_Time) }` on the same cube) and bound the window to it.
## Get ATH of Multiple Tokens
You can run it [here](https://ide.bitquery.io/ATH-of-multiple-tokens-quantile-Solana)
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: {
in: ["token mint address-1", "token mint address-2"]
}
}
}
}
limit: { count: 2 }
orderBy: { descendingByField: "aATH" }
limitBy: { by: Trade_Currency_MintAddress, count: 1 }
) {
Trade {
Currency {
Name
}
}
aATH: quantile(of: Trade_PriceInUSD, level: 0.99)
}
}
}
```
## Get ATH Market Cap of Tokens
This query returns the ATH (All-Time High) market cap, starting market cap, and related price metrics for multiple tokens. It calculates market cap using a 1 billion token supply and uses quantile to find the ATH price.
You can run it [here](https://ide.bitquery.io/Marketcap-of-tokens)
```graphql
query GetAthMarketCap($tokens: [String!]!) {
Solana(dataset: archive) {
DEXTradeByTokens(
limitBy: { by: Trade_Side_Currency_MintAddress, count: 1 }
where: {
Trade: {
Currency: { MintAddress: { in: $tokens } }
}
}
) {
Trade {
Currency {
MintAddress
Name
Symbol
}
PriceInUSD(maximum: Trade_PriceInUSD)
Starting_Price: PriceInUSD(minimum: Block_Slot)
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
max: quantile(of: Trade_PriceInUSD, level: 0.98)
quantile_price_ATH_Marketcap: calculate(expression: "$max * 1000000000")
Real_maximum_price_ATH_Marketcap: calculate(
expression: "$Trade_PriceInUSD_maximum * 1000000000"
)
Starting_Marketcap: calculate(
expression: "$Trade_Starting_Price * 1000000000"
)
}
}
}
```
```json
{
"tokens": ["8SAwv8EKMKaKnupTsYjoQdgBuWxJdo3ouA178UU7pump"]
}
```
## Realised PnL, avg buy price, buy volume, sell volume
Get realised PnL, average buy price, buy volume, and sell volume for a token on Solana of a trader trader for over a time window.
[Run in Bitquery IDE](https://ide.bitquery.io/Realised-Pnl-avg-buy-price-Buy-volume-Sell-Volume-Solana_2)
```graphql
{
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: { is: "4iLKj7fkZF2rSpgSD8W6UFq4fkKXkkbJMGXMz3B8pump" }
}
Account: {
Owner: { is: "2vqBfRdhX8sHmVFo1TY1yBdFXkHMe4LgifrxvHBpXUAK" }
}
Dex: { ProtocolName: { notIn: ["jupiter", "dex_solana_v3"] } }
}
Transaction: { Result: { Success: true } }
Block: { Date: { since: "2026-03-11", till: "2026-03-13" } }
}
) {
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_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
buy_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume_usd: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
buy_volume: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: buy } } } }
)
sell_volume: sum(
of: Trade_Amount
if: { Trade: { Side: { Type: { is: sell } } } }
)
RealizedPnL: calculate(expression: "$sell_volume_usd - $buy_volume_usd")
trades: count
avg_buy_price: calculate(expression: "$buy_volume_usd / $buy_volume")
}
}
}
```
## How far back does Bitquery's Solana historical data go on Solana?
Bitquery **V2** **historical aggregates** on this page (for example **`Solana(dataset: archive)`** / **`combined`** with **`DEXTradeByTokens`**) are available from **1 June 2024** forward for the supported aggregate APIs.
That is **not** full ledger genesis history. For **SPL transfers and older history**, use the **[V1 Solana examples](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers)**. All other chains have complete historical data.
## What fields are available in Solana DEXTradeByTokens with dataset: combined?
**`Solana(dataset: archive)`** (and **`combined`**, which returns the same rows on this chain) **`DEXTradeByTokens`** supports **aggregate-friendly** fields: **time / intervals**, **amounts**, **prices**, **trade counts**, **`Trade.Currency`**, **`Trade.Side.Currency`**, **`Dex`**, pool/market identifiers, and similar columns shown in the examples below. **Fine-grained per-account fields** on the trade side (e.g. **`Trade Side Account`**-style projections) are often **unsupported**: the API returns “columns not available.” **Add fields one at a time** in the IDE and rely on the live schema. See [combined vs realtime on Solana](/docs/graphql/dataset/combined#why-does-dataset-combined-return-fewer-fields-than-dataset-realtime-on-solana) and [Pump.fun combined note](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/#why-does-my-pumpfun-query-return-columns-not-available-in-combined-dataset).
## CoinGecko OHLC compared with Bitquery
| | CoinGecko coin OHLC endpoint | Bitquery |
|---|---|---|
| Scope | Coins listed on CoinGecko, by coin id (chart endpoints also accept a token address) | Any Solana mint or pair, listed or not |
| Candle size | Automatic: 30 minutes for 1 to 2 days, 4 hours for 3 to 30 days, 4 days beyond; daily and hourly intervals on paid plans over fixed ranges | Any interval in seconds, minutes, hours or days |
| History | The range you pass in the `days` parameter | Aggregates from 1 June 2024, per-trade rows for about 30 days, transfers to genesis on V1 |
| Fields | Open, high, low, close | Open, high, low, close, volume, trade count, plus any aggregate you add (makers, buys, sells) |
| Access | API key header | Access token; `archive` and `combined` aggregates need a Solana archive pack (the trial is real-time only) |
## Related pages
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades)
- [Solana OHLC API and second-level candles](/docs/blockchain/Solana/solana-dextrades#solana-ohlc-api)
- [Trading API: crypto price and OHLC](/docs/trading/crypto-price-api/)
- [DEXScreener-style pair data for Solana](/docs/blockchain/Solana/DEXScreener/solana_dexscreener/)
- [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Solana cloud datasets](/docs/cloud/solana)
- [Data coverage and retention](/docs/graphql/data-coverage-retention)
## Video Tutorial for Querying Historical Solana Data
---
## Solana Instructions API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-instructions/
Solana instructions: latest calls, new tokens on PumpFun, Raydium Launchpad, Meteora DBC and more, Metaplex metadata, buy events and token burns.
# Solana Instructions API
## Overview
The **Solana Instructions API** provides comprehensive access to decoded instruction data executed on the Solana blockchain. This API enables you to track real-time instructions, monitor token creation and burning events, and analyze program interactions with detailed information including signer details, transaction signatures, balance updates, and program metadata.
## 📋 Table of Contents
- **[Latest Solana Instructions](#latest-solana-instructions)** - Real-time instruction monitoring
- **[Latest Created Tokens on Solana](#latest-created-tokens-on-solana)** - Token creation tracking
- **[Newly launched tokens (PumpFun, Raydium, Meteora, Heaven, Bags, Jupiter, Moonit)](#newly-launched-tokens-on-pumpfun-raydium-launchpad-meteora-dbc-heaven-dex-bags-jupiter-studio-moonit)** - Multi-launchpad token launches
- **[Track Real-time Token Burn on Solana](#track-real-time-token-burn-on-solana)** - Token burn monitoring
- **[Video Tutorials](#video-tutorials)** - Step-by-step guides
## 🔗 Related APIs
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor real-time balance changes
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Track token supply and creation events
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Monitor trading activities across DEXs
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track token transfers and movements
- **[Solana Fees API](/docs/blockchain/Solana/solana_fees_api/)** - Analyze transaction fees and costs
---
## Latest Solana Instructions
The subscription below fetches the latest instructions executed on the Solana blockchain, including details like indices of preceding instructions, signer information, transaction signatures, balance updates, and program details.
For monitoring the balance changes that result from these instructions, see our **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)**.
You can run the query [here](https://ide.bitquery.io/Latest-Solana-Instructions)
```graphql
subscription {
Solana(network: solana) {
Instructions {
Transaction {
Signer
Signature
Result {
Success
ErrorMessage
}
Index
}
Instruction {
Logs
BalanceUpdatesCount
AncestorIndexes
TokenBalanceUpdatesCount
Program {
Name
Method
}
}
Block {
Time
Hash
}
}
}
}
```
---
## Latest Created Tokens on Solana
The query below fetches the latest created tokens on the Solana blockchain, including details like newly created token addresses (which appear as the first entry in the Accounts array). We are querying the Solana Token Program with address `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA` and filtering for the latest created tokens using `Method: {in: ["initializeMint", "initializeMint2", "initializeMint3"]}`.
You can run the query [here](https://ide.bitquery.io/Get-newly-created-tokens-on-Solana0_3)
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }
Method: {
in: ["initializeMint", "initializeMint2", "initializeMint3"]
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Newly launched tokens on PumpFun, Raydium Launchpad, Meteora DBC, Heaven DEX, Bags, Jupiter studio, Moonit
Subscribe to newly launched tokens across multiple Solana launchpads and DEXs in a single subscription. The query filters for successful token-creation instructions from **PumpFun** (`create` / `create_v2`), **Raydium Launchpad** (`initialize_v2`), **Meteora DBC** (`initialize_virtual_pool_with_spl_token`), **Heaven DEX** (`create_standard_liquidity_pool`), **Bags** (Meteora DBC with Bags program), **Jupiter studio** (Meteora DBC with `jups` account), and **Moonit** (`tokenMint`).
[Run in Bitquery IDE](https://ide.bitquery.io/newly-launched-token-on-PumpFun-Raydium-Launchpad-Meteora-DBC-Heaven-DEX-Bags--Jupiter-studio-Moonit)
```graphql
subscription {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
any: [
{ Instruction: { Program: { Method: { in: ["create", "create_v2"] }, Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" } } } }
{ Instruction: { Program: { Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }, Method: { is: "initialize_v2" } } } }
{ Instruction: { Program: { Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }, Method: { is: "initialize_virtual_pool_with_spl_token" } } } }
{ Instruction: { Program: { Address: { is: "HEAVENoP2qxoeuF8Dj2oT1GHEnu49U5mJYkdeC8BAX2o" }, Method: { is: "create_standard_liquidity_pool" } } } }
{ Instruction: { Program: { Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }, Method: { is: "initialize_virtual_pool_with_spl_token" } }, Accounts: { includes: { Address: { is: "BAGSB9TpGrZxQbEsrEznv5jXXdwyP6AXerN8aVRiAmcv" } } } } }
{ Instruction: { Accounts: { includes: { Address: { endsWith: "jups" } } }, Program: { Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }, Method: { is: "initialize_virtual_pool_with_spl_token" } } } }
{ Instruction: { Program: { Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }, Method: { is: "tokenMint" } } } }
]
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
Transaction {
Signature
}
}
}
}
```
---
## Get Token Metadata using Metaplex of Newly Created Tokens
This query retrieves metadata for newly created tokens on Solana using the Metaplex program.
The metadata is returned is the **JSON** field, which includes fields such as name, symbol, uri, and more.
You can run the query [here](https://ide.bitquery.io/Get-newly-created-token-metadata-on-Solana)
You can also add the keyword `subscription` and track it in real-time.
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s"}, Method: {is: "CreateMetadataAccountV3"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Slot}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Name
Method
}
Data
}
Transaction {
Signature
Signer
}
}
}
}
```
## Number of Latest Created Tokens on Solana
The query below fetches the count of the latest created tokens on the Solana blockchain which were created using `initializeMint` method.
You can run the query [here](https://ide.bitquery.io/Count---Tokens-created-on-Solana)
```graphql
query MyQuery {
Solana(dataset: realtime, network: solana) {
Instructions(
where: {Instruction: {Program: {Address: {is: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"}, Method: {is: "initializeMint"}}}}
limit: {count: 10}
) {
count
Block {
latest: Time(maximum: Block_Time)
oldest: Time(minimum: Block_Time)
}
}
}
}
```
## Get Buyevent instruction details
Use the below query to get the `BuyEvent` instruction details. Test the query [here](https://ide.bitquery.io/BuyEvent).
```graphql
subscription {
Solana {
Instructions(where: {
Instruction: {
Program: {
Method: {
is: "BuyEvent"
}
}
}
}) {
Transaction {
Signature
}
Instruction {
Program {
Method
Name
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
}
}
}
```
---
## Track Real-time Token Burn on Solana
Receive real-time updates on token burn events on the Solana blockchain. The query below applies a filter to only include instructions where the Program Method includes `burn`, indicating that we filter instructions related specifically to token burning. You can run it [here](https://ide.bitquery.io/track-solana-token-burn-in-realtime_1)
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: { Program: { Method: { is: "burn" } } }
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Name
Method
}
Logs
}
Transaction {
Signature
Signer
}
}
}
}
```
### Latest token burns on Solana
The query below fetches the latest token burn instructions on Solana by filtering for the **Token Program** (`TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`) where the method includes `burn`. The **second address in the `Accounts` list is the token address being burnt**.
You can run the query [here](https://ide.bitquery.io/Latest-token-burns-on-Solana#).
```graphql
{
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Program: {
Method: { includes: "burn" }
Address: { is: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }
}
}
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Instruction {
Program {
Method
Name
Address
}
Accounts {
Address
}
Index
BalanceUpdatesCount
}
Transaction {
Signature
}
Block {
Time
Slot
}
}
}
}
```
### Balance updates for token burn instructions
The query below uses the **InstructionBalanceUpdates** API to fetch balance updates that occur when token burn instructions execute. It filters for the Token Program (`TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`) where the method includes `burn`, and returns balance deltas (Amount, PreBalance, PostBalance), currency details, and account info for each update.
You can run the query [here](https://ide.bitquery.io/solana-balance-updates-executing-burn-instruction).
```graphql
{
Solana {
InstructionBalanceUpdates(
limit: { count: 20 }
where: {
Transaction: {}
Instruction: {
Program: {
Method: { includesCaseInsensitive: "burn" }
Address: { is: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }
}
}
}
orderBy: { descending: Block_Time }
) {
BalanceUpdate {
Account {
Address
Owner
}
Amount
Currency {
Name
Symbol
MintAddress
Decimals
}
Index
AmountInUSD
PreBalance
PreBalanceInUSD
PostBalance
PostBalanceInUSD
}
Instruction {
Program {
Method
Address
}
}
Transaction {
Signature
FeePayer
}
Block {
Time
Height
}
}
}
}
```
### Alternative: Token Burn Tracking via TokenSupplyUpdates API
You can also track real-time token burn using the TokenSupplyUpdates API. Check out the [following example](https://ide.bitquery.io/token-burn-example-solana).
For more comprehensive token supply tracking, see our **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** documentation.
```graphql
{
Solana {
TokenSupplyUpdates(
where: { TokenSupplyUpdate: { Amount: { lt: "0" } } }
limit: { count: 20 }
orderBy: { descending: Block_Time }
) {
TokenSupplyUpdate {
Currency {
Name
Symbol
MintAddress
Decimals
}
Amount
AmountInUSD
PreBalance
PreBalanceInUSD
PostBalance
PostBalanceInUSD
Account {
Address
Owner
Token {
Owner
}
}
}
Block {
Time
Height
}
Instruction {
Program {
Address
Method
}
}
Transaction {
Signature
}
}
}
}
```
---
## Video Tutorials
### How to Track New Liquidity Pools Created on Solana Raydium & Orca DEX
### How to Get Newly Created Tokens on Solana Blockchain in Real-time
```
```
---
## Solana Instructions Balance Updates API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-instruction-balance-updates/
Solana Instructions Balance Updates API: fetch current and historical Solana balances with Bitquery GraphQL balance queries.
# Solana Instructions Balance Updates API
This cube attaches balance changes to the instruction that caused them. That makes it the
practical way to answer **"which currency moved, and how much"** for any program: the raw
`Instructions` cube returns account addresses and raw integers, while this one returns
`Currency` with symbol and decimals, a signed decimal `Amount`, and `AmountInUSD`.
## Latest Solana Instructions Balance Updates
The query below gives you balance update associated with a instruction invocation.
You can run the query [here](https://ide.bitquery.io/balance-updates)
```graphql
query {
Solana(dataset: realtime) {
InstructionBalanceUpdates(limit: {count: 10}) {
BalanceUpdate {
Amount
Currency {
MintAddress
Name
}
PreBalance
PostBalance
}
}
}
}
```
## Latest liquidity locks on Streamflow
Using the below query, you can retrieve latest liquidity locks made using streamflow. Test the query [here](https://ide.bitquery.io/Liquidity-lock-using-instructions-balance-update)
```graphql
{
Solana {
InstructionBalanceUpdates(limit: {count: 20}
where:{
BalanceUpdate:{
Currency:{
Native:false
}
Amount:{gt:"0"}
}
Instruction:{
Program:{
Method:{is:"create"}
Address:{is:"strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m"}
}
}
}
) {
BalanceUpdate {
Account {
Address
Owner
}
Amount
Currency {
Name
Symbol
MintAddress
Decimals
}
Index
Amount
AmountInUSD
PreBalance
PreBalanceInUSD
PostBalance
PostBalanceInUSD
}
Instruction {
Program {
Method
Address
}
}
Transaction {
Signature
FeePayer
}
Block {
Time
Height
}
}
}
}
```
## Stream balance updates for one program
:::caution This cube requires a filter when streaming
`InstructionBalanceUpdates` carries every balance change on Solana. An unfiltered subscription
is dropped by the server with `close code 1013 — client is not consuming messages fast enough`.
Always scope it to a program, token or account. See
[which cubes support subscriptions](/docs/subscriptions/which-cubes-stream/).
:::
Filtering by program gives you a live, currency-resolved feed of everything that program moves.
The example below streams Jupiter Z RFQ fills; swap the address for the program you care about.
```graphql
subscription ProgramBalanceUpdates {
Solana {
InstructionBalanceUpdates(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: { Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" } }
}
BalanceUpdate: { Currency: { Native: false } }
}
) {
Block { Time }
Transaction { Signature }
BalanceUpdate {
Amount
AmountInUSD
Currency { Symbol MintAddress Decimals }
Account { Address Token { Owner } }
}
}
}
}
```
Negative `Amount` is the sender's leg, positive is the receiver's. `Account.Token.Owner` tells
you which wallet each leg belongs to.
:::note Native SOL legs
`Currency: { Native: false }` keeps the SPL token legs and drops lamport noise. When one side
of a trade is native SOL, that side disappears from the results. Remove the filter to catch it,
but expect a native SOL leg to emit both a lamport movement and a WSOL token update for the
same value, so do not sum them.
:::
---
## Solana Jito Bundle API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-Jito-Bundle-api/
Jito bundles on Solana: track transfers to the Jito tip payment accounts and list the methods used by the Jito Merkle Upload Authority, with transfer details.
# Jito Bundle API
:::tip Need real-time Jito bundle data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Jito bundle swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Jito bundle data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section, we will show you how to access information about Jito Bundles using Bitquery APIs.
## Transfers to the Tip Payment Accounts
Jito foundation has Tip Payment Program that allows users to transfer tips to a set of
static public keys (compared to signing the transaction with the next N leaders) and ensure that
the incentives are distributed to the correct block leader, while enabling bundles to execute in upto 8 parallel threads.
The subscription that provides you the transfer data of one of these addresses is [writen below](https://ide.bitquery.io/Transfers-of-Tip-Payment-Accounts-on-Solana_1#).
To get the data of all addresses you can use the [this](https://ide.bitquery.io/Transfers-of-All-Tip-Payment-Accounts-on-Solana) query.
```graphql
subscription {
Solana {
Recieved: Transfers(
where: {
Transfer: {
Receiver: {
Address: { is: "HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe" }
}
}
}
) {
Transfer {
Currency {
Name
Symbol
MintAddress
}
AmountInUSD
Sender {
Address
}
}
Transaction {
Signature
}
Block {
Time
Slot
}
}
}
}
```
## List of methods for Jito Merkle Upload Authority
Jito Merkle Upload Autjority account is the block builder that uploads the root of Merkle
tree created by processing the MEV data in an offchain setting.
The [below query](https://ide.bitquery.io/All-Methods-for-Jito-Bundles-on-Solana_1) returns all the methods that are accessible to this account.
```graphql
{
Solana {
Instructions(
where: {
Transaction: {
Signer: { is: "GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib" }
}
}
) {
Instruction {
Program {
Address
Method
Name
}
}
count
}
}
}
```
## More information on Transfer Method
From the above query, we'll get a list of methods that the account is signing. One of those
method is "Transfer".
To get more info on the "Tranfer" method we can run the query given [below](https://ide.bitquery.io/Transfer-Function-Call-Event-Alert-for-Jito-Bundles-on-Solana_1).
```graphql
{
Solana {
Instructions(
limit: { count: 10 }
where: {
Transaction: {
Signer: { is: "GZctHpWXmsZC1YHACTGGcHhYxjdRqQvTpYkb9LMvxDib" }
Result: { Success: true }
}
Instruction: { Program: { Method: { is: "Transfer" } } }
}
) {
Instruction {
Program {
Address
Method
Name
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
}
}
}
}
Block {
Slot
Time
}
Transaction {
Signature
}
}
}
}
```
---
## Solana Jupiter API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-jupiter-api/
Solana Jupiter API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Includes filters and field selection tips.
# Solana Jupiter API - Live Swaps, Limit Orders, DEX Aggregator Data
:::tip Need real-time Jupiter data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Jupiter swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Jupiter data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Get ultra low latency Jupiter DEX Aggregator swaps, limit orders, routing data, and trading analytics from Jupiter API, Streams and Data Dumps.
The below GraphQL APIs and Streams are examples of data points you can get with Bitquery.
If you have any question on other data points reach out to [support](https://t.me/Bloxy_info)
Need zero-latency Jupiter data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
You may also be interested in:
- [Pump.fun APIs ➤](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Raydium APIs ➤](/docs/blockchain/Solana/Solana-Raydium-DEX-API/)
- [Orca APIs ➤](/docs/blockchain/Solana/solana-orca-dex-api/)
- [Serum APIs ➤](/docs/blockchain/Solana/Solana-OpenBook-api/)
- [Solana RFQ API ➤](/docs/blockchain/Solana/solana-rfq-api/): Jupiter Z (`order_engine`) fills, which are in DEX trade data from 29 September 2026, and Jupiter Limit Order v2, which is not
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
---
### Table of Contents
### 1. Jupiter Swaps & Trading Data
- [Track Latest Swaps on Jupiter ➤](#track-latest-swaps-on-jupiter)
- [Monitor Jupiter Swap Activity ➤](#monitor-jupiter-swap-activity)
### 2. Jupiter Limit Orders
- [Track Latest Created Limit Orders ➤](#track-latest-created-limit-orders-on-jupiter)
- [Monitor Cancel Limit Orders ➤](#track-latest-cancel-limit-order-transactions-on-jupiter)
- [Track Cancel Expired Orders ➤](#track-latest-cancel-expired-limit-order-transactions-on-jupiter)
### 3. [Video Tutorials](#video-tutorials)
## Jupiter Swaps & Trading Data
### Track Latest Swaps on Jupiter
Get real-time Jupiter aggregator swap data including tokens involved, routing paths, and account details.
We monitor Jupiter's program address `JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4` for `sharedAccountsRoute` instructions to track swap activity.
The query returns tokens involved in swaps, source and destination addresses, and routing information.
[Jupiter Latest Swaps — Stream ➤](https://ide.bitquery.io/Tokens-involved-in-Jupiter-swap-source-address-destination-address-DEX-involved_2#)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4" }
Method: { is: "sharedAccountsRoute" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Program {
Method
AccountNames
Address
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
}
}
}
}
```
### Monitor Jupiter Swap Activity
Track comprehensive Jupiter swap data including token details, account information, and routing paths for advanced analytics.
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4" }
Method: { is: "sharedAccountsRoute" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Program {
Method
AccountNames
Address
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
}
}
}
}
```
## Jupiter Limit Orders
### Track Latest Created Limit Orders on Jupiter
This stream shows each new Jupiter limit order as it is created, with its tokens and maker address.
The query filters Jupiter's order program `jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu` for `initializeOrder` calls.
The query returns input/output mint addresses, maker addresses, reserve addresses, and order configuration details.
[Jupiter Limit Order Creation — Stream ➤](https://ide.bitquery.io/Latest-created-Limit-Order-on-Jupiter-in-realtime#)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "initializeOrder" }
Address: { is: "jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
InternalSeqNumber
Index
Logs
Program {
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Block {
Time
}
}
}
}
```
### Track Latest Cancel Limit Order Transactions on Jupiter
Each cancelled order streams in with its maker and the tokens involved.
The query uses the same program, `jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu`, filtered to `cancelOrder` calls.
The query returns input mint addresses, maker addresses, reserve addresses, and cancellation details.
[Jupiter Limit Order Cancellation — Stream ➤](https://ide.bitquery.io/Latest-Cancel-Limit-Order-Transactions-on-Jupiter-in-realtime#)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "cancelOrder" }
Address: { is: "jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
InternalSeqNumber
Index
Logs
Program {
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Block {
Time
}
}
}
}
```
### Track Latest Cancel Expired Limit Order Transactions on Jupiter
Orders closed after they expired show up here, with the transaction and its accounts.
This time the filter is `cancelExpiredOrder`.
The query returns transaction signatures, account details, and program arguments for expired order cancellations.
[Jupiter Expired Order Cancellation — Stream ➤](https://ide.bitquery.io/Latest-Cancel-Expired-Order-Transactions-on-Jupiter-in-realtime_1#)
Click to expand GraphQL query
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "cancelExpiredOrder" }
Address: { is: "jupoNjAxXgZ4rjzxzPMP4oxduvQsQtZzyknqvzYNrNu" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
AncestorIndexes
BalanceUpdatesCount
CallPath
CallerIndex
Data
Depth
ExternalSeqNumber
InternalSeqNumber
Index
Logs
Program {
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
}
Block {
Time
}
}
}
}
```
## Video Tutorials
### Video Tutorial | How to Track Swaps on Jupiter Aggregator on Solana in Realtime
### Video Tutorial | How to Track Jupiter Limit Order Creation and Cancellation
---
## Solana Jupiter Studio API
URL: https://docs.bitquery.io/docs/blockchain/Solana/jupiter-studio-api/
Solana Jupiter Studio API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Covers archive history and realtime data.
# Jupiter Studio API - Live Token Launches, Trades, OHLC, Migration Data
:::tip Need real-time Jupiter Studio data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Jupiter Studio data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Get ultra low latency Jupiter Studio launchpad data, token trades, OHLC, migration tracking, and Meteora DBC analytics from Jupiter Studio API, Streams and Data Dumps.
The examples below cover launches, trading activity, migration events and Meteora Dynamic Bonding Curve data.
The below GraphQL APIs and Streams are examples of data points you can get with Bitquery.
If you have any question on other data points reach out to [support](https://t.me/Bloxy_info)
Need zero-latency Jupiter Studio data? [Read about our Shred Streams and Contact us for a Trial](/docs/streams/real-time-solana-data/).
You may also be interested in:
- [Jupiter API ➤](/docs/blockchain/Solana/solana-jupiter-api/)
- [Pump.fun APIs ➤](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
- [Meteora APIs ➤](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)
- [Raydium APIs ➤](/docs/blockchain/Solana/Solana-Raydium-DEX-API/)
:::note
Launches here are created and traded on Meteora DBC, so each one follows the lifecycle of a Meteora DBC mint.
:::
:::caution Launches here are sparse
Meteora DBC is busy, but most of that flow comes from other launchpads. Very few "jups" mints trade in a given week, so the realtime examples below return rows only while one is actively trading, and the per-trade price queries need a mint that traded in the last day or so. For anything older, read `dataset: archive` as the volume example does, or take the last 30 days from the [Trading cube](/docs/trading/crypto-trades-api/trades-api/). The example mints on this page are kept because they show the shape of the data; swap in a current mint before expecting live rows.
:::
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
---
### Table of Contents
### 1. Jupiter Studio Trading & Market Data
- [Track trades in real time ➤](#track-trades-in-real-time)
- [Get the latest price ➤](#get-the-latest-price)
- [OHLC candles ➤](#ohlc-candles)
- [Get Trading Volume & Analytics ➤](#get-trading-volume--analytics)
### 2. Launches and migration
- [Track the latest launches ➤](#track-the-latest-launches-on-meteora-dbc)
- [Monitor migrations ➤](#monitor-migrations)
- [Check migration status ➤](#check-migration-status)
### 3. Jupiter Studio Trader Insights
- [Get the top traders ➤](#get-the-top-traders)
## Jupiter Studio Trading & Market Data
### Track trades in real time
This streams every fill on Meteora's Dynamic Bonding Curve as it confirms, with both sides of the trade, the accounts involved and the transaction.
Launches from this platform end in "jups" and trade on the Meteora DBC program `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`.
The query returns detailed trade information including currency details, amounts, prices, and account addresses.
[Stream these trades ➤](https://ide.bitquery.io/trades-of-jup-studio-tokens-on-meteora-dbc-in-realtime)
Click to expand GraphQL query
```graphql
subscription {
Solana {
DEXTrades(
where: {
any: [
{
Trade: { Buy: { Currency: { MintAddress: { endsWith: "jups" } } } }
}
{
Trade: { Sell: { Currency: { MintAddress: { endsWith: "jups" } } } }
}
]
Trade: {
Dex: {
ProgramAddress: {
is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
### Track the latest launches on Meteora DBC
Monitor real-time Jupiter Studio token pool creations on Meteora Dynamic Bonding Curve with comprehensive launch details including token metadata, creator addresses, and pool configuration.
We track Meteora DBC program address `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` for `initialize_virtual_pool_with_spl_token` instructions.
The query returns token details, account information, program arguments, and transaction specifics for new Jupiter Studio token launches.
[Stream new launches ➤](https://ide.bitquery.io/jup-studio-token-creations-on-meteora-DBC)
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Accounts:{includes:{Address:{endsWith:"jups"}}}
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: {
Result: { Success: true }
}
}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
## Launches and migration
### Monitor migrations
Track real-time Jupiter Studio token migrations from Meteora Dynamic Bonding Curve to Meteora DEX with comprehensive migration details and transaction information.
We monitor Meteora DBC program address `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` for migration instructions including `migrate_meteora_damm` and `migration_damm_v2`.
The query returns token details, account information, and migration transaction specifics for Jupiter Studio tokens.
[Stream migrations ➤](https://ide.bitquery.io/jup-studio-token-migrations-from-Meteora-DBC-to-Meteors-DEX_1)
Click to expand GraphQL query
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Accounts: {includes: {Address: {endsWith: "jups"}}}, Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
```
### Check migration status
Check if specific Jupiter Studio tokens have migrated from Meteora DBC to Meteora DEX with detailed migration history and transaction information.
[Check migration status ➤](https://ide.bitquery.io/Check-if-these-jup-tokens-tokens-have-migrated-from-Meteora-DBC)
Click to expand GraphQL query
```graphql
query MyQuery($tokenAddresses: [String!]) {
Solana {
Instructions(
orderBy:{descending:Block_Time}
where: {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}, Accounts: {includes: {Address: {in: $tokenAddresses}}}}, Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Token {
ProgramId
Owner
Mint
}
IsWritable
Address
}
Program {
Parsed
Name
Method
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Type
Name
}
Address
AccountNames
}
}
Transaction {
Fee
FeeInUSD
FeePayer
Signature
}
}
}
}
{
"tokenAddresses":["CEVuiDHBxUeuuwvLugKqZpRpNtv5ejaQ1wKm2qzyjups","3Po3offygJjPg4cQpvc1AVT9JsYXyUapN2EKgFUbjups"]
}
```
### Get the latest price
Get the most recent price data for a specific Jupiter Studio token trading on Meteora Dynamic Bonding Curve with comprehensive price information.
[Run the latest-price query ➤](https://ide.bitquery.io/latest-price-of-a-jup-studio-token-on-meteora-dbc)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}}, Currency: {MintAddress: {is: "3Po3offygJjPg4cQpvc1AVT9JsYXyUapN2EKgFUbjups"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
Currency{
Name
Symbol
MintAddress
}
}
}
}
}
```
### OHLC candles
Get comprehensive OHLC (Open, High, Low, Close) data for Jupiter Studio tokens trading on Meteora DBC with volume analysis and price movement insights.
:::note
Use this API as a query only, not as a subscription websocket, as aggregates and time intervals don't work well with subscriptions.
:::
[Run the OHLC query ➤](https://ide.bitquery.io/Jupiter-studio-OHLC-API)
Click to expand GraphQL query
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "3Po3offygJjPg4cQpvc1AVT9JsYXyUapN2EKgFUbjups"}}, Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Dex: {ProgramAddress: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}}, 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 Trading Volume & Analytics
This sums traded, buy and sell volume for a Jupiter Studio token on Meteora's bonding curve. It reads the `archive` dataset, because the example window predates the roughly seven days the chain-level `realtime` slice keeps. Note that Solana `archive` and `combined` return about a fifth fewer trades than `realtime` over a window both cover, so treat these totals as a floor, and read the last 30 days from the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) when they have to be exact.
[Run the volume query ➤](https://ide.bitquery.io/Get-trading-volume-buy-volume-sell-volume-of-a-jup-studio-token)
Click to expand GraphQL query
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Block: {Time: {since: "2025-07-18T09:00:00Z", till: "2025-07-19T00:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "3Po3offygJjPg4cQpvc1AVT9JsYXyUapN2EKgFUbjups"}}, Side: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}, Dex: {ProgramAddress: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}}}}
) {
Trade {
Currency {
MintAddress
Decimals
}
Side {
Currency {
Name
MintAddress
}
}
}
traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
traded_volume: sum(of: Trade_Amount)
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}}}}
)
}
}
}
```
## Jupiter Studio Trader Insights
### Get the top traders
Get comprehensive trader analytics for Jupiter Studio tokens including top traders by volume, buy/sell activity, and USD trading volume rankings.
:::note
Use this API as a query only, not as a subscription websocket, because aggregates don't work with subscriptions and will return incorrect results.
:::
[Run the top-traders query ➤](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-jup-studio-Token-on-Meteora-DBC)
Click to expand GraphQL query
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
```json
{
"token": "3Po3offygJjPg4cQpvc1AVT9JsYXyUapN2EKgFUbjups"
}
```
---
## Solana Lifinity DEX API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-Lifinity-dex-api/
Query Lifinity on Solana with Bitquery GraphQL: real-time trades, latest token prices, OHLC candles and the top traders of any token on the DEX.
# Lifinity DEX API
:::tip Need real-time Lifinity data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Lifinity swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Lifinity data older than ~30 days**, raw per-swap detail, or call / event context.
Lifinity trades ship as part of the [Solana DEX API](https://bitquery.io/products/solana-dex-api), one schema across all major Solana venues.
:::
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## Lifinity Trades in Real-Time
This streams a message for every new trade on the venue, carrying the buy and sell sides, the block and the transaction.
You can run the query [here](https://ide.bitquery.io/Real-time-trades-on-Lifinity-DEX-on-Solana_4)
```graphql
subscription {
Solana {
DEXTrades(
where: { Trade: { Dex: { ProtocolFamily: { is: "Lifinity" } } } }
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Latest Price of a Token on Lifinity
This returns the most recent trade for a token here, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest token price](https://ide.bitquery.io/live-price-of-token-on-lifinity).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProtocolFamily: {is: "Lifinity"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Lifinity OHLC API
If you want to get OHLC data for any specific currency pair on Lifinity, you can use this api. Only use [this API](https://ide.bitquery.io/Lifinity-OHLC-for-specific-pair_1) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProtocolFamily: {is: "Lifinity"}}, 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 the Top Traders of a specific Token on Lifinity DEX
This ranks the wallets trading one token on the venue, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on Lifinity](https://ide.bitquery.io/top-traders-of-a-token-on-lifinity)
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProtocolFamily: {is: "Lifinity"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
}
```
## Get trading volume, buy volume, sell volume of a token
This sums traded, buy and sell volume for a token on the venue. It reads the `archive` dataset because this program's trading is historical rather than current; run the latest-trade query above to see how recent the newest row is. Solana `archive` and `combined` return about a fifth fewer trades than `realtime` over a window both cover, so treat these totals as a floor. Open it in the [Bitquery IDE: trade volume](https://ide.bitquery.io/trade_volume_lifinity).
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Block: {Time: {since: "2025-03-10T07:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProtocolFamily: {is: "Lifinity"}}}}
) {
Trade {
Currency {
MintAddress
Decimals
}
Side {
Currency {
Name
MintAddress
}
}
}
traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
traded_volume: sum(of: Trade_Amount)
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}}}}
)
}
}
}
```
## Volatility of a Pair on Lifinity
Volatility is an important factor in trading world as it determines the fluctuation in price that implies the possibility of profit and risk of loss. Lesser volatility denotes that the pair is stable.
Open the [Bitquery IDE: pair volatility](https://ide.bitquery.io/Volatility-of-WSOL-USDC-Pair-on-Lifinity-Dex-on-Solana) to read volatility for a pair over the last 24 hours.
```graphql
query Volatility {
Solana {
DEXTrades(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Lifinity" } }
Buy: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Sell: {
Currency: {
MintAddress: {
is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
}
Block: { Time: { after: "2025-03-18T00:00:00Z" } }
}
) {
volatility: standard_deviation(of: Trade_Buy_Price)
}
}
}
```
---
## Solana Logs API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-logs/
Solana logs: find instructions by matching log messages, filter them with like and not-like conditions, and search program logs for a keyword via GraphQL.
# Solana Logs API
Solana Logs API helps you filter program instruction logs using regular expressions.
## Finding Instructions with Log Matching
The Solana Logs API allows you to search for specific instructions based on log content that matches exact phrases. For example, to find logs related to 'AnchorError' with a specific error code and message
You can find the query [here](https://ide.bitquery.io/SlippageToleranceExceeded#)
```graphql
{
Solana {
Instructions(
limit: {count: 1}
where: {Instruction: {Logs: {includes: {is: "Program log: AnchorError occurred. Error Code: SlippageToleranceExceeded. Error Number: 6001. Error Message: Slippage tolerance exceeded."}}}}
) {
Instruction {
Accounts {
Address
}
Data
Index
Logs
ExternalSeqNumber
Program {
Json
AccountNames
Method
Name
Arguments {
Name
Type
}
}
Index
}
Transaction {
Result {
ErrorMessage
}
}
}
}
}
```
## Filtering Instructions using Not Like Filter
To exclude instructions containing specific log phrases such as 'AnchorError' you can use the `notLike` filter.
You can find the query [here](https://ide.bitquery.io/Not-Anchor-Error-Solana-Logs)
```graphql
{
Solana {
Instructions(
limit: {count: 1}
where: {Instruction: {Logs: {includes: {notLike: "Program log: AnchorError occurred."}}}}
) {
Instruction {
Accounts {
Address
}
Data
Index
Logs
ExternalSeqNumber
Program {
Json
AccountNames
Method
Name
Arguments {
Name
Type
}
}
Index
}
Transaction {
Result {
ErrorMessage
}
}
}
}
}
```
## Finding Instructions using Like Filter
To find instructions based on logs that contain specific patterns or keywords, such as an invoke log, you can use the `like` filter.
```graphql
{
Solana {
Instructions(
limit: {count: 1}
where: {Instruction: {Logs: {includes: {like: "Program Vote111111111111111111111111111111111111111 invoke [1]"}}}}
) {
Instruction {
Accounts {
Address
}
Data
Index
Logs
ExternalSeqNumber
Program {
Json
AccountNames
Method
Name
Arguments {
Name
Type
}
}
Index
}
Transaction {
Result {
ErrorMessage
}
}
}
}
}
```
## Searching Logs using a Particular Keyword
To find instructions based on logs that contain specific patterns or keywords, such as an ZETA market log, you can use the `includes` filter which searches for the presence of the keyword as a whole in the log.
You can run the query [here](https://ide.bitquery.io/Solana-Zeta-Market-logs)
```graphql
{
Solana {
Instructions(
where: {Instruction: {Logs: {includes: {includes: "ZETA"}}}}
limit: {count: 10}
) {
Transaction {
Signature
}
Instruction {
Logs
}
}
}
}
```
---
## Solana Moonshot API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Moonshot-API/
Solana Moonshot API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Copy GraphQL snippets for production apps.
# Moonit API
:::tip Need real-time Moonit data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Moonit data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section we will see how to get real-time data on Moonit trades, transactions and wallet updates. Similarly you can get [pump.fun data here](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/)
:::note
`Trade Side Account` field will not be available as aggregates in Archive and Combined Datasets
:::
## Moonit Trades in Real-Time
The below query gets real-time information whenever there's a new trade on the Moonshot including program method called , buy and sell details, details of the currencies involved, and the transaction specifics like signature.
You can run the query [here](https://ide.bitquery.io/Moonshot-DEX-Trades_2)
```graphql
subscription MyQuery {
Solana {
DEXTrades(
where: {
Trade: { Dex: { ProtocolFamily: { is: "Moonshot" } } }
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Program {
Method
}
}
Trade {
Dex {
ProtocolFamily
ProtocolName
}
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
}
}
}
}
```
## Get newly created Moonit tokens and their Metadata
Now you can track the newly created Moonit Tokens along with their metadata and supply. `PostBalance` will give you the current supply for the token. Check the query [here](https://ide.bitquery.io/Get-newly-created-Moonshot-tokens-with-metadata#)
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
) {
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
```
## Track New Token Creation on Moonit
[Here](https://ide.bitquery.io/Track-new-token-launches-on-Moonshot-in-realtime) is the subscription to get the notification of new token creation event on Moonit. Newly Minted Token Address will be 4th address in the Accounts array. You can also see the Name, Symbol, Supply and URI of the newly minted token in the arguments.
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Method: { is: "tokenMint" }
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
Transaction {
Signature
}
}
}
}
```
## Get all the instructions of Moonit
Below query will get you all the instructions that the Moonit Program has. You can test the API [here](https://ide.bitquery.io/instruction-invocation-count-in-last-10-hours).
```graphql
query MyQuery {
Solana {
Instructions(
where: {Transaction: {Result: {Success: true}}, Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}}}}
) {
Instruction {
Program {
Method
}
}
count
}
}
}
```
## Track Moonit Token Migrations to Raydium or Meteora in Realtime
Using above `get all instructions` api, you will figure out that there is a instruction `migrate` whose invocations migrate the Moonit Token to Raydium and Meteora Dexs respectively.
Thats why we have filtered for these 2 instructions in the below API, and tracking these.
Test out the API [here](https://ide.bitquery.io/Track-Moonit-Token-Migrations-to-Raydium-and-Meteora-in-realtime).
```graphql
subscription MyQuery {
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "migrateFunds"}}}, Transaction: {Result: {Success: true}}}
) {
Block{
Time
}
Instruction {
Program {
Method
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
}
Type
Name
}
Name
}
Accounts {
Address
IsWritable
Token {
ProgramId
Owner
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Track Moonit, LetsBonk.fun, Raydium Launchlab, Boop.fun and Meteora DBC Token Migrations in a single subscription
Use this single subscription to stream real-time token migration events across Boop.fun, Raydium Launchlab, Meteora DBC, and Moonshot/Moonit. It filters by the respective program IDs and migration methods, returning block time, program details, involved accounts, and transaction signatures as events occur.
Try out the [API](https://ide.bitquery.io/Raydium-Launchlab-Meteora-DBC-BoopFun-Moonshot-LetsBonkfun-token-migrations-in-realtime_2) here on IDE.
```graphql
subscription{
Solana {
Instructions(
where: {any: [{Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {is: "initialize_v2"}}}}, {Instruction: {Program: {Address: {is: "boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4"}, Method: {is: "graduate"}}}}, {Instruction: {Program: {Address: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}, Method: {is: "migrateFunds"}}}}, {Instruction: {Program: {Address: {is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN"}, Method: {in: ["migrate_meteora_damm", "migration_damm_v2"]}}}}, {Instruction: {Program: {Address: {is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"}, Method: {in: ["migrate_to_amm", "migrate_to_cpswap"]}}, Accounts: {includes: {Address: {is: "FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1"}}}}}], Transaction: {Result: {Success: true}}}
) {
Block {
Time
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Launchlab
# boop8hVGQGqehUK2iVEMEnMrL5RbjywRzHKBmBE7ry4 - boop.fun
# MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG - Moonshot/Moonit
# dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN - Meteora DBC
# LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj - Program Address and FfYek5vEz23cMkWsdJwG2oa6EphsvXSHrGpdALN4g6W1(letsbonk.fun platform config addr) is present in Accounts array then its Letsbonk.fun migration
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
Method
Name
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Track New Token Creation on Multiple Platforms : Moonit and Pumpfun
In this query we use the program addresses of Moonit and Pumpfun and creation methods to track token creation in realtime. We use the `in` filter to pass multiple addresses.
You can run the query [here](https://ide.bitquery.io/new-token-launches-on-Pump-Fun--Moonshot-in-realtime)
```graphql
subscription {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Program: {
Method: { in: ["tokenMint", "create"] }
Address: {
in: [
"6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P"
"MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
]
}
}
}
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
Method
Name
}
}
Transaction {
Signature
}
}
}
}
```
## Get the Creator of a Moonit Token
The below query fetches the details of Token Creator of a specific token `D68YAXPZdGEBre4Esg61W7HbcRJFN7rmroKzGPXDR87T`.
Here you can find [saved query](https://ide.bitquery.io/Moonshot-token-creator).
```graphql
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Accounts: { includes: { Address: { is: "token mint address" } } }
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
) {
Transaction {
Signer
Signature
}
Instruction {
Accounts {
Address
}
}
}
}
}
```
## Top Token Creators on Moonit
The below query fetches details about token creators filtering using the `MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG` program address and `tokenMint` method.
The `descendingByField: "tokens_count":` Orders the results in descending order based on the count of tokens created.
You can run the query [here](https://ide.bitquery.io/Top-Moonshot-token-creators)
```graphql
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
orderBy: { descendingByField: "tokens_count" }
) {
tokens_count: count
Transaction {
Signer
}
}
}
}
```
## Get OHLC Data of a Token on Moonit
The below query gets OHLC data of the specified Token `A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk` for 1 minute time interval for last 10 minutes on Moonit DEX.
You can run the query [here](https://ide.bitquery.io/OHLC-for-a-token-on-Moonshot_1)
Note - You can only use this API using `query` keyword, using this API as `subscription` will give wrong results because aggregation and interval don't work correctly together in `subscription`.
```graphql
{
Solana {
DEXTradeByTokens(
limit: { count: 10 }
orderBy: { descendingByField: "Block_Timefield" }
where: {
Trade: {
Currency: { MintAddress: { is: "token mint address" } }
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
PriceAsymmetry: { lt: 0.1 }
}
}
) {
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
}
}
}
```
## Track Price of a Token in Realtime on Moonit
The below query gets real-time price of the specified Token `A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk` on the Moonit DEX.
You can run the query [here](https://ide.bitquery.io/Price-of-a-Moonshot-token)
```graphql
subscription MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
Currency: { MintAddress: { is: "token mint address" } }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Trade {
Currency {
MintAddress
Name
Symbol
}
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Side {
Currency {
MintAddress
Symbol
Name
}
}
Price
PriceInUSD
}
Transaction {
Signature
}
}
}
}
```
## Get the Token Holders of a specific Moonit Token
The below query gets top 10 token holders of the specified Token `A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk` on the Moonit DEX. Keep in mind you can use this API only as a query and not a subscription websocket because aggregates don't work with subscription and you will end up getting wrong results.
You can run the query [here](https://ide.bitquery.io/Top-10-holders-for-a-Moonshot-token)
```graphql
query MyQuery {
Solana {
BalanceUpdates(
limit: { count: 10 }
orderBy: { descendingByField: "TotalHolding" }
where: {
BalanceUpdate: {
Currency: { MintAddress: { is: "token mint address" } }
}
}
) {
BalanceUpdate {
Currency {
Name
MintAddress
Symbol
}
Account {
Address
Token {
Owner
}
}
}
TotalHolding: sum(of: BalanceUpdate_Amount, selectWhere: { gt: "0" })
}
}
}
```
## Get the Trading Volume of a specific Token on Moonit DEX
The below query gets the Trading volume of the specified Token `A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk` on the Moonit DEX in the past 1 hour. You will have to change the time in this `Block: {Time: {since: "2024-08-13T08:05:00Z"}}` when you try the query yourself. Keep in mind you can use this API only as a query and not a subscription websocket because aggregates don't work with subscription and you will end up getting wrong results.
You can run the query [here](https://ide.bitquery.io/trading-volume-of-a-token-Moonshot_1)
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: "token mint address" } }
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
}
Block: { Time: { since: "2024-08-13T08:05:00Z" } }
Transaction: { Result: { Success: true } }
}
) {
Trade {
Currency {
Name
Symbol
MintAddress
}
Dex {
ProtocolName
ProtocolFamily
}
Side {
Currency {
Name
Symbol
MintAddress
}
}
}
TradeVolume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## Get the Top Traders of a specific Token on Moonit DEX
The below query gets the Top Traders of the specified Token `A1XqfcD1vMEhUNwEKvBVRWFV48ZLDL4oheFVCPEcM3Vk` which was launched on Moonit. Keep in mind you can use this API only as a query and not a subscription websocket because aggregates don't work with subscription and you will end up getting wrong results.
You can run the query [here](https://ide.bitquery.io/Top-traders-with-their-bought-sold-and-total-volume_3)
```graphql
query TopTraders {
Solana {
DEXTradeByTokens(
orderBy: { descendingByField: "volume" }
limit: { count: 5 }
where: {
Trade: {
Currency: { MintAddress: { is: "token mint address" } }
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Trade {
Dex {
ProtocolName
ProtocolFamily
ProgramAddress
}
Currency {
Symbol
Name
MintAddress
}
Account {
Address
}
}
bought: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: sell } } } }
)
sold: sum(
of: Trade_Side_AmountInUSD
if: { Trade: { Side: { Type: { is: buy } } } }
)
volume: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
## All tokens created by an address
To get all Moonit tokens created by address use [this query](https://ide.bitquery.io/Moonshot-tokens-created-by-a-specific-address).
```graphql
query MyQuery {
Solana(network: solana) {
Instructions(
where: {
Transaction: {
Signer: { is: "BGfwxRRcAps1WrJQQRsgWHzvLWVBpRRnfbUxUNGGQ1xV" }
}
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
) {
Transaction {
Signer
Signature
}
Instruction {
Accounts {
Address
}
}
}
}
}
```
## Moonit Token first and last price
To check the first and last price to calculate the price change in the last X minutes, use [this query](https://ide.bitquery.io/Moonshot-coins-with-price--mc-with-limit-and-delta-from-10-min-back-simple).
In this query, the `from` time should be when you need the price change. For example, if you want a price change for the last 10 minutes, then `from` should be 10 minutes before now.
```graphql
query MoonshotRecentTrades($from: DateTime) {
Solana {
DEXTradeByTokens(
limit: {count: 100}
orderBy: {descendingByField: "Trade_lastPrice_maximum"}
where: {Block: {Time: {since: $from}},
Trade: {Currency: {Native: false},
Dex: {ProgramAddress: {is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Market {
MarketAddress
}
Currency {
Symbol
Name
MintAddress
}
lastPrice: Price(maximum: Block_Slot)
prePrice: Price(minimum: Block_Slot)
}
}
}
}
{
"from": "2024-08-13T09:10:00Z"
}
```
## Get Pools details for Moonit token
To get pool details (Market address) for Moonit token use [this query](https://ide.bitquery.io/Market-info-on-Moonshot-by-tokens).
```graphql
query ($tokens: [String!]) {
Solana {
DEXTradeByTokens(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
Currency: { MintAddress: { in: $tokens } }
}
}
) {
count
Trade {
Market {
MarketAddress
}
Currency {
MintAddress
Symbol
}
}
}
}
}
```
```json
{
"tokens": [
"token mint address"
]
}
```
## OHLC price in SOL and USD and Volume
To get OHLC price in SOL and USD and to get volume use [following query](https://ide.bitquery.io/ohlc-in-sol-with-usd-price_4).
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { ascendingByField: "Block_Time" }
where: {
Trade: {
Currency: { MintAddress: { is: "token mint address" } }
Dex: {
ProgramAddress: {
is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG"
}
}
PriceAsymmetry: { lt: 0.1 }
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time(interval: { count: 5, in: minutes })
}
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Currency {
Symbol
Name
MintAddress
}
open: Price(minimum: Block_Slot)
close: Price(maximum: Block_Slot)
min: Price(maximum: Trade_Price)
max: Price(minimum: Trade_Price)
closeUsd: PriceInUSD(maximum: Trade_PriceInUSD)
}
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
```
---
## Solana NFT API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-nft/
Solana NFT API: track Solana NFT trades, ownership, and metadata with Bitquery GraphQL and streams. Covers archive history and realtime data.
# Solana NFT API
In this section we'll have a look at some examples using the Solana NFT API.
## Track Latest NFT Trades
The subscription query provided below fetches the most recent NFT trades on the Solana blockchain.
You can find the query [here](https://ide.bitquery.io/Latest-Solana-NFT-Trades). In this query you will also get failed transactions. To get only successful transactions, set `Transaction: {Result: {Success: true}}`
```graphql
subscription {
Solana {
DEXTradeByTokens(where: {Trade: {Currency: {Fungible: false}}}) {
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Currency {
Symbol
}
Amount
Side {
Currency {
Symbol
}
Amount
}
}
}
}
}
```
## Track all NFT balance updates across the Solana Ecosystem
The subscription query provided below fetches the real time nft balance updates of addressses across Solana Ecosystem. This query also gives us NFT balance of the wallets using `PreBalance` and `PostBalance`.
You can find the query [here](https://ide.bitquery.io/real-time-nft-balance-updates-across-solana-ecosystem)
```graphql
subscription {
Solana {
BalanceUpdates(
where: {BalanceUpdate: {Currency: {Fungible: false}}}
) {
BalanceUpdate {
Currency {
Name
MintAddress
TokenCreator {
Address
Share
}
}
Account {
Address
}
PreBalance
PostBalance
}
}
}
}
```
## Get Most Traded NFTs Recently
The subscription query provided fetches the most-traded NFTs in the last few hours. For Solana, only realtime information is available, so the aggregate might not be accurate beyond a few hours.
You can find the query [here](https://ide.bitquery.io/NFT-currencies-on-Solana-by-DEXes_1)
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "amt"}
where: {Trade: {Currency: {Fungible: false}}}
) {
amt: sum(of: Trade_Amount)
Trade {
Dex {
ProtocolName
ProtocolFamily
}
Currency {
Symbol
MintAddress
}
}
count
}
}
}
```
## Video Tutorial on How to Get NFT Trades, NFT Balance Updates and Top Traded NFTs Data on Solana
---
## Solana Openbook API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-OpenBook-api/
Query OpenBook v2 on Solana with Bitquery GraphQL: real-time trades, pair price averages, and every instruction including placeOrder and placeTakeOrder.
# OpenBook DEX API
:::tip Need real-time OpenBook data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered OpenBook swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical OpenBook data older than ~30 days**, raw per-swap detail, or call / event context.
OpenBook markets are covered by the [Solana DEX API](https://bitquery.io/products/solana-dex-api) alongside Raydium, Orca and Jupiter.
:::
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## OpenBook Trades in Real-Time
This streams a message for every new trade on the order book, carrying both sides of the fill, the venue that matched it and the block time.
Open it in the [Bitquery IDE: realtime order-book trades](https://ide.bitquery.io/Real-time-trades-on-OpenBook-DEX-on-Solana_1).
```graphql
subscription {
Solana {
DEXTrades(
where: { Trade: { Dex: { ProtocolFamily: { is: "OpenBook" } } } }
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Price Average of Pair on OpenBook
Open the [Bitquery IDE: average price over 24 hours](https://ide.bitquery.io/Average-Price-for-24-hours-of-a-token-on-OpenBook-DEX-on-Solana_1) to read the average price of a pair on a chosen day.
```graphql
query PriceAverage {
Solana {
DEXTrades(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Dex: { ProtocolFamily: { is: "OpenBook" } }
Sell: { Currency: { Symbol: { is: "USDC" } } }
Buy: { Currency: { Symbol: { is: "WSOL" } } }
}
Block: {
Time: {
after: "2024-06-03T00:00:00Z"
before: "2024-06-04T00:00:00Z"
}
}
}
) {
tokenPrice: average(of: Trade_Buy_Price)
}
}
}
```
## Get All Instructions of OpenBook v2
The Solana instructions API returns every instruction the v2 program executed.
Open it in the [Bitquery IDE: OpenBook v2 instructions](https://ide.bitquery.io/Instructions-of-OpenBookV2-Program).
```graphql
query MyQuery {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Program {
Method
}
}
count
}
}
}
```
## Listen to placeOrder, placeTakeOrder Instructions of OpenBook v2
This subscription follows transactions that place orders on v2, through the Solana instructions API. There is also a [video walkthrough on YouTube](https://www.youtube.com/watch?v=B-3w1t-tnwE).
Open it in the [Bitquery IDE: placeOrder and placeTakeOrder instructions](https://ide.bitquery.io/listen-to-placeOrder-placeTakeOrder-instruction-on-OpenBook-V2).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb" }
Method: { in: ["placeOrder", "placeTakeOrder"] }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
Parsed
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
}
}
}
}
}
```
## Listen to consumeEvents Instructions of OpenBook v2
This subscription follows `consumeEvents` transactions on v2. That instruction settles trade events and cancellations, updating the book so every filled order is accounted for. The same [video walkthrough](https://www.youtube.com/watch?v=B-3w1t-tnwE) covers it.
Open it in the [Bitquery IDE: consumeEvents instruction](https://ide.bitquery.io/consumeEvents-instruction-on-OpenBook-V2_3).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb" }
Method: { is: "consumeEvents" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Transaction {
Signature
}
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Method
Name
Parsed
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
}
}
}
}
}
}
```
## Latest Price of a Token on OpenBook
This returns the most recent trade for a token on the order book, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest token price](https://ide.bitquery.io/live-price-of-token-on-openbook).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProtocolFamily: {is: "OpenBook"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Currency {
MintAddress
}
Side {
Currency {
MintAddress
}
}
Price
PriceInUSD
}
}
}
}
```
## OpenBook OHLC API
If you want to get OHLC data for any specific currency pair on OpenBook, you can use this api. Only use [this API](https://ide.bitquery.io/OpenBook-OHLC-for-specific-pair) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Dex: {ProtocolFamily: {is: "OpenBook"}}, 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 the Top Traders of a specific Token on OpenBook DEX
This ranks the wallets trading one token on the venue, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on OpenBook](https://ide.bitquery.io/top-traders-of-a-token-on-openbook)
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProtocolFamily: {is: "OpenBook"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
}
```
## Get trading volume, buy volume, sell volume of a token
This reads the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. Markets here are quoted in USDC, so the example sums every USDC-quoted market on the venue, matching what the previous chain-level version measured. Filter `Token` as well to narrow it to one pair. Open it in the [Bitquery IDE: trade volume](https://ide.bitquery.io/trade_volume_openbook).
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { ProtocolFamily: { is: "OpenBook" }, Network: { is: "Solana" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
## Volatility of a Pair on OpenBook
Volatility is an important factor in trading world as it determines the fluctuation in price that implies the possibility of profit and risk of loss. Lesser volatility denotes that the pair is stable.
Open the [Bitquery IDE: token volatility](https://ide.bitquery.io/Volatility-of-USDC-on-OpenBook-Dex-on-Solana) to read volatility for a token over the last 24 hours.
```graphql
query Volatility {
Solana {
DEXTrades(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "OpenBook" } }
Sell: {
Currency: {
MintAddress: {
is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
}
Block: { Time: { after: "2025-03-18T00:00:00Z" } }
}
) {
volatility: standard_deviation(of: Trade_Buy_Price)
}
}
}
```
## Video Tutorial | How to Listen to OpenBook v2 Instruction Calls in Realtime - Bitquery API
---
## Solana Orbic API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Orbic-API/
Orbic DEX on Solana: stream real-time trades, get the latest price and a live price feed, OHLC candles, top traders and buy and sell volume of a token.
# Orbic API
:::tip Need real-time Orbic data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Orbic swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Orbic data older than ~30 days**, raw per-swap detail, or call / event context.
:::
## Orbic Trades in Real-Time
This streams a message for every new trade on the venue, carrying the buy and sell sides, the block and the transaction.
You can run the query [here](https://ide.bitquery.io/Real-time-trades-on-orbic-DEX-on-Solana#)
```graphql
subscription {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProgramAddress: {
is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"
}
}
}
}
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Latest Price of a Token on Orbic
This returns the most recent trade for a mint, with the price in the quote currency and in USD.
Open it in the [Bitquery IDE: latest price](https://ide.bitquery.io/latest-price-of-a-token-on-Orbic#).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Realtime Price feed of a Token on Orbic
The same filter as a subscription pushes a message on every new trade, giving a live price feed instead of a single reading.
Open it in the [Bitquery IDE: realtime price feed](https://ide.bitquery.io/Realtime-Price-feed-of-a-Token-on-Orbic#).
```graphql
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Orbic OHLC API
If you want to get OHLC data for any specific currency pair on Orbic, you can use this api. Only use [this API](https://ide.bitquery.io/Orbic-OHLC-API#) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}, 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 the Top Traders of a specific Token on Orbic DEX
This ranks the wallets trading one mint on the venue, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on Orbic](https://ide.bitquery.io/Get-the-Top-Traders-of-a-specific-Token-on-Orbic-DEX#)
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
```
## Get trading volume, buy volume, sell volume of a token
This sums traded, buy and sell volume for a mint on the venue. It reads the `archive` dataset because this program's trading is historical rather than current; run the latest-trade query above to see how recent the newest row is. Note that Solana `archive` and `combined` return about a fifth fewer trades than `realtime` over a window both cover, so treat these totals as a floor. Open it in the [Bitquery IDE: trade volume](https://ide.bitquery.io/Get-trading-volume-buy-volume-sell-volume-of-a-token_5#).
```graphql
query MyQuery {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {Block: {Time: {since: "2025-03-10T07:00:00Z"}}, Transaction: {Result: {Success: true}}, Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProgramAddress: {is: "obriQD1zbpyLz95G5n7nJe6a4DPjpFwa5XYPoNm113y"}}}}
) {
Trade {
Currency {
MintAddress
Decimals
}
Side {
Currency {
Name
MintAddress
}
}
}
traded_volume_USD: sum(of: Trade_Side_AmountInUSD)
traded_volume: sum(of: Trade_Amount)
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}}}}
)
}
}
}
```
---
## Solana Phoenix API
URL: https://docs.bitquery.io/docs/blockchain/Solana/Solana-Phoenix-api/
Query the Phoenix order book on Solana with Bitquery GraphQL: real-time trades, latest and streaming token prices, and OHLC candles for any pair.
# Phoenix DEX API
:::info Looking for Phoenix **Perpetuals**?
This page covers the Phoenix **spot** order book. For perpetual futures (orders, fills,
positions, realized PnL, liquidations, funding, mark price and open interest), see the
[**Phoenix Perpetuals API**](/docs/perpetuals/solana/phoenix-perpetuals-api), also
available as a [Kafka protobuf stream](/docs/streams/protobuf/chains/Solana-perpetual-protobuf).
Phoenix order-book data is available as a product. See the [Phoenix Trades API](https://bitquery.io/products/phoenix-trades) page for coverage and plans.
:::
:::tip Need real-time Phoenix data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Phoenix swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Phoenix data older than ~30 days**, raw per-swap detail, or call / event context.
:::
## Phoenix Trades in Real-Time
This streams a message for every new trade on the venue, carrying the buy and sell sides, the block and the transaction.
Open it in the [Bitquery IDE: realtime order-book trades](https://ide.bitquery.io/Real-time-trades-on-Phoenix-DEX-on-Solana_1).
```graphql
subscription {
Solana {
DEXTrades(
where: { Trade: { Dex: { ProtocolFamily: { is: "Phoenix" } } } }
) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Latest Price of a Token on Phoenix
This returns the most recent trade for a token here, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest token price](https://ide.bitquery.io/latest-price-of-token-on-phoenix).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProtocolFamily: {is: "Phoenix"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Realtime Price feed of a Token on Phoenix
The same filter as a subscription pushes a message on every new trade, giving a live price feed instead of a single reading.
Open it in the [Bitquery IDE: realtime price feed](https://ide.bitquery.io/realtime-price-of-token-on-phoenix).
```graphql
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProtocolFamily: {is: "Phoenix"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Phoenix OHLC API
For OHLC candles on a pair here, use [this endpoint](https://ide.bitquery.io/Phoenix-OHLC-for-specific-pair_1) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProtocolFamily: {is: "Phoenix"}}, 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 the Top Traders of a specific Token on Phoenix DEX
This ranks the wallets trading one token on the order book, USDC in the example. Run it as a plain request rather than a WebSocket subscription, because aggregates are recomputed per message on a subscription and the totals come back wrong. Open it in the [Bitquery IDE: top traders on Phoenix](https://ide.bitquery.io/top-traders-of-a-token-on-phoenix)
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProtocolFamily: {is: "Phoenix"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
```
## Get trading volume, buy volume, sell volume of a token
This reads the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. The example follows the WSOL/USDC market; swap the two addresses for the pair you want. Open it in the [Bitquery IDE: Phoenix trade volume](https://ide.bitquery.io/trade_volume_phoenix).
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { ProtocolFamily: { is: "Phoenix" }, Network: { is: "Solana" } }
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
## Volatility of a Pair on Phoenix
Volatility is an important factor in trading world as it determines the fluctuation in price that implies the possibility of profit and risk of loss. Lesser volatility denotes that the pair is stable.
Open the [Bitquery IDE: pair volatility](https://ide.bitquery.io/Volatility-of-WSOL-USDC-Pair-on-phoenix-Dex-on-Solana_1) to read volatility for a pair over the last 24 hours.
```graphql
query VolatilityonPhoenix {
Solana(dataset: realtime) {
DEXTrades(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Phoenix" } }
Buy: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Sell: {
Currency: {
MintAddress: {
is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
}
Block: {
Time: {
after: "2025-06-06T01:00:00Z"
before: "2025-06-06T02:00:00Z"
}
}
}
) {
volatility: standard_deviation(of: Trade_Buy_Price)
}
}
}
```
---
## Solana Photon API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-photon-api/
Track Photon-routed Solana trades with Bitquery GraphQL: latest trades by pair, trader-level rows with USD price, market cap and supply, plus live streams.
# Photon Solana API
:::tip Need real-time Photon-style 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**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) 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 Photon-style trader data older than ~30 days**, raw per-swap detail, or call / event context.
The queries below run on the same data that powers Photon-style terminals — the [Solana DEX API](https://bitquery.io/products/solana-dex-api) page covers venues, latency and plans.
:::
Photon is a routing aggregator on Solana that finds the best execution paths across multiple DEXs. To identify trades that were routed through Photon, we use their program address `BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW` in our queries.
This program address appears in the instruction data when Photon routes a trade, allowing us to filter and analyze only the trades that went through their routing system. By joining DEX trade data with instruction data containing this program address, we can accurately track Photon's routing activity and provide insights into their trade execution patterns.
:::note
`Trade Side Account` field will not be available for aggregate queries in Archive and Combined Datasets
:::
## Latest Trades Routed via Photon
This query retrieves the latest 100 trades that were routed through Photon on Solana.
The query uses a `joinInstructions` function to filter trades that specifically involved Photon's routing program (address: `BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW`). For more information about using joins in Bitquery APIs, see our [graphQL joins documentation](/docs/graphql/capabilities/joins/).
[Run Query](https://ide.bitquery.io/Trades-Executed-on-Photon)
```graphql
{
Solana {
DEXTrades(limit: {count: 100}, orderBy: {descending: Block_Time}) {
Trade {
Dex {
ProtocolName
}
Sell {
Currency {
Symbol
}
Amount
AmountInUSD
Account {
Address
}
Price
PriceInUSD
}
Buy {
Currency {
Symbol
}
Amount
AmountInUSD
Account {
Address
}
Price
PriceInUSD
}
}
Transaction {
Signature
}
Instruction {
ExternalSeqNumber
InternalSeqNumber
}
joinInstructions(
join: inner
Block_Slot: Block_Slot
Transaction_Signature: Transaction_Signature
where: {Instruction: {Program: {Address: {is: "BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW"}}}}
) {
Instruction {
Program {
Address
}
}
Transaction {
Signature
}
}
}
}
}
```
## Get Trade Transactions Of Photon For A Particular Pair
The query will get latest trades for a Solana pair executed via Photon
You can find the query [here](https://ide.bitquery.io/Trades-of-a-Pair-Executed-on-Photon)
```graphql
{
Solana {
DEXTrades(
limit: {count: 100}
orderBy: {descending: Block_Time}
where: {Trade: {Market:{MarketAddress:{is:"FsKeY7bWnGL3ucTVfWWWJZyGCqr1VGXbKVZWteUHPYzX"}}}}
) {
Trade {
Dex {
ProtocolName
}
Sell {
Currency {
Symbol
}
Amount
AmountInUSD
Account {
Address
}
Price
PriceInUSD
}
Buy {
Currency {
Symbol
}
Amount
AmountInUSD
Account {
Address
}
Price
PriceInUSD
}
Market {
MarketAddress
}
}
Transaction {
Signature
}
Instruction {
ExternalSeqNumber
InternalSeqNumber
}
joinInstructions(
join: inner
Block_Slot: Block_Slot
Transaction_Signature: Transaction_Signature
where: {Instruction: {Program: {Address: {is: "BSfD6SHZigAfDWSjzD5Q41jw8LmKwtmjskPH9XW1mrRW"}}}}
) {
Instruction {
Program {
Address
}
}
Transaction {
Signature
}
}
}
}
}
```
---
## Trader-Focused Trade APIs (with USD Price, Market Cap & Supply)
The queries below use the **[Trades cube](/docs/trading/crypto-trades-api/trades-api/)** (`Trading { Trades }`) which is trader-focused and provides reliable USD prices including for all tokens. See [DEXTrades vs DEXTradeByTokens vs Trades cube](/docs/cubes/dextrades-dextradebytokens-trading-trades) for when to use which.
### Get All DEX Trades on Solana With Price, Market Cap, and Supply
Stream **all Solana DEX trades** in real time with **USD price**, **market cap**, **FDV**, **circulating supply**, and **transaction fee** data. Filter by **`Pair.Market.Network: Solana`** to capture every swap across **Raydium**, **Orca**, **Jupiter**, **PumpSwap**, and other Solana DEXs in a single subscription.
You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/All-trades-on-Solana-with-Price-Marketcap-supply).
Click to expand GraphQL query
```graphql
subscription {
Trading {
Trades(where: { Pair: { Market: { Network: { is: "Solana" } } } }) {
Side
Supply {
MaxSupply
TotalSupply
FullyDilutedValuationUsd
CirculatingSupply
MarketCap
}
Trader {
Address
}
TransactionHeader {
Fee
FeePayer
Sender
To
Hash
Index
}
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Block {
Date
Time
Timestamp
}
Pair {
Currency {
Id
Name
Symbol
}
Market {
Address
Program
Network
}
QuoteCurrency {
Id
Name
Symbol
}
Token {
Address
Id
IsNative
Symbol
TokenId
Network
}
QuoteToken {
Address
Id
IsNative
Symbol
TokenId
Network
}
}
Price
PriceInUsd
}
}
}
```
### Top Traders by PnL for a Specific Pool (Last 30 Minutes)
Rank traders by **`PnL`** on one pool: filter **`Pair.Market.Address`**, last **30 minutes**, **`limit: 10`**, and **`orderBy`** **`PnL`** descending. Useful for **leaderboards**, **smart-money screens**, and **pool-specific trader analytics**.
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Traders-by-PnL-of-a-specific-pair#).
Click to expand GraphQL query
```graphql
{
Trading {
Trades(
limit: { count: 10 }
orderBy: [{ descendingByField: "PnL" }]
where: {
Block: { Time: { since_relative: { minutes_ago: 30 } } }
Pair: {
Market: {
Address: { is: "2axyccPzS7Ei57c7ESEq7tBpo4HxtpfCR9gKxh5uNUpu" }
}
}
}
) {
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" } })
}
}
}
```
---
## Video Tutorial | Photon API Tutorial: Track DEXTrades on Solana (2026)
---
## Solana RFQ API - Jupiter Z & Intent Settlement
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-rfq-api/
Query and stream Solana RFQ trades: Jupiter Z order_engine fills, quote expiry, maker spreads and tokenized-equity prices, over API and WebSocket.
# Solana RFQ API
In an RFQ (Request For Quote) trade there is no pool. The taker asks market makers for a
price off chain, a maker signs a firm quote, and the only thing that reaches the chain is a
settlement instruction that moves both sides of the trade at once.
:::info Jupiter Z and the large prop AMMs are in DEX trade data from 29 September 2026
From 15:06 UTC that day, `DEXTrades`, `DEXTradeByTokens` and the `Trading` cube include
Jupiter Z fills and swaps on Tessera V, HumidiFi, QuantumAMM and Scorch. Trades on these
venues from before that time are not in the trade tables.
Jupiter Limit Order v2, Mayan Swift, ZeroFi and 1inch Fusion still produce no trade rows.
:::
For volume and prices, start with
[RFQ trades in DEX trade data](#rfq-trades-in-dex-trade-data). The rest of the page works at
instruction level, for the detail the trade tables leave out: quote expiry, who paid gas, the
raw accounts, and the venues that are still not in trade data. Those sections use the
[Solana Instructions cube](/docs/blockchain/Solana/solana-instructions), the
[Transfers cube](/docs/blockchain/Solana/solana-transfers) and
[Instruction Balance Updates](/docs/blockchain/Solana/solana-instruction-balance-updates).
---
## Quickstart
Endpoint, auth header, and a request you can paste into a terminal right now.
```bash
curl -X POST https://streaming.bitquery.io/graphql \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $BITQUERY_TOKEN" \
-d '{"query":"{ Solana { Instructions(limit: {count: 3} orderBy: {descending: Block_Time} where: {Transaction: {Result: {Success: true}} Instruction: {Program: {Address: {is: \"61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH\"} Method: {is: \"fill\"}}}}) { Block { Time } Transaction { Signature } Instruction { Program { Arguments { Name Value { ... on Solana_ABI_BigInt_Value_Arg { bigInteger } } } } } } } }"}'
```
For streams, the same document works over WebSocket at
`wss://streaming.bitquery.io/graphql?token=YOUR_TOKEN` with the `graphql-ws` subprotocol.
See [generating a token](/docs/authorization/how-to-generate) and
[WebSocket authorization](/docs/authorization/websocket).
:::info Query window
Historical depth depends on your plan, so a
query with an old `since` date can come back empty even when the filter is correct. Test
without a date filter first.
:::
---
## Which protocols exist
Two families. Both price off chain, but only the first settles through a named RFQ
instruction.
### Family 1: true RFQ and intent settlement
| Protocol | Program ID | IDL / instruction | What it is | In DEX trade data |
|---|---|---|---|---|
| Jupiter Z (JupiterZ) | `61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH` | `order_engine` → `fill` | Same-chain RFQ. The maker signs and pays gas, the taker pays nothing. | Yes |
| Jupiter Z (2nd deployment) | `2En5Y11SEAGLNmEezTuRUCwTyzyNReHaMbSnS5gjGsL1` | `order_engine` → `fill` | Same IDL and same maker set, but the taker or a relayer pays gas. | Yes |
| Jupiter RFQ v2 | `fd3nMFYTQjX1yr5ER8u7tPdHJB7qt8RpDpNtLQX2Br5` | `rfq_v2` → `fill_exact_in` | Newer Jupiter RFQ program. Very little traffic so far. | No |
| Jupiter Limit Order v2 | `j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X` | `limit_order_2` → `fill_order` | Resting maker orders filled by a keeper. | No |
| Mayan Swift | `mayan34VedncxdK2XobtvWFDXQASUTBXhUVzt2kKgny` | `swift` → `init_order` / `fulfill` / `settle` | Cross-chain intent auction with competing drivers (solvers). | No |
| 1inch Fusion | `HNarfxC3kYMMhFkxUFeYb8wHVdPzY5t9pupqW5fL2meM` | `fusion_swap` → `fill` | Dutch-auction intents. Deployed, but barely used on Solana. | No |
### Family 2: proprietary market-maker AMMs
These have RFQ economics (one professional maker quotes, aggregators route to it) with AMM
plumbing (a `swap` instruction against program-owned inventory). Several publish quote
updates directly on chain, covered in [the quote tape](#the-on-chain-quote-tape).
| Venue | Program ID | Indexed as DEX trades? |
|---|---|---|
| SolFi v2 | `SV2EYYJyRz2YhfXwXnhNAevDEui5Q6yrfyo13WtupPF` | Yes |
| GoonFi v2 | `goonuddtQRrWqqn5nFyczVKaie28f3kDkHWkHtURSLE` | Yes |
| BisonFi | `BiSoNHVpsVZW2F7rx2eQ59yQwKxzU5NvBcmKshCSUypi` | Yes |
| AlphaQ | `ALPHAQmeA7bjrVuccPsYPiCvsi428SNwte66Srvs4pHA` | Yes |
| Aquifer | `AQU1FRd7papthgdrwPTTq5JacJh8YtwEXaBfKU3bTz45` | Yes |
| Tessera V | `TessVdML9pBGgG9yGks7o4HewRaXVAMuoVj4x83GLQH` | Yes |
| HumidiFi | `9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp` | Yes |
| QuantumAMM | `QuaNtZsgYRe5Z9Bk4LZ4cTD9tbkVoyCNf1R2BN9bBDv` | Yes |
| Scorch | `SCoRcH8c2dpjvcJD6FiPbCSQyQgu3PcUAWj2Xxx3mqn` | Yes |
| ZeroFi | `ZERor4xhbUycZ6gb9ntrhqscUcZmAbQDjEAtCf4hbZY` | No |
Scorch posts its prices through a separate program, `ojh19ojaKduoJZuaJADhcVGp4xt1TcdAvZmpVsCorch`,
which Scorch swaps pass in as an account. That program moves no tokens itself, so it has no
trade rows of its own.
---
## RFQ trades in DEX trade data
These venues appear in `DEXTrades`, `DEXTradeByTokens` and the `Trading` cube under the
following names.
| Venue | `Dex.ProtocolName` | `Dex.ProtocolFamily` | Program |
|---|---|---|---|
| Jupiter Z | `order_engine` | `Jupiter` | `61DFfeTK…` and `2En5Y11S…` |
| Tessera V | `tessera_v` | `Tessera` | `TessVdML…` |
| HumidiFi | `humidifi` | `HumidiFi` | `9H6tua7j…` |
| QuantumAMM | `quantum_amm` | `QuantumAMM` | `QuaNtZsg…` |
| Scorch | `scorch` | `Scorch` | `SCoRcH8c…` |
### Latest Jupiter Z trades
```graphql
query LatestJupiterZTrades {
Solana {
DEXTrades(
limit: { count: 20 }
orderBy: { descending: Block_Time }
where: {
Trade: { Dex: { ProtocolName: { is: "order_engine" } } }
Transaction: { Result: { Success: true } }
}
) {
Block { Time }
Transaction { Signature }
Trade {
Dex { ProgramAddress ProtocolName ProtocolFamily }
Market { MarketAddress }
Buy { Amount AmountInUSD Currency { Symbol MintAddress } Account { Owner } }
Sell { Amount AmountInUSD Currency { Symbol MintAddress } Account { Owner } }
}
}
}
}
```
How to read the result:
- `Trade.Market.MarketAddress` is the maker's wallet. RFQ has no pool, so each maker is its
own market.
- `Trade.Buy.Account.Owner` and `Trade.Sell.Account.Owner` are the taker.
- Do not use `Transaction.Signer` as the trader. On the main program the maker signs and pays
gas, so the signer field holds the maker's wallet.
- A native SOL side shows up as `11111111111111111111111111111111`, while the `fill`
instruction names the wrapped SOL mint (`So111…112`).
### Trades and volume by venue
```graphql
query RfqAndPropAmmVolume {
Solana {
DEXTrades(
where: {
Trade: {
Dex: {
ProtocolName: { in: ["order_engine", "tessera_v", "humidifi", "quantum_amm", "scorch"] }
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
) {
Trade { Dex { ProtocolName ProtocolFamily } }
trades: count
volumeUSD: sum(of: Trade_Buy_AmountInUSD)
}
}
}
```
:::caution Keep the Success filter
`DEXTrades` returns trades from failed transactions unless you filter them out, and bots fire
a lot of failing swaps at the prop AMMs. Between 15:10 and 15:30 UTC on 29 September 2026,
failed transactions made up 92% of HumidiFi rows, 82% of Scorch rows, 66% of Tessera V rows
and 56% of QuantumAMM rows, against under 1% for Jupiter Z. Keep
`Transaction: { Result: { Success: true } }` in every query.
:::
---
## Anatomy of a Jupiter Z fill
One instruction, three arguments, eleven accounts.
```
program: 61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH (IDL name: order_engine)
method: fill
arguments
input_amount u64 exact amount the taker sends (raw, token decimals)
output_amount u64 exact amount the taker receives (raw, token decimals)
expire_at i64 unix timestamp the quote stops being valid
accounts (positional)
0 taker
1 maker
2 taker_input_mint_token_account
3 maker_input_mint_token_account
4 taker_output_mint_token_account
5 maker_output_mint_token_account
6 input_mint
7 input_token_program
8 output_mint
9 output_token_program
10 system_program
```
The execution price is exact, so you never touch pool math:
```
price = (output_amount / 10^outDecimals) / (input_amount / 10^inDecimals)
```
There is no fee tier or curve to model. The number on chain is the fill.
:::caution Account 2 is not always a token account
When the taker pays with native SOL, position 2 holds the program ID itself as a stand-in for
an unused optional account. Read mints from positions 6 and 8 rather than assuming every
token account slot is populated.
:::
---
## Latest RFQ fills
```graphql
query LatestRFQFills {
Solana {
Instructions(
limit: { count: 20 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
}
) {
Block { Time Slot }
Transaction { Signature Signer Fee }
Instruction {
Accounts { Address Token { Mint Owner } }
Program {
Method
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_BigInt_Value_Arg { bigInteger }
... on Solana_ABI_Integer_Value_Arg { integer }
}
}
}
}
}
}
}
```
A trimmed real response:
```json
{
"Block": { "Slot": "436710297", "Time": "2026-08-02T05:57:11Z" },
"Transaction": {
"Signature": "5y22FzbLk7iTPQTs6kMuLEjd3P7YGmdNvWM21G4LkFU3pydps7ou9HTkAdw2qRZWTbXhebdEyLGrhgFMJTM7D1Fc",
"Signer": "CreQJ2t94QK5dsxUZGXfPJ8Nx7wA9LHr5chxjSMkbNft"
},
"Instruction": {
"Accounts": [
{ "Address": "F8FEvP6ekyGhDQLsKopD2qgD1j3qcYeYWJ1cWotJnGhn" },
{ "Address": "CreQJ2t94QK5dsxUZGXfPJ8Nx7wA9LHr5chxjSMkbNft" },
{ "Address": "12To3szF9J3gJGUwYkPJD6Y8efHt3TxD6dsz3fyCddYe" },
{ "Address": "6jz3UuC5tKeYGt5FiX18LRDEeceDmC55jmn5cDUL8wh7" },
{ "Address": "BWZYEPYehnLddXBa31LUo5yDv4ns1tC4RskLrnsqHYfR" },
{ "Address": "2rXQvUwk9P2gQhzoPvVwNFhJAKnSsjoidrXFko2qrqZt" },
{ "Address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" },
{ "Address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" },
{ "Address": "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" },
{ "Address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" },
{ "Address": "11111111111111111111111111111111" }
],
"Program": {
"Method": "fill",
"Arguments": [
{ "Name": "input_amount", "Type": "u64", "Value": { "bigInteger": "3298000943" } },
{ "Name": "output_amount", "Type": "u64", "Value": { "bigInteger": "3300746136" } },
{ "Name": "expire_at", "Type": "i64", "Value": { "bigInteger": "1785650286" } }
]
}
}
}
```
`Transaction.Signer` is the fee payer. On the main deployment that is always the maker, which
is how you detect gasless RFQ. See [who pays gas](#who-pays-for-the-transaction).
:::warning This response does not name the tokens
The mints are in there (positions 6 and 8, `EPjFWdd5…` and `Es9vMFrz…`) but you get base58,
not symbols or decimals. Two ways to fix that: decode positionally against your own token
list, or use [Instruction Balance Updates](#which-currencies-actually-moved), which returns
`Currency` metadata and USD values directly.
:::
### Decoding a fill
Positions 6 and 8 are the mints, positions 0 and 1 the counterparties. Applied to the
response above:
```js
const KNOWN = {
So11111111111111111111111111111111111111112: { symbol: "SOL", decimals: 9 },
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v: { symbol: "USDC", decimals: 6 },
Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB: { symbol: "USDT", decimals: 6 },
};
function decodeFill(node) {
const accounts = node.Instruction.Accounts.map((a) => a.Address);
const args = Object.fromEntries(
node.Instruction.Program.Arguments.map((a) => [a.Name, BigInt(a.Value.bigInteger)])
);
const [taker, maker] = accounts;
const tokenIn = KNOWN[accounts[6]] ?? { symbol: accounts[6].slice(0, 4), decimals: 9 };
const tokenOut = KNOWN[accounts[8]] ?? { symbol: accounts[8].slice(0, 4), decimals: 9 };
const amountIn = Number(args.input_amount) / 10 ** tokenIn.decimals;
const amountOut = Number(args.output_amount) / 10 ** tokenOut.decimals;
return {
time: node.Block.Time,
taker,
maker,
feePayer: node.Transaction.Signer,
pair: `${tokenIn.symbol}/${tokenOut.symbol}`,
amountIn,
amountOut,
price: amountOut / amountIn,
quoteValidForSec:
Number(args.expire_at) - Math.floor(Date.parse(node.Block.Time) / 1000),
};
}
```
Output:
```js
{
time: '2026-08-02T05:57:11Z',
taker: 'F8FEvP6ekyGhDQLsKopD2qgD1j3qcYeYWJ1cWotJnGhn',
maker: 'CreQJ2t94QK5dsxUZGXfPJ8Nx7wA9LHr5chxjSMkbNft',
feePayer: 'CreQJ2t94QK5dsxUZGXfPJ8Nx7wA9LHr5chxjSMkbNft',
pair: 'USDC/USDT',
amountIn: 3298.000943,
amountOut: 3300.746136,
price: 1.0008323809020816,
quoteValidForSec: 55
}
```
A 3,298 USDC to USDT swap at 1.00083, on a quote with 55 seconds left to live.
---
## Which currencies actually moved
If you would rather not decode positions yourself, query the balance updates attached to the
same instruction. This returns `Currency` with symbol and decimals, a signed decimal `Amount`,
and `AmountInUSD`.
```graphql
query RFQFillsWithCurrency {
Solana {
InstructionBalanceUpdates(
limit: { count: 40 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
BalanceUpdate: { Currency: { Native: false } }
}
) {
Block { Time }
Transaction { Signature }
BalanceUpdate {
Amount
AmountInUSD
Currency { Symbol Name MintAddress Decimals }
Account { Address Token { Owner } }
}
}
}
}
```
One fill comes back as a readable four-row set. Negative is the sender, positive the receiver:
| Symbol | Amount | AmountInUSD | Token.Owner |
|---|---:|---:|---|
| USD1 | -56.995411 | -56.937057 | `7mXZXgRT6LR8iA…` (taker) |
| USDC | -56.943005 | -56.934574 | `CreQJ2t94QK5ds…` (maker) |
| USD1 | 56.995411 | 56.937057 | `CreQJ2t94QK5ds…` (maker) |
| USDC | 56.943005 | 56.934574 | `7mXZXgRT6LR8iA…` (taker) |
:::caution Native SOL sides behave differently
`Currency: { Native: false }` keeps the SPL token sides and drops lamport noise. When one side
of the trade is native SOL, that side disappears from the results and you will see only the
maker's WSOL row. Remove the filter to catch it, but expect a native SOL side to emit both a
lamport movement and a WSOL token update for the same value. Do not sum them.
:::
Pair this with the fill instruction when you need `expire_at`, which balance updates do not
carry.
---
## Stream fills in real time
Change `query` to `subscription` and drop the ordering.
```graphql
subscription RFQFillStream {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
}
) {
Block { Time }
Transaction { Signature Signer }
Instruction {
Accounts { Address Token { Mint Owner } }
Program {
Arguments {
Name
Value {
... on Solana_ABI_BigInt_Value_Arg { bigInteger }
}
}
}
}
}
}
}
```
Both Jupiter Z deployments in one stream:
```graphql
subscription AllJupiterZFills {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: {
in: [
"61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH"
"2En5Y11SEAGLNmEezTuRUCwTyzyNReHaMbSnS5gjGsL1"
]
}
Method: { is: "fill" }
}
}
}
) {
Block { Time }
Transaction { Signature Signer }
Instruction {
Accounts { Address }
Program {
Address
Arguments {
Name
Value { ... on Solana_ABI_BigInt_Value_Arg { bigInteger } }
}
}
}
}
}
}
```
The same `decodeFill` function above works on each pushed message.
## The money flows
The Transfers cube gives you two USD-denominated rows per fill. It cannot filter on the RFQ
program directly, so filter on the makers instead, which works because the maker is the fee
payer.
:::caution Do not hard-code the maker set
The addresses below are placeholders. The active maker set is small and it rotates, so pull it
from the [maker leaderboard query](#maker-leaderboard-and-market-share) and substitute the
current values rather than copying these.
:::
```graphql
query RFQTransferLegs {
Solana {
Transfers(
limit: { count: 20 }
where: {
Transaction: {
# replace with the current maker set, see the maker leaderboard query
Signer: { in: [
"CreQJ2t94QK5dsxUZGXfPJ8Nx7wA9LHr5chxjSMkbNft"
"MfDuWeqSHEqTFVYZ7LoexgAK9dxk7cy4DFJWjWMGVWa"
"FkaLnX17cXZGyeu3kZGdHCNdFMJJzBrPPYVvd18B3MZp"
] }
Result: { Success: true }
}
}
orderBy: { descending: Block_Time }
) {
Block { Time }
Transaction { Signature }
Transfer {
Amount
AmountInUSD
Currency { Symbol MintAddress Decimals }
Sender { Address }
Receiver { Address }
}
}
}
}
```
This also catches the maker's own hedging transactions, since those share the same fee payer.
Join back to the `fill` instruction by signature if you need fills only.
---
## Filter fills by asset
Account-level filtering uses `Accounts: { includes: { Address: ... } }`. Pass a mint and you
get every fill where that token was on either side.
```graphql
query RFQFillsForAsset {
Solana {
Instructions(
limit: { count: 25 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: { Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" } }
Accounts: { includes: { Address: { is: "XsoCS1TfEyfFhfvj8EtZ528L3CaKBDBRqRapnBbDF2W" } } }
}
}
) {
Block { Time }
Transaction { Signature }
Instruction {
Accounts { Address }
Program {
Arguments {
Name
Value { ... on Solana_ABI_BigInt_Value_Arg { bigInteger } }
}
}
}
}
}
}
```
That mint is SPYx (SP500 xStock). Swap in TSLAx
`XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB` or anything from the
[mint reference](#mint-reference).
For a stable-quoted pair, price is one line. With `input_mint` USDC (6 decimals) and
`output_mint` TSLAx (9 decimals):
```
price_usd_per_share = (input_amount / 1e6) / (output_amount / 1e9)
```
Invert when the direction is reversed. Both amounts are exact and the quote was firm, so this
is a genuine executed print rather than a mid or an estimate.
---
## Quote expiry: how long a maker commits
`expire_at` minus block time gives the validity remaining at settlement. It is one of the few
places where a market maker's risk appetite is legible on chain.
```graphql
query QuoteExpiry {
Solana {
Instructions(
limit: { count: 50 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
}
) {
Block { Time }
Instruction {
Program {
Arguments {
Name
Value { ... on Solana_ABI_BigInt_Value_Arg { bigInteger } }
}
}
}
}
}
}
```
Jupiter Z quotes are minted with roughly a minute of validity and typically land within a few
seconds of issuance, so the remaining validity clusters just under the ceiling. Mayan Swift
intents carry a `deadline` an order of magnitude longer, because a cross-chain fill has to
survive settlement latency on the far side.
Watch the distribution rather than any single fill. Compression in remaining validity is a
volatility signal from professional makers, and it shows up before anything you can read off
an AMM.
---
## Maker leaderboard and market share
```graphql
query RFQMakerActivity {
Solana {
Instructions(
limit: { count: 30 }
orderBy: { descendingByField: "fills" }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
}
) {
Transaction { Signer }
Block {
firstSeen: Time(minimum: Block_Time)
lastSeen: Time(maximum: Block_Time)
}
fills: count
gasUsd: sum(of: Transaction_FeeInUSD)
}
}
}
```
Since the maker pays the fee on the main deployment, grouping by `Transaction.Signer` gives
you the maker leaderboard for free. No extra join, no address list to maintain.
The active maker set is small (low tens) and turns over, so treat any specific roster as a
result you generate rather than a constant. Two patterns hold up across runs and are worth
building around:
- **Fill count and notional rank differently.** The maker with the most fills is usually not
the maker moving the most money. Rank by both, or you will mistake a dust book for a
dominant one.
- **Makers specialise by size.** Some quote block flow at thousands of dollars a fill, others
run dust books averaging a few dollars or less. Dividing notional by fills separates them
immediately, and the spread they charge tracks that split (see
[execution quality](#execution-quality-in-basis-points)).
Notional is not returned directly, so pair the query above with
[Instruction Balance Updates](#which-currencies-actually-moved) and sum `AmountInUSD` per
maker.
---
## Who pays for the transaction
```graphql
query RFQFeePayer {
Solana {
Instructions(
limit: { count: 10 }
orderBy: { descendingByField: "txs" }
where: {
Instruction: {
Program: {
Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" }
Method: { is: "fill" }
}
}
}
) {
Transaction { Signer Result { Success } }
txs: count(distinct: Transaction_Signature)
totalFeeUsd: sum(of: Transaction_FeeInUSD)
}
}
}
```
Compare the returned `Signer` set against the takers (account 0) and makers (account 1). The
two deployments differ by design:
- On `61DFfeTK…` the fee payer is the maker, on essentially every fill. The taker pays nothing,
which is what makes the flow gasless.
- On `2En5Y11S…` the maker never pays. The cost falls on the taker or on a relayer submitting
for them.
Either way the fee sits close to the base rate: two signatures worth of lamports plus a
negligible priority fee. RFQ fills barely bid in the priority-fee auction, because a firm
off-chain price leaves nothing to front-run. Compare that against any AMM route on the same
chain and the difference is a couple of orders of magnitude.
---
## Execution quality in basis points
You need two sources: the RFQ fill, and an AMM reference price for the same minute.
Pull the RFQ prints with [Latest RFQ fills](#latest-rfq-fills) filtered to one pair, then
compute `price = output/input` with decimals applied. Then pull the AMM reference:
```graphql
query AmmReferencePrice {
Solana {
DEXTradeByTokens(
limit: { count: 100 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } }
Side: { Currency: { MintAddress: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" } } }
}
Transaction: { Result: { Success: true } }
}
) {
Block { Time }
Trade { Price PriceInUSD Amount AmountInUSD }
}
}
}
```
For a taker buying the base asset, `bps = (ref - rfq_price) / ref * 10000`. Invert the sign
when selling. Positive means the taker beat the AMM mid.
### What to expect from the result
Run this on a liquid pair such as SOL/USDC and the shape of the answer is consistent, even
though the exact basis points move with volatility and with which makers are active.
:::warning RFQ is usually not cheaper than the AMM on price
Expect the median RFQ fill to price a few basis points *worse* than the AMM mid, with only a
small minority of fills beating it. That gap is the maker's spread, and on liquid pairs it
runs several times the AMM's own effective spread at retail size. If you are benchmarking
venues on price alone, RFQ loses. Verify with your own window rather than trusting a number
published here.
:::
The advantage sits at the two ends of the size distribution:
- **Small trades.** Gasless settlement dominates. When the fee to send an AMM swap is a
meaningful fraction of a small trade, and a third of those swaps have to be retried, a few
bps of spread is cheap by comparison.
- **Large trades.** AMM price impact grows with size while the maker's quoted spread stays
roughly flat. Past a certain notional the pool costs more than the spread, and that
crossover is the number worth measuring for your own sizes.
- **In between.** Roughly a wash on price, and RFQ wins on certainty instead.
Fill sizes reflect that: the distribution is a barbell, with a large count of very small fills
and most of the notional carried by a handful of large ones. Compute the AMM side by bucketing
`AmountInUSD` and taking the absolute deviation from the minute mid, so you get the crossover
for the pair and period you actually trade.
---
## Landing rate
Bitquery indexes failed transactions, so you can measure how many attempts actually settle.
Drop the `Success` filter and group by result.
```graphql
query LandingRateComparison {
Solana {
rfq: Instructions(
limit: { count: 4 }
where: {
Instruction: {
Program: { Address: { is: "61DFfeTKM7trxYcPQCM78bJ794ddZprZpAwAnLiwTpYH" } }
}
}
) {
Transaction { Result { Success } }
txs: count(distinct: Transaction_Signature)
}
jupiterRoute: Instructions(
limit: { count: 4 }
where: {
Instruction: {
Program: {
Address: { is: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4" }
Method: { in: ["route", "route_v2", "shared_accounts_route", "shared_accounts_route_v2"] }
}
}
}
) {
Transaction { Result { Success } }
txs: count(distinct: Transaction_Signature)
}
solfi: Instructions(
limit: { count: 4 }
where: {
Instruction: {
Program: {
Address: { is: "SV2EYYJyRz2YhfXwXnhNAevDEui5Q6yrfyo13WtupPF" }
Method: { is: "swap" }
}
}
}
) {
Transaction { Result { Success } }
txs: count(distinct: Transaction_Signature)
}
}
}
```
The ordering this produces is stable even as the absolute counts change hour to hour.
Off-chain-quoted settlement lands almost every time it is submitted, because the price was
agreed before the transaction was built and nothing on chain can move underneath it. AMM
routing does not: a large share of submitted swaps fail on slippage or on a stale pool, and
oracle-priced proprietary AMMs fare worst of all because bots race to hit quotes that have
already moved.
Arbitrage-bot spam inflates the AMM failure counts, and a retail-only figure would look
better. The fees on those failures are still real and still paid. If you are choosing what to
route through, run this for your own venues and weigh the landing rate against the spread,
because the gap between the two families is far larger than the few basis points separating
their prices.
---
## Tokenized equities on RFQ
Two issuers of tokenized equities are active on Solana: xStocks from Backed (symbols ending
`x`) and Ondo Global Markets (ending `on`). Both are quoted by RFQ makers, but they trade very
differently.
- **xStocks trade in pools as well.** On 28 September 2026 the 15 xStocks tickers listed below
saw about 390,000 trades on Raydium CLMM and Orca alone.
- **Ondo tickers barely do.** The same day, all the Ondo tickers below together had 20 pool
trades. For them, RFQ fills are close to the only price print on chain.
With the RFQ fills in DEX trade data, you can pull them with
`DEXTradeByTokens` and keep them apart from pool trades by filtering on `order_engine`:
```graphql
query TokenizedEquityRFQTrades {
Solana {
DEXTradeByTokens(
limit: { count: 50 }
orderBy: { descending: Block_Time }
where: {
Trade: {
Dex: { ProtocolName: { is: "order_engine" } }
Currency: {
MintAddress: {
in: [
"Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh"
"XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB"
"gEGtLTPNQ7jcg25zTetkbmF7teoDLcrfTnQfmn2ondo"
"KeGv7bsfR4MheC1CkmnAVceoApjrkvBhHYjWb67ondo"
]
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block { Time }
Trade {
Currency { Symbol MintAddress }
Amount
PriceInUSD
Side { Amount Currency { Symbol } }
Market { MarketAddress }
}
}
}
}
```
The four mints are NVDAx, TSLAx, NVDAon and TSLAon. Drop the `ProtocolName` filter to see RFQ
and pool trades side by side. Older fills are not in the trade tables.
### The cross-issuer spread
Both issuers list several of the same underlyings (S&P 500, Nasdaq, Tesla, Alphabet, NVIDIA,
Meta, Microsoft, Intel, Circle, SpaceX). Decode a fill from each and you get two independent
prints of the same asset, quoted by two independent market makers.
In practice they track each other closely, usually well inside a percent. That is a useful
sanity check on your decoding: if `GOOGLx` and `GOOGLon` disagree by orders of magnitude, you
have a decimals bug rather than an arbitrage. It is also a genuine cross-issuer spread you can
stream, and the moments it widens are the interesting ones.
### Liquidity is concentrated
Expect a handful of makers per issuer. In the first half hour of trade data, three makers
quoted every xStocks RFQ fill and two quoted every Ondo fill. Resolve the current set from
`Trade.Market.MarketAddress` (or account index 1 of the `fill` instruction) rather than
hard-coding addresses, because that is exactly the kind of thing that rotates. For the Ondo
tickers, which barely trade in pools, a maker that stops quoting means the ticker stops
trading, so a per-issuer maker heartbeat is a worthwhile alert.
A large part of this flow also lands outside US market hours, when the underlying is closed.
The maker is pricing a shut market and carrying the overnight gap risk, which is one reason
the spread here is wider than on a crypto pair.
### Mint reference
| Symbol | Name | Mint |
|---|---|---|
| SPYx | SP500 xStock | `XsoCS1TfEyfFhfvj8EtZ528L3CaKBDBRqRapnBbDF2W` |
| QQQx | Nasdaq xStock | `Xs8S1uUs1zvS2p7iwtsG3b6fkhpvmwz4GYU3gWAmWHZ` |
| TSLAx | Tesla xStock | `XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB` |
| NVDAx | NVIDIA xStock | `Xsc9qvGR1efVDFGLrVsmkzv3qi45LTBjeUKSPmx9qEh` |
| GOOGLx | Alphabet xStock | `XsCPL9dNWBMvFtTmwcCA5v3xWPSMEBCszbQdiLLq6aN` |
| METAx | Meta xStock | `Xsa62P5mvPszXL1krVUnU5ar38bBSVcWAB6fmPCo5Zu` |
| MSFTx | Microsoft xStock | `XspzcW1PRtgf6Wj92HCiZdjzKCyFekVD8P5Ueh3dRMX` |
| AMZNx | Amazon.com xStock | `Xs3eBt7uRfJX8QUs4suhyU8p2M6DoUDrJyWBa8LLZsg` |
| AAPLx | Apple xStock | `XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp` |
| COINx | Coinbase xStock | `Xs7ZdzSHLU9ftNJsii5fCeJhoRWSC32SQGzGQtePxNu` |
| CRCLx | Circle xStock | `XsueG8BtpquVJX9LVLLEGuViXUungE6WmK5YZ3p3bd1` |
| MSTRx | MicroStrategy xStock | `XsP7xzNPvEHS1m6qfanPUGjNmdnmsLKEoNAnHjdxxyZ` |
| HOODx | Robinhood xStock | `XsvNBAYkrDRNhA7wPHQfX3ZUXZyZLdnCQDfHZ56bzpg` |
| INTCx | Intel xStock | `XshPgPdXFRWB8tP1j82rebb2Q9rPgGX37RuqzohmArM` |
| SPCXx | SpaceX xStock | `Xs3oZwbHvqis4NYcf4YKWmEia2eC84wSiVrcYcTqpH8` |
| SPYon | SPDR S&P 500 ETF (Ondo) | `k18WJUULWheRkSpSquYGdNNmtuE2Vbw1hpuUi92ondo` |
| QQQon | Invesco QQQ (Ondo) | `HrYNm6jTQ71LoFphjVKBTdAE4uja7WsmLG8VxB8ondo` |
| TSLAon | Tesla (Ondo) | `KeGv7bsfR4MheC1CkmnAVceoApjrkvBhHYjWb67ondo` |
| NVDAon | NVIDIA (Ondo) | `gEGtLTPNQ7jcg25zTetkbmF7teoDLcrfTnQfmn2ondo` |
| GOOGLon | Alphabet Class A (Ondo) | `bbahNA5vT9WJeYft8tALrH1LXWffjwqVoUbqYa1ondo` |
| METAon | Meta Platforms (Ondo) | `fDxs5y12E7x7jBwCKBXGqt71uJmCWsAQ3Srkte6ondo` |
| MSFTon | Microsoft (Ondo) | `FRmH6iRkMr33DLG6zVLR7EM4LojBFAuq6NtFzG6ondo` |
| AAPLon | Apple (Ondo) | `123mYEnRLM2LLYsJW3K6oyYh8uP1fngj732iG638ondo` |
| AMDon | AMD (Ondo) | `14diAn5z8kjrKwSC8WLqvBqqe5YmihJhjxRxd8Z6ondo` |
| AVGOon | Broadcom (Ondo) | `1FWZtdWN7y38BSXGzbs8D6Shk88oL9atDNgbVz9ondo` |
| ARMon | Arm Holdings plc (Ondo) | `15SsCZqCsM9fZGhTmP4rdJTPT9WGZKazDSsgeQ8ondo` |
| CRCLon | Circle Internet Group (Ondo) | `6xHEyem9hmkGtVq6XGCiQUGpPsHBaoYuYdFNZa5ondo` |
| INTCon | Intel (Ondo) | `cJpUMp5R7rZ6fGeLHbHhrRuJzK9mkyKDjZqNpT3ondo` |
| MUon | Micron Technology (Ondo) | `Fz9edBpaURPPzpKVRR1A8PENYDEgHqwx5D5th28ondo` |
| MRVLon | Marvell Technology (Ondo) | `FovBwhoV5KQjZCdhoM6jgXYwXLX3F8vgAfvmLH7ondo` |
| SKHYon | SK Hynix (Ondo) | `Huyb2fyDDjSuDKCRWsN9ci2rmcgPo6NFiLbx9ZDondo` |
| SNDKon | SanDisk (Ondo) | `EJmUVvDqAdfH5zEohkdS4234bi3c6iunqEMobjmondo` |
| SPCXon | SpaceX (Ondo) | `wzAyQTorWyoVXuJKj2x8EqKEGJpS13z6EWE9z5Aondo` |
| TSMon | Taiwan Semiconductor (Ondo) | `keybg184d4vyXeQdFqs4o99YsMg7xBthxTJ6Ky3ondo` |
| GLWon | Corning (Ondo) | `YQzNQh2YSFQ6nh91E8Ja71U6JuZDLap5jJCsELGondo` |
| USDon | Ondo US Dollar Token | `ZPFtoCe7WWqG4N3ZFRccS8T9SMBeHsd1Vmgv2i7ondo` |
All Ondo mints use 9 decimals. The [xStocks API page](/docs/blockchain/Solana/xstocks-api)
covers the pool-traded side of these assets.
### What else trades on RFQ
Aggregate `AmountInUSD` from
[Instruction Balance Updates](#which-currencies-actually-moved) grouped by currency pair and
the mix is consistently unlike the Solana DEX tape. SOL against the majors leads, but a large
block of volume is **stablecoin to stablecoin** (USDC/USDT and the newer dollar tokens), with
wrapped BTC and ETH, a handful of large-cap tokens, and the tokenized equities making up the
rest. Long-tail memecoin churn is largely absent.
That mix is the signature of professional treasury and inventory flow rather than retail
speculation, and it is the main reason RFQ notional looks small next to DEX notional while
being far more concentrated per fill.
---
## Jupiter Limit Order v2
Resting orders rather than quotes, but the fill path has the same shape (`taker`, `maker`,
`order`).
```graphql
query JupiterLimitOrders {
Solana {
Instructions(
limit: { count: 20 }
orderBy: { descendingByField: "cnt" }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "j1o2qRpjcyUwEvwtcfhEQefh773ZgjxcVRry7LDqg5X" }
Method: { in: ["initialize_order", "fill_order", "cancel_order"] }
}
}
}
) {
Instruction { Program { Method } }
Transaction { Signer }
cnt: count
signers: count(distinct: Transaction_Signer)
}
}
}
```
Two things fall out of that grouping and both are structural. Orders are cancelled far more
often than they are filled, so treat `initialize_order` as intent rather than volume. And
while many distinct makers create orders, the `fill_order` signer set collapses to a single
Jupiter-operated keeper, which makes the fill path a single point of failure worth monitoring
separately from the orders themselves.
---
## Mayan Swift: cross-chain intents
Solana is both a source and a destination here. `init_order` starts an outbound intent, while
`fulfill` and `settle` complete an inbound one.
```graphql
query MayanSwiftIntents {
Solana {
Instructions(
limit: { count: 20 }
orderBy: { descending: Block_Time }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "mayan34VedncxdK2XobtvWFDXQASUTBXhUVzt2kKgny" }
Method: { is: "init_order" }
}
}
}
) {
Block { Time }
Transaction { Signature Signer }
Instruction {
Accounts { Address }
Program {
Method
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Json_Value_Arg { json }
... on Solana_ABI_BigInt_Value_Arg { bigInteger }
}
}
}
}
}
}
}
```
The `InitOrderParams` JSON carries the complete intent:
```
amount_in_min, amount_out_min user's limit price
chain_dest, token_out destination chain (Wormhole chain id) and token
deadline intent expiry (minutes, not seconds)
gas_drop destination gas top-up
fee_cancel, fee_refund failure-path economics
addr_ref, fee_rate_ref referrer address and referral fee rate
fee_rate_mayan protocol fee rate
auction_mode auction type
```
`addr_ref` and `fee_rate_ref` together give you per-integrator revenue attribution: which
frontend sourced the order, and what it earned.
Outbound and inbound flows run at broadly similar rates, so Solana is a genuine two-way hub
rather than mostly an exit. Decode `chain_dest` against Wormhole chain ids to get the current
destination mix; the major EVM chains dominate it.
:::note Solver concentration
The trader side of Mayan is wide, with a distinct signer on almost every order. The solver
side is not: fulfils come from a very small set of driver addresses, typically with one taking
the large majority. Track drivers with account index 1 on `fulfill` and alert on that set
shrinking, because it is the part of the system with the least redundancy.
:::
To stream cross-chain flow leaving Solana:
```graphql
subscription MayanOutboundIntents {
Solana {
Instructions(
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: {
Address: { is: "mayan34VedncxdK2XobtvWFDXQASUTBXhUVzt2kKgny" }
Method: { is: "init_order" }
}
}
}
) {
Block { Time }
Transaction { Signature }
Instruction {
Accounts { Address }
Program {
Arguments {
Name
Value { ... on Solana_ABI_Json_Value_Arg { json } }
}
}
}
}
}
}
```
---
## The on-chain quote tape
Several proprietary market makers publish quote updates as top-level instructions that move
zero tokens. They are not trades and appear in no trade table, yet they are the
highest-frequency structured data on Solana.
Use `Instruction.Depth` to tell them apart. Depth `0` is a standalone quote update. Depth `1`
or deeper is a CPI from an aggregator router, meaning a real swap.
```graphql
query QuoteTapeVsFills {
Solana {
Instructions(
limit: { count: 10 }
orderBy: { descendingByField: "cnt" }
where: {
Transaction: { Result: { Success: true } }
Instruction: {
Program: { Address: { is: "9H6tua7jkLhdm3w8BvgpTn5LZNU7g4ZynDmCiNN3q6Rp" } }
}
}
) {
Instruction { Depth }
cnt: count
signers: count(distinct: Transaction_Signer)
}
}
}
```
Swap the program address for any venue in
[Family 2](#family-2-proprietary-market-maker-amms) and the depth-0 to depth-1 ratio sorts
them into two architectures:
- **Quote-posting.** Depth-0 instructions vastly outnumber routed fills, often by an order of
magnitude. HumidiFi, Tessera V, QuantumAMM, Aquifer and BisonFi work this way (Scorch does
the same through its separate price program), and the busiest of them
emit updates at a rate measured in millions per day. This is a live market-maker quote feed
sitting on chain, and it exists in no trade table.
- **Oracle-at-swap.** Little or no depth-0 traffic, because the venue prices from an oracle at
execution time. SolFi, GoonFi, ZeroFi and AlphaQ sit here. There is nothing to watch until a
trade lands.
The `signers` count is the second tell. A venue running its whole quote feed from a single
signer is a different operational risk from one spreading it across dozens.
:::caution Quote updates are not decoded
Bitquery decodes the swaps on HumidiFi, Tessera V, QuantumAMM and Scorch (methods such
as `swap`, `swap2`, `swapV3` and `swap2022`). Their quote updates still arrive undecoded, as
raw `Instruction.Data` with `Program.Parsed: false`, and ZeroFi has no IDL at all. You can
still measure how often each maker updates, and from which signer.
:::
---
## Notes on method
This page deliberately states patterns and gives you the queries, rather than publishing point
in time statistics that go stale. A few things to get right when you run them yourself:
- **Value the stablecoin side.** For notional, take the stablecoin side at $1 where one exists and
fall back to the SOL side otherwise. `AmountInUSD` on
[Instruction Balance Updates](#which-currencies-actually-moved) already does this for you.
- **Prefer medians for reference prices.** `average(of: Trade_PriceInUSD)` is badly skewed on
thin pairs and will hand you a SOL price that is tens of percent wrong. Use a median over a
liquid pair instead.
- **A minute-median AMM price approximates the mid**, not a same-block quote. It is good
enough for spread work on liquid pairs and misleading on illiquid ones.
- **Size buckets need volume.** The interesting crossover sits above $100k, where fills are
rare. Widen the window before drawing conclusions about large size.
- **AMM landing rates include bot traffic.** A retail-only figure is higher. Compare like with
like if you are using it to justify a routing decision.
One open item: the second `order_engine` deployment is identified here from a shared maker set
and matching IDL, not from protocol documentation.
---
## Related
- [Solana Instructions API](/docs/blockchain/Solana/solana-instructions), the cube most queries here use
- [Instruction Balance Updates](/docs/blockchain/Solana/solana-instruction-balance-updates), for currency and USD on each side of a fill
- [Solana Transfers API](/docs/blockchain/Solana/solana-transfers)
- [Solana Jupiter API](/docs/blockchain/Solana/solana-jupiter-api), the aggregator and routing side
- [xStocks API](/docs/blockchain/Solana/xstocks-api), pool-traded tokenized equities
- [SolFi API](/docs/blockchain/Solana/SolFi-api) and [GoonFi API](/docs/blockchain/Solana/goonfi-api)
- [Solana DEX Orders API](/docs/blockchain/Solana/Solana-DEX-Orders-API), limit-order book data
---
## Solana Raydium Clmm API
URL: https://docs.bitquery.io/docs/blockchain/Solana/raydium-clmm-API/
Solana Raydium Clmm API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Keep queries fast with indexed filters.
# Raydium CLMM API
:::tip Need real-time Raydium CLMM data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Raydium CLMM swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Raydium CLMM data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Bitquery provides comprehensive real-time and historical data APIs and Streams for the Solana blockchain, enabling developers and traders to build powerful applications and execute trades based on reliable information.
## Raydium CLMM API Guide
In this section we will see how to get data on Raydium CLMM trades in real-time. According to the official docs available [here](https://docs.raydium.io/products/clmm),
"Concentrated Liquidity Market Maker (CLMM) pools allow liquidity providers to select a specific price range at which liquidity is active for trades within a pool. "
:::note
`Trade Side Account` field will not be available as aggregates in Archive and Combined Datasets
:::
## Subscribe to Realtime CLMM Trades
This query subscribes to real-time trades on the Raydium CLMM (Concentrated Liquidity Market Maker) on the Solana blockchain by filtering using `{Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}}}:`.
You can run the query [here](https://ide.bitquery.io/Raydium-CLMM-DEX-Trades-with-AccountNames)
```graphql
subscription MyQuery {
Solana {
DEXTrades(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}}}, Transaction: {Result: {Success: true}}}
) {
Instruction {
Program {
Method
AccountNames
}
}
Trade {
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
}
}
}
}
```
## Latest Pool Creation on Raydium CLMM
The below query tracks latest pool creation on raydium CLMM.
The `"Program": {"AccountNames"}` includes the order in which account addresses are mentioned in `Accounts` list.
This includes `poolCreator`, token vaults (`tokenVault0`, `tokenVault1`) and token mints (`tokenMint0`, `tokenMint1`).
The mint addresses for the tokens being used in the pool are listed for example `tokenMint1` could be any newly deployed token and `tokenMint0` can be WSOL , indicating which tokens the CLMM pool will support.
You can run the query [here](https://ide.bitquery.io/Raydium-CLMM-Pool-Creation)
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "createPool"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Latest Positions Closed
The below query tracks latest position closes on raydium CLMM by filtering using `Method: {is: "closePosition"}`. The `personalPosition` account which is the 4th in the list of `Accounts` includes the address of account to store personal position.
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "closePosition"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Latest Positions Created
The below query tracks latest position created on raydium CLMM by filtering using `Method: {is: "openPositionV2"}`.
This is where various accounts like NFTs, tokens, and program states are updated. The parameters define liquidity and token amounts involved in the position.
- **amount0Max** corresponds to **tokenVault0** and **tokenAccount0**.
- **amount1Max** corresponds to **tokenVault1** and **tokenAccount1**.
- **amount0Max**: The maximum amount of **Token 0** to be added to the position.
- **amount1Max**: The maximum amount of **Token 1** to be added to the position.
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "openPositionV2"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## CLMM Position Line : Adding Liquidity at a Price
This API fetches Increase Liquidity V2 transactions from the Raydium CLMM on Solana. It retrieves relevant data, including liquidity amounts, token accounts, execution logs, and transaction details.
The arguments and account details include
- `AccountNames`: List of accounts involved
```
"nftOwner",
"nftAccount",
"poolState",
"protocolPosition",
"personalPosition",
"tickArrayLower",
"tickArrayUpper",
"tokenAccount0",
"tokenAccount1",
"tokenVault0",
"tokenVault1",
"tokenProgram",
"tokenProgram2022",
"vault0Mint",
"vault1Mint"
```
- `Address`: Contract address of the program
- `Arguments` (Liquidity & Token Values)
- `liquidity` → `{json}`
- `amount0Max` → The maximum amount of Token 0 (possibly SOL) added as liquidity.
- `amount1Max` → The maximum amount of Token 1 (SPL token) added as liquidity.
You can run the query [here](https://ide.bitquery.io/increaseLiquidityV2-latest-raydium-clmm#)
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "increaseLiquidityV2"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
Name
Method
Json
Parsed
}
Logs
}
Transaction {
Signature
Signer
}
}
}
}
```
## CLMM Position Line : Removing Liquidity at a Price
This API fetches **Decrease Liquidity V2** transactions from the **Raydium CLMM** on **Solana**. It retrieves relevant data, including liquidity amounts, token accounts, execution logs, and transaction details.
### **Arguments and Account Details**
- **`AccountNames`**: List of accounts involved
```
"nftOwner",
"nftAccount",
"personalPosition",
"poolState",
"protocolPosition",
"tokenVault0",
"tokenVault1",
"tickArrayLower",
"tickArrayUpper",
"recipientTokenAccount0",
"recipientTokenAccount1",
"tokenProgram",
"tokenProgram2022",
"memoProgram",
"vault0Mint",
"vault1Mint"
```
- **`Address`**: Contract address of the program
- **`Arguments` (Liquidity & Token Values)**
- `liquidity` → `{json}`
- `amount0Min` → The minimum amount of **Token 0** (possibly SOL) withdrawn from liquidity.
- `amount1Min` → The minimum amount of **Token 1** (SPL token) withdrawn from liquidity.
You can run the query **[here](https://ide.bitquery.io/decreaseLiquidityV2-latest-raydium-clmm_1#)**
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "decreaseLiquidityV2"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
Name
Method
Json
Parsed
}
Logs
}
Transaction {
Signature
Signer
}
}
}
}
```
---
## Solana Raydium Cpmm API
URL: https://docs.bitquery.io/docs/blockchain/Solana/raydium-cpmm-API/
Solana Raydium Cpmm API: real-time Solana memecoin and DEX data via Bitquery GraphQL APIs and Kafka streams. Works with WebSocket live subscriptions.
# Raydium CPMM API
:::tip Need real-time Raydium CPMM data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Raydium CPMM swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Raydium CPMM data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section we will see how to get data on Raydium CPMM trades in real-time. You can check out our [Pump Fun docs](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/), [Raydium v4 docs](/docs/blockchain/Solana/Solana-Raydium-DEX-API/) and [Raydium LaunchPad docs](/docs/blockchain/Solana/launchpad-raydium/) too.
:::note
`Trade Side Account` field will not be available as aggregates in Archive and Combined Datasets
:::
## Subscribe to Realtime CPMM Trades
This query subscribes to real-time trades on the Raydium CPMM on the Solana blockchain by filtering using `{Program: {Address: {is: "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"}}}:`.
You can run the query [here](https://ide.bitquery.io/CPMM-trades).
```graphql
subscription MyQuery {
Solana {
DEXTrades(
where: {Instruction: {Program: {Address: {is: "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"}}}, Transaction: {Result: {Success: true}}}
) {
Instruction {
Program {
Method
}
}
Trade {
Buy {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
Sell {
Amount
Account {
Address
}
Currency {
Name
Symbol
MintAddress
Decimals
Fungible
Uri
}
}
}
Transaction {
Signature
}
}
}
}
```
## Latest Pool Creation on Raydium CPMM
The below query tracks latest pool creation on raydium CPMM.
The `"Program": {"AccountNames"}` includes the order in which account addresses are mentioned in `Accounts` list.
This includes `poolCreator`, token vaults (`tokenVault0`, `tokenVault1`) and token mints (`tokenMint0`, `tokenMint1`).
The mint addresses for the tokens being used in the pool are listed for example `tokenMint1` and `tokenMint0` , indicating which tokens the CPMM will support.
You can run the query [here](https://ide.bitquery.io/CPMM-pools-created_1)
```graphql
{
Solana {
Instructions(
where: {Instruction: {Program: {Address: {is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"}, Method: {is: "initialize"}}}, Transaction: {Result: {Success: true}}}
limit: {count: 10}
orderBy: {descending: Block_Time}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
AccountNames
Address
Arguments {
Value {
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Integer_Value_Arg {
integer
}
}
Name
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
---
## Solana Solfi API
URL: https://docs.bitquery.io/docs/blockchain/Solana/SolFi-api/
SolFi DEX on Solana: real-time trades, latest and streaming token prices, OHLC candles, top traders, buy and sell volume, and pair volatility via GraphQL.
# SolFi DEX API
:::tip Need real-time SolFi data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered SolFi swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical SolFi data older than ~30 days**, raw per-swap detail, or call / event context.
:::
## SolFi Trades in Real-Time
This streams a message for every new SolFi trade, carrying the buy and sell sides, the block and the transaction.
Open it in the [Bitquery IDE: realtime SolFi trades](https://ide.bitquery.io/Real-time-trades-on-Solfi-DEX-on-Solana).
```graphql
subscription {
Solana {
DEXTrades(where: { Trade: { Dex: { ProtocolFamily: { is: "Solfi" } } } }) {
Trade {
Dex {
ProgramAddress
ProtocolFamily
ProtocolName
}
Buy {
Currency {
Name
Symbol
MintAddress
}
Amount
Account {
Address
}
PriceAgainstSellCurrency: Price
}
Sell {
Account {
Address
}
Amount
Currency {
Name
Symbol
MintAddress
}
PriceAgainstBuyCurrency: Price
}
}
Block {
Time
}
}
}
}
```
## Latest Price of a Token on SolFi
This returns the most recent trade for a token on SolFi, with the price in the quote token and in USD.
Open it in the [Bitquery IDE: latest SolFi token price](https://ide.bitquery.io/latest-price-of-token-on-solfi).
```graphql
{
Solana {
DEXTradeByTokens(
limit: {count: 1}
orderBy: {descending: Block_Time}
where: {Trade: {Dex: {ProtocolFamily: {is: "Solfi"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## Realtime Price feed of a Token on SolFi
The same filter as a subscription pushes a message on every new trade, giving a live price feed instead of a single reading.
Open it in the [Bitquery IDE: SolFi realtime price feed](https://ide.bitquery.io/realtime-price-of-token-on-solfi).
```graphql
subscription{
Solana {
DEXTradeByTokens(
where: {Trade: {Dex: {ProtocolFamily: {is: "Solfi"}}, Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}}}
) {
Block {
Time
}
Trade {
Price
PriceInUSD
}
}
}
}
```
## SolFi OHLC API
If you want to get OHLC data for any specific currency pair on SolFi, you can use this api. Only use [this API](https://ide.bitquery.io/SolFi-OHLC-for-specific-pair) as query and not subscription websocket as Aggregates and Time Intervals don't work well with subscriptions.
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "Block_Timefield"}
where: {Trade: {Currency: {MintAddress: {is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"}}, Side: {Currency: {MintAddress: {is: "So11111111111111111111111111111111111111112"}}}, Dex: {ProtocolFamily: {is: "Solfi"}}, 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 the Top Traders of a specific Token on SolFi DEX
This ranks the wallets trading a given token on SolFi, here USDC (`EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v`). Run it as a plain request, not a WebSocket subscription: aggregates are recomputed per message on a subscription, so the totals come back wrong. Open it in the [Bitquery IDE: SolFi top traders](https://ide.bitquery.io/top-traders-of-a-token-on-solfi).
```graphql
query TopTraders($token: String) {
Solana {
DEXTradeByTokens(
orderBy: {descendingByField: "volumeUsd"}
limit: {count: 100}
where: {Trade: {Currency: {MintAddress: {is: $token}}, Dex: {ProtocolFamily: {is: "Solfi"}}}, Transaction: {Result: {Success: true}}}
) {
Trade {
Account {
Owner
}
Side {
Account {
Address
}
Type
}
}
bought: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: buy}}}})
sold: sum(of: Trade_Amount, if: {Trade: {Side: {Type: {is: sell}}}})
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
}
}
}
{
"token": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
```
## Get trading volume, buy volume, sell volume of a token
This reads the [Trading cube](/docs/trading/crypto-trades-api/trades-api/) rather than the chain-level `DEXTradeByTokens`. Every Trading row carries a vetted USD price and the cube covers roughly the last 30 days in full, while the Solana `archive` and `combined` datasets return about a fifth fewer trades than `realtime` over the same window, so volume totals taken from them read low.
`Side` is the trader's own side. The example follows the WSOL/USDC market on SolFi; swap the two addresses for the pair you want, and widen `days_ago` up to the 30-day window. For longer spans use [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs/) with `sum(of: Volume_Usd)` over hourly intervals, which is pre-aggregated and far cheaper than scanning every trade.
Open it in the [Bitquery IDE: SolFi trade volume](https://ide.bitquery.io/trade_volume-Solfi).
```graphql
{
Trading {
Trades(
where: {
Pair: {
Market: { ProtocolFamily: { is: "Solfi" }, Network: { is: "Solana" } }
Token: { Address: { is: "So11111111111111111111111111111111111111112" } }
QuoteToken: {
Address: { is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" }
}
}
Block: { Time: { since_relative: { days_ago: 7 } } }
}
) {
volumeUsd: sum(of: AmountsInUsd_Base)
buy_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
buys: count(if: { Side: { is: "Buy" } })
sells: count(if: { Side: { is: "Sell" } })
}
}
}
```
## Volatility of a Pair on SolFi
Volatility is an important factor in trading world as it determines the fluctuation in price that implies the possibility of profit and risk of loss. Lesser volatility denotes that the pair is stable.
[Here](https://ide.bitquery.io/Volatility-of-WSOL-USDC-Pair-on-Solfi-Dex-on-Solana_1) is the query to get the volatility for a selected pair in the last 1 hour.
```graphql
query Volatility {
Solana(dataset: realtime) {
DEXTrades(
where: {
Trade: {
Dex: { ProtocolFamily: { is: "Solfi" } }
Buy: {
Currency: {
MintAddress: { is: "So11111111111111111111111111111111111111112" }
}
}
Sell: {
Currency: {
MintAddress: {
is: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
}
}
}
}
Block: {
Time: {
after: "2025-06-06T01:00:00Z"
before: "2025-06-06T02:00:00Z"
}
}
}
) {
volatility: standard_deviation(of: Trade_Buy_Price)
}
}
}
```
---
## Solana Staking Rewards API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-rewards/
Solana staking rewards: query the latest reward distributions on Solana and the rewards paid to a specific wallet address, with GraphQL examples.
# Solana Rewards API
Solana rewards are incentives given to investors and validators for staking their SOL tokens to secure the network. This section covers how to access information about the latest Solana rewards among other examples.
## Latest Rewards
The query below helps track the most recent reward distributions on the Solana blockchain in real-time.
You can find the query [here](https://ide.bitquery.io/Latest-Solana-Rewards)
```graphql
subscription {
Solana {
Rewards(limit: {count: 10}) {
Block {
Hash
Height
Slot
RewardsCount
Time
}
Reward {
RewardType
PostBalance
Index
Commission
Amount
Address
}
}
}
}
```
## Rewards for a Wallet Address
If you're interested in tracking the rewards for a specific wallet address, you can modify the query to filter results based on the address. This allows stakeholders to monitor their own rewards or analyze rewards distribution to specific addresses over time. You can find the query [here](https://ide.bitquery.io/Rewards-for-a-wallet-address)
```graphql
subscription {
Solana {
Rewards(
limit: {count: 10}
where: {Reward: {Address: {is: "HnfPZDrbJFooiP9vvgWrjx3baXVNAZCgisT58gyMCgML"}}}
) {
Block {
Hash
Height
Slot
RewardsCount
Time
}
Reward {
RewardType
PostBalance
Index
Commission
Amount
Address
}
}
}
}
```
## Video Tutorial on Solana Rewards API | How to get Rewards Distribution data using Solana Rewards API
---
## Solana Token Holders API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-token-holders/
Solana token holders: top holders from historical transfers (V1) or real-time balance updates (V2), whale tracking, and how to choose the right API.
# Solana Token Holders API
Get real-time and historical token holder data for any SPL token on Solana. Bitquery provides two approaches to retrieve token holders — choose the one that fits your use case.
## Can I get Solana token holder data using Bitquery?
Yes. Bitquery exposes Solana SPL holder analytics via GraphQL: use **V1** transfer-based aggregates for full history and top holders, or **V2** `BalanceUpdates` for fast snapshots on recently active tokens (roughly the last hours of balance updates). Pick V1 for long-lived tokens and trends; V2 for brand-new launches and near-real-time rankings.
## How do I track whale wallets and their token holdings on Solana?
Use V1 holder queries sorted by net balance to list the largest wallets, or V2 `BalanceUpdates` ordered by `PostBalance` for fresh launches. Filter minimum `PostBalance` or post-process balances to focus on whales, then correlate with [Solana transfers](/docs/blockchain/Solana/solana-transfers/) or [DEX trades](/docs/blockchain/Solana/solana-dextrades/) for accumulation or distribution.
## Choosing the Right API
Bitquery provides two versions of Solana APIs — each with different strengths for retrieving token holder data:
| Feature | V1 API (Transfers) | V2 API (Balance Updates) |
|---------|---------------------|--------------------------|
| **Data coverage** | Complete historical data from token launch | Last ~8 hours of balance updates |
| **Best for** | Any token, any age | Newly launched tokens (< 8 hours old) |
| **Data freshness** | Lags a few minutes behind real-time | Real-time |
| **Method** | Calculates holders from cumulative transfers (sum of inflows − outflows) | Reads latest balance snapshot directly |
| **Query complexity** | Requires aggregation (sum, expression) | Simple — just read `PostBalance` |
| **Ideal use cases** | Tokens older than 8 hours, historical holder analysis, whale tracking | Tokens launched within the last 8 hours, Pump.fun launches, fast holder snapshots |
:::tip When to use which?
- **Token launched more than 8 hours ago** → Use **V1 API** (complete history)
- **Token launched within the last 8 hours** → Use **V2 API** (faster, simpler)
- **Need both speed and history** → Combine both: V2 for the latest snapshot, V1 for historical trends
:::
## V1 API — Historical Token Holders via Transfers
The V1 API calculates token holders by summing all incoming and outgoing transfers for each wallet address. This gives you **complete, accurate holder data** for any token regardless of when it was launched.
**Strengths:**
- Full historical coverage from token genesis
- Works for any SPL token, any age
- Accurate holder balances computed from on-chain transfer history
**Limitation:**
- Data may lag a few minutes behind real-time
For more V1 Solana transfer examples, see the [V1 Solana Transfers documentation](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers).
### Top Token Holders
Get the top holders for any SPL token by calculating net balances from transfer history.
**Try it live:** [Solana Token Holders V1](https://ide.bitquery.io/)
```graphql
{
solana(network: solana) {
transfers(
date: { since: "2026-02-19" }
currency: { is: "943YczGfS95e1ZnUSMd5DPQrGXaKBS2zGR76htycpump" }
options: { limit: 10000, desc: "balance" }
) {
sum_in: amount(calculate: sum)
sum_out: amount(calculate: sum)
balance: expression(get: "sum_in - sum_out")
count_in: countBigInt
count_out: countBigInt
currency {
address
symbol
tokenType
}
receiver {
address
}
}
}
}
```
### How This Query Works
1. **Fetches all transfers** for the specified token since the given date
2. **Groups by receiver address** — each row represents a unique wallet
3. **`sum_in`** — total tokens received by that wallet
4. **`sum_out`** — total tokens sent out by that wallet
5. **`balance`** — net balance calculated as `sum_in - sum_out`
6. **Results sorted** by balance in descending order — top holders first
### Customization Options
**Filter by date range** — Narrow down to a specific period:
```graphql
date: { since: "2026-01-01", till: "2026-02-19" }
```
**Increase result limit** — Get more holders (up to the API limit):
```graphql
options: { limit: 25000, desc: "balance" }
```
**Filter out zero balances** — Only show current holders:
Add a filter to exclude wallets where balance equals zero by checking `sum_in - sum_out > 0` in your application logic after receiving the results.
## V2 API — Real-Time Token Holders via Balance Updates
The V2 API reads the latest balance snapshot directly from Solana's balance update records. This is **faster and simpler** but only covers the last ~8 hours of data.
**Strengths:**
- Real-time data with minimal delay
- Simpler query — reads balance directly instead of calculating from transfers
- Great for newly launched tokens and fast-moving markets
**Limitation:**
- Only covers the last ~8 hours of balance updates
- Best suited for tokens launched within that window
### Top Token Holders
Get the top 50 holders for a recently launched token using balance updates.
**Try it live:** [Solana Token Holders V2](https://ide.bitquery.io/)
```graphql
{
Solana {
BalanceUpdates(
orderBy: { descendingByField: "BalanceUpdate_balance_maximum" }
limit: { count: 50 }
where: {
BalanceUpdate: {
PostBalance: { gt: "0" }
Currency: {
MintAddress: {
is: "943YczGfS95e1ZnUSMd5DPQrGXaKBS2zGR76htycpump"
}
}
}
}
) {
BalanceUpdate {
Account {
Owner
}
balance: PostBalance(maximum: Block_Slot)
}
}
}
}
```
### How This Query Works
1. **Fetches balance update records** for the specified token mint address
2. **Filters out zero balances** — `PostBalance: { gt: "0" }` ensures only current holders are shown
3. **`PostBalance(maximum: Block_Slot)`** — gets the most recent balance by taking the value at the highest block slot
4. **Sorted by balance** in descending order — top holders first
5. **`Account.Owner`** — returns the wallet owner address
### Customization Options
**Get more holders** — Increase the limit:
```graphql
limit: { count: 200 }
```
**Filter by minimum balance** — Only show significant holders:
```graphql
PostBalance: { gt: "1000000" }
```
## Use Cases
### Whale tracking (largest holders)
Monitor large holders and track their accumulation or distribution patterns. Use V1 for historical whale behavior or V2 for real-time whale alerts on new tokens. See [How do I track whale wallets and their token holdings on Solana?](#how-do-i-track-whale-wallets-and-their-token-holdings-on-solana) above for the query approach.
### Token Distribution Analysis
Analyze how evenly a token is distributed across holders. Calculate metrics like the Gini coefficient or top-10 holder concentration to assess decentralization.
### New Token Launch Monitoring
Track holder growth for newly launched tokens (especially Pump.fun launches). Use V2 for instant holder snapshots within the first 8 hours.
### Holder Count Over Time
Use V1 to track how the number of unique holders changes over different date ranges, revealing adoption trends.
### Airdrop Verification
Verify that airdrop recipients actually hold the tokens by querying current balances.
### Smart Money Tracking
Identify wallets that consistently hold tokens early in successful launches. Cross-reference with the [Solana Trader API](/docs/blockchain/Solana/solana-trader-API/) for deeper analysis.
## Best Practices
1. **Choose the right API for your use case** — V1 for historical/complete data, V2 for speed on new tokens
2. **Set appropriate date ranges in V1** — Narrower ranges reduce query complexity and points consumed
3. **Filter out zero balances** — Exclude wallets that have sold all tokens for cleaner results
4. **Account for token decimals** — Raw balances need to be divided by `10^decimals` for human-readable amounts
5. **Exclude known program accounts** — Filter out system programs, DEX pools, and bridge contracts for accurate retail holder counts
6. **Cache results** — Token holder data doesn't change every second; cache for 1–5 minutes to reduce API usage
7. **Combine V1 and V2** — Use V2 for the latest snapshot and V1 for historical trend analysis
## Related APIs
- [Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/) — Real-time balance change monitoring
- [Solana Transfers API](/docs/blockchain/Solana/solana-transfers/) — Track token transfers
- [Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/) — Trading activity for tokens
- [Solana Trader API](/docs/blockchain/Solana/solana-trader-API/) — Trader analytics and smart money tracking
- [Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/) — Token supply data
- [Pump.fun API](/docs/blockchain/Solana/Pumpfun/Pump-Fun-API/) — Pump.fun token data
## Support
For questions or issues:
- [Bitquery Support](https://support.bitquery.io)
- [Bitquery IDE](https://ide.bitquery.io)
- [Bitquery Documentation](https://docs.bitquery.io)
---
## Solana Token Market Cap API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-token-marketcap-api/
Solana Token Market Cap API: stream Solana market cap, FDV, supply, and price using Bitquery Trading GraphQL APIs. See examples in the Bitquery IDE.
# Solana Token Market Cap API
## Video Tutorial | How to Track Thousands of Solana Tokens in a single websocket subscription
:::tip Need real-time Solana token market-cap data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Solana token market-cap swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Solana token market-cap data older than ~30 days**, raw per-swap detail, or call / event context.
:::
Use Bitquery’s **Trading** API **`Tokens`** cube to stream or query **market cap**, **fully diluted valuation (USD)**, **total supply**, **price** (OHLC and averages), and **volume** for tokens on **Solana**. Filter with **`solana:`** plus the token **mint** in **`Token.Id`** / **`Currency.Id`**; ranked queries below use **`Token.Network`** **`Solana`**.
For schema details and field meanings, see the **[Tokens cube](/docs/trading/crypto-price-api/tokens)** and **[Supply fields](/docs/trading/crypto-price-api/supply-fields)**.
## Related APIs
- **[Ethereum Token Market Cap API](/docs/blockchain/Ethereum/token-supply/ethereum-token-marketcap-api)** — **`eth:`** ids
- **[Base Token Market Cap API](/docs/blockchain/Base/base-token-marketcap-api)** — **`base:`** ids
- **[Arbitrum Token Market Cap API](/docs/blockchain/Arbitrum/arbitrum-token-marketcap-api)** — **`arbitrum:`** ids
- **[Polygon (Matic) Token Market Cap API](/docs/blockchain/Matic/matic-token-marketcap-api)** — **`matic:`** ids
- **[BSC Token Market Cap API](/docs/blockchain/BSC/bsc-token-marketcap-api)** — **`bsc:`** ids
- **[Crypto Price API — Tokens](/docs/trading/crypto-price-api/tokens)** — full `Tokens` cube reference
---
## How do I stream live Solana token market cap, price, and volume?
Subscribe to **`Tokens`** where **currency id** includes **`solana`**, with **interval duration** greater than **1** (second).
You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/solana-token-marketcap-stream).
```graphql
subscription MyQuery {
Trading {
Tokens(
where: {
Currency: { Id: { includes: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Price {
Average {
Mean
}
Ohlc {
Open
Low
High
Close
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
}
}
}
```
---
## How do I get the latest market cap for a specific token on Solana?
Use **`limit: { count: 1 }`**, **`orderBy: { descending: Block_Time }`**, and **`Token.Id`** with **`includesCaseInsensitive`** (e.g. **`solana:`** + mint).
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/specific-solana-token-latest-marketcap).
```graphql
query {
Trading {
Tokens(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
Token: {
Id: {
includesCaseInsensitive: "solana:JCsv6w5NGR9NWryUCQLD7gMHbSB9vZRAvgYqJTFKNT3K"
}
}
Interval: { Time: { Duration: { gt: 1 } } }
}
) {
Token {
Name
Id
Address
Symbol
}
Block {
Time
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
Price {
Average {
Mean
}
Ohlc {
Open
Low
High
Close
}
}
Volume {
Base
BaseAttributedToUsd
Quote
Usd
}
}
}
}
```
Replace the `includesCaseInsensitive` value with your token’s **`solana:`** id.
---
## How do I stream Solana tokens with market cap above $1 million?
Subscribe when **`Token.Id`** matches **Solana** (**`solana`**) and **`Supply.MarketCap`** **>** **1,000,000** (USD).
You can run this subscription [in the Bitquery IDE](https://ide.bitquery.io/realtime-stream-solana-tokens-with-marketcap-above-1-million).
```graphql
subscription {
Trading {
Tokens(
where: {
Token: { Id: { includesCaseInsensitive: "solana" } }
Interval: { Time: { Duration: { gt: 1 } } }
Supply: { MarketCap: { gt: 1000000 } }
}
) {
Currency {
Name
Id
Symbol
}
Token {
Name
Symbol
Id
Address
Network
}
Supply {
TotalSupply
FullyDilutedValuationUsd
MarketCap
}
}
}
}
```
:::tip Threshold and interval
Tune **`Supply.MarketCap`** and **`Interval.Time.Duration`** for your alerts or dashboards. See **[Tokens cube](/docs/trading/crypto-price-api/tokens)** for more filters.
:::
---
## How do I get top Solana tokens by market cap?
Ranks tokens on **Solana** by **`Supply.MarketCap`**, with **24h** window, **1s** interval, **$1,000+** USD volume, **`limitBy`** per **`Token_Id`**, up to **50** rows. **`Token.Network`** is **Solana**.
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/Top-Tokens-by-Market-Cap-on-solana).
```graphql
{
Trading {
Tokens(
limit: { count: 50 }
limitBy: { count: 1, by: Token_Id }
orderBy: { descending: Supply_MarketCap }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Interval: { Time: { Duration: { eq: 1 } } }
Volume: { Usd: { gt: 1000 } }
Token: { Network: { is: "Solana" } }
}
) {
Currency {
Id
Name
Symbol
}
Price {
Average {
Mean(maximum: Block_Time)
}
}
Volume {
Base(maximum: Block_Time)
Quote(maximum: Block_Time)
Usd(maximum: Block_Time)
}
Token {
Network
Symbol
Address
}
Supply {
MarketCap(maximum: Block_Time)
FullyDilutedValuationUsd(maximum: Block_Time)
TotalSupply(maximum: Block_Time)
}
}
}
}
```
---
## How do I get top Solana tokens by market cap change in 1 hour?
**1-hour** OHLC (`Duration: { eq: 3600 }`), ordered by **`change_mcap`**: **(close − open) × total supply**. **`Token.Network`** is **Solana**.
You can run this query [in the Bitquery IDE](https://ide.bitquery.io/top-solana-tokens-by-Market-Cap-Change-1h).
```graphql
{
Trading {
Tokens(
limit: { count: 50 }
orderBy: { descendingByField: "change_mcap" }
where: {
Interval: { Time: { Duration: { eq: 3600 } } }
Token: { Network: { is: "Solana" } }
}
) {
Currency {
Id
Name
Symbol
}
Token {
Network
Symbol
Address
}
Supply {
MarketCap
FullyDilutedValuationUsd
CirculatingSupply
TotalSupply
MaxSupply
}
change_mcap: calculate(
expression: "($Price_Ohlc_Close-$Price_Ohlc_Open) * Supply_TotalSupply"
)
Price {
Ohlc {
Open
Close
}
}
}
}
}
```
## Video tutorial
---
## Solana Token Price API: Latest Price, Live Stream, OHLC
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-token-price-api/
Solana token price API: latest USD price of any SPL token from its top market, a live price stream, a multi-token watchlist, hourly OHLC and top tokens by volume.
# Solana Token Price API
Get the USD price of any Solana token over GraphQL: the latest price, a live stream, several tokens at once, hourly candles, and the most traded tokens right now. Every query uses the [Trading API](/docs/trading/trading-data-overview), which prices each token from its DEX trades and normalizes the result to USD.
For one token, the most accurate price comes from its **top market**: the pool with the most trading volume, selected with `Ranking: { Position: { eq: 1 } }`. See [why the top market](/docs/trading/crypto-price-api/pairs#most-accurate-token-price) for the details.
:::note
To run these queries outside the [Bitquery IDE](https://ide.bitquery.io), you need an API access token. [How to generate one ➤](/docs/authorization/how-to-generate/)
:::
The examples use BONK (`DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263`). Replace it with any SPL token mint address.
## Latest price of a Solana token
Returns the latest 1-minute candle of the token's top market. `Price.Ohlc.Close` is the current USD price.
```graphql
{
Trading {
Pairs(
where: {
Token: {
Address: { is: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" }
Network: { is: "Solana" }
}
Ranking: { Position: { eq: 1 } }
Interval: { Time: { Duration: { eq: 60 } } }
Price: { IsQuotedInUsd: true }
}
limit: { count: 1 }
orderBy: { descending: Block_Time }
) {
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Protocol
Address
Network
}
Price {
IsQuotedInUsd
Ohlc {
Open
High
Low
Close
}
}
Ranking {
Position
Weight
}
Volume {
Usd
}
Block {
Time
}
}
}
}
```
## Stream a Solana token price in real time
The same filter as a WebSocket subscription, with 1-second intervals. Each message carries the newest price.
```graphql
subscription {
Trading {
Pairs(
where: {
Token: {
Address: { is: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" }
Network: { is: "Solana" }
}
Ranking: { Position: { eq: 1 } }
Interval: { Time: { Duration: { eq: 1 } } }
Price: { IsQuotedInUsd: true }
}
) {
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Protocol
Address
}
Price {
IsQuotedInUsd
Ohlc {
Close
}
}
Ranking {
Position
Weight
}
}
}
}
```
The top market can change as volume moves between pools, so read `Market.Address` from each message instead of assuming a fixed pool.
## Prices of several Solana tokens at once
Pass a list of mint addresses. `limitBy` keeps one row, the newest, per token.
```graphql
{
Trading {
Pairs(
where: {
Token: {
Address: {
in: [
"DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263"
"So11111111111111111111111111111111111111112"
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
}
Network: { is: "Solana" }
}
Ranking: { Position: { eq: 1 } }
Interval: { Time: { Duration: { eq: 60 } } }
Price: { IsQuotedInUsd: true }
Block: { Time: { since_relative: { minutes_ago: 10 } } }
}
limit: { count: 10 }
limitBy: { by: Token_Id, count: 1 }
orderBy: { descending: Block_Time }
) {
Token {
Symbol
Address
}
QuoteToken {
Symbol
}
Market {
Protocol
}
Price {
Ohlc {
Close
}
}
Ranking {
Position
Weight
}
Block {
Time
}
}
}
}
```
## Hourly OHLC candles for a Solana token
Hourly open, high, low and close for the last 24 hours, with USD volume per hour. Change `Duration` (in seconds) and `hours_ago` for other candle sizes and ranges.
```graphql
{
Trading {
Pairs(
where: {
Token: {
Address: { is: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263" }
Network: { is: "Solana" }
}
Ranking: { Position: { eq: 1 } }
Interval: { Time: { Duration: { eq: 3600 } } }
Price: { IsQuotedInUsd: true }
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
limit: { count: 24 }
orderBy: { descending: Block_Time }
) {
Token { Symbol }
Market { Protocol Address }
Price { Ohlc { Open High Low Close } }
Volume { Usd }
Block { Time }
}
}
}
```
For more intervals and chart-ready candles, see the [OHLC API](/docs/trading/crypto-price-api/crypto-ohlc-candle-k-line-api).
## Top Solana tokens by trading volume, with prices
The 10 Solana tokens with the most USD volume in the last hour, with their price. This uses the `Tokens` cube, which blends every pool a token trades in, which suits a chain-wide list.
```graphql
{
Trading {
Tokens(
where: {
Token: { Network: { is: "Solana" } }
Interval: { Time: { Duration: { eq: 3600 } } }
Price: { IsQuotedInUsd: true }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
limit: { count: 10 }
limitBy: { by: Token_Id, count: 1 }
orderBy: { descending: Volume_Usd }
) {
Token { Symbol Name Address }
Price { Average { Estimate } Ohlc { Close } }
Volume { Usd }
Block { Time }
}
}
}
```
## Related
- [Pairs cube](/docs/trading/crypto-price-api/pairs): all price fields and ranking rules
- [Tokens cube](/docs/trading/crypto-price-api/tokens): chain-wide prices and volume
- [Solana token market cap API](/docs/blockchain/Solana/solana-token-marketcap-api)
- [Solana token supply API](/docs/blockchain/Solana/token-supply-cube)
---
## Solana Token Search API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-search-tokens/
Solana token search: find tokens by name, symbol or mint address, with case-insensitive matching and wildcard patterns using likeCaseInsensitive filters.
# Solana Token Search API
## Search Tokens on Solana
You can search tokens on Solana using names or symbols using our APIs and get prices and other details.
You can find the query [here](https://ide.bitquery.io/search-solana-tokens)
```graphql
{
Solana {
DEXTrades(
orderBy: { descending: Block_Time }
limit: { count: 100 }
limitBy: { by: Trade_Buy_Currency_MintAddress, count: 1 }
where: { Trade: { Buy: { Currency: { Name: { includes: "pe" } } } } }
) {
Trade {
Buy {
Price
PriceInUSD
Currency {
Name
Symbol
MintAddress
}
}
Sell {
Currency {
Name
Symbol
MintAddress
}
}
}
}
}
}
```
## Search Tokens on Solana (Case Insensitive)
You can search tokens on Solana using names or symbols case insensitively also using our APIs and get prices and other details.
You can find the query [here](https://ide.bitquery.io/Currency-with-elon-inclusion).
```graphql
{
Solana {
Transfers(
where: {
Transfer: { Currency: { Symbol: { includesCaseInsensitive: "elon" } } }
}
) {
Transfer {
Currency {
MintAddress
Symbol
}
}
count
}
}
}
```
## Search Tokens with Symbol on Solana using likeCaseInsensitive (Case Insensitive)
Get tokens which have a certain specific symbol. This API is case insensitive. In this API we are getting tokens in descending order of their trade volume in last hour which has symbol `trump`.
You can find the query [here](https://ide.bitquery.io/Token-Search-API---trump-symbol#).
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since: "2025-02-28T07:00:00Z" } }
Trade: { Currency: { Symbol: { likeCaseInsensitive: "trump" } } }
Transaction: { Result: { Success: true } }
}
limit: { count: 50 }
orderBy: { descendingByField: "trade_volume" }
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
Dex {
ProtocolName
}
Market {
MarketAddress
}
Side {
Currency {
Name
MintAddress
Symbol
}
}
}
trade_volume: sum(of: Trade_Side_AmountInUSD)
trades: count
}
}
}
```
## Search Tokens with Symbol on Solana using likeCaseInsensitive plus wildcard(%) (Case Insensitive)
Get tokens which have a certain specific symbol `%pump` where "%" can replace any number of characters, its basically a placeholder. This API is case insensitive. In this API we are getting tokens in descending order of their trade volume in last hour which has symbol ending with "pump".
You can find the query [here](https://ide.bitquery.io/token-search-api--pump-wildcard#).
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since: "2025-02-28T07:00:00Z" } }
Trade: { Currency: { Symbol: { likeCaseInsensitive: "%pump" } } }
Transaction: { Result: { Success: true } }
}
limit: { count: 50 }
orderBy: { descendingByField: "trade_volume" }
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
Dex {
ProtocolName
}
Market {
MarketAddress
}
Side {
Currency {
Name
MintAddress
Symbol
}
}
}
trade_volume: sum(of: Trade_Side_AmountInUSD)
trades: count
}
}
}
```
## Search Tokens with Symbol on Solana using likeCaseInsensitive plus wildcard(\_) (Case Insensitive)
Get tokens which have a certain specific symbol `p_e` where "\_" will replace 1 character, its basically a placeholder for 1 character. This API is case insensitive. In this API we are getting tokens in descending order of their trade volume in last hour.
You can find the query [here](https://ide.bitquery.io/Token-Search-API-for-symbol---p_e-wildcard#).
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since: "2025-02-28T07:00:00Z" } }
Trade: { Currency: { Symbol: { likeCaseInsensitive: "p_e" } } }
Transaction: { Result: { Success: true } }
}
limit: { count: 50 }
orderBy: { descendingByField: "trade_volume" }
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
Dex {
ProtocolName
}
Market {
MarketAddress
}
Side {
Currency {
Name
MintAddress
Symbol
}
}
}
trade_volume: sum(of: Trade_Side_AmountInUSD)
trades: count
}
}
}
```
## Search Tokens with MintAddress on Solana using likeCaseInsensitive (Case Insensitive)
Get tokens which have a certain specific address `%pump` where "%" can replace any number of characters, its basically a placeholder. This API is case insensitive. In this API we are getting tokens in descending order of their trade volume in last hour which has mint address ending with "pump".
You can find the query [here](https://ide.bitquery.io/Token-search-api-in-mint-address#).
```graphql
query MyQuery {
Solana {
DEXTradeByTokens(
where: {
Block: { Time: { since: "2025-02-28T07:00:00Z" } }
Trade: { Currency: { MintAddress: { likeCaseInsensitive: "%pump" } } }
Transaction: { Result: { Success: true } }
}
limit: { count: 50 }
orderBy: { descendingByField: "trade_volume" }
) {
Trade {
Currency {
Name
MintAddress
Symbol
}
Dex {
ProtocolName
}
Market {
MarketAddress
}
Side {
Currency {
Name
MintAddress
Symbol
}
}
}
trade_volume: sum(of: Trade_Side_AmountInUSD)
trades: count
}
}
}
```
## Video Tutorial | Token Search API Overview | Search Tokens efficiently using symbol, address, etc
---
## Solana Token Supply API
URL: https://docs.bitquery.io/docs/blockchain/Solana/token-supply-cube/
Track Solana token supply with Bitquery GraphQL: subscribe to supply changes, query mint and burn events, and read circulating supply for any SPL token.
# Solana Token Supply API
In this section we will see how to get Solana Token Supply information using our API. For token prices, see the [Solana Token Price API](/docs/blockchain/Solana/solana-token-price-api).
Supply metrics are part of the broader [Token API](https://bitquery.io/products/digital-assets) — transfers, supply and new token creation across chains.
## Overview
The **Solana Token Supply API** provides comprehensive access to real-time token supply data on the Solana blockchain. This API enables you to track token creation, monitor supply changes, calculate market capitalization, and analyze token burn events with detailed metadata and real-time updates.
## 📋 Table of Contents
- **[Subscribe to Token Supply Changes](#subscribe-to-token-supply-changes)** - Real-time supply monitoring
- **[Get Supply of Specific Token](#get-supply-of-specific-token)** - Individual token supply tracking
- **[Token Creation Tracking](#token-creation-tracking)** - New token creation events
- **[Market Cap Analysis](#market-cap-analysis)** - Market capitalization queries
- **[Token Burn Events](#token-burn-events)** - Burn event monitoring
- **[Video Tutorials](#video-tutorials)** - Step-by-step guides
## 🔗 Related Solana APIs
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Track token creation and burn instructions
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor balance changes from supply updates
- **[Solana Transfers API](/docs/blockchain/Solana/solana-transfers/)** - Track transfers that affect token supply
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Monitor trading activities impacting supply
- **[Solana Fees API](/docs/blockchain/Solana/solana_fees_api/)** - Analyze fees from supply-related transactions
## Subscribe to Token Supply Changes
This subscription will return the token supply changes in realtime. `PostBalance` will give you the current supply. Check the query [here](https://ide.bitquery.io/token-supply-updates-sub)
For tracking the instructions that cause these supply changes (like token creation and burning), see our **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)**.
```graphql
subscription {
Solana {
TokenSupplyUpdates {
TokenSupplyUpdate {
Amount
Currency {
MintAddress
Name
}
PreBalance
PostBalance
}
}
}
}
```
## Get Supply of specific Token
This query will return the latest token supply of a specific token. We are getting here supply for this `6D7NaB2xsLd7cauWu1wKk6KBsJohJmP2qZH9GEfVi5Ui` token `PostBalance` will give you the current supply for this token. Check the query [here](https://ide.bitquery.io/token-supply_2)
```graphql
{
Solana {
TokenSupplyUpdates(
limit: { count: 1 }
orderBy: { descending: Block_Time }
where: {
TokenSupplyUpdate: {
Currency: { MintAddress: { is: "token mint address" } }
}
}
) {
TokenSupplyUpdate {
Amount
Currency {
MintAddress
Name
}
PreBalance
PostBalance
}
}
}
}
```
---
## Token Creation Tracking
### Get newly created Pump Fun tokens, Creation Time, Dev Address, Metadata
Now you can track the newly created Pump Fun Tokens along with their dev address, metadata and supply. `PostBalance` will give you the current supply for the token. Check the query [here](https://ide.bitquery.io/newly-created-PF-token-dev-address-metadata)
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P" }
Method: { is: "create" }
}
}
}
) {
Block {
Time
}
Transaction {
Signer
}
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
```
### Get newly created Moonshot tokens and their Metadata
Now you can track the newly created Moonshot Tokens along with their metadata and supply. `PostBalance` will give you the current supply for the token. Check the query [here](https://ide.bitquery.io/Get-newly-created-Moonshot-tokens-with-metadata#)
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {
Instruction: {
Program: {
Address: { is: "MoonCVVNZFSYkqNXP6bxHLPL6QQJiMagDL3qcqUQTrG" }
Method: { is: "tokenMint" }
}
}
}
) {
TokenSupplyUpdate {
Amount
Currency {
Symbol
ProgramAddress
PrimarySaleHappened
Native
Name
MintAddress
MetadataAddress
Key
IsMutable
Fungible
EditionNonce
Decimals
Wrapped
VerifiedCollection
Uri
UpdateAuthority
TokenStandard
}
PostBalance
}
}
}
}
```
---
## Market Cap Analysis
### Top 10 Solana tokens with the highest marketcap increase in last 1hr
Use below query to get top 10 marketcap jump tokens in last 1hr. Test the query [here](https://ide.bitquery.io/top-10-marketcap-jump-tokens-in-last-1hr#)
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
limit: {count: 10}
orderBy: {descendingByField: "marketcapJump"}
where: {Transaction: {Result: {Success: true}}, Block: {Time: {since_relative: {minutes_ago: 60}}}}
) {
TokenSupplyUpdate {
AmountInUSD
pre: PreBalanceInUSD
post: PostBalanceInUSD
Currency {
MintAddress
Name
Symbol
Decimals
}
}
marketcapJump: calculate(
expression: "(($TokenSupplyUpdate_post - $TokenSupplyUpdate_pre) / $TokenSupplyUpdate_pre) * 100"
)
}
}
}
```
## Marketcap of a Token
We use `PostBalanceInUSD` field to get the marketcap. Since it is built on real-time data, you will get the Marketcap if the token was active in the past 8 hours or is being transacted in real-time.
[This](https://ide.bitquery.io/market-cap-of-token_1) query returns latest marketcap of a particular token.
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
Currency: { MintAddress: { is: "token mint address" } }
}
}
limit: { count: 1 }
orderBy: { descending: Block_Time }
) {
TokenSupplyUpdate {
PostBalanceInUSD
}
}
}
}
```
In case PostAmountInUSD is 0 then, you need to pull price from our Crypto price API.
Here is an example which gets both supply and Price.
[Run query](https://ide.bitquery.io/marketcap-query)
```graphql
{
Solana {
TokenSupplyUpdates(
where: {TokenSupplyUpdate: {Currency: {MintAddress: {is: "4iBhvT6bpCf92u12P1kpbejYrHDS6N3hJCNtAq6wpump"}}}}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
TokenSupplyUpdate {
Currency {
Name
Symbol
MintAddress
Decimals
}
PostBalance
PostBalanceInUSD
}
}
}
Trading {
Tokens(
limit: {count: 1}
where: {Price: {IsQuotedInUsd: true}, Interval: {Time: {Duration: {eq: 1}}}, Token: {Address: {is: "4iBhvT6bpCf92u12P1kpbejYrHDS6N3hJCNtAq6wpump"}}}
) {
Block {
Time(maximum: Block_Time)
}
Price {
Average {
Mean
}
}
}
}
}
```
## Monitor Market Cap Metric for a Pump Fun Token
The subscription given [below](https://ide.bitquery.io/pump-fun-token-mcap-monitoring) could be used to setup a [websocket](/docs/subscriptions/websockets/) like solution that monitors market cap of a Pump Fun token in real time, where the `PostBalanceInUSD` is essentially the marketcap of the token.
```graphql
subscription {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
Currency: { MintAddress: { is: "token mint address" } }
}
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
PostBalanceInUSD
}
}
}
}
```
## Top Solana Tokens By MarketCap
[This](https://ide.bitquery.io/top-Solana-tokens-based-on-market-cap) query returns the top Solana tokens based on the latest MarketCap.
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
orderBy: {
descending: Block_Time
descendingByField: "TokenSupplyUpdate_Marketcap"
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Fungible
Decimals
}
}
}
}
}
```
## Top 100 Pump Fun Tokens By MarketCap
[This](https://ide.bitquery.io/top-pump-fun-tokens-based-on-market-cap_1) query returns the top Solana tokens based on the latest MarketCap.
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: { Currency: { MintAddress: { includes: "pump" } } }
}
orderBy: {
descending: Block_Time
descendingByField: "TokenSupplyUpdate_Marketcap"
}
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
limit: { count: 100 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Fungible
Decimals
Uri
}
}
}
}
}
```
## Get Solana Tokens With a Specific MarketCap
Lets say we need to get the tokens whose marketcap has crossed the `1M USD` mark but is less than `2M USD` for various reasons like automated trading. We can get the token details that have crossed a particular marketcap using [this](https://ide.bitquery.io/tokens-with-market-cap-range) query.
```graphql
query MyQuery {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: {
PostBalanceInUSD: { ge: "1000000", le: "2000000" }
}
}
orderBy: { descending: Block_Time }
limitBy: { by: TokenSupplyUpdate_Currency_MintAddress, count: 1 }
) {
TokenSupplyUpdate {
Marketcap: PostBalanceInUSD
Currency {
Name
Symbol
MintAddress
Decimals
Uri
}
}
}
}
}
```
---
## Token Burn Events
### Get Latest Token Burn Events on Solana
We will be using the token supply API to query recent token liquidity removals (token burn). You can modify this query to track burn events of a specific token using `Currency` filter in real time or query it.
You can run the query [here](https://ide.bitquery.io/burn-token-supply-updates)
```graphql
query MyQuery {
Solana(network: solana) {
TokenSupplyUpdates(
where: {
Instruction: { Program: { Method: { in: ["Burn"] } } }
TokenSupplyUpdate: {}
}
limit: { count: 100 }
orderBy: { descending: Block_Time }
) {
TokenSupplyUpdate {
PostBalanceInUSD
PostBalance
Amount
Currency {
Name
MintAddress
}
}
Instruction {
Program {
Name
Method
}
}
}
}
}
```
---
## Video Tutorials
### Video Tutorial on Streaming and Getting Total Supply of a Solana Token
### Video Tutorial on Getting New Pump Fun Token Metadata
### Video Tutorial | How to get Newly Created Pump Fun Tokens, Dev Address, Creation Time, Metadata
### Video Tutorial | How to get Top Solana tokens by Marketcap increase in last 1 hr
---
## Solana Trader API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-trader-API/
Solana trader data with Bitquery: top traders by USD volume, live wallet trades with balances, buy and sell counts, and a token's first 100 buyers.
# Solana Trader API
:::tip 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**](/docs/trading/trading-data-overview). [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) 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](/docs/blockchain/Solana/solana-dextrades/).
:::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](https://ide.bitquery.io/top-traders-for-a-specific-token)
```graphql
{
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](https://ide.bitquery.io/Trades-of-wallets-in-realtime_1).
```graphql
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](https://ide.bitquery.io/Trades-of-wallets-with-balance-Updates-in-that-trades).
```graphql
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](/docs/trading/crypto-trades-api/trades-api/), 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](https://ide.bitquery.io/buys-and-sells-of-a-traders)
```graphql
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)
}
}
}
```
```json
{
"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](https://ide.bitquery.io/Total-buy-total-sell-avg-sell-last-active)
```graphql
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}}}})
}
}
}
```
```json
{
"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](/docs/subscriptions/websockets/)
Filter by wallet with `Account: {Address: {is}}`. Open it in the [Bitquery IDE](https://ide.bitquery.io/trades-of-a-wallet_2)
Switch `subscription` to `query` to read the wallet's past activity instead.
```graphql
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](https://ide.bitquery.io/get-first-100-buyers-of-a-token_1)
```graphql
query MyQuery {
Solana {
DEXTrades(
where: {
Trade: {
Buy: {
Currency: {
MintAddress: {
is: "2Z4FzKBcw48KBD2PaR4wtxo4sYGbS7QqTQCLoQnUpump"
}
}
}
}
}
limit: { count: 100 }
orderBy: { ascending: Block_Time }
) {
Trade {
Buy {
Amount
Account {
Token {
Owner
}
}
}
}
}
}
}
```
---
## Solana Transactions API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-transactions/
Solana transactions: subscribe to recent transactions in real time and filter them by dynamic criteria such as fees, signer or success status.
# Solana Transactions API
In this section we'll have a look at some examples using the Solana Transactions API.
## Subscribe to Recent Transactions
The subscription query below fetches the most recent transactions on the Solana blockchain
You can find the query [here](https://ide.bitquery.io/Realtime-Solana-Transactions)
```graphql
subscription {
Solana {
Transactions(limit: {count: 10}) {
Block {
Time
Hash
}
Transaction {
BalanceUpdatesCount
Accounts {
Address
IsWritable
}
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
TokenBalanceUpdatesCount
InstructionsCount
}
}
}
}
```
## Filtering Solana Transactions Based on Dynamic Criteria
In this subscription query we will see how to set dynamic filters for the transactions to be retrieved based on various transaction properties. Developers can monitor specific types of transactions on the Solana network, such as high-volume or high-fee transactions.
You can run the query [here](https://ide.bitquery.io/Solana-tx-dynamic-filter)
#### Variables
- **`$network`**: Specifies the Solana network.
- **`$tx_filter`**: A filter object used to specify the criteria for transactions to retrieve.
```graphql
subscription(
$network: solana_network
$tx_filter: Solana_Transaction_Filter
) {
Solana(network: $network) {
Transactions(where:$tx_filter) {
Block {
Time
Hash
}
Transaction {
BalanceUpdatesCount
Accounts {
Address
IsWritable
}
Signer
Signature
Result {
Success
ErrorMessage
}
Index
Fee
TokenBalanceUpdatesCount
InstructionsCount
}
}
}
}
{
"network": "solana",
"tx_filter":{"Transaction": {"TokenBalanceUpdatesCount": {"gt": 10}, "FeeInUSD": {"ge": "0.0010"}}}
}
```
---
## Solana Transfers API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-transfers/
Solana Transfers API: monitor Solana native and token transfers in real time with Bitquery GraphQL APIs. Scale further with Kafka or gRPC streams.
# Solana Transfers API
> **Before you start**: Not sure when to use Transfers vs DEX Trades vs other data primitives? Read our [Mental Model guide](/docs/start/mental-model-transfers-events-calls) to understand which primitive to use for your use case.
In this section we'll have a look at some examples using the Solana Transfers API.
## 🔗 Related Solana APIs
- **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)** - Monitor balance changes from transfers
- **[Solana Instructions API](/docs/blockchain/Solana/solana-instructions/)** - Track transfer instructions and events
- **[Solana DEX Trades API](/docs/blockchain/Solana/solana-dextrades/)** - Monitor trading transfers and swaps
- **[Solana Fees API](/docs/blockchain/Solana/solana_fees_api/)** - Analyze transfer fees and transaction costs
- **[Solana Token Supply API](/docs/blockchain/Solana/token-supply-cube/)** - Track supply changes from transfers
- **[Historical Transfers API](https://docs.bitquery.io/v1/docs/Examples/Solana/transfers)**
## Subscribe to all transfers on Solana
This includes all types of transactions; transfers, swaps, and other types of transactions on Solana
For monitoring the balance changes that result from these transfers, see our **[Solana Balance Updates API](/docs/blockchain/Solana/solana-balance-updates/)**.
[Run Stream >](https://ide.bitquery.io/Subscribe-to-the-all-transfers-on-Solana)
```graphql
subscription {
Solana(network: solana) {
Transfers {
Transfer {
Amount
AmountInUSD
Currency {
Name
MintAddress
Fungible
Symbol
Uri
}
Receiver {
Address
}
Sender {
Address
}
}
Transaction {
Signature
}
}
}
}
```
## Subscribe to the latest NFT token transfers on Solana
Let's see an example of NFT token transfers using GraphQL Subscription (Webhook). In the following API, we will be subscribing to all NFT token transfers. You can run the query [here](https://ide.bitquery.io/Subscribe-to-the-latest-NFT-transfers-on-Solana)
```graphql
subscription {
Solana {
Transfers(where: {Transfer: {Currency: {Fungible: false}}}) {
Transfer {
Amount
AmountInUSD
Currency {
Name
MintAddress
Fungible
Symbol
Uri
}
Receiver {
Address
}
Sender {
Address
}
}
Transaction {
Signature
}
}
}
}
```
## SPL Token Transfers API | Token transfers of a particular token on Solana
One of the most common types of transfers on Solana are SPL token transfers. Let's see an example to get the latest SPL token transfers using our API. Today we are taking an example of JUPITER token transfers. The contract address for the JUPITER token is `JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN`. You can find the query [here](https://ide.bitquery.io/SPL-transfers-websocket_1)
```graphql
subscription {
Solana {
Transfers(
where: {Transfer: {Currency: {MintAddress: {is: "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN"}}}}
) {
Transfer {
Currency {
MintAddress
Symbol
Name
Fungible
Native
}
Receiver {
Address
}
Sender {
Address
}
Amount
AmountInUSD
}
}
}
}
```
## Get transfers in a Transaction Signature
This query will help you fetch transfers for a particular transaction signature `3x3fbg3zfTvcfwEiDee5Z5NnQP2Hr7cgZZ9bMxNYtYKi6fMN9gT6xpdUzRb2FjfCkGXMPvhkt3bW61CHCNaWwdQi`. Check the query [here](https://ide.bitquery.io/Query-transfer-by-sig)
```graphql
{
Solana(dataset: realtime) {
Transfers(
limit: {count: 10}
orderBy: {descending: Block_Slot}
where: {Transaction: {Signature: {is: "3x3fbg3zfTvcfwEiDee5Z5NnQP2Hr7cgZZ9bMxNYtYKi6fMN9gT6xpdUzRb2FjfCkGXMPvhkt3bW61CHCNaWwdQi"}}}
) {
Transaction {
Signature
}
Block {
Slot
}
count
Transfer {
Amount
AmountInUSD
Currency {
MintAddress
Name
Symbol
}
Receiver {
Address
}
Index
Sender {
Address
}
}
}
}
}
```
## Transfers sent by specific address
This websocket retrieves transfers where the sender is a particular address `2g9NLWUM6bPm9xq2FBsb3MT3F3G5HDraGqZQEVzcCWTc`. For this subscription query we use `where` keyword and in that we specify `{Transfer: {Sender: {Address: {is: "2g9NLWUM6bPm9xq2FBsb3MT3F3G5HDraGqZQEVzcCWTc"}}}}` to get the desired data. You can find the query [here](https://ide.bitquery.io/transfers-where-sender-is-the-specified-address_1)
```graphql
subscription {
Solana {
Transfers(
where: {Transfer: {Sender: {Address: {is: "2g9NLWUM6bPm9xq2FBsb3MT3F3G5HDraGqZQEVzcCWTc"}}}}
) {
Transaction {
Signature
}
Transfer {
Amount
AmountInUSD
Sender {
Address
}
Receiver {
Address
}
Currency {
Name
Symbol
MintAddress
}
}
}
}
}
```
## Monitor multiple solana wallets transfers in real time using Websocket
You can also monitor multiple wallet addresses using Bitquery's GraphQL subscription via WebSocket. The following query listens to real-time transfers sent or received by the specified wallet addresses.
You can include around 100 addresses in a single subscription, potentially more, as we typically do not throttle this on our end.
However, if you need to track thousands of addresses, you can subscribe to all transfers and filter them on your side.
Websockets are priced based on their running time, not the amount of data delivered.
Run query using [this link](https://ide.bitquery.io/Solana-Websocket---Subscribe-to-all-transfers-of-specific-addresses-in-realtime)
```graphql
subscription {
Solana {
Transfers(
where: {
any: [
{
Transfer: {
Sender: {
Address: {
in: [
"7Ppgch9d4XRAygVNJP4bDkc7V6htYXGfghX4zzG9r4cH"
"G6xptnrkj4bxg9H9ZyPzmAnNsGghSxZ7oBCL1KNKJUza"
]
}
}
}
}
{
Transfer: {
Receiver: {
Address: {
in: [
"7Ppgch9d4XRAygVNJP4bDkc7V6htYXGfghX4zzG9r4cH"
"G6xptnrkj4bxg9H9ZyPzmAnNsGghSxZ7oBCL1KNKJUza"
]
}
}
}
}
]
}
) {
Transfer {
Amount
AmountInUSD
Authority {
Address
}
Currency {
Decimals
CollectionAddress
Fungible
MetadataAddress
MintAddress
Name
Native
Symbol
}
Receiver {
Address
}
Sender {
Address
}
}
}
}
}
```
## Transfers of a wallet address
This query fetches you the recent 10 transfers of a specific wallet address `9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8`. Try the query [here](https://ide.bitquery.io/Transfers-of-a-wallet_1).
```graphql
{
Solana {
Transfers(
limit: {count: 10}
orderBy: {descending: Block_Time}
where: {any: [{Transfer: {Sender: {Address: {is: "9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8"}}}}, {Transfer: {Receiver: {Address:{is: "9nnLbotNTcUhvbrsA6Mdkx45Sm82G35zo28AqUvjExn8"}} }}]}
) {
Transaction {
Signature
}
Transfer {
Amount
AmountInUSD
Sender{
Address
}
Receiver{
Address
}
}
}
}
}
```
## Video Tutorial on Solana Transfers API | How to get NFT, SPL Transfers data on Solana in Realtime
---
## Solana Xstocks API
URL: https://docs.bitquery.io/docs/blockchain/Solana/xstocks-api/
xStocks tokenized stocks on Solana: real-time trades, latest price, live price and market cap, OHLC, top traders, volume of Tesla, Apple and Meta.
# xStocks API
:::tip These examples use the Trading API
The queries on this page use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered xStocks swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**, and [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) / [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) give you ready-made OHLC candles. `Trading.Trades` covers **real-time and roughly the last 30 days**; for xStocks history older than that, drop down to the chain-level [`DEXTradeByTokens`](/docs/cubes/dextradesbyTokens) cube.
:::
:::note RFQ fills are included from 29 September 2026
xStocks trade in pools and through Jupiter Z RFQ quotes. Since 15:06 UTC that day, the RFQ fills are in the trade data too, with `Pair.Market.Protocol` set to `order_engine` and the market maker's wallet as `Pair.Market.Address`. Trade and volume queries on this page that filter by token return them alongside pool trades; the price and OHLC queries pinned to the top-ranked market may not. Earlier RFQ fills are not included. For maker-level detail, and for Ondo's tokenized stocks, which trade almost only through RFQ, see the [Solana RFQ API](/docs/blockchain/Solana/solana-rfq-api/).
:::
## Tesla xStock Trades in Real-Time
Below subscription gives you realtime trades of Tesla's xStocks token. The token is selected with `Pair.Token.Id`, which on Solana takes the form `bid:solana:`.
[Run in IDE ➤](https://ide.bitquery.io/Tesla-stock-trades-stream)
```graphql
subscription LatestTrades {
Trading {
Trades(
where: {
Pair: {
Market: { Network: { is: "Solana" } }
Token: {
Id: { is: "bid:solana:XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB" }
}
}
}
) {
Block {
Time
}
TransactionHeader {
Hash
}
Side
Price
PriceInUsd
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Trader {
Address
}
Supply {
CirculatingSupply
TotalSupply
MarketCap
FullyDilutedValuationUsd
}
Pair {
Pool {
Address
}
Market {
Address
Program
Protocol
Network
}
Token {
Address
Id
Symbol
Name
}
QuoteToken {
Address
Id
Symbol
Name
}
}
}
}
}
```
## Latest Price of the Apple xstock
You can use the following query to get the latest price of AAPLx, the Apple token, on Solana. We are using `Ranking_Position` filter set to one to ensure that the latest price comes from the pair providing the most liquidity, hence the price is normalised. If you need the latest price regardless of that, then the filter could be removed.
[Run in IDE ➤](https://ide.bitquery.io/Apple-xStock-latest-price)
```graphql
{
Trading {
Trades(
where: {Pair: {Token: {Address: {is: "XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp"}, Network: {is: "Solana"}}}, Ranking: {Position: {eq: 1}}}
limit: {count: 1}
orderBy: {descending: Block_Time}
) {
Block {
Time
}
Price
PriceInUsd
Pair {
QuoteToken {
Address
Name
Symbol
}
}
}
}
}
```
## Stream Real Time Price and Marketcap of Apple xstock
Change the query above into a subscription to receive every new AAPLx print as it is confirmed on-chain. By adding the Supply_MarketCap, you can also see the Market cap of the token in real time.
[Run in IDE ➤](https://ide.bitquery.io/Apple-xStock-price-and-market-cap-stream)
```graphql
subscription {
Trading {
Trades(
where: {Pair: {Token: {Address: {is: "XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp"}, Network: {is: "Solana"}}}, Ranking: {Position: {eq: 1}}}
) {
Block {
Time
}
Price
PriceInUsd
Pair {
QuoteToken {
Address
Name
Symbol
}
}
Supply{
MarketCap
}
}
}
}
```
## Tesla xStock OHLC API
The Trading API publishes ready-made candles, so you no longer need to aggregate raw trades yourself. The query below returns the last 10 one-minute candles for the Tesla token on its top-ranked market. Change `Interval.Time.Duration` to get another timeframe (`60` = 1 minute, `300` = 5 minutes, `3600` = 1 hour).
[Run in IDE ➤](https://ide.bitquery.io/Tslax-OHLCV)
```graphql
{
Trading {
Pairs(
where: {
Token: {
Address: { is: "XsDoVfqeBukxuZHWhdvWHBhgEHjGNst4MLodqsJHzoB" }
Network: { is: "Solana" }
}
Ranking: { Position: { eq: 1 } }
Interval: { Time: { Duration: { eq: 60 } } }
Price: { IsQuotedInUsd: true }
}
limit: { count: 10 }
orderBy: { descending: Block_Time }
) {
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
Market {
Protocol
Address
Network
}
Interval {
Time {
Start
Duration
End
}
}
Price {
IsQuotedInUsd
Ohlc {
Open
High
Low
Close
}
}
Volume {
Base
Quote
Usd
}
Block {
Time
}
}
}
}
```
For candles blended across every market the token trades on, use the [`Tokens`](/docs/trading/crypto-price-api/tokens) cube with the same `Interval` filter instead of `Pairs`.
## Get the Top Traders of the Apple xStock
The below query gets the top traders of AAPLx `XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp`, ranked by USD volume over the last 24 hours. Keep in mind you can use this API only as a query and not a subscription websocket, because aggregates don't work with subscriptions and you will end up getting wrong results.
[Run in IDE ➤](https://ide.bitquery.io/Top-traders-of-Apple-on-xStocks)
```graphql
query TopTraders($token: String) {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "volume" }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: { Network: { is: "Solana" } }
Token: { Id: { is: $token } }
}
}
) {
Trader {
Address
}
Pair {
Token {
Symbol
Name
Address
}
}
trades: count
volume: sum(of: AmountsInUsd_Quote)
buyVolume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Buy" } })
sellVolume: sum(of: AmountsInUsd_Quote, if: { Side: { is: "Sell" } })
}
}
}
```
```json
{
"token": "bid:solana:XsbEhLAtcf6HdfpFZ5xEMdqW8nfAvcsP5bdudRLJzJp"
}
```
`AmountsInUsd.Quote` is the reliable USD side; see [Use `AmountsInUsd.Quote` for USD](/docs/trading/crypto-trades-api/trades-api) for why you should not aggregate on `.Base`.
## Get trading volume, buy volume, sell volume of the Meta xStock
This query fetches you the traded volume, buy volume and sell volume of METAx `Xsa62P5mvPszXL1krVUnU5ar38bBSVcWAB6fmPCo5Zu` over the last 24 hours, broken out per market.
[Run in IDE ➤](https://ide.bitquery.io/trading-volume-buy-volume-sell-volume-of-the-Meta-xStock-per-pool)
```graphql
query MyQuery {
Trading {
Trades(
limit: { count: 100 }
orderBy: { descendingByField: "traded_volume_USD" }
where: {
Block: { Time: { since_relative: { hours_ago: 24 } } }
Pair: {
Market: { Network: { is: "Solana" } }
Token: {
Id: { is: "bid:solana:Xsa62P5mvPszXL1krVUnU5ar38bBSVcWAB6fmPCo5Zu" }
}
}
}
) {
Pair {
Market {
Protocol
Address
}
Token {
Name
Symbol
Address
}
QuoteToken {
Name
Symbol
Address
}
}
trades: count
traded_volume_USD: sum(of: AmountsInUsd_Quote)
traded_volume: sum(of: Amounts_Base)
buy_volume: sum(of: Amounts_Base, if: { Side: { is: "Buy" } })
sell_volume: sum(of: Amounts_Base, if: { Side: { is: "Sell" } })
}
}
}
```
## Video Tutorial | How to Monitor Tokenized Stocks (Tesla, Apple, Meta, etc) on Solana
---
## Solana Zeta Markets API
URL: https://docs.bitquery.io/docs/blockchain/Solana/solana-zeta/
Zeta DEX on Solana: track placed orders, liquidations, fund settlements, and order cancellations in real time with GraphQL subscriptions.
# ZETA DEX API
:::tip Need real-time Zeta data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview) — [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean, MEV-filtered Zeta swaps with **USD price, market cap, and supply on every row** across **10 chains in one API**. Use this page when you need **historical Zeta data older than ~30 days**, raw per-swap detail, or call / event context.
:::
In this section, we'll show you how to access information about Zeta DEX data using Bitquery APIs.
## Track Order placed on Zeta in Realtime
To retrieve the latest orders placed on Zeta DEX, we will utilize the Solana instructions API/Websocket.
We will specifically look for the latest instructions from Zeta's program, identified by the program ID `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`, [using this query](https://ide.bitquery.io/Get-all-the-Zeta-Program-methods#). And then we can see in the response that the method with the largest count is an empty string which should be the method to place orders. We will filter for this method to get the orders placed on Zeta in realtime.
You can run this query using this [link](https://ide.bitquery.io/Track-orders-placed-on-Zeta-in-realtime#).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD" }
Method: { is: "" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Owner
Mint
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
}
}
Name
Method
}
}
Transaction {
Signature
}
}
}
}
```
## Track Liquidations happening on Zeta in Realtime
To track the latest Liquidations on Zeta DEX, we will utilize the Solana instructions API/Websocket.
We will specifically look for the latest instructions from Zeta's program, identified by the program ID `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`, [using this query](https://ide.bitquery.io/Get-all-the-Zeta-Program-methods#). And then we can see in the response `liquidateV2` method which is called to initialize a liquidation. We will filter for this method to get the liquidations on Zeta in realtime.
You can run this query using this [link](https://ide.bitquery.io/Track-Liquidations-on-Zeta-in-realtime).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD" }
Method: { is: "liquidateV2" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Owner
Mint
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
}
}
Name
Method
}
}
Transaction {
Signature
}
}
}
}
```
## Track Settling of Funds on Zeta in Realtime
To retrieve the latest settling of funds transactions on Zeta DEX, we will utilize the Solana instructions API/Websocket.
We will specifically look for the latest instructions from Zeta's program, identified by the program ID `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`, [using this query](https://ide.bitquery.io/Get-all-the-Zeta-Program-methods#). And then we can see in the response `settleDEXFunds` method which is called to initialize a settlement. We will filter for this method to track the settlements on Zeta in realtime.
You can run this query using this [link](https://ide.bitquery.io/Track-settling-of-funds-on-Zeta-in-realtime).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD" }
Method: { is: "settleDexFunds" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Owner
Mint
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
}
}
Name
Method
}
}
Transaction {
Signature
}
}
}
}
```
## Track Cancelling of orders on Zeta in Realtime
To retrieve the latest cancelling of orders on Zeta DEX, we will utilize the Solana instructions API/Websocket.
We will specifically look for the latest instructions from Zeta's program, identified by the program ID `ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD`, [using this query](https://ide.bitquery.io/Get-all-the-Zeta-Program-methods#). And then we can see in the response `cancelOrder` method which is called to initialize a cancellation.
You can run this query using this [link](https://ide.bitquery.io/Track-cancelling-of-Orders-on-Zeta-in-realtime).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "ZETAxsqBRek56DhiGXrn75yj2NHU3aYUnxvHXpkf3aD" }
Method: { is: "cancelOrder" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Instruction {
Accounts {
Address
IsWritable
Token {
Owner
Mint
ProgramId
}
}
Logs
Program {
AccountNames
Address
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Json_Value_Arg {
json
}
... on Solana_ABI_Float_Value_Arg {
float
}
}
}
Name
Method
}
}
Transaction {
Signature
}
}
}
}
```
## Video Tutorial | How to Track Zeta Placed Orders, Liquidations and Settling of Funds
---
## StonkFun (Stonk.fun) API - Solana Launches, Trades, Live Prices
URL: https://docs.bitquery.io/docs/blockchain/Solana/stonkfun-api/
StonkFun (Stonk.fun) API on Solana: stream new launches on Raydium LaunchLab, bonding curve progress, graduations, trades, USD prices and OHLC with Bitquery GraphQL.
# StonkFun (Stonk.fun) API - Solana Launches, Trades, Live Prices
:::tip Need real-time StonkFun data or anything from the last ~30 days?
For **real-time + last ~30 days**, use the [**Trading cube**](/docs/trading/trading-data-overview): [`Trading.Trades`](/docs/trading/crypto-trades-api/trades-api) gives you clean swaps with **USD price, market cap, and supply on every row**, and [`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) / [`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) give you ready-made OHLC candles. Use the `DEXTradeByTokens` examples at the end of this page only for **historical StonkFun data older than ~30 days**.
:::
[StonkFun](https://www.stonkfun.xyz/), also written Stonk.fun or Stonk Fun, is a Solana launchpad where every new coin is paired with a quote asset of the creator's choice: tokenized stocks such as SPYx, NVDAx and QQQx from [xStocks](/docs/blockchain/Solana/xstocks-api/), pre-IPO tokens from PreStocks such as OPENAI and ANTHROPIC, crypto assets such as ZEC, WBTC and HYPE, SOL, or another StonkFun coin.
Since September 2026 new StonkFun launches run on [Raydium LaunchLab](/docs/blockchain/Solana/launchpad-raydium/): the token trades on a bonding curve first and graduates into a [Raydium CPMM](/docs/blockchain/Solana/raydium-cpmm-API/) pool once the curve has raised its target in the quote asset. Before that, every StonkFun launch opened a one-sided [Raydium CLMM](/docs/blockchain/Solana/raydium-clmm-API/) pool directly, and that direct-pool path still shows up on-chain. This page covers both, plus trades, prices, candles, holders and the Burn & Earn buybacks of the platform token STONK.
You can also check out our [Raydium LaunchLab API Docs](/docs/blockchain/Solana/launchpad-raydium/), [xStocks API Docs](/docs/blockchain/Solana/xstocks-api/) and [LetsBonk.fun API Docs](/docs/blockchain/Solana/letsbonk-api/), which runs on the same LaunchLab program.
:::note
To query or stream data via graphQL **outside the Bitquery IDE**, you need to generate an API access token.
Follow the steps here to create one: [How to generate Bitquery API token ➤](/docs/authorization/how-to-generate/)
:::
If you want fastest data without any latency, we can provide Kafka streams, please [fill this form](https://bitquery.io/forms/api) for it. Our Team will reach out.
## How StonkFun works on-chain
| What | Address | Notes |
| ------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------- |
| Raydium LaunchLab program | `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` | Bonding-curve launches. `raydium_launchpad` in `Dex.ProtocolName` and `Market.Protocol` |
| StonkFun platform config, reward launches | `6BwHHDg3u1854jC8PDLXvR4spTcLNaoBxLJNGC4nTESt` | Token-2022 mints with a 1% or 3% transfer fee, the source of StonkFun's reward payouts |
| StonkFun platform config, standard launches | `4E876qZTE9FJMrBzgVtBrSrzz2TLivB5Y5QXPjB4gZL7` | Token-2022 mints without a transfer fee |
| Raydium CPMM program | `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` | Where graduated tokens trade. `raydium_cp_swap` |
| CPMM fee config used at graduation | `CRRS5ieQmBrZjWhcj99JuGrT5tyuWDaGAXLXLFjbAtjQ` | 0.25% trade fee tier |
| Raydium CLMM program | `CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK` | Direct-pool launches. `amm_v3` |
| StonkFun launcher and fee wallet | `5CEbueQnq1Ym2uSSx2xXds3jQAqT1BDnkA59RZobSPAG` | Platform fee wallet of both configs, signs direct-pool launches and Burn & Earn burns |
| STONK (platform token) | `6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx` | Used as the example token on this page |
| STONK / SPYx pool (CLMM) | `7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49` | Used as the example pool on this page |
| SPYx (xStocks S&P 500) | `XsoCS1TfEyfFhfvj8EtZ528L3CaKBDBRqRapnBbDF2W` | Most common stock quote asset |
Both platform configs carry the name `StonkFun` on-chain and share the same fee settings. The only difference is the launch type: reward launches add a Token-2022 transfer-fee extension to the new mint, standard launches do not.
### Bonding-curve launch on Raydium LaunchLab
A launch is one `initialize_with_token_2022` instruction on the LaunchLab program that references a StonkFun platform config. It does the following:
1. Creates the base mint with 1,000,000,000 supply and 6 decimals on the Token-2022 program. Reward launches attach a transfer fee of 100 or 300 basis points. Its authority is `5KXDF6QnqhBj72hDtJNkkpFaQVUfbFXNybMsp3DiK6tD`, the wallet that also sends out StonkFun's reward payouts.
2. Opens a constant-product bonding curve that sells 793,100,000 tokens (79.31% of supply). The graduation target is `total_quote_fund_raising`, expressed in the quote asset's smallest unit. StonkFun converts a fixed dollar target into the quote asset at launch time, so the number differs from launch to launch even for the same quote asset. Read it from the launch instruction instead of hard-coding it.
3. Charges a 1% fee on every curve trade, set by `fee_rate` (10,000 out of 1,000,000) on the platform config and paid in the quote asset. Raydium's 0.25% protocol fee, the RAY buyback share, comes out of that 1% rather than on top of it, and the rest goes to the StonkFun fee wallet. The creator fee rate is 0. On buys the fee comes off the quote amount before the curve math; on sells it comes off the quote amount the curve pays out.
4. Optionally runs the creator's dev buy as a `buy_exact_in` instruction in the same transaction.
When the quote vault reaches the target, LaunchLab calls `migrate_to_cpswap`: the remaining 206,900,000 tokens and the raised quote asset seed a Raydium CPMM pool on the 0.25% fee tier. The whole LP position is locked to the platform (`platform_scale` 1,000,000, nothing burned, no creator share), which is how StonkFun keeps earning fees from graduated pools.
### Direct-pool launch on Raydium CLMM
The original StonkFun mode mints the token and opens a one-sided Raydium CLMM pool in a single transaction signed by the launcher wallet: 1,000,000,000 supply with 9 decimals, mint and freeze authorities revoked, two one-sided positions holding the full supply (950M + 50M) and an optional dev buy as `swapV2`. There is no curve, no migration and no on-chain graduation, so the pool address never changes.
## Track StonkFun Token Launches on Raydium LaunchLab in Real Time
Subscribe to LaunchLab `initialize_with_token_2022` instructions whose accounts include one of the two StonkFun platform configs. `initialize_v2` is included for completeness; it is the variant LaunchLab uses for classic SPL Token mints. `Program.AccountNames` names every account in the instruction, and `Program.Arguments` returns the decoded mint, curve and transfer-fee parameters.
Click to expand GraphQL query
```graphql
subscription StonkFunLaunchLabLaunches {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { in: ["initialize_v2", "initialize_with_token_2022"] }
}
Accounts: {
includes: {
Address: {
in: [
"6BwHHDg3u1854jC8PDLXvR4spTcLNaoBxLJNGC4nTESt"
"4E876qZTE9FJMrBzgVtBrSrzz2TLivB5Y5QXPjB4gZL7"
]
}
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Program {
Method
AccountNames
Arguments {
Name
Type
Value {
... on Solana_ABI_Integer_Value_Arg {
integer
}
... on Solana_ABI_String_Value_Arg {
string
}
... on Solana_ABI_Address_Value_Arg {
address
}
... on Solana_ABI_BigInt_Value_Arg {
bigInteger
}
... on Solana_ABI_Bytes_Value_Arg {
hex
}
... on Solana_ABI_Boolean_Value_Arg {
bool
}
... on Solana_ABI_Float_Value_Arg {
float
}
... on Solana_ABI_Json_Value_Arg {
json
}
}
}
}
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
}
}
}
}
```
Account positions in the `initialize_with_token_2022` instruction (the same order as `AccountNames`):
| Index | Account |
| ----- | -------------------------------------------------- |
| 0 | Payer |
| 1 | Creator |
| 2 | LaunchLab global config |
| 3 | **StonkFun platform config** (reward or standard) |
| 4 | LaunchLab authority |
| 5 | **Pool state** (the bonding-curve market address) |
| 6 | **Base mint** (the new StonkFun token) |
| 7 | **Quote mint** (SPYx, OPENAI, ZEC, SOL, ...) |
| 8, 9 | Base and quote vaults |
| 10, 11 | Token programs for base and quote |
| 12 | System program |
| 13 | Event authority |
| 14 | LaunchLab program |
Arguments worth reading:
| Argument | What it holds |
| ------------------------------ | -------------------------------------------------------------------------------------------------- |
| `base_mint_param` | `decimals`, `name`, `symbol` and metadata `uri` of the new token |
| `curve_param` | `supply`, `total_base_sell`, `total_quote_fund_raising` (graduation target) and `migrate_type` (1 = CPMM) |
| `vesting_param` | Creator vesting; StonkFun launches use zero |
| `transfer_fee_extension_param` | `transfer_fee_basis_points` on reward launches, `null` on standard launches |
Unlike the direct-pool launches below, the mints are not sorted by public key: the new token is always the base mint at index 6 and the quote asset is at index 7.
## Bonding Curve Progress of a StonkFun Token
`DEXPools` returns the curve reserves after every trade. Because every StonkFun curve sells 793,100,000 of 1,000,000,000 tokens, progress can be computed from the base side without knowing the quote asset:
```
progress % = 100 - ((Base.PostAmount - 206,900,000) * 100 / 793,100,000)
```
Or use the quote side: `Quote.PostAmount` divided by the launch's `total_quote_fund_raising` (after adjusting for the quote asset's decimals). The example uses a live curve pool; bonding-curve pools graduate or go quiet within hours, so take a current `Pool state` address from the launch stream above and swap it in.
Click to expand GraphQL query
```graphql
query StonkFunBondingCurveProgress {
Solana {
DEXPools(
where: {
Pool: {
Market: {
MarketAddress: { is: "AX4FJkpEPDeHdSdha5iGvyqnok8AdbjWJMg4u68GKPLh" }
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Block {
Time
}
Pool {
Dex {
ProtocolName
}
Market {
MarketAddress
BaseCurrency {
MintAddress
Symbol
}
QuoteCurrency {
MintAddress
Symbol
}
}
Base {
PostAmount
PostAmountInUSD
PriceInUSD
}
Quote {
PostAmount
PostAmountInUSD
}
}
}
}
}
```
Change `query` to `subscription` and drop `orderBy` and `limit` to get every reserve update of the curve as it happens.
## Track StonkFun Graduations to Raydium CPMM in Real Time
Graduation is a `migrate_to_cpswap` instruction on the LaunchLab program that references the StonkFun platform config. The new CPMM pool is the sixth account and the old curve pool is the eighteenth, so one message gives you the mapping from the bonding curve to the pool where trading continues.
Click to expand GraphQL query
```graphql
subscription StonkFunGraduations {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj" }
Method: { is: "migrate_to_cpswap" }
}
Accounts: {
includes: {
Address: {
in: [
"6BwHHDg3u1854jC8PDLXvR4spTcLNaoBxLJNGC4nTESt"
"4E876qZTE9FJMrBzgVtBrSrzz2TLivB5Y5QXPjB4gZL7"
]
}
}
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signature
}
Instruction {
Program {
Method
AccountNames
}
Accounts {
Address
Token {
Mint
ProgramId
}
}
}
}
}
}
```
Account positions in `migrate_to_cpswap`:
| Index | Account |
| ----- | ----------------------------------------- |
| 0 | Payer |
| 1 | Base mint (the StonkFun token) |
| 2 | Quote mint |
| 3 | StonkFun platform config |
| 4 | Raydium CPMM program |
| 5 | **New CPMM pool** (the market address after graduation) |
| 6 | CPMM authority |
| 7 | CPMM LP mint |
| 8, 9 | CPMM base and quote vaults |
| 10 | CPMM fee config |
| 11 | CPMM create-pool fee account |
| 12 | CPMM observation state |
| 13, 14, 15 | LP lock program, lock authority, locked LP vault |
| 16 | LaunchLab authority |
| 17 | **Bonding-curve pool state** being migrated |
## Latest StonkFun Trades using the Trading API
StonkFun pools are ordinary Raydium pools, so the cleanest way to get their trades is the [Trading cube](/docs/trading/trading-data-overview). Every row already carries the USD price and market cap of the token at the time of the trade, and router hops from Jupiter or DFlow are attributed to the pool they hit, so nothing is double counted.
The query below returns the latest trades quoted in SPYx across the three programs StonkFun uses. `Market.Protocol` tells you which stage the token is in: `raydium_launchpad` for bonding-curve trades, `raydium_cp_swap` for graduated pools and `amm_v3` for direct-pool launches. Swap the `QuoteToken.Address` for any other quote asset listed on StonkFun (NVDAx, OPENAI, ZEC, STONK itself) to follow that segment. Keep a `Block.Time` window on program-wide queries; without one the scan across all Raydium pools can time out.
Click to expand GraphQL query
```graphql
query LatestStonkFunTrades {
Trading {
Trades(
where: {
Pair: {
Market: {
Network: { is: "Solana" }
Program: {
in: [
"LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj"
"CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C"
"CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK"
]
}
}
QuoteToken: {
Address: { is: "XsoCS1TfEyfFhfvj8EtZ528L3CaKBDBRqRapnBbDF2W" }
}
}
Block: { Time: { since_relative: { hours_ago: 6 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 50 }
) {
Block {
Time
}
Side
Price
PriceInUsd
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
}
Trader {
Address
}
Pair {
Token {
Symbol
Name
Address
}
QuoteToken {
Symbol
Address
}
Market {
Address
Program
Protocol
Network
}
}
TransactionHeader {
Hash
}
}
}
}
```
Note that in `Trading.Trades`, `Price` and `PriceInUsd` are plain float fields with no sub-selection, and `Side` is a string (`Buy` or `Sell`).
To get trades in real time, change `query` to `subscription` and remove the `orderBy`, `limit` and `Block.Time` arguments. The same can be tracked using [Bitquery Kafka Streams](/docs/streams/kafka-streaming-concepts/).
## Latest Trades of a Specific StonkFun Token
To follow one token, filter on `Pair.Token.Address` (the mint) or on `Pair.Market.Address` (the pool). Filtering by pool is the exact equivalent of the chart on the StonkFun token page. For a bonding-curve token, use the `Pool state` address before graduation and the new CPMM pool address after it, or filter by mint only to get both.
Click to expand GraphQL query
```graphql
query LatestTradesOfStonkFunToken {
Trading {
Trades(
where: {
Pair: {
Token: {
Address: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Market: {
Address: { is: "7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49" }
}
}
}
orderBy: { descending: Block_Time }
limit: { count: 50 }
) {
Block {
Time
}
Side
Price
PriceInUsd
Amounts {
Base
Quote
}
AmountsInUsd {
Base
Quote
}
Supply {
MarketCap
}
Trader {
Address
}
TransactionHeader {
Hash
}
}
}
}
```
## Latest Price and Market Cap of a StonkFun Token
[`Trading.Tokens`](/docs/trading/crypto-price-api/tokens) aggregates every pool of a token into one USD price series, which matters for STONK because it now trades in SOL pools on other DEXs as well as in its own SPYx pool. The one-minute interval with `limit: 1` gives you the latest price, volume and market cap in a single row.
Click to expand GraphQL query
```graphql
query LatestStonkFunTokenPrice {
Trading {
Tokens(
where: {
Token: {
Address: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Interval: { Time: { Duration: { eq: 60 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Block {
Time
}
Token {
Symbol
Name
Address
}
Price {
Ohlc {
Close
}
IsQuotedInUsd
}
Volume {
Usd
}
Supply {
MarketCap
CirculatingSupply
TotalSupply
}
}
}
}
```
To stream price updates, change `query` to `subscription` and remove `orderBy` and `limit`.
## OHLC Candles of a StonkFun Token (Trading API)
The same cube serves candles at 1, 3, 5, 10, 30 and 60 seconds and at 5, 15, 30 and 60 minutes. Set `Interval.Time.Duration` in seconds. The example returns hourly candles for the last two days.
Click to expand GraphQL query
```graphql
query StonkFunTokenOHLC {
Trading {
Tokens(
where: {
Token: {
Address: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Interval: { Time: { Duration: { eq: 3600 } } }
Block: { Time: { since_relative: { hours_ago: 48 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 48 }
) {
Block {
Time
}
Interval {
Time {
Start
End
Duration
}
}
Price {
Ohlc {
Open
High
Low
Close
}
Average {
Mean
}
IsQuotedInUsd
}
Volume {
Usd
Base
}
}
}
}
```
## OHLC Candles of a StonkFun Pool
[`Trading.Pairs`](/docs/trading/crypto-price-api/pairs) gives candles per pool, with volume in both the token and the quote asset. Use it when you want the STONK / SPYx chart specifically rather than the token-wide price, or the chart of one bonding curve.
Click to expand GraphQL query
```graphql
query StonkFunPoolOHLC {
Trading {
Pairs(
where: {
Market: {
Address: { is: "7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49" }
}
Interval: { Time: { Duration: { eq: 300 } } }
Block: { Time: { since_relative: { hours_ago: 6 } } }
}
orderBy: { descending: Block_Time }
limit: { count: 72 }
) {
Block {
Time
}
Interval {
Time {
Start
End
Duration
}
}
Token {
Symbol
Address
}
QuoteToken {
Symbol
Address
}
Price {
Ohlc {
Open
High
Low
Close
}
IsQuotedInUsd
}
Volume {
Usd
Base
Quote
}
}
}
}
```
## Top Traders of a StonkFun Token
Aggregate `Trading.Trades` by trader to rank the most active wallets over a time window. `AmountsInUsd_Base` is the USD value of the StonkFun token side of each trade, and `Side` is the trader's own action, so the buy and sell splits are labelled from the wallet's point of view.
Click to expand GraphQL query
```graphql
query TopStonkFunTraders {
Trading {
Trades(
where: {
Pair: {
Token: {
Address: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Market: { Network: { is: "Solana" } }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
orderBy: { descendingByField: "volumeUsd" }
limit: { count: 100 }
) {
Trader {
Address
}
volumeUsd: sum(of: AmountsInUsd_Base)
boughtUsd: sum(of: AmountsInUsd_Base, if: { Side: { is: "Buy" } })
soldUsd: sum(of: AmountsInUsd_Base, if: { Side: { is: "Sell" } })
trades: count
}
}
}
```
## Liquidity of a StonkFun Pool
`DEXPools` returns the pool reserves after every liquidity change or trade. `Base` and `Quote` follow the pool's own ordering; for STONK / SPYx the base is SPYx and the quote is STONK. The same query works for a bonding-curve pool (it returns the curve reserves) and for the CPMM pool after graduation.
Click to expand GraphQL query
```graphql
query StonkFunPoolLiquidity {
Solana {
DEXPools(
where: {
Pool: {
Market: {
MarketAddress: { is: "7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49" }
}
}
Transaction: { Result: { Success: true } }
}
orderBy: { descending: Block_Time }
limit: { count: 1 }
) {
Block {
Time
}
Pool {
Dex {
ProtocolName
}
Market {
BaseCurrency {
MintAddress
Symbol
}
QuoteCurrency {
MintAddress
Symbol
}
}
Base {
PostAmount
PostAmountInUSD
PriceInUSD
}
Quote {
PostAmount
PostAmountInUSD
}
}
}
}
}
```
## Top Holders of a StonkFun Token
Click to expand GraphQL query
```graphql
query StonkFunTopHolders {
Solana {
BalanceUpdates(
where: {
BalanceUpdate: {
Currency: {
MintAddress: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
}
}
orderBy: { descendingByField: "BalanceUpdate_Holding_maximum" }
limit: { count: 100 }
) {
BalanceUpdate {
Account {
Address
Owner
}
Holding: PostBalance(maximum: Block_Slot)
Currency {
Symbol
}
}
}
}
}
```
## Track StonkFun Burn & Earn Buybacks
StonkFun sweeps trading fees, buys tokens and burns them from the launcher wallet. STONK is burned every few minutes, and the program also buys and burns the platform's largest tokens by market cap. Each burn lowers the supply, so the whole buyback history is one `TokenSupplyUpdates` query filtered on the launcher wallet as signer. Add a `Currency.MintAddress` filter to follow STONK alone, and change `query` to `subscription` to get each burn as it happens.
Click to expand GraphQL query
```graphql
query StonkFunBurns {
Solana {
TokenSupplyUpdates(
where: {
TokenSupplyUpdate: { Amount: { lt: "0" } }
Transaction: {
Signer: { is: "5CEbueQnq1Ym2uSSx2xXds3jQAqT1BDnkA59RZobSPAG" }
Result: { Success: true }
}
}
orderBy: { descending: Block_Time }
limit: { count: 100 }
) {
Block {
Time
}
Transaction {
Signature
}
TokenSupplyUpdate {
Amount
PostBalance
Currency {
Symbol
MintAddress
Decimals
}
}
}
}
}
```
## Track Direct-Pool StonkFun Launches on Raydium CLMM
The original StonkFun launch mode is a Raydium CLMM `create_customizable_pool` instruction signed by the StonkFun launcher wallet, and these launches still appear alongside the bonding-curve ones. Our decoder does not name this instruction, so `Program.Method` is empty for it; filter on the instruction data prefix `2B44D4A7592FA401` (the instruction discriminator) together with the launcher wallet as `Transaction.Signer`.
The pool address is the third account in the `Accounts` array. The two mints are the fourth and fifth accounts, ordered by public key, so the new token can be in either slot: the new token is the mint whose `Token.Owner` and metadata were created in the same signature, and the other one is the quote asset.
Click to expand GraphQL query
```graphql
subscription StonkFunDirectPoolLaunches {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK" }
}
Data: { startsWith: "2B44D4A7592FA401" }
}
Transaction: {
Signer: { is: "5CEbueQnq1Ym2uSSx2xXds3jQAqT1BDnkA59RZobSPAG" }
Result: { Success: true }
}
}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Instruction {
Data
Accounts {
Address
IsWritable
Token {
Mint
Owner
ProgramId
}
}
Program {
Address
Name
Method
}
}
}
}
}
```
Account positions in the `create_customizable_pool` instruction:
| Index | Account |
| ----- | ----------------------------------------- |
| 0 | Pool creator (StonkFun launcher wallet) |
| 1 | Raydium amm config (fee tier) |
| 2 | **Pool state** (the market address) |
| 3 | Token mint 0 |
| 4 | Token mint 1 |
| 5, 6 | Token vaults 0 and 1 |
| 7 | Observation state |
| 8 | Tick array bitmap |
| 9, 10 | Token programs for mint 0 and mint 1 |
| 11 | System program |
| 12 | Rent sysvar |
To catch the creator's dev buy, subscribe to `swapV2` instructions on the same program and match on `Transaction.Signature`.
The `Instructions` cube is real-time only and keeps a short window of history, with no archive dataset. For launches older than that, take the first trade of each pool from the `DEXTradeByTokens` archive instead.
## Historical StonkFun Data older than 30 days
For history beyond the Trading cube window, use `DEXTradeByTokens` on the `combined` dataset. Always filter on the pool's `MarketAddress` so that aggregator hops and pools where the token is used as a quote asset are excluded; otherwise a token-level sum overstates volume. For a graduated token, run the query once for the bonding-curve pool and once for the CPMM pool.
### Daily Volume of a StonkFun Pool since Launch
:::note Reading history beyond the realtime window
Both queries in this section read `dataset: archive`, because the pool has been trading since July and the chain-level realtime window only reaches back about seven days. Archive is the only dataset with that depth, but it is not complete: over a window both datasets cover it returns roughly a fifth to a quarter fewer trades than `realtime`, and correspondingly less volume. Treat archive totals as a floor, and take figures for the last 30 days from the [Trading cube](/docs/trading/crypto-trades-api/trades-api/), where every row carries a vetted USD price.
:::
Click to expand GraphQL query
```graphql
query StonkFunDailyVolume {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Market: {
MarketAddress: { is: "7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49" }
}
}
Block: { Time: { since: "2026-07-23T00:00:00Z" } }
}
orderBy: { ascending: Block_Date }
limit: { count: 365 }
) {
Block {
Date
}
trades: count
volumeUsd: sum(of: Trade_Side_AmountInUSD)
priceUsd: median(of: Trade_PriceInUSD)
}
}
}
```
### Historical Hourly OHLC of a StonkFun Pool
Click to expand GraphQL query
```graphql
query StonkFunHistoricalOHLC {
Solana(dataset: archive) {
DEXTradeByTokens(
where: {
Trade: {
Currency: {
MintAddress: { is: "6GmAFSYs4gk3FDao5FzzySQpPZaWsa4rUJHacpMpUNgx" }
}
Market: {
MarketAddress: { is: "7a8xxAJBELDo6P9dikSYctdw6ce8F4mWr3ahcAD8Ao49" }
}
}
Block: { Time: { since: "2026-07-23T00:00:00Z" } }
}
orderBy: { descendingByField: "Block_Timefield" }
limit: { count: 1000 }
) {
Block {
Timefield: Time(interval: { count: 1, in: hours })
}
Trade {
open: PriceInUSD(minimum: Block_Slot)
high: PriceInUSD(maximum: Trade_PriceInUSD)
low: PriceInUSD(minimum: Trade_PriceInUSD)
close: PriceInUSD(maximum: Block_Slot)
}
volumeInUSD: sum(of: Trade_Side_AmountInUSD)
count
}
}
}
```
---
## Trends.fun API: Token Launches, Bonding Curve Progress, Migrations and Trades
URL: https://docs.bitquery.io/docs/blockchain/Solana/trends-fun-API/
Trends.fun tokens launch on Meteora's Dynamic Bonding Curve. Bitquery GraphQL for launches by config, curve progress, pools near graduation, migrations, trades.
# Trends.fun API: Token Launches, Bonding Curve Progress, Migrations and Trades
Trends.fun turns a tweet into a token on Solana. The tokens it mints launch on Meteora's Dynamic Bonding Curve, program `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN`, trade there until the curve fills, and then migrate to a Meteora DAMM v2 pool. Bitquery decodes the curve program's instructions, records every pool state change in `DEXPools` and every trade in `DEXTradeByTokens`, so a trends.fun tracker is a set of Dynamic Bonding Curve queries. The curve program is shared by many launchpads; what makes a launch a trends.fun launch is the config account passed as the first account of the launch instruction, and the second section shows how to isolate one. Every example runs in the [IDE](https://ide.bitquery.io) on the `eap` endpoint. Queries on the `archive` or `combined` dataset need an archive add-on; the free trial is real-time only. The worked token is a trends.fun token, `@easytopredict` at `CY1P83KnKwFYostvjQcoR2HJLyEJWRBRaVQmYyyD3cR8`, which launched on the curve in October 2025 and trades on Meteora DAMM v2 today. Curve pool rows are kept for about half a day and decoded instructions for a few days, so the curve and launch queries below run without a token filter and show the filter line as a comment; trade history reaches the archive.
## Every launch on the bonding curve, live
`initialize_virtual_pool_with_spl_token` creates the curve pool. The accounts arrive in program order: `config`, `pool_authority`, `creator`, `base_mint`, `quote_mint`, `pool`, then the vaults. Saved stream [here](https://ide.bitquery.io/latest-pools-created-on-trendsfun-stream).
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Program {
AccountNames
}
Accounts {
Address
Token {
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Launches from one launchpad config
Every launchpad on the curve program has its own config account, and it is the first account of every launch it makes. Run the query below once, read the first address of a row that belongs to a trends.fun token, then uncomment the `Accounts` filter with that address to see only trends.fun launches. The same `includes` filter with a mint address finds one token's launch.
```graphql
{
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
# Accounts: { includes: { Address: { is: "" } } }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
limit: { count: 20 }
orderBy: { descending: Block_Time }
) {
Block {
Time
}
Instruction {
Accounts {
Address
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Bonding curve state and progress
Each `DEXPools` row is the curve after one trade: the tokens still on the curve under `Base.PostAmount`, the quote raised under `Quote.PostAmount` with its USD value, and the price. Progress toward graduation is the quote raised against the migration threshold set in the launchpad's config, since the curve migrates when the quote reserve reaches it. The query returns the latest state of every curve pool that traded recently, one row per market; uncomment the `BaseCurrency` filter for one token. Saved query [here](https://ide.bitquery.io/bonding-curve-progress-percentage-of-a-trends-fun-token).
```graphql
{
Solana {
DEXPools(
where: {
Pool: {
Dex: { ProgramAddress: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" } }
# Market: { BaseCurrency: { MintAddress: { is: "" } } }
}
Transaction: { Result: { Success: true } }
}
limitBy: { by: Pool_Market_MarketAddress, count: 1 }
orderBy: { descending: Block_Time }
limit: { count: 20 }
) {
Block {
Time
}
Pool {
Market {
MarketAddress
BaseCurrency {
Name
Symbol
MintAddress
}
QuoteCurrency {
Symbol
}
}
Base {
PostAmount
}
Quote {
PostAmount
PostAmountInUSD
PriceInUSD
}
}
}
}
}
```
## Pools closest to graduation
The curve pools with the fewest tokens left, among those that traded in the last hour, one row per market. Saved query [here](https://ide.bitquery.io/trends-fun-tokens-between-95-and-100-bonding-curve-progress).
```graphql
{
Solana {
DEXPools(
where: {
Pool: {
Dex: { ProgramAddress: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" } }
Market: {
QuoteCurrency: {
MintAddress: {
in: [
"So11111111111111111111111111111111111111112"
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
]
}
}
}
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { hours_ago: 1 } } }
}
limitBy: { by: Pool_Market_MarketAddress, count: 1 }
orderBy: { ascending: Pool_Base_PostAmount }
limit: { count: 20 }
) {
Block {
Time
}
Pool {
Market {
MarketAddress
BaseCurrency {
Symbol
MintAddress
}
}
Base {
PostAmount
}
Quote {
PostAmount
PostAmountInUSD
}
}
}
}
}
```
## Migrations to Meteora, live
When a curve fills, the program migrates the token's liquidity into a DAMM pool. Two methods cover both destinations, and the accounts of each call name the token and the new pool.
```graphql
subscription {
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { in: ["migrate_meteora_damm", "migration_damm_v2"] }
}
}
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Instruction {
Program {
Method
AccountNames
}
Accounts {
Address
Token {
Mint
}
}
}
Transaction {
Signature
Signer
}
}
}
}
```
## Latest trades of a token
One row per trade, newest first, with the counter token, the USD price and the market. For the worked token the market is its DAMM v2 pool; for a token still on the curve it is the curve pool. Saved query [here](https://ide.bitquery.io/Latest-Trades-of-a-Trends-Fun-Token).
```graphql
{
Solana {
DEXTradeByTokens(
orderBy: { descending: Block_Time }
limit: { count: 50 }
where: {
Trade: { Currency: { MintAddress: { is: "CY1P83KnKwFYostvjQcoR2HJLyEJWRBRaVQmYyyD3cR8" } } }
Transaction: { Result: { Success: true } }
}
) {
Block {
Time
}
Transaction {
Signature
Signer
}
Trade {
Market {
MarketAddress
}
Dex {
ProtocolName
}
Amount
AmountInUSD
PriceInUSD
Side {
Type
Amount
AmountInUSD
Currency {
Symbol
}
}
}
}
}
}
```
## Top buyers and top sellers of a token
`Side.Type` names the counter-side, so the token was bought where the side was sold. Sort on `bought` for buyers and `sold` for sellers; add `dataset: archive` to the root for the token's whole life. Saved queries: [top buyers](https://ide.bitquery.io/Top-Buyers-of-a-Trends-Fun-Token), [top sellers](https://ide.bitquery.io/Top-Sellers-of-a-Trends-Fun-Token).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: { Currency: { MintAddress: { is: "CY1P83KnKwFYostvjQcoR2HJLyEJWRBRaVQmYyyD3cR8" } } }
Transaction: { Result: { Success: true } }
}
orderBy: { descendingByField: "bought" }
limit: { count: 100 }
) {
Transaction {
Signer
}
bought: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: sell } } } })
sold: sum(of: Trade_Side_AmountInUSD, if: { Trade: { Side: { Type: { is: buy } } } })
trades: count
}
}
}
```
## Hourly OHLC of a token
Candles against WSOL for the last week; curve tokens are quoted in WSOL or USDC, so put the quote mint under `Side.Currency`. Saved query [here](https://ide.bitquery.io/OHLCV-of-a-trends-fun-token).
```graphql
{
Solana {
DEXTradeByTokens(
where: {
Trade: {
Currency: { MintAddress: { is: "CY1P83KnKwFYostvjQcoR2HJLyEJWRBRaVQmYyyD3cR8" } }
Side: { Currency: { MintAddress: { is: "So11111111111111111111111111111111111111112" } } }
}
Transaction: { Result: { Success: true } }
Block: { Time: { since_relative: { days_ago: 7 } } }
}
limit: { count: 168 }
orderBy: { descendingByField: "Block_Timefield" }
) {
Block {
Timefield: Time(interval: { in: hours, count: 1 })
}
volume: sum(of: Trade_Amount)
volumeUsd: sum(of: Trade_Side_AmountInUSD)
Trade {
high: Price(maximum: Trade_Price)
low: Price(minimum: Trade_Price)
open: Price(minimum: Block_Slot)
close: Price(maximum: Block_Slot)
}
count
}
}
}
```
## Tokens launched by one creator
The creator signs the launch transaction, so grouping launches by signer ranks the most active creators of the last day; uncomment the `Signer` filter and drop the aggregate to list one creator's launches, where the fourth account of each row is the mint. Saved query [here](https://ide.bitquery.io/All-Tokens-Created-by-a-Trends-Fun-Token-CreatorDeveloper).
```graphql
{
Solana {
Instructions(
where: {
Instruction: {
Program: {
Address: { is: "dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN" }
Method: { is: "initialize_virtual_pool_with_spl_token" }
}
}
Transaction: {
# Signer: { is: "" }
Result: { Success: true }
}
Block: { Time: { since_relative: { hours_ago: 24 } } }
}
orderBy: { descendingByField: "launches" }
limit: { count: 20 }
) {
Transaction {
Signer
}
launches: count
}
}
}
```
## Related pages
- [Meteora Dynamic Bonding Curve API](/docs/blockchain/Solana/meteora-dynamic-bonding-curve-api/)
- [Solana DEX trades API](/docs/blockchain/Solana/solana-dextrades)
- [Solana API hub](/docs/blockchain/Solana/)
- [Kafka streams for Solana](/docs/streams/kafka-streaming-concepts/)