It may sound it but I promise it’s not. Order filling is surprisingly simple but the devil is in the details, as always.
https://dylanlott.com/orderbook
If you’re interested in reading more. I’m planning a part 2 update to it soon.
Edited to fix my link.