rt-subs-shaheem

Streams DEX trades by token as they happen: block time, trade amount, amount in USD, buyer, decimals, currency name, protocol name and 14 more fields.

By furqan · saved 25 December 2024 · Bitquery API v2

What it returns

The subscription

subscription ($network: evm_network, $quoteToken: String, $baseToken: String) {
  EVM(network: $network) {
    DEXTradeByTokens(
      where: {Trade: {Currency: {SmartContract: {is: $baseToken}}, Side: {Currency: {SmartContract: {is: $quoteToken}}}}}
    ) {
      Block {
        Time
      }
      Trade {
        Amount
        AmountInUSD
        Buyer
        Currency {
          Decimals
          Name
          ProtocolName
          Symbol
        }
        PriceInUSD
        Sender
        Side {
          Amount
          AmountInUSD
          Buyer
          Seller
          Currency {
            Decimals
            Name
            ProtocolName
            Symbol
          }
        }
        Dex {
          ProtocolName
          SmartContract
        }
      }
      Transaction {
        From
        Hash
      }
    }
  }
}

Variables

{
  "network": "eth",
  "quoteToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
  "baseToken": "0xC16d88fCC29f1AF69376D237Da627D3F4B842Ad5",
}

Similar queries