News for hackers. Stuff that matters.
Re:Positions, Profit and Loss by Exuma on Monday August 02, 2021 @01:35PM (#28039895)
> By definition, this order must be the top of the book, because it’s price already had to be aggressive, and there could be no other bids above us. Therefore, the new best bid increases from $99 to $102, since that is the limit price of our order.

I really wonder here, in this part of "Introduction to Limit Orders", how they handle race conditions. Do you think they use a synchronous queue that queues orders while it's transacting, or do they try to also handle inserting orders during the process of filling orders?

Re:Positions, Profit and Loss by is0tope on Monday August 02, 2021 @03:05PM (#28041210)
Order books will almost always be single threaded or something similar. Only one order action is allowed at a time in each book, otherwise it would be chaos. Exchanges are very strict on "fairness" since if there is a (legal) edge to be had, you can bet that someone will find it and try and exploit it. That's just the game.