buy_and_sell

Returns the latest 10 DEX trades on Ethereum, where smart contract address is 0xb54c…e00e, buy currency is 0x75C9…c1BA and sell currency is 0x75C9…c1BA: timestamp time, block height, trade index, buy amount, buy currency address, buy currency symbol, sell amount and 3 more fields.

By Oluwatomisin · saved 5 November 2023 · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $limit: Int!, $offset: Int!, $address: String!, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  ethereum(network: $network) {
    dexTrades(
      options: {desc: ["block.height", "tradeIndex"], limit: $limit, offset: $offset}
      date: {since: $from, till: $till}
      smartContractAddress: {is: $address}
      buyCurrency: {is: "0x75C97384cA209f915381755c582EC0E2cE88c1BA"}
      sellCurrency: {is: "0x75C97384cA209f915381755c582EC0E2cE88c1BA"}
    ) {
      block {
        timestamp {
          time(format: "%Y-%m-%d %H:%M:%S")
        }
        height
      }
      tradeIndex
      buyAmount
      buyCurrency {
        address
        symbol
      }
      sellAmount
      sellCurrency {
        address
        symbol
      }
      transaction {
        hash
      }
    }
  }
}

Variables

{
  "limit": 10,
  "offset": 0,
  "network": "ethereum",
  "address": "0xb54ce26f2e30f64c5b684b141311ce138ab5e00e",
  "from": "2023-10-29",
  "till": "2023-11-05T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries