A trading process reconnects and immediately starts reading new messages. It feels like the system is back where it left off. That assumption is the risk.
Polymarket's real-time order guidance treats a reconnect as a checkpoint: refresh open orders and recent trades, then resume applying new stream events from that state.
A stream is incremental
The authenticated user stream reports changes to an account's orders and the trades created when those orders match. It is useful for reacting quickly, but it is not a complete account ledger.
A disconnected client can miss a placement, partial match, or cancellation. Starting at the newest message can leave local state quietly out of date.
Refresh before you act
After reconnecting, fetch the account's open orders and recent trades from the authoritative endpoints. Save the refresh time and the identifiers you used as the recovery checkpoint.
This is not wasted latency. It is the step that tells the process which orders still exist before it decides to cancel, replace, or size another one.
Apply new events after the checkpoint
Once the refreshed state is recorded, resume the stream and apply new order and trade events. Keep placement, update, and cancellation events separate from trade statuses such as matched, mined, confirmed, retrying, or failed.
An order update can change the open amount while a trade update follows its settlement path. Combining them into one boolean called ‘done’ throws away the distinction the recovery process needs.
Keep the recovery path boring
Log disconnects, reconnects, refresh results, and the first event applied after the checkpoint. Keep authenticated credentials on the server and make a failed refresh stop new submissions.
The useful question is not whether the socket is connected. It is whether the local view agrees with the account before the next action is signed.
Further reading: Real-time order updates · Manage orders · Wallets and authentication.
Explore the markets: Open Polymarket (referral link).
A note on risk
Prices can change and positions can lose their full value. Examples are educational, not promises of returns.