fix(hyperliquid): default fetchOHLCV params to {}#1161
Merged
Conversation
…survives
Server's flat-body dispatch passes a single merged object as args[0],
leaving args[1] undefined. The other HL read methods make params
optional; OHLCV did not, so calls without explicit start/end crashed
with 'Cannot read properties of undefined (reading start)'.
Reproduces via MCP: pmxt.fetchOHLCV({exchange:'hyperliquid', outcomeId:'hl-outcome-172', resolution:'1h'}).
2 tasks
realfishsam
added a commit
that referenced
this pull request
Jun 19, 2026
SDKs were sending '?id=...' for GET reads, but server method-verbs spec defines the first arg as 'outcomeId'. The GET dispatcher uses spec names to peel primitive args, then bundles every other query key into the object arg. So outcomeId arrived as undefined and the raw key 'id' ended up inside params. fromMarketId(undefined) crashed with 'Cannot read properties of undefined (reading match)'. POST path was unaffected because it sends positional args directly. Also: default HL fetchOHLCV params to a benign value so the build fix from #1161 type-checks (resolution is required on OHLCVParams). Verified locally against npm run server with both Python and TS SDKs: fetch_markets, fetch_events, fetch_order_book, fetch_ohlcv, fetch_trades all return data for exchange='hyperliquid'.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
fetchOHLCV(outcomeId, params)hadparamstyped as required. Server's flat-body dispatch (app.ts) merges body fields into a single object and passes it asargs[0], leavingargs[1]undefined.fetchOHLCVfor Hyperliquid crashes withCannot read properties of undefined (reading 'start').fetchOrderBook,fetchTrades) already makeparamsoptional and work fine.Repro
Test plan
start/endISO strings — still worksKnown not fixed in this PR
fetchMarkets/fetchEventsreturn[]forexchange=hyperliquiddespiteloadMarketsreturning ~6000 markets. Root cause not yet identified from code reading; needs local repro againstnpm run dev.outcomeIdparameter on HL read methods actually expects a marketId (hl-outcome-{n}), not the encoded outcome token id fromloadMarkets[].outcomes[].outcomeId. Either the param naming or the handler is wrong — separate issue.