subscribe to latest trades of a bep20 token

Streams DEX trades by token on BNB Chain as they happen, where currency smart contract is 0xb465…b9f0 and trade price is above 0: block time, owner address, protocol family, protocol name, amount in USD, buyer, seller and 10 more fields.

By Divyasshree · saved 29 January 2025 · Bitquery API v2

What it returns

Filters

The subscription

subscription ($network: evm_network, $token: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {is: $token}}, Price: {gt: 0}}}
    ) {
      Block {
        allTime: Time
      }
      Trade {
        Dex {
          OwnerAddress
          ProtocolFamily
          ProtocolName
        }
        AmountInUSD
        Buyer
        Seller
        Side {
          Type
          Buyer
          Seller
        }
        Price
        Amount
        Side {
          Currency {
            Symbol
            SmartContract
            Name
          }
          AmountInUSD
          Amount
        }
      }
    }
  }
}

Variables

{
  "network": "bsc",
  "token": "0xb46584e0efde3092e04010a13f2eae62adb3b9f0"
}

Similar queries