trade data v1 to v2

Returns DEX trades by token on Ethereum, where currency smart contract is 0xdac1…1ec7 or 0xC02a…6Cc2, sorted by count, highest first: block time, currency name, currency symbol, smart contract, trade price, count, sum of trade side amount in USD and unique of transaction from.

By Kshitij Mahajan · saved 17 March 2025 · run 2 times · Bitquery API v2

What it returns

Filters

The query

query MyQuery($in: [String!]) {
  EVM(dataset: realtime, network: eth) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {in: $in}}}}
      orderBy: {descendingByField: "count"}
    ) {
      Block{
        Time(minimum: Block_Time)
      }
      Trade {
        Currency {
          Name
          Symbol
          SmartContract
        }
        maxPrice: Price(maximum: Trade_Price, if: {Trade: {Side: {AmountInUSD: {ge: "1"}}}}) # Price against the side/quote currency
        openPrice: Price(minimum: Block_Time)
      }
      count
      tradeAmount: sum(of: Trade_Side_AmountInUSD)
      buyAmount: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: buy}}}})
      sellAmount: sum(of: Trade_Side_AmountInUSD, if: {Trade: {Side: {Type: {is: sell}}}})
      senders: uniq(of: Transaction_From)
    }
  }
}

Variables

{
  "in": ["0xdac17f958d2ee523a2206206994597c13d831ec7", "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"]
}

Similar queries