zerohash's CLOB uses the FIX 5.0 protocol for session-level message sequencing and recovery. This page covers how sequence numbers work, what happens during a session disruption, and how Platforms must handle resend scenarios to avoid unintended order submissions.
Sequence Numbers
Every FIX message carries an incrementing MsgSeqNum (34). Both sides maintain independent counters. If a gap is detected on either side, the receiving party will issue a ResendRequest (35=2) to recover missing messages.
Sequence numbers are scoped to a session — the period between Logon and Logout. A session reset can occur in two ways: a Platform reconnects with ResetSeqNumFlag(141)=Y on Logon, or the gateway's sequence state is reset as part of a recovery procedure. In either case, the gateway may detect a sequence gap upon reconnection and issue a ResendRequest covering the missing range.
Responding to a ResendRequest
Platforms must respond for every message in the requested sequence range, regardless of which side initiated the reset.
- Replay the message — for orders that remain open and actionable, retransmit with
PossDupFlag(43)=Yand the original sending time inOrigSendingTime(122). - GapFill the message — for any message that should not be reprocessed — including
NewOrderSingle (35=D)messages for orders that are filled, cancelled, expired, or otherwise inactive — respond with a SequenceReset-GapFill:
| Field | Value |
|---|---|
MsgType (35) | 4 |
GapFillFlag (123) | Y |
NewSeqNo (36) | Next sequence number after the skipped range |
PossDupFlag (43) | Y |
⚠️ PossDupFlag(43)=Y is not a deduplication mechanism. A message carrying 43=Y with a sequence number the gateway has not previously received will be processed as a new, live order. Always use GapFill for messages you do not intend to execute.
ClOrdID Scope
ClOrdID (11) uniqueness is enforced within a session. After a reset, the prior session's ClOrdID cache is cleared and IDs may be reused — but any retransmitted NewOrderSingle for an already-filled or cancelled GTC order will be treated as a new submission.
- ⚠️ After a session reset, use GapFill to skip
NewOrderSinglemessages forGTCorders that were filled or cancelled in the prior session. Do not retransmit them.
Support
For questions about FIX session configuration or integration support, contact our team at [email protected] or raise a support ticket here.