query from dexrabbit

Returns the latest 50 DEX trades by token, where side currency smart contract is 0xaf88…5831, currency smart contract is 0x82af…bab1 and block time since 2025-07-02: block time, transaction hash, smart contract, protocol family, protocol name, currency symbol, currency name and 9 more fields.

By Aleksey · saved 3 July 2025 · Bitquery API v2

What it returns

Filters

The query

query LatestTrades($network: evm_network, $token: String, $base: String, $time_ago: DateTime) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 50}
      where: {TransactionStatus: {Success: true}, Trade: {Side: {Amount: {gt: "0"}, Currency: {SmartContract: {is: $token}}}, Currency: {SmartContract: {is: $base}}, Success: true}, Block: {Time: {since: $time_ago}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Dex {
          SmartContract
          ProtocolFamily
          ProtocolName
        }
        Currency {
          Symbol
          SmartContract
          Name
        }
        PriceInUSD
        AmountInUSD
        Amount
        Side {
          Type
          Currency {
            Symbol
            SmartContract
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "base": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
  "token": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
  "time_ago": "2025-07-02T14:42:53Z"
}

Similar queries