Switch the live feed to Schwab and document the rate limits

LIVE_SOURCE=schwab locally. Seeding stays on Yahoo, which is enforced in the
factory rather than left to configuration.

The portal's "Order Limit: 120" caps orders per minute and this app places none;
Schwab's separate REST limit is commonly cited at the same number. Neither binds
here, because streaming is not REST — one socket, bars pushed, essentially no
REST traffic in steady state. Worth recording as a reason the stream beats the
polling fallback beyond latency: polling quotes once a second would have sat at
half the limit permanently.

Reconnects are the exception. Each calls get_user_preferences() for the socket
URL, and the retry backoff is five seconds, so a sustained outage costs about
twelve REST calls a minute — under the limit, but a reason not to shorten that
backoff without thinking.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Chris Amow 2026-08-10 05:26:47 -05:00
parent d526001742
commit 09114f7c6a

View file

@ -196,6 +196,25 @@ bars would remove it entirely.
`/ES` resolves to the active contract (`/ESU26` today) on Schwab's side, so
contract rolls need no handling.
### Rate limits
The developer portal shows **Order Limit: 120**, which caps orders per minute —
this app places none. Schwab separately rate-limits REST calls, commonly cited at
120 per minute.
Neither constrains us, because **streaming is not REST**. The WebSocket is a
single connection and bars arrive by push, so steady-state Schwab REST usage is
essentially zero. This is a concrete advantage of the stream over the polling
fallback: polling `get_quotes()` once a second would have sat at roughly half the
limit permanently, forever.
The exception is reconnects. Each one calls `get_user_preferences()` to fetch the
socket URL, and `StreamService` retries every five seconds, so a sustained outage
generates about twelve REST calls a minute. Comfortably under, but not nothing —
worth remembering before shortening that backoff.
Yahoo is a different service and none of these limits apply to it.
### Authenticating
```bash