Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mobula.io/llms.txt

Use this file to discover all available pages before exploring further.

Subscriptions use the WebSocket endpoint wss://api.mobula.io/graphql/subscriptions with the graphql-transport-ws protocol.

Returns

onTokenEventsCreated
AddTokenEventsOutput!
Batched events for the subscribed token. See AddTokenEventsOutput.

Arguments

input
OnTokenEventsCreatedInput!
required
See OnTokenEventsCreatedInput.
commitmentLevel
[EventCommitmentLevel!]
Separate top-level argument (not part of input). Optional commitment filter: Confirmed (default if omitted) — events confirmed on-chain. Processed — events as soon as they’re observed (unconfirmed; may be reorged out), available on Solana only. See EventCommitmentLevel.

Example

subscription {
  onTokenEventsCreated(
    input: { tokenAddress: "0xdac17f958d2ee523a2206206994597c13d831ec7", networkId: 1 }
    commitmentLevel: [Confirmed]
  ) {
    id
    events {
      id
      address
      networkId
      eventType
      eventDisplayType
      commitmentLevel
      maker
      token0Address
      token1Address
      transactionHash
      timestamp
      data {
        __typename
        ... on SwapEventData {
          amount0
          amount1
          amount0In
          amount0Out
          amount1In
          amount1Out
          priceUsd
          priceUsdTotal
          amountNonLiquidityToken
        }
      }
    }
  }
}

Example response

{
  "data": {
    "onTokenEventsCreated": {
      "id": "0xdac17f958d2ee523a2206206994597c13d831ec7:1",
      "events": [
        {
          "id": "0x9f2c…a31:48:1",
          "address": "0x3416cf6c708da44db2624d63ea0aaef7113527c6",
          "networkId": 1,
          "eventType": "Swap",
          "eventDisplayType": "Buy",
          "commitmentLevel": "Confirmed",
          "maker": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
          "token0Address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
          "token1Address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
          "transactionHash": "0x9f2c…a31",
          "timestamp": 1715002345,
          "data": {
            "__typename": "SwapEventData",
            "amount0": "-25000.00",
            "amount1": "25001.13",
            "amount0In": "0",
            "amount0Out": "25000.00",
            "amount1In": "25001.13",
            "amount1Out": "0",
            "priceUsd": "1.0001",
            "priceUsdTotal": "25001.13",
            "amountNonLiquidityToken": "25001.13"
          }
        }
      ]
    }
  }
}