State 007 Fidelity Profile
This profile captures the required technical shape for state 007-pricing-awareness-market-data.
Runtime Stack Deltas From State 006β
| Concern | State 006 | State 007 |
|---|---|---|
| Messaging backbone | nats-broker | nats-broker + price-publisher |
| Trade schema | quantity/state only | + execution price |
| Position schema | quantity only | + averageCostBasis |
| Browser real-time stream | account-scoped trade/position updates | account-scoped updates + pricing.* streams |
| Runtime model | Docker Compose | Docker Compose |
Pricing Constraintsβ
- Persisted
priceandaverageCostBasisuse 3-decimal precision. - Market data tick generation is synthetic random walk bounded by startup open/close with per-ticker startup-assigned band profile:
- 20% of tickers: up to Β±4% beyond open/close,
- 60% of tickers: up to Β±2% beyond open/close,
- 20% of tickers: strict open/close bounds.
- Bootstrap mode:
snapshotfor deterministic local behavior,yfinancefor startup seeding from recent market data.
- Publish model:
- randomized interval defaults to
750-1500ms, - each cycle publishes a randomized subset (default
25%) of symbols, - all parameters are runtime-configurable.
- randomized interval defaults to
- Symbol universe:
- reference-data and price-publisher are configured to share the same supported symbol list,
- legacy
FBis normalized toMETAin reference-data outputs.
UI Fidelity Constraintsβ
- Position blotter includes
OPEN,MKT PRICE,POSITION VALUE, andP&L. - Market price row semantics are computed against open price:
- above open:
β²+ green highlight, - below open:
βΌ+ pink highlight, - equal open: neutral marker.
- above open:
- Position value and P&L use green/pink highlight semantics for positive/negative valuation state.
Closeness Policyβ
State 007 is functional-close to 006 with additive pricing behavior.
Messaging/runtime architecture remains unchanged except for adding the pricing publisher component.