Ws subscribe result
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 of1+
. 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 than1
. 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.NameLite |
Type | RequiredDefault |
Description |
---|---|---|---|
streams |
string | True | The channel to subscribe to (eg: ticker.s / ticker.d) |
subss1 |
[string] | True | The list of feeds subscribed to |
unsubsu |
[string] | True | The list of feeds unsubscribed from |
num_snapshotsns |
[integer] | True | The number of snapshot payloads to expect for each subscribed feed. Returned in same order as subs |
first_sequence_numberfs |
[string] | True | The first sequence number to expect for each subscribed feed. Returned in same order as subs |