BNB/USD Current Price

Returns one address detail on Ethereum and BNB Chain, where address is 0xbb4c…095c, base currency is 0xbb4c…095c and quote currency is 0x55d3…7955, sorted by block height transaction index, highest first: currency symbol, currency name, decimals, token type, block height, timestamp time, transaction index and 3 more fields.

By Santhosh · saved 21 September 2021 · run 21 times · Bitquery API v1

What it returns

Filters

The query

query($token: String, $currency: String){
  ethereum(network: bsc) {
    address(address: {is: $token}) {
      smartContract {
      currency {
          symbol
          name
          decimals
          tokenType
        }
      }
    }
    dexTrades(
      baseCurrency: {is: $token}
      quoteCurrency: {is: $currency}
      options: {desc: ["block.height", "transaction.index"], limit: 1}
    ) {
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      transaction {
        index
      }
      baseCurrency {
        symbol
      }
      quoteCurrency {
        symbol
      }
      quotePrice
    }
  }
}

Variables

{
  "token": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "currency": "0x55d398326f99059ff775485246999027b3197955"
}

Similar queries