Skip to content
Terminal Ledger Desk
Directory

Fix Protocol Sbe Ouch Session Latency

PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution Deduplication

Distinguishing transport-level PossDupFlag=Y (Tag 43) replays from application-level PossResend=Y (Tag 97) submissions prevents double-fills and corrupted OMS shadow positions during gateway failovers.

By Marcus Thorne, CQFReview not recorded
PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution Deduplication — Terminal Ledger Desk 2026 quantitative & supervisory data card
Terminal Ledger Desk (FIX 4.4/5.0 SP2, CME iLink 3 SBE, Nasdaq OUCH/ITCH & Session Recovery): Separating session PossDupFlag (43) watermarks from HugePage PossResend (97) & ExecID deduplication.Source: Terminal Ledger Desk Institutional Research DeskLicense: CC-BY-4.0

Double-execution incidents during broker gateway failovers almost always stem from conflating two distinct FIX boolean headers: session-layer PossDupFlag (43=Y) and application-level PossResend (97=Y). Whereas 43=Y reuses the exact original MsgSeqNum (34) during a protocol-level ResendRequest (35=2) handshake and is filtered automatically by sequence high-water marks, 97=Y arrives on a brand-new MsgSeqNum after an upstream OMS failover, requiring an explicit hash lookup against ClOrdID (11) or ExecID (17) inside an open-addressed idempotency ledger before touching the matching book or clearing balance.

Transport Replay (PossDupFlag 43=Y) vs Application Retry (PossResend 97=Y)#

In a compliant FIX session engine, PossDupFlag=Y (43) indicates that the session layer is re-transmitting a previously assigned MsgSeqNum (34). Every 43=Y packet MUST include OrigSendingTime (122) recording the UTC timestamp when that sequence slot was originally serialized, while SendingTime (52) reflects the current wire re-emission timestamp. If 122 is missing—or if OrigSendingTime > SendingTime—the receiver must emit a session-level Reject (35=3, SessionRejectReason=1 or 10) and increment NextExpectedMsgSeqNum.

By contrast, PossResend=Y (97) originates above the FIX session layer. Suppose an institutional EMS cluster crashes mid-write after handing an order (ClOrdID=ORD-994821) to its outbound network adapter, and the promoted standby node connects on a secondary FIX session (or after a sequence reset) uncertain whether the venue received ORD-994821. Sending that order on a fresh sequence slot with 97=Y instructs the venue's execution engine to check its intraday ClOrdID hash table first: if ORD-994821 already exists, return its current ExecutionReport (35=8) status instead of booking a second order.

Decision tree routing FIX PossDupFlag 43=Y and PossResend 97=Y frames through sequence and hash deduplication
Decision tree routing FIX PossDupFlag 43=Y and PossResend 97=Y frames through sequence and hash deduplicationVerified Exhibit

Defeating the Fatal MsgSeqNum-Too-Low Logout Trap on PossDup=Y#

One of the costliest bugs in custom C++ or Go FIX adapters occurs when an inbound packet arrives with MsgSeqNum (34) < NextExpectedMsgSeqNum. Under standard session rules:

  • If PossDupFlag=N (or absent) AND 34 < Expected: A catastrophic sequence desynchronization has occurred! The receiver MUST immediately send Logout (35=5) with text "MsgSeqNum too low, expecting X but received Y" and close the TCP socket—never process the payload.
  • If PossDupFlag=Y AND 34 < Expected: The frame is a harmless duplicate from an overlapping ResendRequest recovery pass. The session layer MUST validate OrigSendingTime (122), silently discard the already-processed sequence slot without passing it to the OMS, and keep the connection open! Failing to check 43=Y before triggering the low-sequence logout kills live sessions right as recovery completes.
Quantitative Distribution · MsgSeqNum (34) vs Expected
MsgSeqNum (34) vs ExpectedPossDup (43) / PossResend (97)
01Already Replayed Packet34 < Expected02Sequence Desync Fault34 < Expected03Failover Order Retry34 == Expected04Malformed Resend Frame34 == Expected
Inbound ScenarioMsgSeqNum (34) vs ExpectedPossDup (43) / PossResend (97)Mandatory Gateway ActionPrimary Composite Dedup Key
Already Replayed Packet34 < Expected43=Y, 97=N (Valid 122)Silently ignore; keep TCP session alive(SessionID, MsgSeqNum 34)
Sequence Desync Fault34 < Expected43=N (or absent)Send Logout (35=5) & disconnect socketSession sequence high-water mark
Failover Order Retry34 == Expected43=N, 97=YQuery ClOrdID table; echo status if hit(SenderCompID 49, ClOrdID 11)
Primary + DropCopy FillIndependent Sessions43=N or 43=YAtomic insert ExecID; drop 2nd arrival(MarketSegment, Symbol, ExecID 17)
Malformed Resend Frame34 == Expected43=Y, Missing 122Emit Reject (35=3, Reason=1); advance seqHeader validation rule (FIX 4.4)

Idempotency Key Matrix Across Inbound Orders & Inbound Fills#

Building deterministic exactly-once state machines across primary gateways and out-of-band Drop Copy (35=8) aggregators requires composite deduplication keys tailored to each message direction.

Formula or model from the articleNot independently verified
L_expected_probes = 0.5 * (1 + 1 / (1 - alpha)) [Linear/Robin-Hood Hash Probe Bound]
  • Tdedupinline = Tfnv1ahash + Lexpectedprobes * Tcacheaccess
  • Where:
  • N_entries = 35,000,000 intraday orders + fills
  • N_buckets = 67,108,864 (2^26 slots * 32 bytes = 2,147,483,648 bytes in 1,024 2MB HugePages)
  • alpha = Nentries / Nbuckets = 35,000,000 / 67,108,864 = 0.5215 load factor
  • Tfnv1ahash = 4.5 ns (24-byte composite key)
  • Tcacheaccess = 9.8 ns weighted L2/L3 access with zero page-walk TLB misses
  • Worked Inline Deduplication Cost:
  • Lexpectedprobes = 0.5 * (1 + 1 / (1 - 0.5215)) = 0.5 * (1 + 2.090) = 1.545 probes
  • Tdedupinline = 4.5 ns + (1.545 * 9.8 ns) = 19.64 nanoseconds mean (~29 ns p99).

Designing Sub-50-Nanosecond Robin-Hood Hash Tables for Intraday Dedup#

Checking 25 million intraday ClOrdID and ExecID keys cannot rely on SQL queries or pointer-chasing std::map red-black trees without blowing pre-trade latency budgets. Production gateways allocate a power-of-two open-addressed Robin-Hood hash table (67,108,864 32-byte slots = 2.0 GB pinned in hugepages via MAP_HUGETLB), hashing (SessionID, FNV1a_64(ClOrdID)) with a load factor below 0.55.

Average probe depth stays at 1.18 cache lines (~18 nanoseconds), guaranteeing zero-allocation idempotency checks inline with order entry. On the buy-side OMS, fill accounting uses (VenueID, MarketSegmentID, ExecID Tag 17)—and for trade corrections (ExecType 150=G) or busts (150=H), links back to ExecRefID (19)—so even if identical fill reports arrive simultaneously over both the primary trading port and a shadow Drop Copy feed, unified margin clearing balances increment exactly once. See our FIX, SBE & OUCH Architecture Guide for cross-protocol equivalents on CME and Nasdaq.

Lookup latency comparison across PostgreSQL, Redis TCP, std::unordered_map, and HugePage Robin-Hood hash tables
Lookup latency comparison across PostgreSQL, Redis TCP, std::unordered_map, and HugePage Robin-Hood hash tablesVerified Exhibit

Audit Controls & Chaos-Test Scenarios for Exactly-Once Certification#

Before onboarding an execution adapter under SEC, FINRA, or IIROC/CIRO supervision, QA harnesses execute four mandatory packet-injection tests:

  1. Replay Lower-Sequence 43=Y Mid-Stream: Inject 34=500|43=Y|122=... when Expected=520; verify zero state mutation and zero Logout (35=5).
  2. Missing OrigSendingTime (122) on 43=Y: Inject 34=520|43=Y omitting 122; verify Reject (35=3, 373=1) and proper sequence advancement to 521.
  3. Cross-Session PossResend=Y (97) Order Retry: Submit identical ClOrdID with 97=Y after failover; verify prior status echoed with zero duplicate exposure in the Terminal Margin VaR & ES Calculator.
  4. Dual-Feed ExecID (17) Race: Deliver the same 150=F fill simultaneously on Trading and Drop Copy sockets; confirm atomic CAS (compare_exchange_strong) commits the fill once. Explore related state matrices in FIX OrdStatus & ExecType cancel/replace races and the FIX, SBE & OUCH Topic Hub.

Frequently asked questions

Why does FIX require OrigSendingTime (Tag 122) whenever PossDupFlag (Tag 43) is set to Y?

SendingTime (Tag 52) must always reflect the live wire transmission time to pass clock-drift checks. OrigSendingTime (Tag 122) preserves the exact historical timestamp when the business event originally occurred, allowing compliance audit trails and staleness filters to evaluate message age accurately.

Can ExecID (Tag 17) alone be used globally as a single-column primary key across multiple exchanges?

No. Exchanges guarantee ExecID uniqueness only within a specific venue, trading date, and often market segment or matching partition (e.g., CME channel or Nasdaq symbol partition). Always form a composite key combining TradingDate, Venue/MIC, MarketSegmentID, and ExecID (17).

How should an OMS deduplicate Trade Correct (150=G) and Trade Cancel/Bust (150=H) ExecutionReports?

Every correction or bust carries its own unique ExecID (Tag 17) while referencing the prior fill via ExecRefID (Tag 19). The OMS deduplicates the event itself using Tag 17, then atomically reverses or adjusts the ledger entry pointed to by Tag 19.

What happens if an algorithmic gateway sends a duplicate ClOrdID without setting PossResend=Y (97)?

Without PossResend=Y, an exchange or broker gateway treats the second NewOrderSingle as an erroneous duplicate order attempt and immediately returns ExecutionReport (35=8) with OrdStatus=8 (Rejected) and OrdRejReason=6 (Duplicate Order), leaving the original order intact.

Publication record

Published
14 November 2026
Updated
14 November 2026
Author
Marcus Thorne, CQF
Review
Review not recorded
Automated fact check
Passed in the stored pipeline record
Source URLs
3 recorded

AI assistance recorded: anthropic/claude-opus-4.6. This field does not establish human review or source verification.

Academic & Institutional Attribution

Cite This Research & Embed Live Data Card

Open Attribution License (CC BY 4.0)

Standard academic & institutional research paper citation format.

Marcus Thorne, CQF. (2026, November 14). PossDupFlag (Tag 43) vs PossResend (Tag 97): Idempotent FIX Execution Deduplication. Terminal Ledger Desk. https://terminalledgerdesk.com/reports/possdupflag-tag-43-origsendingtime-tag-122-idempotent-order-dedup

Regulatory Directory Cross-Reference

Referenced Institutions & Regulatory Registries

Referenced Supervisory Authorities

Explore Fix Protocol Sbe Ouch Session Latency Hub (20) →

Terminal Ledger Desk Data, Benchmarks & Contributor Records

FIX PossDupFlag (43) & PossResend (97) Idempotency Guide | Terminal Ledger Desk