Functional Delta: YU06-eod-price-production (vs YU05-post-trade-compliance)
Everything from YU05-post-trade-compliance is carried forward unchanged; order matching, the
post-trade recon/TCA read side, the admin JWT authentication, and the deploy and observability
harness. What this state adds is an end-of-day layer: an official, versioned closing price per
instrument for each trading session, a durable event announcing that the prices are ready, and one
real overnight job that consumes them. It runs entirely on the read side, so the order-matching hot
path and its event schema are untouched.
Addedβ
- Session-close trigger
POST /eod/session/close?sessionDate=intrade-processor, called both by a Kubernetes CronJob and by an operator on demand through the same code path. - Official closing price per instrument, defined as the newest last-trade sample at or before the
close from the existing
pricing.*price feed; no new market-data source. - Versioned, immutable closing-price snapshot (
eod_price_session,eod_price_snapshot) keyed by session date and version; re-running production writes a newDRAFTand never edits aPUBLISHEDone. - Data-quality classification of every price as
OK,STALE,SPIKEorMISSING, from configured staleness and maximum-move thresholds plus an expected-instrument universe (eod.universe). - Manual override endpoint
POST /eod/prices/{date}/overridethat records a corrected price and its reason as a new version, so a bad price is resolved without touching what was already published. - Admin-only EOD control surface: every
/eod/*endpoint requires an authenticatedadmincaller, reusing the JWT mechanism inherited fromYU05-post-trade-compliancerather than adding a new one. - Publication fail-safe:
POST /eod/prices/{date}/publishreturns409while any instrument is an unresolvedSTALE,SPIKEorMISSING; a session that closes clean auto-publishes. - Durable
EOD_PRICES_READYevent on JetStream subjecteod.prices.ready, emitted only after the version is fully committed, so a consumer that was offline still receives it on reconnect. - Downstream EOD consumer in
position-servicethat marks positions against the exact(sessionDate, version)the event names rather than live ticks, and holds an entire account back when one of its holdings is missing or flagged instead of guessing a price. - Chain-completion event
eod.pnl.done, plus Micrometer counters for quality flags, sessions published and accounts marked or halted, surfaced in atraderx-eod-batch-chainGrafana dashboard.