first_&_last_trade_pair_of_day (basecurrency/quotecurrency)

Returns the latest DEX trade on Ethereum, where base currency is 0x65f9…1447, quote currency is 0xc02a…6cc2 and date since 2023-04-18: block height, address address, base amount, base currency symbol, base currency address, sell amount, sell currency symbol and 3 more fields.

By Omkar Acharekar · saved 20 April 2023 · Bitquery API v1

What it returns

Filters

The query

query ($network: EthereumNetwork!, $from: ISO8601DateTime, $till: ISO8601DateTime) {
  ethereum(network: $network) {
    first: dexTrades(
      date: {since: $from, till: $till}
      options: {asc: "block.height",  limit: 1}
      baseCurrency : {is : "0x65f9a292f1aeed5d755aa2fd2fb17ab2e9431447"}
      quoteCurrency: {is : "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
    ) {
      block {
        height
      }
      smartContract {
        address {
          address
        }
      }
      baseAmount
      baseCurrency {
        symbol
        address
      }
      sellAmount
      sellCurrency {
        symbol
        address
      }
      quotePrice
      transaction {
        hash
      }
    }
   last : dexTrades(
      date: {since: $from, till: $till}
      options: {desc: "block.height",  limit: 1}
      baseCurrency : {is : "0x65f9a292f1aeed5d755aa2fd2fb17ab2e9431447"}
      quoteCurrency: {is : "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"}
    ) {
      block {
        height
      }
      smartContract {
        address {
          address
        }
      }
      baseAmount
      baseCurrency {
        symbol
        address
      }
      sellAmount
      sellCurrency {
        symbol
        address
      }
      quotePrice
      transaction {
        hash
      }
    }
  }
}

Variables

{
  "network": "ethereum",
  "from": "2023-04-18T00:00:01",
  "till": "2023-04-18T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries