feat(clob): add match_time_nano field to TradeResponse#306
Open
yovanoc wants to merge 5 commits intoPolymarket:mainfrom
Open
feat(clob): add match_time_nano field to TradeResponse#306yovanoc wants to merge 5 commits intoPolymarket:mainfrom
yovanoc wants to merge 5 commits intoPolymarket:mainfrom
Conversation
The CLOB /trades endpoint returns match_time_nano (nanosecond precision match timestamp) as documented in the OpenAPI spec, but the field was missing from the TradeResponse struct. Added as Option<String> with serde(default) since the field may not always be present in the response.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #306 +/- ##
=======================================
Coverage 85.54% 85.54%
=======================================
Files 32 32
Lines 5167 5167
=======================================
Hits 4420 4420
Misses 747 747
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| pub match_time: DateTime<Utc>, | ||
| /// Match time with nanosecond precision (string of nanoseconds since epoch). | ||
| #[serde(default)] | ||
| pub match_time_nano: Option<String>, |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| #[builder(default)] | ||
| #[serde(default)] | ||
| #[serde_as(deserialize_as = "DefaultOnNull<DisplayFromStr>")] | ||
| pub match_time_nano: u64, |
Collaborator
There was a problem hiding this comment.
sorry if that wasn't clear earlier, you could have kept the Option<u64> but this works too
Zorak556
added a commit
to Zorak556/polymarket-client-sdk
that referenced
this pull request
Apr 10, 2026
Upstream merges: - Polymarket#321: accept custom reqwest::Client via Config - Polymarket#322: BuilderTradeResponse.builder Address → ApiKey - Polymarket#306: add match_time_nano to TradeResponse - Polymarket#305: preserve unknown activity side values - Polymarket#303: version bump to 0.4.5 - Dep bumps: rust_decimal 1.41, uuid 1.23 Local patches: - Reduce auth header allocations (HeaderValue::from for integers) - Reorder order_builder size validation before async fee_rate call - Skip double deserialization when tracing is disabled - subscribe_book_and_prices: single-stream book + price_change - subscribe_user/orders/trades: async for tokio::sync::RwLock - Subscription lag: escalate to error and force resubscribe - Broadcast capacity: 1024 → 16384 - excludeDepositsWithdrawals param on ActivityRequest - cancel_order: orderId → orderID Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Zorak556
added a commit
to Zorak556/polymarket-client-sdk
that referenced
this pull request
Apr 10, 2026
Upstream merges: - Polymarket#321: accept custom reqwest::Client via Config - Polymarket#322: BuilderTradeResponse.builder Address → ApiKey - Polymarket#306: add match_time_nano to TradeResponse - Polymarket#305: preserve unknown activity side values - Polymarket#303: version bump to 0.4.5 - Dep bumps: rust_decimal 1.41, uuid 1.23 Local patches: - Reduce auth header allocations (HeaderValue::from for integers) - Reorder order_builder size validation before async fee_rate call - Skip double deserialization when tracing is disabled - subscribe_book_and_prices: single-stream book + price_change - subscribe_user/orders/trades: async for tokio::sync::RwLock - Subscription lag: escalate to error and force resubscribe - Broadcast capacity: 1024 → 16384 - excludeDepositsWithdrawals param on ActivityRequest - cancel_order: orderId → orderID Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Summary
match_time_nano: Option<String>toTradeResponsestruct#[serde(default)]since the field may not always be presentThe CLOB
/tradesendpoint returnsmatch_time_nanowith nanosecond-precision match timestamps, which is useful for deterministic ordering of trades that share the same second-precisionmatch_time.Note
Low Risk
Low risk: adds an optional/deserializable new response field without changing existing parsing behavior, aside from accepting an additional JSON key.
Overview
Adds
match_time_nanotoTradeResponseto capture nanosecond-precision match timestamps (nanoseconds since epoch) returned by the CLOB trades API.The field is defaulted for backwards compatibility and deserializes from nullable/string inputs via
serde_with::DisplayFromStr+DefaultOnNull.Written by Cursor Bugbot for commit afd2c27. This will update automatically on new commits. Configure here.