dex trades api 2

Returns the latest 100 DEX trades on Ethereum and BNB Chain, where base currency is 0x5546…71f5, quote currency is 0xbb4c…095c and time since 2022-02-17: transaction hash, address address, contract type, currency name, trade index, block height, iso8601 and 7 more fields.

By gaurav · saved 18 February 2022 · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $baseAddress: String, $quoteAddress: String, $since: ISO8601DateTime!) {
  ethereum(network: $network) {
    dexTrades(
      options: {limit: 100, desc: "block.height"}
      baseCurrency: {is: $baseAddress}
      quoteCurrency: {is: $quoteAddress}
      time: {since: $since}
    ) {
      transaction {
        hash
      }
      smartContract {
        address {
          address
        }
        contractType
        currency {
          name
        }
      }
      tradeIndex
      block {
        height
        timestamp {
          iso8601
        }
      }
      buyAmount
      buyAmountInUsd: buyAmount(in: USD)
      buyCurrency {
        symbol
        address
      }
      sellAmount
      sellAmountInUsd: sellAmount(in: USD)
      sellCurrency {
        symbol
        address
      }
      sellAmountInUsd: sellAmount(in: USD)
      tradeAmount(in: USD)
    }
  }
}

Variables

{
  "network": "bsc",
  "baseAddress": "0x5546600f77eda1dcf2e8817ef4d617382e7f71f5",
  "quoteAddress": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "since": "2022-02-17T08:55:21.000Z"
}

Similar queries