docs: Gtd payload is Unix milliseconds, not seconds (release 0.8.4)#108
Merged
Conversation
The TimeInForce::Gtd doc claimed "seconds since epoch" — the outlier in the crate: TimestampMs, trade timestamps and statistics are all milliseconds, this crate's own tests always used 13-digit ms epochs for GTD, and orderbook-rs compares the payload against Clock::now_millis. A caller following the old doc got orders that appeared expired immediately. - Gtd doc rewritten (milliseconds, rationale, cross-refs); GTD bullet in lib.rs/README carries the unit; README regenerated. - gtd_payload_unit_is_milliseconds pins the contract: an ms deadline is live against an ms clock, and the same deadline expressed in seconds reads as long-expired. - Version 0.8.3 -> 0.8.4 + CHANGELOG (doc-only; bump required to republish). Closes joaquinbejar/OrderBook-rs#187 (the pricelevel half; the orderbook-rs half — unit docs on has_expired/set_market_close_timestamp and a dep-floor bump — lands there).
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
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
Fixes the
TimeInForce::Gtdpayload-unit documentation (found via joaquinbejar/OrderBook-rs#187). The doc claimed "seconds since epoch" — the outlier inside this crate:TimestampMs, trade timestamps and statistics are all milliseconds;order_type.rs,time_in_force.rs);orderbook-rs::OrderBook::has_expiredcompares the payload againstClock::now_millis().A caller following the old doc and passing seconds got orders that appeared expired immediately against a milliseconds clock (this nearly caused a 1000× "fix" in the wrong direction downstream — see Option-Chain-OrderBook-Backend#98).
Changes (doc-only — no API, behavior, or wire change)
Gtddoc rewritten: milliseconds, rationale, cross-references.lib.rs/README carries the unit; README regenerated viamake readme.gtd_payload_unit_is_millisecondspins the contract: an ms deadline is live against an ms clock; the same deadline expressed in seconds reads as long-expired.Closes the pricelevel half of joaquinbejar/OrderBook-rs#187.