Time query

Query

Returns the latest DEX trade on Ethereum and BNB Chain, where base currency is 0x2dbe…462b, quote currency is 0xbb4c…095c and exchange name is Pancake or Pancake v2: address address, currency name, date date, buy currency address, sell currency symbol, trade amount, block height and 3 more fields.

By gaurav · saved 11 November 2021 · run 2 times · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      exchangeName: {in: ["Pancake", "Pancake v2"]}
      baseCurrency: {is: "0x2dbe5158eb61bb4bc1084740e14e868c902e462b"}
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      time: {before: "2021-10-14T23:50:01"}
    ) {
      smartContract {
        address {
          address
        }
        currency {
          name
        }
      }
      date {
        date
      }
      buyCurrency {
        address
      }
      sellCurrency {
        symbol
      }
      tradeAmount(in: USD)
      block {
        height
      }
      quotePrice
      block {
        height
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
      }
      tradeIndex
    }
  }
}

Similar queries