Skip to main content

Module engine

Module engine 

Source
Expand description

Trade engine — the main entry point for processing actions and price updates.

TradeEngine is a synchronous, side-effect-free orchestrator. It owns a PositionManager and tracks the last known price per symbol. All mutations flow through two methods:

  • apply_action — process a trading action (open, close, modify, …)
  • on_price — feed a new price quote, which triggers pending-fill checks and rule evaluation

Both methods return Vec<Effect> that the caller (backtest runner, live executor, …) handles according to its context.

Structs§

FutureEngineTransaction
An in-place FutureQuote mutation that can be committed or rolled back.
TradeEngine
The core trade engine.

Enums§

FutureApplyError
Errors raised while preparing or atomically applying FutureQuote state.

Type Aliases§

FutureApplyResult