Infrastructure

How the system works — and how it scales.

A live system with real fills and every gate public — and the reorg that turns today's broker-coupled monolith into a modular core. What's shipped is labeled shipped; the rest is the plan.

01 · The redesign

From a broker-coupled monolith to a modular core

Today's code ships fast but carries debt: broker logic is welded into the strategies. The reorg untangles it so adding a broker is one adapter — not a rewrite.

Current

Shipped
nument-trade-uione repo · UI + API + jobs
nument-trade-logicper-strategy daemons, copy-pasted
strategies/tastytradebroker logic tangled into the strategy
TastyTradethe only broker actually wired in

Target

Planned
GitHub org · nument-trade-*corp-owned, one module per concern
nument-trade-uithe web app
nument-trade-logicshared, tested pricing + risk core
nument-trade-appone parameterized daemon
BrokerAdapter interfaceone clean contract, all brokers behind it
TastyTradePublicSchwab+ future = one adapter

The unlock: a BrokerAdapter layer plus a shared, tested core means a new broker is a single adapter behind a known interface — and the risk math is written once, not per strategy. Adding a broker = one adapter, not a rewrite.

02 · Canonical diagram

Target-state architecture

The shipped broker-coupled system transitions into one modular target. Its agentic loops and staging-first pipeline are target capabilities, planned post-raise.

Current

Broker-coupled monolith · MVP

Shipped
nument-trade-uiNext.js UI + API · one repo
nument-trade-logicper-strategy daemons · copy-pasted
strategies/tastytradebroker logic tangled into strategy
TastyTradeonly broker wired in
Reorg

Target

Modular, corp-owned GitHub org

Planned
nument-trade-logicshared pricing + risk core · powers web + mobile
BrokerAdapter interfaceone clean contract
TastyTrade adapterPublic adapterSchwab adapterfuture broker = one new adapter
nument-trade-uithe web app
nument-trade-mobilethe mobile app
nument-trade-telemetrytraces · metrics · analytics
nument-trade-adminSystem Pulse · command center
Target capability

Agentic loops

Always-running + one user-triggered

agent fleet · orchestratorTheta · Athena · Hermes
nightly trade-review loopwinners · losers · why we lost
bug-fix + trade-logic loopissue → PR
strategy R&D loopresearch repeatable edges · sector calls
ops loop · manager-of-managersruns the command center
Theta build loop · per userusers design · shadow → live
Target capability

Delivery pipeline

Staging-first · per-PR previews

localhostbuild & test locally
dev.nument.tradestaging · paper brokers
productionreal fills, gated rollout

Current = shipped · everything else = planned. No schema change touches production without a staging-first migration and a paper-broker dry run.

System Architecture — Consolidated Backend · Elixir / Phoenix
CLIENTS
WEB BFF
BACKEND
BRAIN
EXTERNAL
DATA
Drag to pan
WEB BFF · SvelteKit / Node
CLIENTS
BACKEND · Elixir / Phoenix
EXTERNAL
BRAIN · TS / Python — advisory
PERSISTENCE
vendor feeds
normalized quotes
live quotes
order intent
approved order
broker API
fills / acks
spawn / monitor
start / stop
place order
pnl push
WS · live PNL
WS · live PNL
form actions · auth
REST · queries · commands · orders
HTTP · REST
reasoning (advisory)
greeks (optional)
persist / rehydrate
audit
pull creds
hover, focus, or select any node to trace its connections · drag the canvas to pan · use the controls or hold ⌘ / Ctrl and scroll to zoom · green paths carry live market data & PnL