Joel Grunbaum
2022-01-12 e8c910e52d1807e2fcca3b43d80a9df6acac5387
protocol.cpp
@@ -109,24 +109,24 @@
   case json::SPREAD_TYPE:
   case json::CALL_TYPE:
   case json::PUT_TYPE:
      announce(bs, dynamic_cast<json::AnnounceMessage*>(message));
      announce(bs, static_cast<json::AnnounceMessage*>(message));
      break;
   case json::SETTLEMENT:
      settle(bs, dynamic_cast<json::SettleMessage*>(message));
      settle(bs, static_cast<json::SettleMessage*>(message));
      break;
   case json::ADDED:
      addedOrder(bs, dynamic_cast<json::AddedMessage*>(message));
      addedOrder(bs, static_cast<json::AddedMessage*>(message));
      break;
   case json::DELETED:
      deletedOrder(bs, dynamic_cast<json::DeletedMessage*>(message));
      deletedOrder(bs, static_cast<json::DeletedMessage*>(message));
      break;
   case json::TRADE:
      tradeOrder(bs, dynamic_cast<json::TradeMessage*>(message));
      tradeOrder(bs, static_cast<json::TradeMessage*>(message));
      break;
   case json::BROKER_REQUEST:
   case json::BROKER_ACK:
   case json::BROKER_CONFIRM:
      broker(bs, dynamic_cast<json::Broker*>(message));
      broker(bs, static_cast<json::Broker*>(message));
      break;
   default:;
   }
@@ -170,7 +170,7 @@
void tradeOrder(std::unordered_map<std::string, book::Book>& bs,
                json::TradeMessage* message)
{
   if (bs.contains(message->passiveOrder)) {
   if (bs.find(message->passiveOrder) != bs.end()) {
      if (message->tradeType == json::BUY_AGGRESSOR) {
         if (message->passiveOrderRemaining > 0) {
            bs[message->product].askSide.at(message->passiveOrder).volume =