Skip to content

fix: spot_meta_and_asset_ctxs doesn't inject dex into the payload - #265

Open
KyaClaw wants to merge 1 commit into
hyperliquid-dex:masterfrom
kyaky:fix/issue-257
Open

KyaClaw wants to merge 1 commit into
hyperliquid-dex:masterfrom
kyaky:fix/issue-257

Conversation

@KyaClaw

@KyaClaw KyaClaw commented Mar 2, 2026

Copy link
Copy Markdown

Summary

Adds missing dex parameter to spot_meta_and_asset_ctxs method, aligning it with other info methods that support DEX-specific queries.

Changes

  • Added optional dex: str = "" parameter to spot_meta_and_asset_ctxs method.
  • Included "dex": dex in the payload sent to the /info endpoint.

Testing

  • Existing test suite passes (where network requests are mocked).
  • No breaking changes; default behavior unchanged (empty string DEX).

Fixes #257

@koriyoshi2041 koriyoshi2041 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rechecked this against the live mainnet /info endpoint today (2026-09-16), and the proposed parameter still appears to be a silent no-op. I sent spotMetaAndAssetCtxs three ways: with no dex, with dex="xyz", and with dex="definitely-invalid-dex". After isolating the non-volatile metadata object (response[0]), all three normalized outputs had the same SHA-256 (3bdf5005b7206faa1acff7eb759a71c6d0991e03fa6ce2074eb75babd3bd3f4c) and the same 501 tokens / 328 universe entries. The full responses differed only because market contexts changed between sequential calls.

That matches the evidence already recorded on #257: HIP-3 partitions perp universes, while spot metadata is global. Adding dex here would therefore advertise filtering the server does not provide. I recommend closing this implementation PR; a docstring note that spot contexts are not dex-scoped would be the accurate alternative.

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.

2 participants