Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As others have mentioned this depends on how matching works on the exchange.

The case where the bid is higher or equal to the ask is known as a "crossed book". I most cases, this should never happen and if it does it would be as a result of a bug in the matching algorithm. If you place a buy/sell order with a price that is in excess of the best ask/bid respectively then that order will be matched against the opposite side. Under normal conditions what you suggested should be impossible.

If you want to know more about how order books work, I wrote an article specifically about how this works mechanically: https://www.machow.ski/posts/2021-07-18-introduction-to-limi...



Thank you for this! This is exactly what I was looking for.


No problem, glad it was helpful!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: