API to get price of Binance Smart Chain token on PancakeSwap

Returns the latest DEX trade by token on BNB Chain, where currency smart contract is 0x2170…33F8, side currency smart contract is 0xbb4C…095c and DEX smart contract is 0x74E4…4fbc: smart contract, currency name, currency symbol, trade price, price in USD and block time.

By Akshat · saved 13 May 2024 · Bitquery API v2

What it returns

Filters

The query

query MyQuery {
  EVM(network: bsc) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 1}
      where: {Trade: {Currency: {SmartContract: {is: "0x2170Ed0880ac9A755fd29B2688956BD959F933F8"}}, Side: {Currency: {SmartContract: {is: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c"}}}, Dex: {SmartContract: {is: "0x74E4716E431f45807DCF19f284c7aA99F18a4fbc"}}}}
    ) {
      Trade {
        Currency {
          SmartContract
          Name
          Symbol
        }
        PriceAgainstSellCurrency: Price
  			PriceInUSD: PriceInUSD
      }
      Block {
        Time
      }
    }
  }
}

Similar queries