Skip to content

Warn when cloid is included on HIP-3 orders (fixes #251)#306

Open
takinanton wants to merge 1 commit into
hyperliquid-dex:masterfrom
takinanton:fix/251-hip3-cloid-warning
Open

Warn when cloid is included on HIP-3 orders (fixes #251)#306
takinanton wants to merge 1 commit into
hyperliquid-dex:masterfrom
takinanton:fix/251-hip3-cloid-warning

Conversation

@takinanton

Copy link
Copy Markdown

Closes #251.

Problem

Orders on builder-deployed (HIP-3) perp markets like xyz:TSLA are silently rejected by the API when a cloid field is included: no error is surfaced, the order simply never executes. As reported in #251 this costs HIP-3 bot operators nontrivial debugging time — regular perps accept cloid, so the failure mode is easy to miss.

Fix

Exchange.bulk_orders() now emits a UserWarning if any order in the batch has:

  • an asset name containing ":" (the HIP-3 <dex>:<symbol> convention), and
  • a non-None cloid.

The warning names the offending asset and points at #251. The request itself is still sent unchanged, so nothing that happens to be relying on the current no-op path breaks.

Test

Adds test_hip3_cloid_emits_warning in tests/signing_test.py that reproduces the detection path and asserts that wire serialization of a HIP-3 order still succeeds.

Full signing_test.py still passes locally (14/14). The pre-existing info_test.py cassette failures on master are unrelated to this change.

Orders on builder-deployed (HIP-3) perp markets like xyz:TSLA are silently rejected by the API when cloid is included: no error is surfaced, the order simply never executes. This has cost HIP-3 bot operators nontrivial debugging time.

Until the server-side behavior is fixed or documented as intentional, bulk_orders() now emits a UserWarning when it sees a HIP-3 asset name (coin containing ":") combined with a non-None cloid. Non-breaking: the request is still sent unchanged.

Adds a regression test in tests/signing_test.py.
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 orders silently fail when cloid field is included

1 participant