Runtime Topology: YU06-eod-price-production
Parent state: YU05-post-trade-compliance
Entrypointsβ
POST /eod/session/close,GET /eod/prices/{date}[/versions/{v}],POST /eod/prices/{date}/override,POST /eod/prices/{date}/publish;trade-processor, admin-JWT gated.eod-session-closeCronJob (k8s); calls/eod/session/closeon a schedule, using the same admin-token mint + call path an operator uses manually.- No new HTTP entrypoint on
position-service; it is driven entirely by theeod.prices.readyJetStream subscription.
Componentsβ
- Inherits the Kubernetes/C3/FDC3 runtime components already present in
YU05-post-trade-compliance. trade-processorgains the EOD producer: quality classifier, versioned snapshot repository, durable event publisher, and the/eod/*controller; all reading from its existingPriceHistoryStoreprice feed and writing to its existing MariaDB datasource.position-servicegains the EOD consumer: a durable JetStream subscriber, a read-only snapshot reader, and an idempotent P&L writer against its own MariaDB datasource.NATS JetStreamgains one new stream,TRADERX_EOD(file storage), carryingeod.prices.readyandeod.pnl.done.- MariaDB gains three tables (
eod_price_session,eod_price_snapshot,eod_position_pnl) added to the shared runtime schema alongside every table prior states already defined there.
Networkingβ
trade-processorandposition-serviceeach connect directly to the NATS broker; no new service-to-service HTTP calls are introduced between them.- Publication order in
trade-processoris always snapshot rows committed, then status flipped to published, then the event emitted; the event can never reference an uncommitted version. position-servicenever queries live prices; it reads only the exact(session_date, version)named in the event it received.
Startup / Health Orderβ
- Generate and verify the inherited
YU05-post-trade-compliancebaseline assets. - Start MariaDB, NATS, and inherited support services as in the parent state.
- Start
trade-processorandposition-service; both connect to NATS in a background thread and retry independently of application readiness, so neither blocks on broker availability at boot. - The
TRADERX_EODJetStream stream is created on first publish/subscribe if it does not already exist. - The
eod-session-closeCronJob becomes active on its configured schedule once the cluster is up.
Degraded Behaviorβ
| Condition | Effect |
|---|---|
position-service unreachable/down at publish time | EOD_PRICES_READY is retained on the durable stream; the consumer receives it on reconnect and marks the session. |
NATS unreachable from trade-processor at publish time | The snapshot version is committed as published in MariaDB but the event publish fails; re-running /publish is an idempotent retry that re-emits the (deduplicated) event. |
| A held security is missing or unresolved in the snapshot | The consumer halts that account's marking and increments an alert counter; other accounts in the same session are still marked. |
Duplicate EOD_PRICES_READY delivery | The consumer's write is an idempotent upsert keyed by (session_date, version, account_id, security). |
| MariaDB unreachable | The current producer or consumer operation fails its cycle via the existing datasource retry/backoff; no impact on order-matcher or the BLP. |