Skip to main content

Crate nautilus_model

Crate nautilus_model 

Source
Expand description

Trading domain model for NautilusTrader.

The nautilus-model crate provides a type-safe domain model that forms the backbone of the framework and can serve as the foundation for building algorithmic trading systems.

§NautilusTrader

NautilusTrader is an open-source, production-grade, Rust-native engine for multi-asset, multi-venue trading systems.

The system spans research, deterministic simulation, and live execution within a single event-driven architecture, providing research-to-live semantic parity.

§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.
  • high-precision: Enables high-precision mode to use 128-bit value types.
  • defi: Enables the DeFi (Decentralized Finance) domain model.
  • extension-module: Builds the crate as a Python extension module.

Modules§

accounts
Account types such as CashAccount and MarginAccount.
currencies
Common Currency constants.
data
Data types for the trading domain model.
defi
DeFi (Decentralized Finance) domain model.
enums
Enumerations for the trading domain model.
events
Events for the trading domain model.
ffi
C foreign function interface (FFI) from cbindgen.
identifiers
Identifiers for the trading domain model.
instruments
Instrument definitions for the trading domain model.
macros
Model specific macros.
orderbook
Order book components which can handle L1/L2/L3 data.
orders
Order types for the trading domain model.
position
A Position for the trading domain model.
python
Python bindings from PyO3.
reports
Status report types for trading operations.
stubs
Type stubs to facilitate testing.
types
Value types for the trading domain model.
venues
Common Venue constants.

Macros§

enum_strum_serde
identifier_for_python
impl_catalog_path_prefix
Macro for implementing CatalogPathPrefix for data types.