# Spec Kit Component: trade-processor

> For the complete documentation index, see [llms.txt](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/llms.txt).

## Responsibilities

*   Consume new trade events.
*   Persist trade state transitions and position deltas.
*   Publish account-scoped trade and position update events.

## Covered Flows

*   `STARTUP`
*   [`F4`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/end-to-end-flows.md#f4-process-trade-events)

## Requirement Coverage

*   [`SYS-FR-001`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/system-requirements.md), [`SYS-FR-007`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/system-requirements.md), [`SYS-FR-011`](https://deploy-preview-472--lucky-concha-f3599f.netlify.app/specs/baseline-uncontainerized-parity/system/system-requirements.md)

## Contracts

*   `specs/001-baseline-uncontainerized-parity/contracts/trade-processor/openapi.yaml`

## Verification

*   `scripts/test-trade-processor-overlay.sh`

## Commit boundary (#461)

Both baseline and pricing implementations register success notifications with the shared CommittedTradeEvents helper inside the Spring booking transaction. The helper captures booking values and publishes only in afterCommit, attempts both topics independently, and contains checked/unchecked notification failures. Direct nontransactional invocation fails before repository writes. Database failure and post-commit delivery failure must not share a retry/rebooking path.
