TradeSyncer · Cockpit V2 (event-sourced, no RTDB)

uid
uid — — idle

Positions leader drives · followers mirror

Market shared last price

Quick actions writes → the log

Actions don't mutate the screen directly — they emit events; the cockpit updates only when the engine + broker confirm (true event-sourcing).

Live event feed under the hood

Accounts role · broker/ref · connection · net position · open PnL

Leader set which account leads

Per-follower controls multiplier · ratio · group · lock · activate

Place order command.place_order

price/stopPrice sent only when filled. Order type market ignores them.

Modify / cancel command.modify_order · cancel_order

Cancel accepts orderId, or fall back to symbol/group below.

Flatten / close command.flatten · flatten_all · close_position

Risk limits config.set_risk_limits · per account

Empty fields are omitted. Current limits are config (not surfaced by the cockpit read-model), so this form is write-only.

Broker connections lifecycle → the log

Connect emits cred.token_set (credentialRef only — never a secret) + connection.enable; the connection-manager confirms with broker.connection_status → the cockpit flips to “connected”.