# open-source implementation of orderbook from FAST?

I'm looking for c/c++ implementation of OrderBook. I need implementation to reconstruct market data from FAST. I don't need to do "matching" because it already did by exchange, I only need to "aggregate" such structures:

struct OrderUpdate {
int32_t instrumentId;
uint32_t MDEntryID;
uint32_t MDUpdateAction;      // 0 - New 1 - Change 2 -Delete
int64_t MDEntryPx_Mantissa;
int16_t MDEntryPx_Exponent;
int64_t MDEntrySize_Mantissa;
int16_t MDEntrySize_Exponent;
uint32_t RptSeq;
uint32_t MDEntryTime;
uint32_t OrigTime;
char MDEntryType;    // 0 - buy; 1 - sell; other values in documentation
char MsgType;
};


Main requirement is, of course, speed. I've found in internet several projects:

Unfortunately most of these implementations are "matching" engines and not exactly what I'm looking for.

What is better to use to reconstruct orderbook from FAST messages?

• Each exchange may provide its own algorithm to manage order book. Please provide more info. I see that your struct does not contain Order ID, so it looks like fixed depth order book (e.g. CME). But there is also no NumberOfOrders field in your struct. Is this just a fixed depth order book where each level contains only <price,size> entry? In this case it's just 20 lines of code. – Serg Nov 30 '13 at 2:12
• this is for moex.com for this template ftp.micex.com/pub/FAST/ASTS/template/FIX50SP2-ALL.xml – Oleg Vazhnev Nov 30 '13 at 2:59
• MDEntryID is OrderId (not equal to real order id but this is not important). MDEntryPx is order price and MDEntrySize is order volume and MDUpdateAction is what happened with order (added, modified or removed) – Oleg Vazhnev Nov 30 '13 at 3:02