diff --git a/core/src/exchanges/hyperliquid/index.ts b/core/src/exchanges/hyperliquid/index.ts index a0b788ff..a9e09ae5 100644 --- a/core/src/exchanges/hyperliquid/index.ts +++ b/core/src/exchanges/hyperliquid/index.ts @@ -146,6 +146,15 @@ export class HyperliquidExchange extends PredictionMarketExchange { return this.normalizer.normalizeOrderBook(raw, outcomeId); } + // ponytail: Hyperliquid has no native batch order-book endpoint; loop client-side. + // Add a concurrency cap if rate limits start biting in practice. + async fetchOrderBooks(outcomeIds: string[]): Promise> { + const entries = await Promise.all( + outcomeIds.map(async id => [id, await this.fetchOrderBook(id)] as const), + ); + return Object.fromEntries(entries); + } + async fetchOHLCV(outcomeId: string, params: OHLCVParams = { resolution: '1h' }): Promise { const raw = await this.fetcher.fetchRawOHLCV(outcomeId, params); return this.normalizer.normalizeOHLCV(raw, params);