diff --git a/src/server/sparkd/cmds/spartan/md/mdp3/back_testing/matcher/FifoMergedSecurityMatcher.cpp b/src/server/sparkd/cmds/spartan/md/mdp3/back_testing/matcher/FifoMergedSecurityMatcher.cpp index 7d5b6aa18..eb9d5d127 100644 --- a/src/server/sparkd/cmds/spartan/md/mdp3/back_testing/matcher/FifoMergedSecurityMatcher.cpp +++ b/src/server/sparkd/cmds/spartan/md/mdp3/back_testing/matcher/FifoMergedSecurityMatcher.cpp @@ -107,12 +107,13 @@ void FifoMergedSecurityMatcher::implied_matching_status(bool value) { } void FifoMergedSecurityMatcher::on_order_change(const SmallOrderChange& ch, std::vector* effects, FillDepot& fills) { - if (!ch.affect_book) { - if (_me->implied_matching_status) - ERROR("affect-free matching does not support implied markets (implied_matching_status=true, so affect-free fills will be unreliable)"); + if (!implied_matching_status()) { + // there is no "merged matching" when implied matching is off, + // just pass the order changes the direct matcher. matcher()->on_order_change(ch, effects); return; } + bts_assert_msg(ch.affect_book, "affect-free matching is not supported in markets with implied matching."); switch (ch.change) { case OrderChange::ChangeType::updated: { auto prev_ord_tup = matcher()->find_order(ch.order.key); @@ -320,13 +321,7 @@ MDP3Quantity FifoMergedSecurityMatcher::_fill( effects = new std::vector(); uint32_t fills_pos = effects->size(); auto target_fill_qty = std::min(quantity, get_qty(dtop)); - // this is temp hack to ensure partial fills are appropriately created - auto fill_price = get_price(dtop); - if (!implied_matching_status()) { - target_fill_qty = quantity; - fill_price = price; - } - auto rem = matcher()->fill(key, side, fill_price, target_fill_qty, effects, true); + auto rem = matcher()->fill(key, side, get_price(dtop), target_fill_qty, effects, true); auto fill_qty = target_fill_qty - rem; quantity -= fill_qty; DIAG("filled ", fill_qty, ". Order now: ", ord_desc());