Subsystems

The subsystem lens answers "what does this piece of machinery do?" — independently of where it runs (server lens), what it manipulates (domain lens), or how it threads through a flow (lifecycle lens). Five subsystems form Kraite's running infrastructure: a scheduler that owns time, a daemon that owns dispatch, two WebSocket streams that own real-time exchange events, a queue surface that owns concurrency, and a market-regime gate that owns whether new opens are allowed at all.

Dispatch daemon

The persistent supervisor process on Kraite that replaced scheduler forks with one long-lived loop. Every cron-originating workload flows through here.

Scheduler

The Laravel scheduler — kline fetches, indicator computation, listenKey refreshes, balance snapshots. The time-driven entry point that hands off to the daemon and the queues.

WebSocket streams

Two long-lived daemons: per-account user-data WS for order events (push, <100 ms) and the public mark-price WS for ~1 Hz price refresh across all symbols and exchanges.

Horizon queues

Eight bounded lanes on the single Kraite host. The consumer side of every trading, stream, indicator, scheduled, and web workload.

Market regime

The black-swan circuit breaker. Score 0–100, four bands (Calm / Elevated / Fragile / Critical), gates new opens at the Critical band. Override beats cooldown.


Cross-lens entry points

The subsystem lens is one of four. The same machinery shows up under three other angles:

  • Servers — where every subsystem runs on the single production host.
  • Business domainswhat the subsystems manipulate (positions, orders, indicators, accounts, token selection).
  • Lifecycleshow a single end-to-end flow threads through every subsystem in turn.