Volume, supply and liquidity fetch

Returns the latest 5 DEX trades by token and token supply updates on Solana, where currency mint address is AY6WiV…pump, side currency mint address is So1111…1112 and base currency mint address is AY6WiV…pump: price in USD, trade price, currency symbol, currency name, currency mint address, side currency symbol, side currency name and 18 more fields.

By Praveen maan · saved 1 July 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query TokenMetrics($token: String, $base: String) {
  Solana(dataset: realtime) {
    # Get Latest Price in USD and SOL
    latestPrice: DEXTradeByTokens(
      where: {
        Trade: {
          Currency: { MintAddress: { is: $token } }
          Side: { Currency: { MintAddress: { is: $base } } }
        }
        Transaction: { Result: { Success: true } }
      }
      orderBy: { descending: Block_Time }
      limit: { count: 1 }
    ) {
      Trade {
        PriceInUSD
        Price
        Currency {
          Symbol
          Name
          MintAddress
        }
        Side {
          Currency {
            Symbol
            Name
            MintAddress
          }
        }
        Market {
          MarketAddress
        }
        Dex {
          ProtocolName
        }
      }
      Block {
        Time
      }
    }

    # Get Token Supply
    tokenSupply: TokenSupplyUpdates(
      where: {
        TokenSupplyUpdate: {
          Currency: { MintAddress: { is: $token } }
          Amount: { gt: "0" }
        }
      }
      orderBy: { descending: Block_Time }
      limit: { count: 1 }
    ) {
      TokenSupplyUpdate {
        Amount
        AmountInUSD
        Currency {
          Symbol
          Name
          MintAddress
          Decimals
        }
      }
    }

    # Get Liquidity for All Pools
    liquidity: DEXPools(
      where: {
        Pool: {
          Market: {
            BaseCurrency: { MintAddress: { is: $token } }
            QuoteCurrency: { MintAddress: { is: $base } }
          }
        }
        Transaction: { Result: { Success: true } }
      }
      orderBy: { descending: Block_Time }
      limit: { count: 5 }
    ) {
      Pool {
        Market {
          MarketAddress
          BaseCurrency {
            Symbol
            Name
            MintAddress
          }
          QuoteCurrency {
            Symbol
            Name
            MintAddress
          }
        }
        Dex {
          ProtocolFamily
          ProtocolName
        }
        Base {
          PostAmount
          PostAmountInUSD
        }
        Quote {
          PostAmount
          PostAmountInUSD
        }
      }
      Block {
        Time
      }
    }
  }
}

Variables

{
  "token": "AY6WiVvvsS9zkViiv3eCZzNT7dCcXMWo3hVgZ6bfpump",
  "base": "So11111111111111111111111111111111111111112"
}

Similar queries