Skip to content

docs: document HIP-3 dex parameter on Info methods#288

Open
claygeo wants to merge 1 commit into
hyperliquid-dex:masterfrom
claygeo:fix/add-dex-param-user-fills
Open

docs: document HIP-3 dex parameter on Info methods#288
claygeo wants to merge 1 commit into
hyperliquid-dex:masterfrom
claygeo:fix/add-dex-param-user-fills

Conversation

@claygeo

@claygeo claygeo commented Apr 13, 2026

Copy link
Copy Markdown

Summary

Adds the missing dex parameter documentation to the Args docstrings of the five Info methods that already accept and forward a dex argument for HIP-3 builder-deployed perpetuals: user_state, open_orders, frontend_open_orders, all_mids, and meta.

Fixes #286.

Why

HIP-3 bot developers don't realize these methods support per-DEX selection, because the dex parameter is only discoverable by reading the source. Documenting it in the Args section makes HIP-3 support visible.

Changes

  • hyperliquid/info.py: add dex to the Args docstrings of the 5 methods that already accept it. No code or signature changes.

Scope note (this PR originally also targeted #287)

This PR initially also added a dex parameter to user_fills and user_fills_by_time. I removed that half after testing the live mainnet /info API: userFills/userFillsByTime returned an identical result set whether dex was omitted, set to a valid HIP-3 dex (xyz), or set to an invalid value (and the invalid value was not rejected) — dex appears to have no effect on those two endpoints. By contrast the sibling endpoints (clearinghouseState, openOrders, metaAndAssetCtxs) validate dex (HTTP 500 on an invalid value) and return dex-specific data. Adding a forwarded-but-ignored dex to the two fill methods would document filtering the SDK can't actually provide, so it's been dropped. Repro on #287.

Backwards compatibility

Docstring-only change. No behavior changes.

@claygeo claygeo force-pushed the fix/add-dex-param-user-fills branch from e5525ef to 0835976 Compare June 19, 2026 14:06
@claygeo claygeo changed the title feat: add dex parameter to user_fills and user_fills_by_time for HIP-3 docs: document HIP-3 dex parameter on Info methods Jun 19, 2026
@claygeo

claygeo commented Jun 19, 2026

Copy link
Copy Markdown
Author

Rebased onto the latest master and refreshed this PR.

One scope change worth flagging: I pared it down to the docs-only half, documenting dex on the five Info methods that already support it (user_state, open_orders, frontend_open_orders, all_mids, meta), which closes #286.

I dropped the original user_fills / user_fills_by_time change after testing the live API: the /info endpoint silently ignores a dex field on userFills/userFillsByTime (a valid HIP-3 dex returns the same default-dex fills, and an invalid dex isn't rejected), while clearinghouseState/openOrders validate it. Adding the parameter there would have implied per-DEX filtering the backend doesn't actually do. Full repro on #287.

Tests and mypy pass locally. Would appreciate a re-review when you get a chance. Thanks!

Add the missing `dex` parameter to the Args docstrings of user_state,
open_orders, frontend_open_orders, all_mids, and meta -- the five Info
methods that already accept and forward a `dex` argument for HIP-3
builder-deployed perpetuals. Improves discoverability of HIP-3 support.

Fixes hyperliquid-dex#286.
@claygeo claygeo force-pushed the fix/add-dex-param-user-fills branch from 0835976 to 44952da Compare June 19, 2026 18:55
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.

HIP-3 dex parameter missing from docstrings for user_state, open_orders, all_mids

1 participant