Skip to content

fix: add RFQ callbacks and exact trade quantity types - #13

Merged
harley-poly merged 1 commit into
mainfrom
harley/rfq-callbacks
Sep 29, 2026
Merged

harley-poly merged 1 commit into
mainfrom
harley/rfq-callbacks

Conversation

@harley-poly

@harley-poly harley-poly commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Changes

Private RFQ frames currently reach only raw message listeners. Add an RFQ callback, subscription helper and complete payload types for all seven event variants. Preserve the original message and existing error handling.

Add the missing portfolio Trade.qtyDecimal string type and update the examples. Set the additive SDK version to 2.1.0.

Part of ISVBE-936. This completes the remaining callback code; SDK publication and the MM heads-up remain follow-up work.

Testing

  • 206 tests pass on Python 3.13/websockets 17.1 and Python 3.10/websockets 13.0.
  • Gateway-generated fixtures cover all seven RFQ events and default/null/empty payloads through real local sockets. Removing RFQ dispatch fails 15 cases; removing qtyDecimal fails the typed consumer.
  • Ruff lint/format, mypy (package, typed consumers and example), and wheel/sdist build pass.

Checklist

  • Tests pass (pytest)
  • Linting passes (ruff check .)
  • Types check (mypy polymarket_us)

Note

Low Risk
Additive SDK surface (types, subscription helper, dispatch); no changes to order/auth HTTP paths. WebSocket behavior for RFQ follows existing private-stream patterns.

Overview
Adds private WebSocket RFQ support so lifecycle frames are not limited to the raw message handler. Callers can use subscribe_rfq() with SUBSCRIPTION_TYPE_RFQ, listen on rfq_event, and type payloads with RFQEvent plus exported RFQ / Quote models covering all seven gateway variants (create/close RFQ and quote create/delete/accept/confirm/execute), including nullable nested objects.

Also adds Trade.qtyDecimal on portfolio activity trades for exact fractional quantities (alongside rounded qty), updates the WebSocket example and README, and bumps the package to 2.1.0. Regression tests use gateway-serialized RFQ fixtures over a local socket and assert empty error strings still deliver data callbacks.

Reviewed by Cursor Bugbot for commit 94f0741. Bugbot is set up for automated code reviews on this repo. Configure here.

@harley-poly
harley-poly merged commit a9cafc7 into main Sep 29, 2026
11 checks passed
watashi pushed a commit to watashi/polymarket-us-python that referenced this pull request Oct 12, 2026
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