base

arbitrum data

Returns DEX trades on Base, where transaction from is 0x8568…8010 or 0x5bfe…1034, buy currency smart contract is 0x0db5…950f and sell currency smart contract is 0x0db5…950f: from, sum of trade buy amount, sum of trade buy amount in USD, sum of trade sell amount in USD and sum of trade sell amount.

By ds · saved 20 November 2024 · Bitquery API v2

What it returns

Filters

The query

query TotalPurchasesAndSales($from: [String!], $token: String!) {
  EVM(dataset: combined, network: base) {
    sellTrade: DEXTrades(
      where: {
        Transaction: {
          From: { in: $from }
        }
        Trade: {
          Buy: {
            Currency: { SmartContract: { is: $token } }
          }
        }
      }
    ) {
			Transaction{
        From
      }
      sellAmount: sum(of: Trade_Buy_Amount)
      cost: sum(of: Trade_Buy_AmountInUSD)
      cost_1: sum(of: Trade_Sell_AmountInUSD)
    }
    buyTrade: DEXTrades(
      where: {
        Transaction: {
          From: { in: $from }
        }
        Trade: {
          Sell: {
            Currency: { SmartContract: { is: $token } }
          }
        }
      }
    ) {
      Transaction{
        From
      }
      buyAmount: sum(of: Trade_Sell_Amount)
      cost: sum(of: Trade_Sell_AmountInUSD)
      cost_1: sum(of: Trade_Buy_AmountInUSD)
    }
  }
}

Variables

{
  "from":["0x85687cc0a149e77227fcba1269a1dd4055f38010", "0x5bfeb4ca066c9458842ac89b6e5cd983bd1a1034"],
  "token":"0x0db510e79909666d6dec7f5e49370838c16d950f"
}

Similar queries