Skip to content

Commit 2c4929b

Browse files
authored
Merge pull request #32 from pbeets/ci/github-actions-workflow
Release 0.7.1
2 parents 51b3c4a + ce6b76a commit 2c4929b

File tree

8 files changed

+263
-101
lines changed

8 files changed

+263
-101
lines changed

CHANGELOG.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,53 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.7.1] - 2026-01-23
11+
12+
### Added
13+
14+
#### New Utility Module (`util`)
15+
- **`InstrumentInfo`**: Parsed instrument reference data from Rithmic
16+
- Converts `ResponseReferenceData` to a structured type via `TryFrom`
17+
- `price_precision()`: Calculate decimal places based on tick size
18+
- `size_precision()`: Returns 0 for futures (whole contracts)
19+
- Fields include: symbol, exchange, name, tick_size, point_value, is_tradable, and more
20+
- **`OrderStatus`**: Order status enum with helper methods
21+
- Parses case-insensitively with common variations ("filled" → Complete, "canceled" → Cancelled)
22+
- `is_terminal()`: Returns true for Complete, Cancelled, Rejected
23+
- `is_active()`: Returns true for Open, Pending, Partial
24+
- Implements `FromStr`, `Display`, `Default` (Unknown)
25+
- **`rithmic_to_unix_nanos(ssboe, usecs)`**: Convert Rithmic timestamps to Unix nanoseconds
26+
- **`rithmic_to_unix_nanos_precise(ssboe, usecs, nsecs)`**: Convert with optional nanosecond precision
27+
28+
#### RithmicResponse Helper Methods
29+
- **`is_error()`**: Returns true if response has an error or connection issue
30+
- **`is_connection_issue()`**: Returns true for ConnectionError, HeartbeatTimeout, ForcedLogout
31+
- **`is_market_data()`**: Returns true for BestBidOffer, LastTrade, DepthByOrder, OrderBook, etc.
32+
33+
#### Optional Serde Support
34+
- Added `serde` feature flag for serialization/deserialization support
35+
- `RithmicEnv` derives `Serialize`/`Deserialize` when enabled with lowercase rename
36+
- Enable with: `rithmic-rs = { version = "0.7.1", features = ["serde"] }`
37+
38+
#### New Example
39+
- **`bracket_order.rs`**: Demonstrates placing bracket orders with typed enums
40+
41+
#### CI/CD
42+
- Added GitHub Actions CI workflow for automated testing
43+
44+
### Fixed
45+
46+
#### Error Handling Improvements
47+
- Replaced `.unwrap()` panics with proper error handling in all plant handles
48+
- `RithmicTickerPlantHandle`: `subscribe`, `unsubscribe`, `get_front_month_contract`, and other methods now handle channel send failures gracefully
49+
- `RithmicOrderPlantHandle`: `place_bracket_order`, `modify_order`, `cancel_order`, and other methods now handle channel send failures gracefully
50+
- `RithmicHistoryPlantHandle`: `load_time_bars`, `load_ticks`, and other methods now handle channel send failures gracefully
51+
- `RithmicPnlPlantHandle`: `subscribe_pnl_updates`, `pnl_position_snapshots`, and other methods now handle channel send failures gracefully
52+
53+
#### Code Quality
54+
- Addressed clippy lints in util module
55+
- Cleaned up util module documentation
56+
1057
## [0.7.0] - 2026-01-08
1158

1259
### Breaking Changes
@@ -524,6 +571,7 @@ Previous stable release. See git history for earlier changes.
524571

525572
## Version History Summary
526573

574+
- **0.7.1** (2026-01-23): New utility module (InstrumentInfo, OrderStatus, timestamp helpers), RithmicResponse helper methods, optional serde support, improved error handling
527575
- **0.7.0** (2026-01-08): Breaking changes - Order types now use enums instead of raw integers, cleaner public API exports
528576
- **0.6.2** (2025-12-20): Expanded plant handle APIs, additional message types, OCO order support, and new sender methods
529577
- **0.6.1** (2025-11-24): Environment-specific configuration variables
@@ -534,7 +582,8 @@ Previous stable release. See git history for earlier changes.
534582
- **0.5.0** (2025-11-16): Major stability and API improvements - Connection strategies, unified config, panic fixes, connection health monitoring
535583
- **0.4.2** (2025-11-15): Previous stable release
536584

537-
[Unreleased]: https://github.com/pbeets/rithmic-rs/compare/v0.7.0...HEAD
585+
[Unreleased]: https://github.com/pbeets/rithmic-rs/compare/v0.7.1...HEAD
586+
[0.7.1]: https://github.com/pbeets/rithmic-rs/compare/v0.7.0...v0.7.1
538587
[0.7.0]: https://github.com/pbeets/rithmic-rs/compare/v0.6.2...v0.7.0
539588
[0.6.2]: https://github.com/pbeets/rithmic-rs/compare/v0.6.1...v0.6.2
540589
[0.6.1]: https://github.com/pbeets/rithmic-rs/compare/v0.6.0...v0.6.1

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rithmic-rs"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "Rust client for the Rithmic R | Protocol API to build algo trading systems"
55
license = "MIT OR Apache-2.0"
66
edition = "2024"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add to your `Cargo.toml`:
1515

1616
```toml
1717
[dependencies]
18-
rithmic-rs = "0.7.0"
18+
rithmic-rs = "0.7.1"
1919
```
2020

2121
Set your environment variables:

src/plants/history_plant.rs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,10 @@ impl RithmicHistoryPlantHandle {
728728

729729
let _ = self.sender.send(command).await;
730730

731-
Ok(rx.await.unwrap().unwrap().remove(0))
731+
Ok(rx
732+
.await
733+
.map_err(|_| "Connection closed".to_string())??
734+
.remove(0))
732735
}
733736

734737
/// Log in to the Rithmic History plant
@@ -747,9 +750,15 @@ impl RithmicHistoryPlantHandle {
747750
};
748751

749752
let _ = self.sender.send(command).await;
750-
let response = rx.await.unwrap().unwrap().remove(0);
751-
752-
if response.error.is_none() {
753+
let response = rx
754+
.await
755+
.map_err(|_| "Connection closed".to_string())??
756+
.remove(0);
757+
758+
if let Some(err) = response.error {
759+
error!("history_plant: login failed {:?}", err);
760+
Err(err)
761+
} else {
753762
let _ = self.sender.send(HistoryPlantCommand::SetLogin).await;
754763

755764
if let RithmicMessage::ResponseLogin(resp) = &response.message {
@@ -766,10 +775,6 @@ impl RithmicHistoryPlantHandle {
766775
info!("history_plant: logged in");
767776

768777
Ok(response)
769-
} else {
770-
error!("history_plant: login failed {:?}", response.error);
771-
772-
Err(response.error.unwrap())
773778
}
774779
}
775780

@@ -791,7 +796,10 @@ impl RithmicHistoryPlantHandle {
791796
};
792797

793798
let _ = self.sender.send(command).await;
794-
let response = rx.await.unwrap().unwrap().remove(0);
799+
let response = rx
800+
.await
801+
.map_err(|_| "Connection closed".to_string())??
802+
.remove(0);
795803
let _ = self.sender.send(HistoryPlantCommand::Close).await;
796804

797805
Ok(response)
@@ -826,7 +834,7 @@ impl RithmicHistoryPlantHandle {
826834

827835
let _ = self.sender.send(command).await;
828836

829-
Ok(rx.await.unwrap().unwrap())
837+
rx.await.map_err(|_| "Connection closed".to_string())?
830838
}
831839

832840
/// Load historical time bar data for a specific symbol and time range
@@ -864,7 +872,7 @@ impl RithmicHistoryPlantHandle {
864872

865873
let _ = self.sender.send(command).await;
866874

867-
Ok(rx.await.unwrap().unwrap())
875+
rx.await.map_err(|_| "Connection closed".to_string())?
868876
}
869877

870878
/// Load volume profile minute bars
@@ -906,7 +914,7 @@ impl RithmicHistoryPlantHandle {
906914

907915
let _ = self.sender.send(command).await;
908916

909-
Ok(rx.await.unwrap().unwrap())
917+
rx.await.map_err(|_| "Connection closed".to_string())?
910918
}
911919

912920
/// Resume a previously truncated bars request
@@ -928,7 +936,7 @@ impl RithmicHistoryPlantHandle {
928936

929937
let _ = self.sender.send(command).await;
930938

931-
Ok(rx.await.unwrap().unwrap())
939+
rx.await.map_err(|_| "Connection closed".to_string())?
932940
}
933941

934942
/// Subscribe to live time bar updates
@@ -963,7 +971,10 @@ impl RithmicHistoryPlantHandle {
963971

964972
let _ = self.sender.send(command).await;
965973

966-
Ok(rx.await.unwrap().unwrap().remove(0))
974+
Ok(rx
975+
.await
976+
.map_err(|_| "Connection closed".to_string())??
977+
.remove(0))
967978
}
968979

969980
/// Subscribe to live tick bar updates
@@ -1001,7 +1012,10 @@ impl RithmicHistoryPlantHandle {
10011012

10021013
let _ = self.sender.send(command).await;
10031014

1004-
Ok(rx.await.unwrap().unwrap().remove(0))
1015+
Ok(rx
1016+
.await
1017+
.map_err(|_| "Connection closed".to_string())??
1018+
.remove(0))
10051019
}
10061020
}
10071021

0 commit comments

Comments
 (0)