Hi,
I am developing an order book in java, which supports high speed order execution. I had previously developed a simple and messy order book based on two sorted maps, one for bid and one for ask. It is currently working in our project. Now I want to build a proper order book where the order execution is optimal in terms of speed and accuracy of order matching. How should I start building it?
Here are the Classes I thought of:
OrderBook -> contains map of SYMBOL (String) and Instrument (POJO).
Instrument -> contains a linkedlist of Order(POJO), one for BID, one for ASK.
Order -> contains orderId( long), quantity ( double), price( double), order type (market , limit), timestamp ( timestamp).
OrderBook will have method executeEvent(), it will process 3 events ADD, UPDATE and DELETE.
Though the design is still not optimal enough. I do think I can improve this further. How should I enhance this design?
I am developing an order book in java, which supports high speed order execution. I had previously developed a simple and messy order book based on two sorted maps, one for bid and one for ask. It is currently working in our project. Now I want to build a proper order book where the order execution is optimal in terms of speed and accuracy of order matching. How should I start building it?
Here are the Classes I thought of:
OrderBook -> contains map of SYMBOL (String) and Instrument (POJO).
Instrument -> contains a linkedlist of Order(POJO), one for BID, one for ASK.
Order -> contains orderId( long), quantity ( double), price( double), order type (market , limit), timestamp ( timestamp).
OrderBook will have method executeEvent(), it will process 3 events ADD, UPDATE and DELETE.
Though the design is still not optimal enough. I do think I can improve this further. How should I enhance this design?