Docs / Concepts / Running systems
RealReconciliation after restart
A restarted session imports what is already open at the venue.
What is imported
Before the first strategy callback, Engine::reconcile takes a report from the venue. Open orders come in as accepted orders with no owning strategy; positions come in as an opening fill at the venue's average price.
Safety rules
- The engine's order id counter moves past every imported id, and a new order with an existing id is refused.
- Duplicate ids inside one report are refused.
- The venue adopts the whole set or none of it. If it cannot reach every imported order, reconcile fails and the venue follows none of them.
- A later fill for a reconciled order updates order state and the portfolio.
On the XRPL testnet venue
XrplVenue::reconcile_report builds the report from the account's resting offers on the ledger, with order ids of the form XRPL-<sequence>. An offer that is already followed is not followed twice. Offers the engine did not take are not followed.
Batch handling
If one event in a batch refers to an unknown order, the engine still applies the rest of the batch and reports the error at the end.