Solana DEX Pools API
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.
Click to expand GraphQL query
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.
Click to expand GraphQL query
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
Click to expand GraphQL query
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.
Latest Price of Token Based on Liqudity​
This 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
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
Click to expand GraphQL query
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 Top Pools Based on Liquidity​
This 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
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.
Click to expand GraphQL query
{
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.
Click to expand GraphQL query
{
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.