Expand description
Common componentry for NautilusTrader.
The nautilus-common
crate provides shared components and utilities that form the system foundation for
NautilusTrader applications. This includes the actor system, message bus, caching layer, and other
essential services.
§Platform
NautilusTrader is an open-source, high-performance, production-grade algorithmic trading platform, providing quantitative traders with the ability to backtest portfolios of automated trading strategies on historical data with an event-driven engine, and also deploy those same strategies live, with no code changes.
NautilusTrader’s design, architecture, and implementation philosophy prioritizes software correctness and safety at the highest level, with the aim of supporting mission-critical, trading system backtesting and live deployment workloads.
§Feature flags
This crate provides feature flags to control source code inclusion during compilation, depending on the intended use case, i.e. whether to provide Python bindings for the nautilus_trader Python package, or as part of a Rust only build.
ffi
: Enables the C foreign function interface (FFI) from cbindgen.python
: Enables Python bindings from PyO3.stubs
: Enables type stubs for use in testing scenarios.defi
: Enables DeFi (Decentralized Finance) support.indicators
: Includes thenautilus-indicators
crate and indicator utilities.extension-module
: Builds the crate as a Python extension module.
Modules§
- actor
- Actor system for event-driven message processing.
- cache
- In-memory cache for market and execution data, with optional persistent backing.
- clock
- Real-time and static
Clock
implementations. - component
- Component system for managing stateful system entities.
- custom
- A user custom data type.
- enums
- Enumerations for common components.
- factories
- Factories for constructing domain objects such as orders.
- ffi
- C foreign function interface (FFI) from cbindgen.
- generators
- Provides generation of identifiers such as
ClientOrderId
andPositionId
. - greeks
- Greeks calculator for options and futures.
- logging
- The logging framework for Nautilus systems.
- messages
- Message types for system communication.
- msgbus
- A common in-memory
MessageBus
supporting multiple messaging patterns: - python
- Python bindings from PyO3.
- runner
- Global runtime machinery and thread-local storage.
- runtime
- The centralized Tokio runtime for a running Nautilus system.
- signal
- A user signal type.
- testing
- Common test related helper functions.
- throttler
- Message throttling and rate limiting functionality.
- timer
- Real-time and test timers for use with
Clock
implementations. - xrate
- Exchange rate calculations between currencies.
Macros§
- log_
debug - Logs a debug message with automatic color mapping or custom color and component.
- log_
error - Logs an error message with automatic red color or custom color and component.
- log_
info - Logs an info message with automatic color mapping or custom color and component.
- log_
trace - Logs a trace message with automatic color mapping or custom color and component.
- log_
warn - Logs a warning message with automatic yellow color or custom color and component.