Skip to main content
The Pulse stream keeps a board of views up to date in real time. You subscribe with the same request body you would send to POST /pulse/views. The server answers with a snapshot of every view, then sends a message whenever a token enters a view, changes, or leaves it.
This endpoint is separate from the channel WebSocket at /v1/ws. It has its own small protocol, described on this page. The channel protocol’s messages, limits, cursors and reconnect message do not apply here.
  • There is no authentication. Query strings on the URL are ignored.
  • Every client message is a JSON text frame with an op field.
  • Every server message is a JSON object with a type field. Snapshots can optionally be gzip-compressed binary frames (see Compression).

Quick test with wscat

Client operations

subscribe

Differences from the REST endpoint:
  • The default limit per view is 50 (REST uses 30). The maximum is still 100.
  • offset is not available. Any view with offset above 0 is rejected with views.<i>.offset: not available on the stream.
  • Omit views to get the default new, bonding and bonded views.
There is no separate acknowledgement: a successful subscribe is answered with an initial snapshot. Sending subscribe again with the same id on the same connection replaces that subscription; its old views are dropped and you get a new initial snapshot. Use different ids to hold several subscriptions on one connection.

pause and resume

  • views is required and lists at least one view name.
  • Without id, the operation applies to views with those names in every subscription on the connection.
  • A paused view gets no token-* messages and no periodic resyncs. Use it for views that are off screen.
  • resume immediately sends a snapshot with reason: "resync" that contains only the resumed views.
  • Unknown view names are ignored.

unsubscribe

A subscription whose last view is removed is deleted. There is no reply.

ping

The server answers {"type":"pong"}. This is optional: the server already sends WebSocket protocol pings (see Connection lifecycle).

Server messages

snapshot

Replace each view listed in a snapshot with its new list. Views not listed in a resync are unchanged. A resync snapshot is sent:
  1. On resume, for the resumed views only.
  2. About every 30 seconds, for every view of the subscription that is not paused. The server re-ranks active views against the database on this interval, which corrects any drift.
  3. After back-pressure. If more than about 4 MiB of messages are waiting to be sent to your connection, the server stops sending it events. Once the backlog drops below about 2 MiB, it sends a resync of every view that is not paused.

token-added

The token entered the view’s top limit because it was just launched or just bonded. No position is sent. Insert the token and re-sort the view by its sort. If the addition pushed another token out, that token gets its own token-removed. Tokens that start to match a view only because their stats changed (for example volume rising above a filter) are not sent as token-added. They appear in the next periodic resync snapshot.

token-updated

Same fields as token-added. The token’s stats or metadata changed.
  • token is the full token object, not a diff. Replace the stored token by its key.
  • Re-sort the view afterwards, because the change can move the token.
  • Updates are throttled to at most one per token per view about every 50 ms. Changes in between are merged and the latest state is sent.
  • Metadata refreshes (logo, description, socials, name, symbol) also produce token-updated.
  • A newly launched token first appears with the data seen at launch. A fuller version usually follows as token-updated about 150 ms later, and a logo that shows up within the token’s first 5 minutes is also pushed as an update.

token-removed

Remove the token whose chainId and lowercase address build the same key. When a token bonds, for example, it leaves bonding with token-removed and enters bonded with token-added.

error

The connection stays open after an error. See Errors.

pong

Compression

Set "compressed": true in params to receive this subscription’s snapshot messages as binary WebSocket frames containing the gzip-compressed JSON. Every other message (token-*, error, pong) is always sent as plain JSON text.
In Node.js, zlib.gunzipSync(Buffer.from(data)).toString() does the same.

Limits

When you replace a subscription (same id), its current views do not count against the 10-view limit.

Connection lifecycle

  • Heartbeat. The server sends a WebSocket protocol ping every 30 seconds. A connection that has not answered the previous ping with a pong is closed. Browsers and common WebSocket libraries answer pings automatically.
  • Restarts. When the server restarts, it closes connections with code 1012 and reason Server restarting, reconnect. While it is shutting down, new connection attempts get HTTP 503.
  • Reconnecting. Subscriptions do not survive a reconnect. After any close, reconnect with exponential backoff (for example min(30 s, 1 s × 2^attempt)), send your subscribe again, and rebuild your state from the new initial snapshot.

Building a client

Keep one ordered list per view, and apply messages like this: To re-sort, use the view’s sort: your sortBy and sortOrder, or the model’s preset sort (new: createdAt desc, bonding: bondingPercentage desc, bonded: bondedAt desc, trending: feesPaid15minUSD desc). Use the camelCase field name from the token object, and keep tokens with a null value last. This runs in a browser or in Node.js 22 and later:

Session transcript

→ is a client message, ← a server message. Token objects are shortened.

Errors

Invalid pulse subscription comes in two forms:
  • Shape errors (wrong types, limit above 100, more than 10 views): the issue paths start with params., and the error has no id.
  • View errors (unknown filters, unsupported chains, duplicate names, offset above 0, too many views on the connection): the issue paths start with views., except the connection limit, which is reported as the plain issue at most 10 views per connection. The error carries the subscription id, or the generated UUID if you did not send one. The full list is in Filters and sortable fields.
A rejected subscribe does not change existing subscriptions. A client message larger than 64 KiB is not answered with an error: the server closes the connection with WebSocket close code 1009 (message too big).