AI Market Maker 5.0.2

5 December 2025

PERFORMANCEMEMORY OPTIMIZATIONSTABILITYBUG FIXES

AI Market Maker v5.0.2

Release Date: December 5, 2025 Tags: PERFORMANCE, MEMORY OPTIMIZATION, STABILITY, BUG FIXES

Changed

Performance

  • Changed market processing to run in controlled batches — five markets at a time, with a short pause between batches — instead of all at once. This prevents CPU and memory spikes when many markets are active, and reduces database connection contention.
  • Changed trade identifier generation to load its library once at startup rather than on every trade, reducing CPU overhead and memory churn.

Monitoring and diagnostics

  • Added a warning when a tick takes more than twice its configured interval, and tracking of consecutive slow ticks, so degraded performance is visible before it causes problems.
  • Added a five-second timeout on market processing, so a single stuck market cannot block the whole engine. The timeout is logged and the remaining markets continue.

Fixed

The engine crashed when a symbol had order updates but no order book

  • Fixed a crash — "Cannot read properties of undefined (reading 'bids')" — raised whenever order updates arrived for a symbol that had no order book entries yet. It occurred more than a hundred times an hour and left unhandled promise rejections behind. An empty order book is now used as the starting point instead.

Memory leaks

  • Fixed unbounded growth in the price cache. It is now capped at 1,000 entries, and entries older than sixty seconds are cleared periodically, so accumulated price data can no longer exhaust memory.
  • Fixed orphaned timers left behind when a market is removed. Removing a market now clears its intervals before dropping the market's references, so the timers stop consuming CPU and the references can be collected.
    • Correction (6.1.3): this entry was inaccurate. The component involved was never reachable from any live code path, so the timers it created were never started and this fix had no runtime effect. It has since been removed entirely and replaced by a tick-driven order-flow layer that installs no timers at all.

Resource exhaustion

  • Fixed overlapping engine ticks piling up. A new tick is skipped while the previous one is still running, each tick is capped at five seconds, and consecutive slow ticks are tracked and logged so a runaway condition is detected before it brings the system down.
  • Fixed overlapping scheduled runs. Simultaneous runs are prevented, a minimum four-second interval is enforced between them, and the state is reset even when a run fails.