An exchange publishes the same market data on two multicast feeds, A and B, from separate infrastructure. Your handler sees A sequence 1001, 1002, 1004 and B sequence 1001, 1003, 1004. Describe the arbitration logic, what you publish downstream and when, and what you do about 1005 if it never arrives on either feed.

An exchange publishes the same market data on two multicast feeds, A and B, from separate infrastructure. Your handler sees A sequence 1001, 1002, 1004 and B sequence 1001, 1003, 1004. Describe the arbitration logic, what you publish downstream and when, and what you do about 1005 if it never arrives on either feed.

Approach: Treat both feeds as unreliable streams of the same numbered sequence and keep one output sequence counter, publishing a message the first time its number is seen and buffering anything ahead of the counter.

Publish each sequence number the first time either feed delivers it, so the output is 1001, 1002, 1003, 1004 with no duplicates and no wait. Keep a next-expected counter and a small reorder buffer. 1001 arrives on A, publish and advance to 1002. 1002 arrives on A, publish, expect 1003. 1004 arrives on A ahead of the counter, so buffer it rather than publish. 1003 arrives on B, publish it and then drain 1004 from the buffer immediately. The duplicate copies of 1001 and 1004 are dropped by number. This is why exchanges run two independent multicast feeds at all: independent loss on each path means a gap on one is usually covered by the other with no request and no round trip. For 1005 missing on both, start a gap timer sized to the feed's normal jitter, a few hundred microseconds to a few milliseconds, then request retransmission on the recovery channel or rebuild from the snapshot feed. Until the gap fills you must mark the book stale for the affected instrument and stop quoting it, because a book with a hole in it is a book you can be picked off on.

Follow-up: Your gap timer is 500 microseconds and the recovery round trip is 20 milliseconds. What is the correct quoting behaviour in that 20 ms window and what does it cost you?

Key concepts: feed arbitration, sequence gap, multicast, retransmission.