Skip to main content

Heal executions whose tradeId disagrees with their order's tradeId

POST 

/api/v1/reconciliation/heal-execution-order-drift

Fills follow their order (#1334): an execution with an orderId has no independent link state. This action finds every non-deleted execution (scoped to the caller's accounts, optionally narrowed to one account) whose tradeId disagrees with its order's tradeId - including the DELL incident shape where the order is orphaned but its fill still points at a trade - and converges each execution onto its order, using the same write shape as link-order (order has a trade) or unlink-order (order has no trade). Level-based and idempotent: re-running after a clean pass finds nothing left to converge.

Defaults to a dry run, which reports the drift and writes nothing. A live run (dryRun false) converges the drift, recalculates affected trades' aggregates, and writes one AuditLog row per converged order (action "Healed execution/order tradeId drift", entityType "Order") plus one summary row for the run. Backs the "Heal execution-order drift" action on the reconcile Broker data tab. The CLI script (apps/api/src/scripts/heal-execution-order-drift.ts) is a break-glass wrapper over the same service function.

Request​

Responses​

Drift report (dry run) or convergence result (live run)