Futures Trading 6.1.9

Pre-release

This version isn’t published on updates.mashdiv.com yet — the notes are available to preview, but it can’t be downloaded until it’s released.

23 August 2026

This release has upgrade notes. Read them before updating — they describe behaviour changes that need your attention.

ORDER-BOOKMATCHING-ENGINECRITICAL FIXES

Futures Trading v6.1.9

Release Date: August 23, 2026 Tags: ORDER-BOOK, MATCHING-ENGINE, CRITICAL FIXES

Overview

One market order could erase the entire opposite side of a futures order book. The orders were not cancelled and the margin was not released — they simply stopped existing on the ladder. Nothing could match them, the depth disappeared from the trading panel, and market orders on the surviving side began to be refused for "insufficient liquidity" against a book that was full of real, funded orders.

The orderbook table is the aggregated book: one row per symbol, side and price, holding every participant's size at that level. Each matching cycle hands the writer only the levels it moved, so a side with no entries means "this pass touched nothing here". The writer read it as "this side is empty" and issued a delete naming no price — which took every level on that side, for every trader, in the same batch as the fills.

An untouched side is not an edge case: a market buy sweeping a resting ask leaves the bid side untouched on every cycle it runs in, and so does every reduce-only liquidation. The spot engine was fixed for this incident; futures was the forked copy that never got it.

Read Upgrade Notes before you update — depth already erased does not come back on its own. Requires Core v6.7.0.

Update Instructions

pnpm updator

Restart the backend afterwards. There is no database change and no migration.


Upgrade Notes

Check your futures books after updating, and expect gaps

Updating stops the erasure. It does not retract one that has already happened.

A price level that was wiped is written again the next time a matching cycle touches that price, because the writer stores the level's whole amount rather than a change to it. A level that nothing touches stays missing — and the orders behind it are still open, still holding their margin, and still invisible to everybody including their owner's ladder.

  • Open each futures market after the restart and compare the ladder against your open orders. A market whose book is thin on one side and normal on the other is the signature of this defect.
  • Where a level does not come back, ask the trader to cancel and re-place. That writes the level from scratch.
  • Nothing was lost. No order was cancelled, no position was closed and no margin was released by this — the book row was missing, not the order.

Fixed

A market order could wipe every price level on the opposite side

The writer that persists order-book changes received the levels one matching cycle had moved. When a side carried none, it answered with a delete that named the symbol and the side and no price at all.

That statement removes every level on that side of the shared book. The orders it erased still existed and still held their margin; they just had no book presence. Nothing could match them, the ladder and the depth chart lost them, the worst-case sweep that sizes a market order could not see them, and market orders on the other side started failing for lack of liquidity against a book that was full.

A side carrying no entries is the ordinary case, not an unusual one: only the levels a pass actually moved are ever written into it. Orders that never rest contribute no depth, so a market order and a reduce-only liquidation both leave the opposite side empty on every cycle they run in — which made a plain market buy enough to trigger it.

  • Fixed the whole-side delete. A side the cycle did not touch now emits no statement at all.
  • Changed nothing about how levels that genuinely reach zero are removed: they are still deleted, by price, one at a time, which is the only delete this writer may now emit.