Copy of New Query

Streams the latest 50 DEX trades by token on BNB Chain as they happen, where side currency smart contract is 0x8ac7…580d, 0x55d3…7955 or 2 more and currency smart contract is 0x2170…33f8: quantile of trade price in USD, block time, transaction hash, smart contract, protocol family, protocol name, amount in USD and 12 more fields.

By Diego · saved 9 June 2025 · Bitquery API v2

What it returns

Filters

The subscription

subscription LatestTrades($network: evm_network, $token: String, $usdc: String!, $usdt: String!, $wbnb: String!, $bnb: String!) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Time}
      limit: {count: 50}
      where: {TransactionStatus: {Success: true}, Trade: {Side: {Currency: {SmartContract: {in: [$usdc, $usdt, $wbnb, $bnb]}}}, Currency: {SmartContract: {is: $token}}, Success: true}}
    ) {
      min: quantile(of: Trade_PriceInUSD, level: 0.05)
      max: quantile(of: Trade_PriceInUSD, level: 0.95)
      Block {
        Time
      }
      Transaction {
        Hash
      }
      Trade {
        Dex {
          SmartContract
          ProtocolFamily
          ProtocolName
        }
        AmountInUSD
        Buyer
        Seller
        Side {
          Type
          Buyer
          Seller
        }
        PriceInUSD
        close: PriceInUSD
        Amount
        Side {
          Currency {
            Symbol
            SmartContract
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "network": "bsc",
  "token": "0x2170ed0880ac9a755fd29b2688956bd959f933f8",
  "bnb": "0x",
  "usdc": "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
  "usdt": "0x55d398326f99059ff775485246999027b3197955",
  "wbnb": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
  "dataset": "realtime",
  "time_ago": "2025-06-06T23:25:25Z",
  "interval": 60,
  "from": "2025-06-09T17:26:31.000Z",
  "to": "2025-06-09T23:26:31.000Z"
}

Similar queries