Master-Child Account Synchronization Architecture
Master-child account synchronization is the core mechanism that makes copy trading work. It is the process of keeping child accounts in step with a master account as trades happen in real time. This article examines the architecture — event capture, state reconciliation, lag handling and the consistency guarantees a production system must provide.
Event capture from the master account
Synchronization begins with capturing master account events. The engine subscribes to the master broker’s order stream and records every event — order placed, modified, partially filled, cancelled, position closed — as a structured message with a unique identifier. This event log is the source of truth; all child replication derives from it.
State reconciliation
Child accounts drift. A child order might reject due to insufficient margin, or fill partially while the master fills completely. The engine must reconcile child state against master state continuously:
- If a child missed an event (network gap), the engine replays it on reconnection.
- If a child order was rejected, the engine logs it and flags it for intervention.
- If a child partially filled, the engine tracks the remaining quantity.
- If the master closed a position, the engine ensures every child closes its corresponding position.
Handling replication lag
Replication is not instantaneous — there is lag between the master event and the child execution. In fast markets, this lag causes price slippage. The architecture must account for it: the engine can skip events that are already stale (a master order cancelled before the child places it), and it must never block the master stream while waiting for a child response.
Consistency guarantees
A production synchronization system provides eventual consistency: given no new master events, all child accounts converge to the correct state. It does not guarantee identical fills — that is impossible across brokers — but it guarantees that every master event is processed, every child outcome is recorded, and every discrepancy is surfaced. See our copy trading software development for how this is engineered.
Building master-child synchronization?
Discuss your technical requirements with CodingAlgo and explore a custom software development solution.
Discuss Your Project