Back to Documentation

Changelog

Release notes for the PaperBroker Python Client

v0.2.4 Latest
March 17, 2026

Introduces SQLite-based order persistence — solving a critical issue where active order IDs are lost if the program crashes or is terminated unexpectedly. Orders are now saved to SQLite on every lifecycle event and can be recovered on restart.

Added
  • order_store_path constructor parameter — enables SQLite persistence (default: "orders.db", set None to disable)
  • recover_pending_orders() method — reloads active orders from SQLite and rehydrates in-memory state so cancel_order() works immediately after restart
  • New OrderStore module (paperbroker/session/order_store.py) with WAL journal mode, atomic commits, and thread-safe access
  • Example 02_cancel_order.py updated to demonstrate crash recovery flow
Design
  • Order state persisted at 3 critical moments: place_order(), execution report received, and every status change
  • Fail-safe design — SQLite errors are logged but never crash the trading flow
  • 100% backward compatible — no breaking changes, no new dependencies (sqlite3 is stdlib)
Recovery Usage
client.connect()
client.wait_until_logged_on(timeout=10)

# Recover orders from previous session
pending = client.recover_pending_orders()
if pending:
    for order in pending:
        print(f"  {order['cl_ord_id']}: {order['side']} "
              f"{order['qty']}x {order['symbol']} @ {order['price']}")
        client.cancel_order(order["cl_ord_id"])
Backward Compatibility
Scenario Behavior
Existing code, no changes Works — persistence auto-enabled with orders.db
order_store_path=None Memory-only mode, identical to v0.2.3
SQLite file missing or corrupt Degrades to memory-only, logs warning
SQLite write fails mid-session Error logged, order flow continues
v0.2.2 Stable
January 2026

Initial public release with FIX 4.4 trading support, event-based API, market data subscriptions, and REST integration for account management.

Features
  • FIX 4.4 protocol support via QuickFIX engine
  • Event-based order management (place, cancel, track)
  • Market data query and real-time subscription (Redis & Kafka)
  • Multi sub-account support with cross-matching
  • REST API integration for portfolio, transactions, and cash balance
  • 11 example scripts covering all major use cases