> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trdrs.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Streaming

> Follow live prices and account changes over Server-Sent Events, and rebuild your state from the snapshot on every connect.

Two live streams push changes to you as they happen, both as plain Server-Sent Events. Use this
page when you build anything that shows live prices or a live account.

| Stream | What it sends |
| - | - |
| `/api/market/stream` | Live bars and quotes |
| `/api/account/stream` | The account: its orders, positions and balances |

Server-Sent Events need no websocket library, custom protocol or handshake. An `EventSource` in a
browser, a `for await` loop on a server, or `curl -N` on the command line is a complete client.

## Rebuild from the snapshot

Both streams send a full snapshot every time you connect or reconnect, then send changes as they
happen. That one rule keeps your client simple:

1. When you connect, replace your local state with the snapshot.
2. After that, apply each event as it arrives.
3. If the connection drops, reconnect and replace your state again.

Treat anything missing from a snapshot as gone. A working order that filled while you were
disconnected simply isn't in the next snapshot, and that absence is the truth. You never reconcile
a gap, replay a cursor or ask what you missed, so reconnecting is always safe and always enough.
