https://community.bitquery.io/t/ethereum-token-quotes-using-dextrades-query-how-acccurate/422

Returns the latest DEX trade on Ethereum and BNB Chain, where base currency is 0x2eba…a943, quote currency is 0xbb4c…095c and tx hash is 0x6c26…f3ab: transaction hash, trade index, address address, contract type, currency name, timestamp time, unixtime and 7 more fields.

By Sayon · saved 19 August 2021 · run 1 time · Bitquery API v1

What it returns

Filters

The query

{
  ethereum(network: bsc) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: 1}
      exchangeName: {in: ["Pancake v2"]}
      baseCurrency: {is: "0x2eba09fb8063aedba27424de9bf0dcb41567a943"}
      quoteCurrency: {is: "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c"}
      txHash: {is: "0x6c26d2e320739be9022d8454fbdc68346e3a86c82224d0bd5c8b4ccb1ac2f3ab"}
    ) {
      transaction {
        hash
      }
      tradeIndex
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
          unixtime
        }
        height
      }
      baseCurrency {
        symbol
        address
      }
      quoteCurrency {
        symbol
        address
      }
      quotePrice
      tradeAmount(in: USD)
    }
  }
}

Similar queries