usd_prices_multiple_currencies

trying to get (reliable) latest usd prices of multiple currencies

Returns DEX trades by token on BNB Chain, where side currency smart contract is 0xbb4c…095c and block date since 2022-04-27: chain ID, price in USD, trade price, side currency symbol and currency symbol.

By gaurav · saved 29 April 2024 · run 3 times · Bitquery API v2

What it returns

Filters

The query

query getTokenCandles($network: evm_network, $baseCurrency: [String!], $from: String) {
  EVM(network: $network, dataset: realtime) {
    DEXTradeByTokens(
      orderBy: [{descending: Block_Time}]
      where: {Trade: {Side: {Currency: {SmartContract: {in: $baseCurrency}}}}, Block: {Date: {since: $from}}}
      limitBy: {by: [Trade_Currency_SmartContract, Trade_Side_Currency_SmartContract], count: 1}
    ) {
      ChainId
      Trade {
        usd: PriceInUSD(maximum: Trade_PriceInUSD)
        actual: Price
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
        Side {
          Currency {
            Symbol
          }
        }
        Currency {
          Symbol
        }
      }
    }
  }
}

Variables

{
  "network": "bsc",
  "baseCurrency": [
    "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"
  ],
  "from": "2022-04-27"
}

Similar queries