Last 10 trades

Returns the latest 10 DEX trades on Ethereum, where base currency is 0xc02a…6cc2, quote currency is 0x95ad…c4ce and date since 2021-11-16: timestamp time, block height, trade index, protocol, full name, address address, annotation and 7 more fields.

By spendil · saved 22 November 2021 · run 1 time · Bitquery API v1

What it returns

Filters

The query

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

Variables

{
  "limit": 10,
  "offset": 0,
  "network": "ethereum",
  "baseAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "quoteAddress": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
  "from": "2021-11-16",
  "till": null,
  "dateFormat": "%Y-%m-%d"
}

Similar queries