repowisenautechsystems/nautilus_trader

Architecture of nautechsystems/nautilus_trader

nautechsystems/nautilus_trader is 5,357 source files holding 139,028 symbols across 11 modules, written mainly in Rust, Python, Shell. The largest module is crates, with 3,333 files, and 61 files are entry points into the dependency graph.

How nautilus_trader fits together

Venue adapters, such as the one in crates/adapters/binance/src/lib.rs, translate each exchange's or data provider's raw API into a unified interface and normalized domain model. The Rust crates under crates/ hold the core engine parts, including crates/execution/src/matching_engine/engine.rs, which is part of the matching engine in the execution crate. The nautilus_trader directory holds the Python package, which exposes the Rust core through PyO3 bindings so that strategies and system configuration can be written in Python. The same event-driven runtime drives research backtests, which replay historical quote tick, trade tick, bar, and order book data, and live execution. Tests sit in directories such as crates/data/tests and crates/execution/tests, while examples and integration guides are in examples and docs/integrations.

Largest modules

  • crates: 3,333 files and 1,195,905 lines of code
  • tests: 741 files and 257,668 lines of code
  • nautilus_trader: 406 files and 116,033 lines of code
  • python: 276 files and 55,430 lines of code
  • docs: 228 files and 50,122 lines of code
  • examples: 158 files and 14,631 lines of code
  • scripts: 77 files and 7,497 lines of code
  • patches: 42 files and 8,243 lines of code

Languages

By file count: Rust 2,567 files, Python 1,378 files, Shell 101 files, C++ 4 files, Makefile 1 file.

More on nautilus_trader: summary and FAQ, codebase overview, code health.