Non-Functional Delta: 007 Pricing Awareness and Market Data
Parent state: 006-observability-lgtm-compose
Runtime / Operationsβ
- Add
price-publisherservice to compose runtime with deterministic startup behavior. - Preserve single ingress model and NATS websocket entrypoint from state
006. - Keep market bootstrap mode configurable (
snapshotoryfinance) without code change. - Keep publish cadence and batch ratio configurable via runtime environment:
PRICE_PUBLISH_INTERVAL_MIN_MS,PRICE_PUBLISH_INTERVAL_MAX_MS,PRICE_PUBLISH_BATCH_RATIO.
- Keep supported symbol universe configurable and shared across pricing + reference-data:
SUPPORTED_TICKERS,REFERENCE_DATA_SUPPORTED_TICKERS(wired from shared set in compose).
Precision / Data Qualityβ
- Persisted trade execution price and position average cost basis use precision scale of 3.
- Position valuation calculations in UI use numeric safety defaults when market prices are temporarily unavailable.
Performance / Scalabilityβ
- Price stream fan-out uses NATS subject wildcard (
pricing.*) for efficient browser subscription. - Price generation cadence uses randomized interval (default
750-1500ms) with subset publish model (default25%symbols each cycle) to reduce local message flood.
Reliabilityβ
- yfinance bootstrap is startup-only and falls back to snapshot/fallback values on failure.
- Existing baseline trade/account validation behavior remains unchanged.
- Legacy ticker compatibility is normalized at source (
FBemitted asMETA) to avoid dual-symbol drift across clients.