Skip to content

feat(hyperliquid): implement fetchOrderBooks via client-side loop - #1253

Merged
realfishsam merged 1 commit into
mainfrom
fix/hl-fetchorderbooks-client-side-batch
Jun 21, 2026
Merged

realfishsam merged 1 commit into
mainfrom
fix/hl-fetchorderbooks-client-side-batch

Conversation

@realfishsam

Copy link
Copy Markdown
Contributor

Summary

HL has no native batch order-book endpoint, so fetchOrderBooks threw "Method not supported". Implemented as Promise.all over fetchOrderBook — inherits the outcome-token-or-marketId resolution from the single-fetch path. The has.fetchOrderBooks capability auto-flips to true because BaseExchange._deriveCapabilities introspects overrides.

A ponytail: comment marks the unbounded concurrency: add a cap if HL info rate limits start biting in practice.

Verified locally (Python + TS) against npm run server

hl.fetchOrderBooks(['hl-outcome-171','hl-outcome-172','hl-outcome-173'])
  -> 3 books (171: empty, 172: 4 bids / 9 asks, 173: 20/20)
mixed marketId + outcomeToken: 2 books returned

Hyperliquid has no native batch order-book endpoint. fetchOrderBooks
previously threw 'Method not supported' on the SDKs. Now overrides the
base stub with a Promise.all over fetchOrderBook, which inherits the
outcome-token-or-marketId resolution from the single-fetch path. The
capability map auto-flips because BaseExchange derives has.* by
introspecting overrides.

ponytail comment marks the unbounded concurrency: add a cap if HL info
rate limits start biting in practice.

Verified locally (Python + TS) against npm run server:
  hl.fetchOrderBooks(['hl-outcome-171', 'hl-outcome-172', 'hl-outcome-173'])
    -> 3 books returned, mixed marketId + outcomeToken input also works.
@realfishsam
realfishsam merged commit 2abab2d into main Jun 21, 2026
6 of 11 checks passed
@realfishsam
realfishsam deleted the fix/hl-fetchorderbooks-client-side-batch branch June 21, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant