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.

Overview

Stream the current page of a filterTokens query in real time. The same filters, rankings, and pagination arguments accepted by filterTokens are accepted here — the server re-evaluates them on every tick and pushes the full current page.
  • First message is the full filtered set for the supplied arguments.
  • Subsequent messages re-run the filter every updatePeriod ms and yield the full current set (not a delta).
  • updatePeriod defaults to 500 ms and is capped at 60000 ms.

Returns

onFilterTokensUpdated
FilterTokenUpdates!
Current page of matching tokens for the supplied filters. See FilterTokenUpdates.

Arguments

filters
TokenFilters
Filter conditions. See TokenFilters.
rankings
[TokenRanking]
Sorting criteria. See TokenRanking and TokenRankingAttribute.
statsType
TokenPairStatisticsType
FILTERED or UNFILTERED. See TokenPairStatisticsType.
phrase
String
Search phrase to match against token name or symbol.
tokens
[String]
Array of specific token selectors in "address:networkId" format.
excludeTokens
[String]
Array of token addresses to exclude from results.
limit
Int
Maximum number of results to return (default: 25, max: 200).
offset
Int
Pagination offset (default: 0).
updatePeriod
Int
Update interval in milliseconds (default: 500, max: 60000).

Example

subscription {
  onFilterTokensUpdated(
    filters: {
      network: [1]
      liquidity: { gte: 10000 }
      volume24: { gte: 50000 }
    }
    rankings: [{ attribute: volume24, direction: DESC }]
    updatePeriod: 1000
    limit: 10
  ) {
    updates {
      priceUSD
      liquidity
      marketCap
      volume24
      change24
      buyCount24
      sellCount24
      holders
      token { name symbol address networkId }
    }
  }
}

Subscribe example

Open a graphql-transport-ws WebSocket to wss://api.mobula.io/graphql/subscriptions, complete the connection_init handshake, then send a subscribe message:
{
  "id": "1",
  "type": "subscribe",
  "payload": {
    "query": "subscription ($filters: TokenFilters, $period: Int, $limit: Int) { onFilterTokensUpdated(filters: $filters, updatePeriod: $period, limit: $limit) { updates { priceUSD liquidity volume24 change24 token { name symbol address networkId } } } }",
    "variables": {
      "filters": { "network": [1], "liquidity": { "gte": 10000 }, "volume24": { "gte": 50000 } },
      "period": 1000,
      "limit": 10
    }
  }
}