Crate nautilus_common

Source
Expand description

Common componentry for PoseiTrader.

The common crate provides shared components and utilities that form the system foundation for PoseiTrader applications. This includes the actor system, message bus, caching layer, and other essential services.

§Platform

PoseiTrader 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.

PoseiTrader’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 posei_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.

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 and PositionId.
greeks
Greeks calculator for options and futures.
logging
The logging framework for Posei 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 Posei 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.