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 Athena that replaced 20 scheduler forks per second 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

Seven queues across five boxes (athena for user-data, eos + iris + nyx for trading, tyche for indicators + cronjobs). The consumer side of every workload Kraite dispatches — positions, orders, priority, indicators, and more.

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:

  • Serverswhere each subsystem physically runs (athena hosts the daemon + scheduler + streams + the public web vhosts; eos + iris + nyx consume trading queues; tyche owns indicators + cronjobs; hyperion holds MySQL + Redis).
  • Business domainswhat the subsystems manipulate (positions, orders, indicators, accounts, token selection).
  • Lifecycleshow a single end-to-end flow threads through every subsystem in turn.