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

onTokenBarsUpdated
OnTokenBarsUpdatedResponse!
Bar update payload pushed on each swap on the token. See OnTokenBarsUpdatedResponse.

Arguments

tokenId
String
Token identifier in <tokenAddress>:<networkId> form. Required at runtime — omitting it returns BAD_USER_INPUT.
commitmentLevel
[BarCommitmentLevel!]
Allow-list of commitment levels to receive. Defaults to [Confirmed]. See BarCommitmentLevel.
networkId
Int
Network id hint (currently redundant — derived from tokenId).

Example

subscription OnTokenBarsUpdated {
  onTokenBarsUpdated(
    tokenId: "So11111111111111111111111111111111111111112:1399811149"
    commitmentLevel: [Confirmed]
  ) {
    tokenAddress
    networkId
    commitmentLevel
    statsType
    eventSortKey
    aggregates {
      r5  { t usd { o h l c v volume buys sells } }
      r60 { t usd { o h l c v volume } }
      r1D { t usd { o h l c v volume } }
    }
  }
}