Ws subscribe result

WSSubscribeResult

To ensure you always know if you have missed any payloads, GRVT servers apply the following heuristics to sequence numbers:

  • All snapshot payloads will have a sequence number of 0. All delta payloads will have a sequence number of 1+. So its easy to distinguish between snapshots, and deltas
  • Num snapshots returned in Response (per stream): You can ensure that you received the right number of snapshots
  • First sequence number returned in Response (per stream): You can ensure that you received the first stream, without gaps from snapshots
  • Sequence numbers should always monotonically increase by 1. If it decreases, or increases by more than 1. Please reconnect
  • Duplicate sequence numbers are possible due to network retries. If you receive a duplicate, please ignore it, or idempotently re-update it.

When subscribing to the same primary selector again, the previous secondary selector will be replaced. See Overview page for more details.

Name
Lite
Type Required
Default
Description
stream
s
string True The channel to subscribe to (eg: ticker.s / ticker.d)
subs
s1
[string] True The list of feeds subscribed to
unsubs
u
[string] True The list of feeds unsubscribed from
num_snapshots
ns
[integer] True The number of snapshot payloads to expect for each subscribed feed. Returned in same order as subs
first_sequence_number
fs
[string] True The first sequence number to expect for each subscribed feed. Returned in same order as subs