Solana Get Pools for Token

Returns DEX pools on Solana, sorted by pool base post amount in USD maximum, highest first: quote currency symbol, quote currency name, quote currency mint address, metadata address, market address, base currency symbol, base currency name and 7 more fields.

By CoinTradeLedger · saved 25 January 2025 · run 2 times · Bitquery API v2

What it returns

The query

query ($tokenA: String!, $tokenB: String!) {
  Solana {
    DEXPools(
      orderBy: { descendingByField: "Pool_Base_PostAmountInUSD_maximum" },
      where: {
        any: [
          {
            Pool: {
              Market: {
                BaseCurrency: { MintAddress: { is: $tokenA } },
                QuoteCurrency: { MintAddress: { is: $tokenB } }
              }
            }
          },
          {
            Pool: {
              Market: {
                BaseCurrency: { MintAddress: { is: $tokenB } },
                QuoteCurrency: { MintAddress: { is: $tokenA } }
              }
            }
          }
        ]
      }
    ) {
      Pool {
        Market {
          QuoteCurrency {
            Symbol
            Name
            MintAddress
            MetadataAddress
          }
          MarketAddress
          BaseCurrency {
            Symbol
            Name
            MintAddress
            Decimals
          }
        }
        Dex {
          ProtocolFamily
        }
        Base {
          PostAmount(maximum: Block_Slot)
          PostAmountInUSD(maximum: Block_Slot)
        }
        Quote {
          PostAmount(maximum: Block_Slot)
          PostAmountInUSD(maximum: Block_Slot)
        }
      }
    }
  }
}

Variables

{
    "tokenA": "FUAfBo2jgks6gB4Z4LfZkqSZgzNucisEHqnNebaRxM1P",
    "tokenB": "So11111111111111111111111111111111111111112"
  }

Similar queries