velora_core/
lib.rs

1//! # velora-core
2//!
3//! Core types, errors, and utilities for the Velora HFT platform.
4//!
5//! This crate provides the foundational types used throughout the Velora ecosystem,
6//! including trading types (orders, trades, positions), market data structures
7//! (ticks, candles, order books), error handling, and configuration management.
8//!
9//! ## Features
10//!
11//! - **Type-safe numeric types**: Using `OrderedFloat` for prices and volumes
12//! - **Comprehensive trading types**: Orders, trades, positions, balances
13//! - **Market data structures**: Ticks, candles, order books
14//! - **Error handling**: Unified error type with conversions
15//! - **Configuration management**: TOML-based configuration
16//!
17//! ## Example
18//!
19//! ```
20//! use velora_core::*;
21//!
22//! // Create a new limit order
23//! let order = Order::new_limit(
24//!     Symbol::new("BTC/USD"),
25//!     Side::Buy,
26//!     50000.0.into(),
27//!     0.1.into(),
28//! );
29//!
30//! assert_eq!(order.order_type, OrderType::Limit);
31//! assert!(order.is_active());
32//! ```
33
34#![warn(missing_docs)]
35#![warn(missing_debug_implementations)]
36#![warn(rust_2018_idioms)]
37
38pub mod config;
39pub mod errors;
40pub mod types;
41
42// Re-export commonly used types for convenience
43pub use config::*;
44pub use errors::{Result, VeloraError};
45pub use types::*;