EVM_Transfer_Fields_Transaction

..

Returns DEX trades by token and transactions on Ethereum, where currency smart contract is 0xc02a…6cc2, side currency smart contract is 0xa0b8…eb48 and block time after 2025-01-27, sorted by amount, highest first: protocol family, protocol name, price in USD, sum of trade side amount in USD, unique of trade side currency smart contract, count, cost and 3 more fields.

By Việt Thanh · saved 30 January 2025 · Bitquery API v2

What it returns

Filters

The query

query pairDexList($network: evm_network, $token: String, $base: String, $time_10min_ago: DateTime, $time_1h_ago: DateTime, $time_3h_ago: DateTime, $time_ago: DateTime) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descendingByField: "amount"}
      where: {Trade: {Currency: {SmartContract: {is: $base}}, Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}}, Block: {Time: {after: $time_ago}}}
    ) {
      Trade {
        Dex {
          ProtocolFamily
          ProtocolName
        }
        price_last: PriceInUSD(maximum: Block_Number)
        price_10min_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_10min_ago}}}
        )
        price_1h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_1h_ago}}}
        )
        price_3h_ago: PriceInUSD(
          maximum: Block_Number
          if: {Block: {Time: {before: $time_3h_ago}}}
        )
      }
      amount: sum(of: Trade_Side_AmountInUSD)
      pairs: uniq(of: Trade_Side_Currency_SmartContract)
      trades: count
    }
    Transactions(where: {Transaction: {ToCode: {Hash: {}}, Protected: true}}) {
      Transaction {
        Cost(maximum: Block_GasLimit)
        Data(maximum: Block_GasLimit)
      }
      Signature {
        R(selectWhere: {ge: ""})
      }
    }
    Transfers {
      Transaction
    }
  }
}

Variables

{
  "network": "eth",
  "base": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "token": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "time_10min_ago": "2025-01-30T14:17:48Z",
  "time_1h_ago": "2025-01-30T13:27:48Z",
  "time_3h_ago": "2025-01-30T11:27:48Z",
  "time_ago": "2025-01-27T14:27:48Z"
}

Similar queries