Business domains

The business-domain lens answers "what is this business object and what states can it be in?" Domains are the things Kraite manipulates — positions, orders, accounts, indicators — and the rules that govern their state transitions. Domain chapters describe contracts, invariants, and ownership; the flows that move objects between states live in the lifecycle lens.

Open positions

The central domain. Slot-based opening (6 LONG + 6 SHORT seeded), status state machine, the SL-before-TP invariant, partial-fill and WAP semantics. Every other domain orbits this one.

Orders

Per-order state machine — market entries, limit-rung DCAs, take-profits, stop-losses. Idempotency anchored to exchange_order_id. Push-fill via WS, polling-fill as safety net.

Accounts

One row per (user, exchange). Credentials, position-mode flag, can_trade toggle. The unit of credential isolation — only Binance accounts query TAAPI; others receive direction by copy.

Indicators

Twelve TAAPI indicators per symbol per timeframe (1h / 4h / 12h). The throttler-bound input layer that feeds the signal-to-direction lifecycle.

Token selection

Which symbol fills a freed slot. Four selection priorities (override / fast-track / BTC-bias / fallback), log-compressed scoring, stability + diversification + S/R proximity multipliers.


Cross-lens entry points

  • Subsystemswhat runs the workflows that change domain state (the daemon, the queues, the streams).
  • Serverswhere each domain's data lives (everything on Zeus) and where its workflows execute.
  • Lifecycleshow a domain object moves through its states end-to-end.