Skip to content

fix(client): require 3 minute GTD expirations#134

Merged
cesarenaldi merged 1 commit into
mainfrom
fix/gtd-expiration-3min
Jul 3, 2026
Merged

fix(client): require 3 minute GTD expirations#134
cesarenaldi merged 1 commit into
mainfrom
fix/gtd-expiration-3min

Conversation

@cesarenaldi

@cesarenaldi cesarenaldi commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • update GTD limit order expiration validation from 60 seconds to 3 minutes
  • refresh sync and async client docstrings
  • update expiration boundary tests

Verification

  • uv run pytest tests/unit/test_order_limit.py
  • uv run ruff check .
  • uv run ruff format --check .
  • uv run pyright
  • uv run pytest -m "not integration"

Note

Medium Risk
Tightens trading input validation and may break integrations that relied on 60–179 second GTD expirations; behavior change is localized to limit orders with an explicit expiration.

Overview
Raises the minimum future expiration for GTD limit orders from 60 seconds to 3 minutes (180s) in validate_limit_order_params via _MIN_EXPIRATION_BUFFER_S.

Sync and async secure client docs for create_limit_order / place_limit_order now describe the 3-minute rule. Unit tests were updated for rejection messages and the 180s acceptance boundary.

Note: Callers passing expiration between ~60s and ~179s ahead of time.time() will now get UserInputError before sign/post.

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

@cesarenaldi cesarenaldi merged commit d487124 into main Jul 3, 2026
7 checks passed
@cesarenaldi cesarenaldi deleted the fix/gtd-expiration-3min branch July 3, 2026 11:41
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.

1 participant