trades for a pair

Returns the latest 500 DEX trades on Ethereum and BNB Chain, where smart contract address is 0x604d…a6dc, exchange name is Pancake v2 and date since 2022-12-09: timestamp time, block height, trade index, buy amount, buy currency address, buy currency symbol, sell amount and 4 more fields.

By gaurav · saved 22 December 2022 · run 42 times · Bitquery API v1

What it returns

Filters

The query

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

Variables

{
  "limit": 500,
  "offset": 0,
  "network": "bsc",
  "exchange": "Pancake v2",
  "from": "2022-12-09",
  "till": "2022-12-22T23:59:59",
  "dateFormat": "%Y-%m-%d"
}

Similar queries