Latest Trades of Token in Network subscription

Streams the latest 10 DEX trades by token on Ethereum as they happen, where currency smart contract is 0x8ce5…796f, currency smart contract is not 0x and trade seller is not 0x: chain ID, block number, block time, seller, buyer, trade amount, smart contract and 6 more fields.

By Nadia · saved 11 August 2023 · Bitquery API v2

What it returns

Filters

The subscription

subscription ($network: evm_network, $limit: Int!, $token: String!) {
  EVM(network: $network) {
    DEXTradeByTokens(
      orderBy: {descending: Block_Number}
      limit: {count: $limit}
      where: {Trade: {Currency: {SmartContract: {is: $token, not: "0x"}}, Seller: {not: "0x"}, Side: {Currency: {SmartContract: {not: "0x"}}}, Buyer: {not: "0x"}}}
    ) {
      ChainId
      Block {
        Number
        Time
      }
      Trade {
        Seller
        Buyer
        Amount
        Currency {
          SmartContract
          Symbol
        }
        Price
        Side {
          Amount
          Currency {
            SmartContract
            Symbol
          }
        }
      }
      Transaction {
        Hash
      }
    }
  }
}

Variables

{
  "network": "eth",
  "limit": 10,
  "offset": 0,
  "token": "0x8ce578bad214d59aefafb49bd20408e81271796f"
}

Similar queries