Skip to content

feat(models): add taker delay in milliseconds - #397

Merged
kartojal merged 2 commits into
mainfrom
codex/fractional-seconds-delay
Oct 29, 2026
Merged

kartojal merged 2 commits into
mainfrom
codex/fractional-seconds-delay

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Add optional trading.taker_delay_ms from the takerDelayMs response field, representing the taker delay in milliseconds. Deprecate trading.seconds_delay with guidance to use the new field.

Keep seconds_delay typed as int | None. Add regression coverage for parsing the new field, preserving the old field, and the deprecation warning.

Validation: Ruff lint and format checks, Pyright, uv build, and all 3,520 non-integration tests pass. The full test suite ran outside the sandbox to allow network and local WebSocket access.

Context: https://polymarket.slack.com/archives/C0CC6E66P0F/p1793265583940099


Note

Low Risk
Additive model and parsing changes with backward-compatible deprecation; no trading or auth logic touched.

Overview
Adds trading.taker_delay_ms on the gamma Market model, mapped from the API’s takerDelayMs field (including flat payload normalization in parse_response).

trading.seconds_delay remains available but is marked deprecated with guidance to use taker_delay_ms instead; accessing it emits a Pydantic deprecation warning. The new field is not backfilled from secondsDelay when takerDelayMs is absent.

Unit tests cover parsing taker_delay_ms (including 0 and None), coexistence with secondsDelay, and the deprecation warning on seconds_delay.

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

@cesarenaldi
cesarenaldi marked this pull request as draft October 29, 2026 10:05
@cesarenaldi cesarenaldi changed the title fix(models): accept fractional market trading delays feat(models): add taker delay in milliseconds Oct 29, 2026
@cesarenaldi
cesarenaldi marked this pull request as ready for review October 29, 2026 10:32
@kartojal
kartojal merged commit fb4fea3 into main Oct 29, 2026
7 checks passed
@kartojal
kartojal deleted the codex/fractional-seconds-delay branch October 29, 2026 11:20
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