A persistent low-latency execution system designed for high-frequency websocket streams, real-time trade state transitions, and automated recovery.
Inputs
Execution plane
Entry / target / SL / expiry evaluation on every relevant tick.
Persistent Node.js workers evaluate ticks against entry, target, stoploss, and expiry. Stateful processes replace cron/Lambda intervals for lower tail latency and fewer duplicate evaluations.
Entry / target / SL / expiry evaluation on every relevant tick.
Persistent Node.js workers evaluate ticks against entry, target, stoploss, and expiry. Stateful processes replace cron/Lambda intervals for lower tail latency and fewer duplicate evaluations.
Entry / target / SL / expiry evaluation on every relevant tick.
Persistent Node.js workers evaluate ticks against entry, target, stoploss, and expiry. Stateful processes replace cron/Lambda intervals for lower tail latency and fewer duplicate evaluations.
Source of truth
Every transition that must survive restarts is durable in MongoDB. Workers write audited state; reads for heavy analytics stay off the hot path.
Change streams propagate authoritative writes back into Redis, trimming ghost keys and aligning in-memory snapshots with persisted documents.
Grafana + Prometheus watch SLO-style signals: lag, error budgets, provider health. Paging hooks for disconnect storms or reconciliation backlog.
When gaps are detected, historical bars replay through the same rules engine, reconcile against live-advanced state, then hand control back to the websocket path.
Sync mechanism
Change streams propagate authoritative documents; workers read Redis first, Mongo for recovery and analytics. Writes finalize in MongoDB; watch streams push deltas into Redis. Periodic reconciliation jobs heal drift if a worker crashes mid-flight.
New recommendation allocates symbol interest.
Collapse duplicate advisor requests per symbol.
Open channel only if pool count transitions 0→1.
Fan-out ticks to subscribed worker queues.
Keep channel while any trade references symbol.
Tear down when last trade closes.