Buy-Sell Price

Returns the latest 5000 DEX trades on Ethereum, where smart contract address is 0x4626…8745, time after 2023-05-17 and time before 2023-08-18: address address, full name, full name with ID, exchange name, decimals, currency name, currency symbol and 18 more fields.

By Samrin Joe · saved 20 August 2023 · run 13 times · Bitquery API v1

What it returns

Filters

The query

query ($from: ISO8601DateTime!, $to: ISO8601DateTime!) {
  ethereum(network: ethereum) {
    dexTrades(
      time: {after: $from, before: $to}
      smartContractAddress: {is: "0x4626b71c13e4638390f47d91979836fe955f8745"}
      options: {limit: 5000, desc: ["block.height", "tradeIndex"], limitBy: {each: "buyCurrency.address, sellCurrency.address", limit: 1}}
    ) {
      exchange {
        address {
          address
        }
        fullName
        fullNameWithId
        name
      }
      smartContract {
        address {
          address
        }
        currency {
          decimals
          name
          symbol
          tokenType
        }
        protocolType
        contractType
      }
      buyAmount
      buyAmountUSD: buyAmount(in: USD)
      buyCurrency {
        symbol
        address
        name
        tokenType
        decimals
      }
      sellAmount
      sellAmountUSD: sellAmount(in: USD)
      sellCurrency {
        symbol
        address
        name
        tokenType
        decimals
      }
      buyCurrencyPrice: expression(get: "buyAmountUSD / sellAmount")
      sellCurrencyPrice: expression(get: "sellAmountUSD / buyAmount")
      buyCurrencyPrice1: expression(get: "buyAmountUSD / buyAmount")
      sellCurrencyPrice1: expression(get: "sellAmountUSD / sellAmount")
      count
      tradeAmount(in: USD)
      daysTraded: count(uniq: dates)
      started: minimum(of: date)
      block {
        height
        timestamp {
          iso8601
        }
      }
      tradeIndex
    }
  }
}

Variables

{
  "from": "2023-05-17T12:06:59.000Z",
  "to": "2023-08-18T12:07:59.000Z",
  "limit": 10
}

Similar queries