Skip to content

Add end-to-end test for auto-cancellation of expired orders #50

@tomdevman

Description

@tomdevman

Summary

Add a Python SDK end-to-end test that verifies the matching engine's auto-cancellation of expired orders works correctly through the full stack.

Background

The matching engine now supports automatic cancellation of expired orders via the expiresAfter field (seconds since epoch). When an order's expiration time passes, the ME's fast thread detects it and auto-cancels it. We should have a Python SDK test that exercises this full flow.

Suggested test flow

  1. Place a GTC order with a short expires_after (e.g., current time + 5 seconds)
  2. Verify the order is accepted and resting in the book (via GET /v2/wallet/{address}/openOrders or WebSocket orderChanges)
  3. Wait for the expiry time to pass (+ some margin for scan interval)
  4. Verify the order is no longer in open orders
  5. Optionally verify a CANCELLED status update was received via WebSocket

Notes

  • The expiresAfter field is in seconds since epoch (per the OpenAPI spec)
  • The ME scans for expired orders on a configurable interval (100-1000ms), so the test should allow a few seconds of margin
  • This is a good candidate for the examples/ directory or a dedicated tests/ integration test
  • Can be tested against the cronos (testnet) environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions