Engine
Five-layer order admission, gated scheduled strategies, a scheduler, a base strategy class, an AST-guarded sandbox, bracket orders, a mode guard, and reconciliation.
Part of FlintTrade: the open-source self-hosted trading software monorepo built with Python, React, TypeScript, and Rust.
Language: Python
Public surface
src/flinttrade_engine/safety.py: five-layer order-admission safety, explicit L5 kill switch, and account-scoped MTM circuit breakersrc/flinttrade_engine/strategy_execution.py: gated scheduled-strategy execution through BrokerRoutersrc/flinttrade_engine/strategy.py: base class for live strategiessrc/flinttrade_engine/sandbox_executor.py: user-strategy execution with AST guardsrc/flinttrade_engine/mode_guard.py: server-side mode-claim enforcement (explore for example data, practice, and live)
(See the source for the full surface.)
Install
This package is part of the FlintTrade monorepo. Install via the workspace from the repo root:
uv pip install -e packages/services/engineIf you only want to use the package in isolation, the package's pyproject.toml,
Cargo.toml, or package.json lists its dependencies. The supported path is the
root workspace.
Tests
python -m pytest packages/services/engine/tests/ -v --import-mode=importlibRun one command per line. They work unchanged in bash, zsh and Windows
PowerShell. Do not join them with &&, which Windows PowerShell 5.1 does not
support.
For the full test matrix, see the contributor guide at docs/DEVELOPER_GUIDE.md.
How this fits in
This package's role in the wider FlintTrade architecture is documented in docs/ARCHITECTURE.md. For the end-user features it provides, see docs/USER_GUIDE.md.
Contributing
Contributions are welcome. Read contributing.md at the repo root before opening a pull request.
License
AGPL-3.0. Same as the parent repository. See LICENSE for the full text.