ohlcv_usd_historic_value

Returns the latest 500 DEX trades by token on BNB Chain, where side currency smart contract is 0x55d3…7955, currency smart contract is 0xbb4c…095c and block date since 2022-04-21: chain ID, block time, sum of trade amount, price in USD, side currency symbol, currency symbol and count.

By gaurav · saved 25 April 2024 · run 11 times · Bitquery API v2

What it returns

Filters

The query

query ($network: evm_network, $interval: Int, $limit: Int, $from: String, $baseCurrency: String, $quoteCurrency: String, $timeframe: OLAP_DateTimeIntervalUnits) {
  EVM(network: $network, dataset: combined) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "Block_Time"}
      limit: {count: $limit}
      where: {Trade: {PriceAsymmetry: {le: 0.01}, Side: {Currency: {SmartContract: {is: $quoteCurrency}, Symbol: {}}}, Currency: {SmartContract: {is: $baseCurrency}, Symbol: {}}, Price: {gt: 0}, Amount: {gt: "0.000000000000000001"}}, Block: {Date: {since: $from}}}
    ) {
      ChainId
      Block {
        Time(interval: {in: $timeframe, count: $interval})
      }
      volume: sum(of: Trade_Amount)
      Trade {
        high: PriceInUSD(maximum: Trade_PriceInUSD)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
        Side {
          Currency {
            Symbol
          }
        }
        Currency {
          Symbol
        }
      }
      count
    }
  }
}

Variables

{
  "network": "bsc",
  "baseCurrency": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "quoteCurrency": "0x55d398326f99059ff775485246999027b3197955",
  "interval": 1,
  "timeframe": "days",
  "limit": 500,
  "from": "2022-04-21"
}

Similar queries