Whichever order fulfills the rules of the jurisdiction the exchange resides in, I believe in the US that would mean the order that came in first.<p>In general orders are serialized first and then processed according to the order that was serialized, it&#x27;s impossible to reason about an order book with out serializing entries to it.