A minimal Order and Execution Management System in modern C++ — FIX protocol, price-time priority matching, and TWAP/VWAP execution algorithms.
All operations go through just, which delegates to Podman containers.
Nix manages dependencies inside the container; CMake builds the project.
just dev # Build the dev image (cached after first run)
just configure # cmake configure
just test # Run all tests (unit + integration + system)
just unit-test # Run unit tests only
just integration-test # Run integration tests only
just system-test # Run end-to-end HTTP system tests
just coverage # gcov + lcov HTML report under build-cov/coverage-html/
just bench # Google Benchmark suite under build-bench/
just docs # Generate EN/JA Doxygen HTML and open the Japanese docs entry page
just api-gen # Regenerate src/api-gen/ from docs/openapi.yaml
just api-gen-check # Fail if src/api-gen/ is stale vs committed (CI)
just openapi-validate # Validate docs/openapi.yaml
just openapi-preview # Preview openapi.yaml via Swagger UI at :8081
just fmt # Format code (clang-format)
just lint # Static analysis (clang-tidy)
just check # fmt + lint + test
just build # Build the production image
just run # Run in containerThe HTTP API is specified in docs/openapi.yaml (OpenAPI 3.0.3)
— the single source of truth. Server-side C++ code (DTOs + abstract
controllers using oatpp) is regenerated from it via
openapi-generator and lives under
src/api-gen/. Human-written glue in src/core/api/oems_controllers.{hpp,cpp}
bridges the generated abstract API to the domain layer.
To add or change an endpoint:
- Edit
docs/openapi.yaml - Run
just api-gen - Compiler errors point to missing/changed controller methods — implement them
just testto verify
Apache-2.0 — see LICENSE.
See docs/architecture.md for the full v1 design. The implementation follows the recommended build order:
| Module | Path | Purpose |
|---|---|---|
| Foundation types | src/core/types/ |
OrderId, Price, Symbol, Result, errors |
| Matching engine | src/core/matching/ |
Price-time-priority order book |
| Risk manager | src/core/risk/ |
Pre-trade controls |
| Order manager | src/core/order/ |
Lifecycle, events, coordination |
| Persistence | src/core/persistence/ |
SQLite-backed durable state |
| HTTP/JSON API | src/core/api/ + src/api-gen/ |
oatpp server, spec-first (openapi.yaml) |
| FIX gateway | src/core/fix/ |
FIX4 session + application translation |
| Execution algos | src/core/algo/ |
TWAP and VWAP slice generation |
| Market data | src/core/market_data/ |
BBO snapshots, reference prices |
| Server | [src/main.cc](@ref src/main.cc) | Assembles modules, runs HTTP server |
| CLI | [src/cli/main.cc](@ref src/cli/main.cc) | Developer command-line client |
Once the server is running (./mini-oems 8080 oems.db):
oems-cli server-status
oems-cli new-order --symbol AAPL --side buy --type limit --price 10000 --qty 100
oems-cli show-book --symbol AAPL
oems-cli show-orders --status Accepted
oems-cli cancel-order --order-id 1
oems-cli show-trades