When trying to fix negative markouts in your market making system, top of the list should be digging into fills that happened during inflight cancels.
These are trades your system knew were going to be toxic, but you got filled anyway.
This may happen because you're still too slow on the tails and quoting too tight for your latency, or it could be an inconsistency in your business logic.
Tracking these events involves accepting a small amount of overhead in the hot path but is generally worth it, especially in the testing phase with smaller amounts of capital.
When such events cross a certain threshold, I like to attach a cancel and fill context for detailed analysis of the system state before and after. This can include details about the BBO, alpha states, latency deltas, skew, etc.
Then, once such events have been reduced to an acceptable level, compile them out to shave the extra nanos off the hot path.