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

onEventsCreated
AddEventsOutput!
Batched event payload scoped to the subscribed pair. See AddEventsOutput.

Arguments

id
String
Pair ID in the form address:networkId. Provide this or the address + networkId pair.
address
String
Pair contract address. Required when id is not provided.
networkId
Int
Network ID. Required when id is not provided.
quoteToken
QuoteToken
Override the quote side. When set, eventDisplayType (Buy/Sell) and the per-unit pricing fields on SwapEventData are recomputed against this quote. Defaults to token0. See QuoteToken.
commitmentLevel
[EventCommitmentLevel!]
Allow-list of commitment levels to receive. Defaults to [Confirmed]. Today only Confirmed events are produced; passing [Processed] only will receive nothing. See EventCommitmentLevel.

Example — by id

subscription {
  onEventsCreated(id: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1") {
    address
    networkId
    quoteToken
    events {
      id
      eventType
      eventDisplayType
      maker
      timestamp
      transactionHash
      data {
        __typename
        ... on SwapEventData {
          amount0 amount1 amount0In amount0Out amount1In amount1Out
          priceUsd priceUsdTotal amountNonLiquidityToken
        }
      }
    }
  }
}

Example — by address + networkId, with explicit quoteToken

subscription {
  onEventsCreated(
    address: "0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640"
    networkId: 1
    quoteToken: token1
  ) {
    quoteToken
    events {
      id
      eventDisplayType
      data { __typename ... on SwapEventData { priceUsd priceUsdTotal } }
    }
  }
}