Repository navigation
feat: add batch order helpers - #14
Merged
Merged
Conversation
3 tasks done
poly-william
approved these changes
Oct 8, 2026
watashi
pushed a commit
to watashi/polymarket-us-python
that referenced
this pull request
Oct 12, 2026
feat(streams): rtds websocket stream
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.
Changes
Add
orders.create_many(),cancel_many()andmodify_many()to both Python clients, with typed requests/responses and usage examples. Each helper sends one authenticated request through the existing transport, preserving its no-retry policy for orders.Document the 20-order limit and that cancel/modify response IDs confirm submission, not individual order outcomes. Accept fractional quantities in the reused create/modify request types. These two annotations overlap #6; its response quantity changes remain separate.
Set the additive SDK version to 2.4.0, to release after #15's 2.3.0. Follows the SDK follow-up in https://github.com/Polymarket/go-gateway-us/pull/751.
Testing
Checklist
pytest)ruff check .)mypy polymarket_us)Note
Medium Risk
New trading endpoints with non-idempotent POST semantics; incorrect client assumptions about cancel/modify response IDs could cause operational mistakes, though behavior matches existing single-order retry policy.
Overview
Adds batch order APIs to the sync and async clients:
orders.create_many,cancel_many, andmodify_many, each posting up to 20 items in one authenticated request to/v1/orders/batched(and/cancel,/modify). New TypedDicts cover batch request/response shapes; create/modifyquantityis widened toint | floatfor fractional sizes.README documents the 20-order cap, semantics of returned ID lists (create returns exchange IDs; cancel/modify echo submitted IDs without per-order confirmation), and that batches are not auto-retried or split—same as single-order POSTs. Package version bumps to 2.4.0; tests cover signing, payloads, errors, timeouts, auth, and server-side batch size validation.
Reviewed by Cursor Bugbot for commit a407ed7. Bugbot is set up for automated code reviews on this repo. Configure here.