Remix.run Logo
alexpotato 3 days ago

> Every modern exchange has a single logical sequencer. No matter how many gateways feed the system, all events flow into one component whose job is to assign the next sequence number. That integer defines the global timeline.

A notable edge case here is that if EVERYTHING (e.g. market data AND orders) goes through the sequencer then you can, essentially, Denial of Service to key parts of the trading flow.

e.g. one of the first exchanges to switch to a sequencer model was famous for having big market data bursts and then huge order entry delays b/c each order got stuck in the sequencer queue. In other words, the queue would be 99.99% market data with orders sprinkled in randomly.

blibble 3 days ago | parent [-]

why would market data go through the sequenced stream on an exchange?

for an exchange: market data is a projection of the order book, an observer that sits on the stream but doesn't contribute to it

and client ports have rate limits

alexpotato 3 days ago | parent [-]

B/c, by design, you want the archived stream of events to include everything.

e.g. a lot of these systems have a "replay" node that can be used by components that just restarted. You want the replay to include ALL of the messages seen so you can rebuild the state at any given point.

(There are, of course, tradeoffs to this so I'm just commenting on the "single sequencer" design philosophy)

blibble 3 days ago | parent [-]

by definition: an exchange doesn't need any reference to outside market data

even for systems built on a sequencer which do (e.g. an OMS), the volume is too large

the usual strategy is for processes which require it, is to sample it and them stamp it on commands

which maintains the invariants

(my background: I have been a developer on one of Mike Blum's original sequencers)

alexpotato a day ago | parent | next [-]

Fair point that you don't actually need the market data you send out if you have the original order book data internally.

usefulcat 2 days ago | parent | prev [-]

How would an exchange enforce the trade through rule without any outside market data?