Skip to main content
Subscriptions (WebSockets) require a Growth or Enterprise plan. Learn more.

Returns

AddEventsOutput

Arguments

address
String
The pair contract address.
id
String
The ID of the pair (address:networkId). Required unless you are on an enterprise plan including EventFeed features.
quoteToken
The token of interest within the pair. Can be token0 or token1.
networkId
Int
The networkId to use when getting all events per network
subscription {
  onEventsCreated(
    id: "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149"
    quoteToken: token0
  ) {
    address
    networkId
    id
    quoteToken
    events {
      eventType
      eventDisplayType
      timestamp
      blockNumber
      transactionHash
      maker
      token0Address
      token1Address
      token0SwapValueUsd
      token1SwapValueUsd
      token0ValueBase
      token1ValueBase
      walletAge
      walletLabels
      labels {
        sandwich {
          label
          sandwichType
          token0DrainedAmount
          token1DrainedAmount
        }
      }
    }
  }
}
Example Response
{
  "data": {
    "onEventsCreated": {
      "address": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y",
      "networkId": 1399811149,
      "id": "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149",
      "quoteToken": "token0",
      "events": [
        {
          "eventType": "Swap",
          "eventDisplayType": "Sell",
          "timestamp": 1769560515,
          "blockNumber": 396374007,
          "transactionHash": "4EqnQCBDP9AgyKjQu3B7SzFUP6MRXBQWiLGb3b1yqFQQFieamW9B5u3DsH6Ds7KpCfojjxkw27c2izY3xts1A8zx",
          "maker": "7zujqoQsFic14ncDYhBSVGvDnqc94rE49c1ZJCHvAtiW",
          "token0Address": "So11111111111111111111111111111111111111112",
          "token1Address": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
          "token0SwapValueUsd": "126.529818076092595016837547037910922",
          "token1SwapValueUsd": "0.99969429999999993936190205232353184",
          "token0ValueBase": "1",
          "token1ValueBase": "0.0078957792081491622",
          "walletAge": 14494714,
          "walletLabels": null,
          "labels": {
            "sandwich": null
          }
        }
      ]
    }
  }
}

Usage Guidelines

  • Subscribe by id (format pairAddress:networkId) to stream transactions for a specific pair
  • Alternatively, use address + networkId to identify the pair, or just networkId to stream all events on a network
  • Set quoteToken to token0 or token1 to control which token is treated as the base for display
  • eventDisplayType provides a human-readable label (Buy, Sell) relative to the quoteToken
  • Use token0SwapValueUsd / token1SwapValueUsd for the USD value of each side of the swap
  • labels includes MEV detection (e.g., sandwich attacks) for transaction quality assessment
  • walletAge returns the age of the maker wallet in seconds, useful for filtering out new wallets

Troubleshooting Tips

eventType is the raw on-chain event (e.g., Swap, Mint, Burn). eventDisplayType is a user-friendly label relative to the quoteToken — for example, a Swap is displayed as Buy or Sell depending on which direction the trade went for the quote token.
Yes. Pass only networkId without an address or id to receive all events across a network. This is high-volume — use it with caution or filter client-side.
labels provides MEV and behavioral detection. The sandwich field indicates whether a transaction is part of a sandwich attack — sandwichType identifies it as frontrun, backrun, or sandwiched, and token0DrainedAmount / token1DrainedAmount show how much value was extracted.
quoteToken determines the perspective of eventDisplayType. For example, in a SOL/USDC pair where SOL is token0, setting quoteToken: token0 means buying SOL shows as Buy and selling SOL shows as Sell.