Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 38 additions & 39 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ Risks and debt:
- `ExchangeConnector` is not the best documentation surface today; prefer the smaller capability traits when writing examples or new code.
- `src/lib.rs` re-exports only part of the exchange surface. The reliable public namespace is still `lotusx::exchanges::<exchange>`.
- Some legacy compatibility constructors keep old names or parameters while delegating to the new builders. Prefer the direct `build_connector*` functions in new code.
- `ExchangeFactory` is for latency tests and demos, not the canonical construction path for every production connector. In particular, check exchange-specific builders when credentials, passphrases, testnet URLs, or custom base URLs matter.
- `RestClientConfig::max_retries` is currently configuration intent, not a guarantee that every request path retries.
- `ExchangeFactory` is for latency tests and demos. It now delegates Bybit and OKX creation through the exchange builders, but production code should still prefer exchange-specific builders when credentials, passphrases, or custom behavior matter.
- `RestClientConfig::max_retries` applies to retryable GET and DELETE failures. POST requests are not automatically retried to avoid repeating order-style side effects.
- `KlineInterval` includes exchange-specific formatting helpers, so a small amount of exchange dialect knowledge leaks into the shared type layer.
- `src/exchanges/okx/` is implemented, but `src/exchanges/okx_perp/` is an empty, unregistered directory. Treat OKX perpetual as not implemented.
- Some tests depend on public exchange APIs and can fail because of network or upstream API changes.
Expand Down
2 changes: 1 addition & 1 deletion examples/custom_latency_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
markets_metrics: markets_metrics.clone(),
klines_metrics: markets_metrics.clone(), // Simplified for demo
websocket_connection_time: std::time::Duration::from_millis(100),
websocket_first_message: std::time::Duration::from_millis(1000),
websocket_first_message: std::time::Duration::from_secs(1),
websocket_success_rate: 1.0,
tick_to_trade_latency: std::time::Duration::from_millis(50),
market_impact_bps: calculate_market_impact(&markets_metrics),
Expand Down
4 changes: 1 addition & 3 deletions examples/okx_example.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {

/// Create OKX configuration from environment variables or use defaults
fn create_config() -> ExchangeConfig {
let testnet = env::var("OKX_TESTNET")
.map(|v| v.to_lowercase() == "true")
.unwrap_or(false);
let testnet = env::var("OKX_TESTNET").is_ok_and(|v| v.to_lowercase() == "true");

// Create config with credentials if available, otherwise use defaults
let api_key = env::var("OKX_API_KEY").unwrap_or_else(|_| "your_api_key".to_string());
Expand Down
Loading
Loading