Token Price

get token price

Returns the latest DEX trade on Ethereum and BNB Chain, where base currency is 0x25c3…0ece: timestamp time, block height, trade index, protocol, full name, address address, annotation and 7 more fields.

By Ashish · saved 2 February 2023 · run 61 times · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $token: String!, $offset: Int!) {
  ethereum(network: $network) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1, offset: $offset}
      baseCurrency: {is: $token}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      protocol
      exchange {
        fullName
      }
      smartContract {
        address {
          address
          annotation
        }
      }
      baseAmount
      baseCurrency {
        address
        symbol
      }
      base_amount_usd: baseAmount(in: USD)
      quoteAmount
      quoteCurrency {
        address
        symbol
      }
      quote_amount_usd: quoteAmount(in: USD)
      transaction {
        hash
      }
    }
  }
}

Variables

{
  "limit": 10,
  "offset": 0,
  "network": "bsc",
  "token": "0x25c30340e6f9f6e521827cf03282943da00c0ece",
  "from": "2023-01-26",
  "till": "2023-02-02T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries