wrong lquidity data for token

Returns the latest DEX trade by token on Solana, where currency mint address is FNLSV5…8MsA, base currency mint address is FNLSV5…8MsA and quote currency mint address is FNLSV5…8MsA: currency mint address, currency name, currency symbol, decimals, price in USD, sum of trade side amount in USD, market address and 9 more fields.

By gaurav · saved 13 May 2025 · run 1 time · Bitquery API v2

What it returns

Filters

The query

query ($token: String, $since: DateTime, $prev24h_start: DateTime, $prev24h_end: DateTime) {
  Solana(dataset: realtime) {
    latest: DEXTradeByTokens(
      where: {Trade: {Currency: {MintAddress: {is: $token}}}, Block: {Time: {since: $since}}}
      limit: {count: 1}
      orderBy: {descending: Block_Time}
    ) {
      Trade {
        Currency {
          MintAddress
          Name
          Symbol
          Decimals
        }
        PriceInUSD
      }
    }
    current_volume: DEXTradeByTokens(
      where: {Trade: {Currency: {MintAddress: {is: $token}}}, Block: {Time: {since: $since}}, Transaction: {Result: {Success: true}}}
    ) {
      total_volume: sum(of: Trade_Side_AmountInUSD)
    }
    previous_volume: DEXTradeByTokens(
      where: {Trade: {Currency: {MintAddress: {is: $token}}}, Block: {Time: {since: $prev24h_start, till: $prev24h_end}}, Transaction: {Result: {Success: true}}}
    ) {
      total_volume: sum(of: Trade_Side_AmountInUSD)
    }
    basePool: DEXPools(
      orderBy:{
        descending:Block_Time
      }
      where: {Block: {Time: {since: $since}}, 
        Transaction: {Result: {Success: true}},
        Pool: {Market: {BaseCurrency: 
          {MintAddress: {is: $token}}}}}
      limit: {count: 1}
    ) {
      Pool {
        Market {
          MarketAddress
          BaseCurrency {
            MintAddress
            Name
          }
          QuoteCurrency {
            MintAddress
            Name
          }
        }
        Base {
          PostAmount
          PostAmountInUSD(maximum: Block_Slot)
        }
        Quote {
          PostAmount
          PostAmountInUSD(maximum: Block_Slot)
        }
      }
    }
    quotePool: DEXPools(
      orderBy:{
        descending:Block_Time
      }
      where: {Block: {Time: {since: $since}},
        Transaction: {Result: {Success: true}}, 
        Pool: {Market: {QuoteCurrency: 
          {MintAddress: {is: $token}}}}}
      limit: {count: 1}
    ) {
      Pool {
        Market {
          MarketAddress
          BaseCurrency {
            Name
          }
          QuoteCurrency {
            Name
          }
        }
        Base {
          PostAmount
          PostAmountInUSD
        }
        Quote {
          PostAmount
          PostAmountInUSD
        }
      }
    }
    supply: TokenSupplyUpdates(
      where: {TokenSupplyUpdate: {Currency: {MintAddress: {is: $token}}}}
      limit: {count: 1}
      orderBy: {descending: Block_Time}
    ) {
      TokenSupplyUpdate {
        PostBalance
      }
    }
  }
}

Variables

{
  "token": "FNLSV5gM6VCRrpEGyQDQVXE1R2D23ohxyCnz48LX8MsA",
  "since": "2025-05-12T16:48:25Z",
  "prev24h_start": "2025-05-11T16:48:25Z",
  "prev24h_end": "2025-05-12T16:48:25Z"
}

Similar queries