Rebuild a trade's aggregates from its executions
POST/api/v1/reconciliation/repair/:tradeId/recalculate
Replays computeTradeAggregates over the trade's linked executions
and writes the result back onto the trade row, repairing a trade whose
stored aggregate fields contradict themselves (the health invariant
trade.aggregates.inconsistent). This is the only repair for a trade
whose executions are correct and whose trade row is not; every other
repair action rebuilds only as a side effect of changing something
else.
Idempotent and sync-proof: it writes exactly what the next automatic
rebuild would write. It also trusts the executions completely, so when
a fill is the fault use fix-execution instead. No link-state filter
is applied; every non-deleted execution on the trade is replayed.
Request
Responses
- 200
- 400
- 401
- 404
- 409
- 500
Aggregates rebuilt
Invalid trade ID or request body
Authentication required
Trade not found or access denied
Rebuild would push exposure above the broker position
Server error