Crate nautilus_risk

Source
Expand description

Risk engine PoseiTrader.

The risk crate provides comprehensive risk management capabilities including pre-trade order validation, position sizing calculations, and trading controls. This system ensures trading operations remain within defined risk parameters and regulatory constraints:

  • Risk engine: Central risk management orchestration with configurable trading states.
  • Order validation: Pre-trade checks for price, quantity, notional limits, and market conditions.
  • Position sizing: Fixed-risk position sizing calculations with commission and exchange rate support.
  • Trading controls: Rate limiting, balance validation, and exposure management.
  • Account protection: Multi-currency balance checks and margin requirement validation.

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

  • python: Enables Python bindings from PyO3.

Re-exports§

pub use engine::RiskEngine;

Modules§

engine
Risk management engine implementation.
sizing
Position sizing calculation functions.