Skip to content

user_fills and user_fills_by_time missing dex parameter for HIP-3 support #287

Description

@keitaj

Feedback from an HIP-3 MM bot operator. We needed per-DEX fill data for cost efficiency analysis and had to use raw HTTP as a workaround.

Problem

user_fills and user_fills_by_time don't accept a dex parameter, making it impossible to retrieve fill history for HIP-3 (builder-deployed perpetuals) markets through the SDK.

Current code

# info.py line 199 — no dex parameter
def user_fills(self, address: str) -> Any:
    return self.post("/info", {"type": "userFills", "user": address})

# info.py line 228 — no dex parameter
def user_fills_by_time(self, address, start_time, end_time=None, aggregate_by_time=False):
    return self.post("/info", {"type": "userFillsByTime", "user": address, ...})

Comparison with other methods

Other methods already support dex:

  • user_state(address, dex="") ✅
  • open_orders(address, dex="") ✅
  • all_mids(dex="") ✅
  • meta(dex="") ✅
  • user_fills(address) ❌ — no dex parameter
  • user_fills_by_time(address, ...) ❌ — no dex parameter

Impact

HIP-3 bot operators cannot track per-DEX fill history through the SDK. We had to use raw HTTP calls as a workaround:

requests.post(API + "/info", json={"type": "userFills", "user": addr, "dex": "xyz"})

Suggestion

Add dex parameter consistent with other methods:

def user_fills(self, address: str, dex: str = "") -> Any:
    return self.post("/info", {"type": "userFills", "user": address, "dex": dex})

Activity

  1. mifth commented on Apr 12, 2026

    @mifth

    Good find. As an addition the Info.meta_and_asset_ctxs() has also no dex parameter.
    #278

  2. claygeo commented on Jun 19, 2026

    @claygeo

    Update after digging into this while preparing #288, because it changes the picture.

    I tested the live mainnet /info endpoint directly, and dex appears to have no effect on userFills / userFillsByTime:

    • userFills for one address returned an identical result set whether dex was omitted, dex="", dex="xyz" (a real HIP-3 dex from perpDexs), or dex="<invalid>". A valid HIP-3 dex did not change the results, and an invalid dex was not rejected.
    • By contrast, openOrders, clearinghouseState, and metaAndAssetCtxs reject an invalid dex with HTTP 500 and return dex-specific data for a valid one, which confirms the test methodology.

    So unlike the sibling endpoints, userFills/userFillsByTime don't appear to honor dex server-side today. Adding the parameter to the SDK would document per-DEX fill filtering it can't actually provide, so I've scoped #288 down to the docstring fix for the methods that already accept dex (#286).

    If per-DEX fill history is exposed another way (or this is planned), happy to revisit — but as of today the SDK can't offer a reliable server-side per-dex fill query.

  3. mifth commented on Jun 19, 2026

    @mifth

    @claygeo could you please add to your commit the #278 please?

  4. claygeo commented on Jun 19, 2026

    @claygeo

    @mifth thanks for the pointer. I checked metaAndAssetCtxs against the live API and it's a real gap, and unlike the fill endpoints it genuinely honors dex: dex="xyz" returns the xyz perp-dex universe (xyz:TSLA, xyz:NVDA, ...) and an invalid dex is rejected with HTTP 500. So #278 is valid.

    Your PR #282 already adds the param correctly, so I'd rather not duplicate it here and step on your contribution. Best for that credit to stay with you. I'm keeping #288 scoped to the docstring fix (#286), and a docstring-only change can only document params that already exist, so meta_and_asset_ctxs is out of scope here until #282 lands the param. Happy to give #282 a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions