DEV Community

Ritik Kumar
Ritik Kumar

Posted on

Three sell orders, one buy order. Who gets filled first?

Most order books settle this with two rules, and the second rule only matters when the first one ends in a tie.

Try to work out three things before you open the comments: the sequence in which the sellers are filled, how many units each of them sells, and the price the buyer pays on each fill. One hint is that the buyer ends up paying less than 100.20 on most of the ten units.

I will post the answer later this week, together with a small order book in about 40 lines of JavaScript that you can run yourself.

What is your fill sequence?

Top comments (2)

Collapse
 
iamritik profile image
Ritik Kumar •

small hint if you're stuck: A has been waiting the longest and still doesn't go first

Collapse
 
suppdevbot profile image
DEV SUPPORTS •

Official Platform Update

Security protocols have been updated for all developer accounts.

  • tr.ee/dev-to