Category
WebSocket Reconnect Intervals
Locations
core/src/exchanges/kalshi/websocket.ts:140 — this.config.reconnectIntervalMs || 5000
core/src/exchanges/gemini-titan/websocket.ts:127 — this.config.reconnectIntervalMs ?? 5000
core/src/exchanges/opinion/websocket.ts:125 — this.config.reconnectIntervalMs ?? 5000
core/src/feeds/binance/binance-feed.ts:35 — config.reconnectIntervalMs ?? BINANCE_RELAY_DEFAULTS.reconnectIntervalMs (resolves to 5000 via types.ts:44)
core/src/feeds/chainlink/chainlink-feed.ts:57 — config.reconnectIntervalMs ?? CHAINLINK_DEFAULTS.reconnectIntervalMs (resolves to 5000 via types.ts:47)
core/src/exchanges/limitless/websocket.ts:67 — config.reconnectDelay ?? config.reconnectIntervalMs ?? 1000 ← 1000 ms
Inconsistencies
Every exchange defaults to 5000 ms except Limitless which defaults to 1000 ms — 5× faster reconnects. There is no documentation explaining why Limitless warrants a faster reconnect cadence, and the field name also differs (reconnectDelay vs reconnectIntervalMs).
Additionally, kalshi/websocket.ts uses || (falsy check) while gemini-titan and opinion use ?? (nullish check) — a 0 value (disable reconnect) would be swallowed by the Kalshi fallback but correctly passed through by the others.
Risk
- Limitless will reconnect 5× more aggressively than other venues after a disconnect, potentially causing unintended reconnect storms or hitting server connection limits.
- The Kalshi
|| vs ?? inconsistency means reconnectIntervalMs: 0 (disable reconnect) silently becomes 5000 on Kalshi but works correctly on other exchanges.
Suggested Fix
Define a shared default in core/src/utils/ws-defaults.ts:
export const DEFAULT_RECONNECT_INTERVAL_MS = 5000;
Standardize all fallbacks to ?? (nullish). Determine and document whether Limitless's 1000 is intentional; if so, name it LIMITLESS_RECONNECT_INTERVAL_MS = 1000 in its config and add a comment explaining why it differs.
Found by automated magic numbers audit
Category
WebSocket Reconnect Intervals
Locations
core/src/exchanges/kalshi/websocket.ts:140—this.config.reconnectIntervalMs || 5000core/src/exchanges/gemini-titan/websocket.ts:127—this.config.reconnectIntervalMs ?? 5000core/src/exchanges/opinion/websocket.ts:125—this.config.reconnectIntervalMs ?? 5000core/src/feeds/binance/binance-feed.ts:35—config.reconnectIntervalMs ?? BINANCE_RELAY_DEFAULTS.reconnectIntervalMs(resolves to5000via types.ts:44)core/src/feeds/chainlink/chainlink-feed.ts:57—config.reconnectIntervalMs ?? CHAINLINK_DEFAULTS.reconnectIntervalMs(resolves to5000via types.ts:47)core/src/exchanges/limitless/websocket.ts:67—config.reconnectDelay ?? config.reconnectIntervalMs ?? 1000← 1000 msInconsistencies
Every exchange defaults to 5000 ms except Limitless which defaults to 1000 ms — 5× faster reconnects. There is no documentation explaining why Limitless warrants a faster reconnect cadence, and the field name also differs (
reconnectDelayvsreconnectIntervalMs).Additionally,
kalshi/websocket.tsuses||(falsy check) whilegemini-titanandopinionuse??(nullish check) — a0value (disable reconnect) would be swallowed by the Kalshi fallback but correctly passed through by the others.Risk
||vs??inconsistency meansreconnectIntervalMs: 0(disable reconnect) silently becomes5000on Kalshi but works correctly on other exchanges.Suggested Fix
Define a shared default in
core/src/utils/ws-defaults.ts:Standardize all fallbacks to
??(nullish). Determine and document whether Limitless's1000is intentional; if so, name itLIMITLESS_RECONNECT_INTERVAL_MS = 1000in its config and add a comment explaining why it differs.Found by automated magic numbers audit