Skip to content

Releases: pbeets/rithmic-rs

v0.6.2

21 Dec 06:05
04ea3f3

Choose a tag to compare

Added

New Sender API Methods

Ticker Plant

  • request_rithmic_system_gateway_info(): Get gateway-specific information
  • request_get_instrument_by_underlying(): Get all instruments for an underlying symbol
  • request_market_data_update_by_underlying(): Subscribe to market data by underlying
  • request_give_tick_size_type_table(): Get tick size table for a tick size type
  • request_product_codes(): Get available product codes for an exchange
  • request_get_volume_at_price(): Get volume profile for a symbol
  • request_auxilliary_reference_data(): Get additional reference data for a symbol
  • request_volume_profile_minute_bars(): Get minute bars with volume profile
  • request_resume_bars(): Resume a truncated bars request
  • request_depth_by_order_snapshot(): Get depth by order snapshot
  • request_depth_by_order_update(): Subscribe to depth by order updates

Order Plant

  • request_login_info(): Get current login session information
  • request_oco_order(): Place OCO (One Cancels Other) order pairs
  • request_link_orders(): Link multiple orders together
  • request_easy_to_borrow_list(): Get easy-to-borrow list for short selling
  • request_modify_order_reference_data(): Update user tag on existing order
  • request_order_session_config(): Get/set order session configuration
  • request_replay_executions(): Replay historical execution data

Repository Plant (Agreements)

  • request_list_unaccepted_agreements(): List agreements not yet accepted
  • request_list_accepted_agreements(): List already accepted agreements
  • request_accept_agreement(): Accept a specific agreement
  • request_show_agreement(): Get full agreement details
  • request_set_rithmic_mrkt_data_self_cert_status(): Set market data self-certification status

API Ergonomics

  • Re-exported RithmicOcoOrderLeg and related OCO order enums from api module
  • Changed RithmicOcoOrderLeg.trigger_price from f64 to Option<f64> since it's only required for stop orders

New Market Data Messages (Ticker Plant)

  • TradeStatistics, QuoteStatistics, IndicatorPrices, EndOfDayPrices
  • MarketMode, OpenInterest, FrontMonthContractUpdate, DepthByOrderEndEvent
  • SymbolMarginRate, OrderPriceLimits

New Order Plant Messages

  • UserAccountUpdate, AccountListUpdates, AccountRmsUpdates

New RithmicMessage Variants

  • ResponseReferenceData, ResponseFrontMonthContract, ResponseTimeBarUpdate
  • ResponseTickBarUpdate, ResponseAccountRmsUpdates

Fixed

  • Clippy warning: use is_multiple_of() instead of modulo check in connection retry logic

Documentation

  • Updated README with dedicated Plants section describing each plant's functionality
  • Improved configuration documentation (environment variables first, builder pattern second)
  • Added reconnection example in Connection Strategies section

See CHANGELOG.md for full details.

v0.6.1

24 Nov 04:39
c57a864

Choose a tag to compare

⚠️ Breaking Changes

Environment variable names have changed to support multiple environments simultaneously.

What Changed

All configuration variables now require environment prefixes (DEMO, LIVE, TEST):

Old (0.6.0 and earlier):

RITHMIC_ACCOUNT_ID=account123
FCM_ID=fcm123
IB_ID=ib123
RITHMIC_DEMO_USER=user
RITHMIC_DEMO_PW=pass

New (0.6.1):

RITHMIC_DEMO_ACCOUNT_ID=account123
RITHMIC_DEMO_FCM_ID=fcm123
RITHMIC_DEMO_IB_ID=ib123
RITHMIC_DEMO_USER=user
RITHMIC_DEMO_PW=pass
RITHMIC_DEMO_URL=<provided_by_rithmic>
RITHMIC_DEMO_ALT_URL=<provided_by_rithmic>

Migration Guide

Update your environment variables:

  • RITHMIC_ACCOUNT_IDRITHMIC_<ENV>_ACCOUNT_ID
  • FCM_IDRITHMIC_<ENV>_FCM_ID
  • IB_IDRITHMIC_<ENV>_IB_ID

Add new required variables:

  • RITHMIC_<ENV>_URL
  • RITHMIC_<ENV>_ALT_URL

See examples/.env.blank for a complete template.

Benefits

  • ✅ Run multiple environments simultaneously (Demo + Live)
  • ✅ Clear separation of environment configurations
  • ✅ Consistent naming across all variables
  • ✅ Better support for testing and development workflows

Code Quality Improvements

  • Fixed rustfmt compliance issues
  • Fixed clippy warning: use .first() instead of .get(0)

Full Changelog: https://github.com/pbeets/rithmic-rs/blob/v0.6.1/CHANGELOG.md#061---2025-11-24

Release v0.6.0

24 Nov 00:55

Choose a tag to compare

📖 Migration Guide: See MIGRATION_0.6.0.md for migration instructions from 0.4.x or 0.5.x.

Breaking Changes

  • Removed connection_info module - deprecated types removed (use RithmicConfig instead)
  • Removed RithmicConfig::from_dotenv() method - consumers call dotenvy::dotenv() themselves
  • Removed return_heartbeat_response() method from all plant handles
  • Updated to dotenvy crate - moved to dev-dependencies (from deprecated dotenv)

Changed

  • Connection health monitoring now fully automatic via WebSocket ping/pong
    • Heartbeats sent automatically for protocol compliance
    • Successful responses silently dropped
    • Errors delivered as HeartbeatTimeout messages
  • Environment variable loading now consumer-controlled
    • Library no longer forces approach for loading env vars
    • Examples demonstrate using dotenvy, but any method works
  • Reduced code complexity - removed 500+ lines of deprecated code

Documentation

  • Consolidated migration guides into single MIGRATION_0.6.0.md
  • Removed dotenv/.env references from library docs (examples still show usage)
  • Updated README with clearer examples and breaking changes summary

Installation

[dependencies]
rithmic-rs = "0.6.0"

Full Changelog: v0.5.3...v0.6.0

v0.5.3 - API Expansion

23 Nov 03:54
f0f92cb

Choose a tag to compare

v0.5.3 - API Expansion

This release adds extensive new API functionality for order history, risk management, symbol search, and trade routes, significantly expanding the capabilities of rithmic-rs.

🚀 Highlights

Order Management APIs

  • Cancel all orders: New cancel_all_orders() method to cancel all active orders across symbols/exchanges
  • Order history: Comprehensive methods to query historical orders with multiple levels of detail
    • Query available dates
    • Get summaries for specific dates
    • Retrieve detailed order information
    • Filter by basket ID

Risk Management APIs

  • Account RMS info: get_account_rms_info() for account-level risk limits
  • Product RMS info: get_product_rms_info() for product-specific limits
  • Trade routes: get_trade_routes() with optional subscription updates

Symbol Discovery APIs

  • Symbol search: search_symbols() with flexible filtering (exchange, product code, instrument type, pattern matching)
  • Exchange listing: list_exchanges() to query available exchanges and permissions

📋 Changes

Added

  • 🆕 10 new public methods across RithmicOrderPlantHandle and RithmicTickerPlantHandle

    • cancel_all_orders()
    • show_order_history_dates()
    • show_order_history_summary(date)
    • show_order_history_detail(basket_id, date)
    • show_order_history(basket_id)
    • get_account_rms_info()
    • get_product_rms_info()
    • get_trade_routes(subscribe_for_updates)
    • search_symbols(...)
    • list_exchanges(user)
  • 🔧 10 new request methods in RithmicSenderApi

    • request_cancel_all_orders() - Template 346
    • request_account_rms_info() - Template 304
    • request_product_rms_info() - Template 306
    • request_trade_routes() - Template 310
    • request_search_symbols() - Template 109
    • request_list_exchanges() - Template 342
    • request_show_order_history_dates() - Template 318
    • request_show_order_history_summary() - Template 324
    • request_show_order_history_detail() - Template 326
    • request_show_order_history() - Template 322
  • 📨 New TradeRoute message type for template ID 310

    • Handles trade route information
    • Delivered as update message
    • Supports subscription updates

Changed

  • Extended OrderPlantCommand enum with 8 new command variants
  • Extended TickerPlantCommand enum with 2 new command variants
  • Updated receiver API to handle TradeRoute messages

Known Issues

  • ⚠️ New code contains .unwrap() calls following existing patterns (may panic on errors)
  • TradeRoute message handler uses .unwrap() on protobuf decode (receiver_api.rs:438)
  • Plant handle methods use multiple .unwrap() calls on channel operations
  • These will be addressed in future releases for improved robustness

📚 Documentation

  • CHANGELOG.md - Complete changelog
  • All new methods include comprehensive documentation
  • Template IDs documented for all new requests

📦 Installation

[dependencies]
rithmic-rs = "0.5.3"

Full Changelog: v0.5.2...v0.5.3

v0.5.2 - Heartbeat Improvements

21 Nov 08:33

Choose a tag to compare

v0.5.2 - Heartbeat Improvements

This release adds optional heartbeat response handling and timeout detection for better connection health monitoring, while reverting the default heartbeat behavior to reduce subscription channel noise.

🚀 Highlights

Optional Heartbeat Response Handling

  • New return_heartbeat_response() method on all plant handles
  • Default: heartbeats use request/response pattern (not sent to channel)
  • Enable during trading hours for explicit connection health monitoring
  • Disable during off-hours to avoid false alarms

Heartbeat Timeout Detection

  • New HeartbeatManager tracks heartbeat response timeouts
  • Detects timeouts after 30 seconds (configurable)
  • Non-blocking implementation with tokio sleep_until()
  • New RithmicMessage::HeartbeatTimeout variant for notifications

📋 Changes

Added

  • return_heartbeat_response() method on all plant handles (ticker, order, pnl, history)
  • HeartbeatManager for tracking heartbeat response timeouts
  • RithmicMessage::HeartbeatTimeout variant for timeout notifications
  • HEARTBEAT_TIMEOUT_SECS constant (30 seconds)

Changed

  • Reverted heartbeat behavior: Responses no longer sent through subscription channel by default
    • Previous behavior (0.5.0): All heartbeat responses delivered as updates
    • New behavior: Only delivered if explicitly enabled via return_heartbeat_response(true)
    • Reduces noise for applications that don't need heartbeat monitoring
  • Renamed internal field ignore_heartbeat_response to expect_heartbeat_response for clarity

Fixed

  • ✅ Fixed ResponseHeartbeat request_id extraction in receiver API
  • ✅ Fixed ResponseHeartbeat routing in all plants
  • ✅ Fixed clippy warning tabs_in_doc_comments in src/rti.rs
  • ✅ Updated all doctests to use current API

📚 Documentation

  • CHANGELOG.md - Complete changelog
  • Comprehensive documentation for heartbeat timeout detection
  • Usage examples for connection health monitoring

📦 Installation

[dependencies]
rithmic-rs = "0.5.2"

Full Changelog: v0.5.1...v0.5.2

v0.5.0

17 Nov 04:04
dee33b3

Choose a tag to compare

v0.5.0 - Stability and Connection Reliability

Major release focused on stability, ergonomics, and connection reliability. This release eliminates panics, introduces connection strategies, and provides a unified configuration API.

🚀 Highlights

Connection Strategies

  • Simple: Fast-fail single connection attempt (recommended default)
  • Retry: Indefinite retries with exponential backoff capped at 60 seconds
  • AlternateWithRetry: Alternates between primary and beta URLs for maximum reliability

Unified Configuration API

  • New RithmicConfig type with builder pattern and from_env() method
  • Replaces fragmented AccountInfo types with single, cohesive configuration
  • Proper error handling with Result types - no more panics on missing config

Connection Health Monitoring

  • Heartbeat errors and forced logout events now visible in subscription channel
  • Enables robust reconnection logic and real-time connection health tracking
  • All connection health events delivered to applications for monitoring

⚠️ Breaking Changes

This is a breaking release. See MIGRATION_0.5.0.md for detailed migration guide.

Quick Migration Summary

  1. Plant Initialization

    // Before (0.4.x)
    let ticker_plant = RithmicTickerPlant::new(&account_info).await;
    
    // After (0.5.0)
    let config = RithmicConfig::from_env(RithmicEnv::Demo)?;
    let ticker_plant = RithmicTickerPlant::connect(&config, ConnectStrategy::Simple).await?;
  2. Configuration

    // Before (0.4.x)
    let account_info = AccountInfo { /* ... */ };
    
    // After (0.5.0)
    let config = RithmicConfig::builder()
        .user("username".to_string())
        .password("password".to_string())
        .env(RithmicEnv::Demo)
        .build()?;
  3. Error Handling

    • Must now handle heartbeat errors in subscription channel
    • Must handle forced logout events
    • See migration guide for complete examples

📋 Changes

Added

  • ConnectStrategy enum with Simple, Retry, and AlternateWithRetry modes
  • RithmicConfig unified configuration type with builder pattern
  • RithmicEnv environment selection enum (Demo, Live, Test)
  • ConfigError for type-safe configuration error handling
  • from_env() and from_dotenv() configuration loaders
  • Heartbeat responses now include error information
  • Forced logout events delivered through subscription channel

Changed

  • Plant constructors renamed: new()connect()
  • Return type changed to Result<Plant, Box<dyn std::error::Error>>
  • All plants now require ConnectStrategy parameter
  • Unified error handling pattern across all plants
  • Retry strategies now retry indefinitely with max 60s backoff

Fixed

  • ✅ Fixed panic on unknown message types
  • ✅ Fixed panic on error responses in ticker plant
  • ✅ Fixed panic on heartbeat errors across all plants
  • ✅ Fixed inconsistent heartbeat logic (now only sent after login)
  • ✅ Fixed MessageType decode unwraps with proper error handling
  • ✅ Removed invalid #[allow(dead_code)] annotations

Deprecated

  • AccountInfo → Use RithmicConfig
  • RithmicConnectionInfo → Use RithmicConfig
  • RithmicConnectionSystem → Use RithmicEnv
  • get_config() → Use RithmicConfig::from_env() or builder

📚 Documentation

  • CHANGELOG.md - Complete changelog
  • MIGRATION_0.5.0.md - Step-by-step migration guide
  • Updated README with new API examples
  • Enhanced module documentation

📦 Installation

[dependencies]
rithmic-rs = "0.5.0"

🔮 What's Next (v0.6.0)

  • Move dotenv to optional feature flag
  • Remove deprecated types
  • Additional API improvements

Full Changelog: v0.4.2...v0.5.0

0.4.2

27 Aug 02:47

Choose a tag to compare

  • added logging of unique user id for each session / plant
  • update using server configured heartbeat interval
  • added streaming live ticks example
  • updated connect_async to use beta url if primary fails

Full Changelog: 0.4.1...0.4.2

0.4.1

08 Aug 03:37

Choose a tag to compare

  • Updated channels to have more message capacity, to better cope with spikes in activity.

Full Changelog: 0.4.0...0.4.1

0.4.0

21 Jun 15:32

Choose a tag to compare

  • Added ability to load time bars via load_time_bars from the history plant
    • Added examples on how to pull historical data
  • Added skeleton to load order book data via subscribe_order_book and request_depth_by_order_snapshot (this has not been tested)
  • Updated web sockets to use TCP_NODELAY

Full Changelog: 0.3.6...0.4.0

0.3.6

23 May 07:29

Choose a tag to compare

  • Updated Rithmic API to latest v0.84.0.0

Full Changelog: 0.3.5...0.3.6