Queue-Reactive Market Maker — Patch Update
Audit / Issue Found
The strategy was only counting trades when it fired one of its emergency market orders such as a scratch close or a position-cap reduction. The normal post-only quotes that earn the bid-ask spread did not count. As a result, the trade counter and volume figures shown on the dashboard did not reflect most of the activity the bot was doing.
Before the patch
You could run the strategy for hours and see the trade counter sitting at a single-digit number even though the bot had filled many small spread captures. Volume totals were similarly understated. Profit and loss was tracked correctly because that was driven by inventory changes, but the operational metrics that tell you how busy the strategy is were misleading.
After the patch
The inventory detector at the end of every cycle is now the single source of truth for the trade counter and the volume totals. It watches actual position changes from the exchange and bumps the counter for every confirmed change in holdings.
When a market-order path fires, it still bumps the counter immediately so the action is visible right away, but it also tags the cycle with the quantity it sent. When the inventory detector later sees the corresponding inventory change, it subtracts the tagged quantity before counting, so the same fill is never counted twice. Any leftover inventory change beyond the tag is a real post-only fill and gets counted exactly once.
Bottom line
The trade counter and volume statistics now reflect every confirmed fill from the exchange, not just emergency actions, so you can see how active the strategy actually is.
Follow-up correctness audit, same day
Three real issues were found and fixed.
First, the carry-over window between a tagged market order and the inventory detector was only one cycle. If a market order partial-filled over two or three ticks, the leftover portion was counted as a brand-new fill. The window is now five cycles by default, tunable per pair.
Second, a safety reaper was added so a tag that never matches a balance change cannot stay in memory forever and silently absorb future fills.
Third, the side-panel value labelled Pair Exposure was pinned at one hundred percent because the formula was the spot-side version on a futures strategy. The fix replaces it with the futures-correct version, position notional divided by wallet balance.