Skip to content

[GAP-30 follow-up] ExecRestatementReason=210 on Sweep & Cross residual handling #533

Description

@pedrosakuma

Follow-up deferred from #501 / PR #527 (the wire-conformance slice of GAP-30 Sweep & Cross).

Context

Sweep & Cross (CrossType.AgainstBook) is implemented as a 3-phase flow in ChannelDispatcher: (1) sweep IOC leg crosses the resting book, (2) residual rests, (3) cross the other leg. PR #527 landed TrdSubType=109 on sweep-phase UMDF trades. One GAP-30 sub-item remains deferred:

ExecRestatementReason=210 on the residual handling. B3 EntryPoint defines ExecRestatementReason values that annotate an ExecutionReport when an order's state is restated by an exchange-initiated action (rather than a client request). Value 210 is associated with the Sweep & Cross / cross-trade residual handling.

The ambiguity to resolve first

In #501 the product decision was that the sweep residual STAYS RESTING (not cancelled). ExecRestatementReason=210 is typically emitted on a CANCEL/restatement ER. So it is unclear under the current design when (or whether) 210 should fire:

  • If the residual always rests, there may be no cancel ER to carry 210 → the item could be a no-op / closed as not-applicable under the current design.
  • If B3 semantics require the residual (or some portion) to be cancelled/restated in certain Sweep & Cross outcomes, then a cancel/restatement ER carrying ExecRestatementReason=210 is owed.

Scope (pending spec confirmation)

  1. Confirm against the B3 EntryPoint spec (§16.6 + the ExecRestatementReason field definition) the EXACT trigger for ExecRestatementReason=210 in a Sweep & Cross: which ER (cancel vs trade vs new), and under which residual outcome.
  2. If applicable under the simulator's "residual rests" design, emit the ER carrying ExecRestatementReason=210 at the correct point; map the field on the EntryPoint SBE ExecutionReport (verify the field exists in schemas/b3-entrypoint-messages-8.4.2.xml; if absent, this becomes a documented wire-gap, NOT a hand-edit of the vendored schema).
  3. If NOT applicable under the current design, document that conclusion in docs/B3-ENTRYPOINT-COMPLIANCE.md GAP-30 and close this issue as not-applicable.

Constraints

  • No new Commands.cs enum value / snapshot codec bump unless strictly required (raise first).
  • Schemas are vendored — do not hand-edit.
  • Per AGENTS.md: gpt-5.5 review before draft→ready; single-writer dispatcher threading.

Refs: #501, PR #527, docs/B3-ENTRYPOINT-COMPLIANCE.md GAP-30 row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions