Warn when cloid is included on HIP-3 orders (fixes #251)#306
Open
takinanton wants to merge 1 commit into
Open
Conversation
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.
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.
Closes #251.
Problem
Orders on builder-deployed (HIP-3) perp markets like
xyz:TSLAare silently rejected by the API when acloidfield 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 acceptcloid, so the failure mode is easy to miss.Fix
Exchange.bulk_orders()now emits aUserWarningif any order in the batch has:":"(the HIP-3<dex>:<symbol>convention), andNonecloid.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_warningintests/signing_test.pythat reproduces the detection path and asserts that wire serialization of a HIP-3 order still succeeds.Full
signing_test.pystill passes locally (14/14). The pre-existinginfo_test.pycassette failures on master are unrelated to this change.