Skip to main content

Architecture (State 007 Pricing Awareness and Market Data)

State 007 builds on NATS-based runtime from 006 and adds synthetic market pricing, trade execution price stamping, position cost basis aggregation, and frontend valuation.

  • Inherits architectural baseline from: 006-observability-lgtm-compose
  • Generated from: system/architecture.model.json
  • Canonical flows: ../001-baseline-uncontainerized-parity/system/end-to-end-flows.md

Entry Points​

  • ingress: http://localhost:8080
  • nats-ws: ws://localhost:8080/nats-ws
  • price-publisher: http://localhost:18100/prices

Architecture Diagram​

Node Catalog​

NodeKindLabelNotes
traderactorTrader BrowserUses Angular UI and receives realtime trade, position, and pricing updates.
ingressgatewayNGINX IngressRoutes REST and websocket traffic.
webfrontendWeb Front End AngularSubscribes to account and pricing streams via nats.ws.
natsmessagingNATS BrokerPub/sub broker for backend and browser streaming.
pricePublisherservicePrice PublisherPublishes pricing.<TICKER> and exposes REST quote endpoint.
tradeServiceserviceTrade ServiceValidates account/ticker and stamps execution price before publishing orders.
tradeProcessorserviceTrade ProcessorProcesses trades, persists price/cost basis, emits account updates.
accountserviceAccount ServiceAccount and account-user operations.
positionservicePosition ServiceTrades/positions query endpoints.
referenceDataserviceReference DataTicker lookup/list.
peopleservicePeople ServiceIdentity lookup and validation.
databasedatabaseDatabasePersistent account/trade/position state.

State Notes​

  • Markets are treated as always open in this simulation.
  • yfinance bootstrap is optional startup-only and falls back to snapshot data.
  • Advanced pricing/risk engines are intentionally out of scope for this state.