trades for currency

Returns the latest 50 DEX trades by token on Ethereum, where currency smart contract is 0x9000…c667, side currency smart contract is 0x, 0xc02a…6cc2 or 2 more and block time since 2025-06-10: block time, transaction hash, smart contract, protocol family, protocol name, amount in USD, buyer and 11 more fields.

By gaurav · saved 11 June 2025 · Bitquery API v2

What it returns

Filters

The query

query LatestTrades($network: evm_network, $time_ago: DateTime, $token: String, $eth: String!, $weth: String!, $usdc: String!, $usdt: String!) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 50}
      where: {TransactionStatus: {Success: true}, Trade: {Side: {Currency: {SmartContract: {in: [$eth, $weth, $usdc, $usdt]}}}, Currency: {SmartContract: {is: $token}}, Success: true}, Block: {Time: {since: $time_ago}}}
    ) {
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Dex {
          SmartContract
          ProtocolFamily
          ProtocolName
        }
        AmountInUSD
        Buyer
        Seller
        Side {
          Type
          Buyer
          Seller
        }
        PriceInUSD
        Amount
        Side {
          Currency {
            Symbol
            SmartContract
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "network": "eth",
  "token": "0x90001c5f2c6ffd4b90a801afddefcbf31965c667",
  "eth": "0x",
  "usdc": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "usdt": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "weth": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
  "dataset": "realtime",
  "time_ago": "2025-06-10T11:50:34Z"
}

Similar queries