dextrade by token

Returns DEX trades by token on Ethereum, where side currency smart contract is 0xc02a…6cc2, currency smart contract is 0x1f98…f984 and block time since 2025-01-10, sorted by block time: block time, smart contract, trade amount, currency name, side amount, side currency name, side smart contract and 7 more fields.

By gaurav · saved 13 January 2025 · run 19 times · Bitquery API v2

What it returns

Filters

The query

query tradingViewPairs($network: evm_network, $dataset: dataset_arg_enum, $token: String, $base: String, $time_ago: DateTime) {
  EVM(network: $network, dataset: $dataset) {
    DEXTradeByTokens(
      orderBy: {ascendingByField: "Block_Time"}
      where: {Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Currency: {SmartContract: {is: $base}}}, Block: {Time: {since: $time_ago, till: "2025-01-10T10:00:00Z"}}, TransactionStatus: {Success: true}}
    ) {
      Block {
        Time
      }
      Trade {
        Dex {
          SmartContract
        }
        Amount
        Currency {
          Name
          SmartContract
        }
        Side {
          Amount
          Currency {
            Name
            SmartContract
          }
        }
        open: PriceInUSD(minimum: Block_Number)
        close: PriceInUSD(maximum: Block_Number)
        low: PriceInUSD(minimum: Trade_PriceInUSD)
        minEth: Price(minimum: Trade_Price)
        high: PriceInUSD(maximum: Trade_PriceInUSD)
      }
      minQ: quantile(of: Trade_PriceInUSD, level: 0.1)
      maxQ: quantile(of: Trade_PriceInUSD, level: 0.9)
      average: median(of: Trade_PriceInUSD)
      count
      Transaction {
        Hash
      }
      volume: sum(of: Trade_Side_AmountInUSD)
    }
  }
}

Variables

{
  "network": "eth",
  "base": "0x1f9840a85d5af5bf1d1762f925bdaddc4201f984",
  "token": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "time_ago": "2025-01-10T08:41:32Z",
  "dataset": "combined",
  "interval": 60
}

Similar queries