You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The watchOrderBook method for Limitless was previously catching all SDK/network errors and silently returning an empty orderbook. This caused two severe issues:
Upstream stream loops (streamSingle) would spin infinitely at max CPU.
Downstream trading logic received false "zero liquidity" signals instead of feed degradation alerts.
This PR removes the empty fallback. It now properly logs the error (including the market context as requested in #1374) and throws it, forcing the caller to handle the failure and allowing circuit breakers / reconnect logic to function normally.
Attempts to make Limitless watchOrderBook throw instead of returning fake empty liquidity when the WebSocket/snapshot path fails. That matters because SDK consumers should not mistake transport failure for an empty order book.
Blast Radius
Limitless WebSocket order-book path in core/src/exchanges/limitless/websocket.ts; no schema or SDK wrapper signature changes.
Consumer Verification
Before (base branch):
Static consumer-path trace: when the timeout fallback fetchOrderBookSnapshot() failed, watchOrderBook() logged a warning and resolved getEmptyOrderbook(), so a consumer could receive empty bids/asks for a transport/API failure.
After (PR branch):
The outer catch now throws, but the timeout fallback still catches its own snapshot error and resolves this.getEmptyOrderbook() at core/src/exchanges/limitless/websocket.ts:186-189. That means the concrete failure path in the PR title still returns fake empty liquidity instead of throwing.
Test Results
Build: PASS for current main core build during scheduled run
Unit tests: PASS for current main core Jest (699 passed, 3 skipped)
Server starts: NOT VERIFIED for this PR head
E2E smoke: FAIL by static consumer-path trace for timeout fallback failure
Findings
core/src/exchanges/limitless/websocket.ts:186-189 — the timeout fallback still swallows fetchOrderBookSnapshot() failures and resolves getEmptyOrderbook(). The new outer catch at lines 195-202 cannot see this because the inner promise resolves successfully, so watchOrderBook() still reports an empty order book for this failure mode.
PMXT Pipeline Check
Field propagation (3-layer): N/A
OpenAPI sync: N/A
Financial precision: OK/N/A
Type safety: OK
Auth safety: N/A
Semver Impact
patch -- bug fix intent, but incomplete.
Risk
If merged as-is, sparse Limitless WS updates plus REST snapshot failure can still produce false zero-liquidity order books for SDK consumers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #676 and closes #1374.
The
watchOrderBookmethod for Limitless was previously catching all SDK/network errors and silently returning an empty orderbook. This caused two severe issues:streamSingle) would spin infinitely at max CPU.This PR removes the empty fallback. It now properly logs the error (including the market context as requested in #1374) and throws it, forcing the caller to handle the failure and allowing circuit breakers / reconnect logic to function normally.