From 09114f7c6a2c2de338f36cd03b12488d3acb2ff3 Mon Sep 17 00:00:00 2001 From: Chris Amow Date: Mon, 10 Aug 2026 05:26:47 -0500 Subject: [PATCH] Switch the live feed to Schwab and document the rate limits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 5014c2f..acc8b03 100644 --- a/README.md +++ b/README.md @@ -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