Knowledge Base/How much data is streamed through Massive's WebSockets?

How much data is streamed through Massive's WebSockets?

We stream market data as we receive it, with no sampling, so one connection can carry every trade, quote and aggregate bar on a channel. What decides whether you keep up is events per second rather than messages, because one message often carries several events.

Size your WebSocket consumer by events per second, not messages per second, because one message routinely carries several events: measured on the stocks cluster, trade messages averaged 1.85 events each with a maximum of 27 in a single message. A client sized against a messages figure is therefore undersized, and it is the bursts rather than the average that break it.

Applies to

  • Plans: every paid subscription.
  • Feeds: every channel on wss://socket.massive.com/stocks, /options, /indices, /futures, /forex and /crypto.
  • Asset classes: stocks, options, indices, futures, forex and crypto.

One message is not one event

A data message is a JSON array, and the array usually holds more than one event. Measured on the stocks cluster, trade messages carried 1.85 events on average with a maximum of 27 in a single message, and quote messages carried 2.14 on average with a maximum of 26. A consumer sized against a messages-per-second figure will therefore be undersized, and the bursts are what break it rather than the average.

Which channels are heavy

The heavy channels are quotes and, above all, Options Quotes, which is the only feed with a subscription cap, at around a thousand contracts per connection. On the stocks cluster, quotes ran about twice the event rate of trades in one sample, and per-second aggregate bars ran roughly a tenth of either, because one bar replaces every trade in its second. If you need the shape of the market rather than every print, subscribing to AM or A instead of T and Q cuts the volume by an order of magnitude without changing what you can plot.

How to measure what you will actually receive

Do not size a consumer from a published average. Subscribe to the channels you intend to use, during the session you care about, and count for a minute:

  1. Count messages and events separately. Parse each message as an array and add its length.
  2. Do it during regular trading hours. An after-hours sample can be an order of magnitude lighter, so it will not tell you whether your consumer survives the open.
  3. Watch the gap between your read loop and your parser. If the queue between them grows, you are already on the way to a disconnect, well before you see one.

If you see an error

Repeated disconnects with no status message before them usually mean the server-side buffer filled because your client read too slowly. Read packets into a queue immediately and parse them on another thread. If nothing changed on your side, check massive.com/system and massive-status.com for an incident as well.

{"ev":"status","status":"error","message":"not authorized"} after subscribing to a heavy channel is an entitlement or channel-name problem rather than a volume limit.

The one count-based refusal is the Options Quotes cap, which answers {"ev":"status","status":"error","message":"Subscription limit reached for feed..."} and rejects the whole message. Nothing else about the amount of data causes a subscribe to be refused.

Related


Was this article helpful?

Modernizing Wall St.

Reimagining financial market data for the 21st century.

Schedule a demo

Talk with our market data experts

Recommended

Can't find the answer you're looking for? Contact our team.
  • Title
    Are all indices available through the basic subscription tier?
    Data Coverage Category

    Data Coverage

    Indices Category

    Indices

    Description
    No, and the ones it withholds are the famous ones: SPX, DJI, RUT and VIX all need a paid Indices tier. Basic still reaches more than 10,000 of the 13,000-odd indices Massive publishes, and NDX and the Nasdaq Composite are among them.
  • Title
    Does Massive offer dark pool data?
    Data Coverage Category

    Data Coverage

    Stocks Category

    Stocks

    Description
    Yes. Off-exchange prints, which include dark pool executions, arrive on the ordinary trades feed and are identified by an exchange ID of 4. There is no separate dark pool endpoint, and no way to tell which individual venue a print came from.
  • Title
    Does Massive offer pre-market and after-hours data?
    FAQ Category

    FAQ

    Stocks Category

    Stocks

    Description
    Yes. Every extended-hours trade and quote is published, from 04:00 to 20:00 Eastern. There is no session parameter, so you select a session with timestamps, and expect far fewer aggregate bars outside regular hours because many extended-hours trades are odd lots that cannot set a price.