Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.quanux.org/llms.txt

Use this file to discover all available pages before exploring further.

The Strategy Forge is the intelligence layer of QuanuX. It gives you a structured path from a rough trading idea to a production-grade, compiled strategy running inside the C++ execution engine. Rather than treating research and deployment as separate workflows, the Forge unifies them into a single pipeline: you write your logic in Python, the AI Foundry generates and verifies equivalent code, the Crucible backtesting engine stress-tests it against historical L3 data, and the final compiled artifact is promoted into the live spreader.

The Forge pipeline

Every strategy in QuanuX travels through four stages before it reaches live execution. Python prototype — You write and iterate on your strategy using the StrategyComponent base classes in server/strategies/. Python gives you access to the full data science ecosystem and makes it fast to explore ideas. AI Foundry generation — Once your logic is solid, you submit a forge request to POST /api/foundry/forge. The Foundry dispatches the job over NATS to an AI generation worker that produces Cython or C++ code matching your strategy’s behavior. Crucible backtest — You run the generated strategy through Crucible, QuanuX’s C++ backtesting engine backed by DuckDB. Crucible executes your strategy at speeds up to 100x faster than pandas-based engines and captures L3-grade execution metrics. C++ deployment — After the strategy passes backtesting and equivalence verification, it is compiled and promoted into the live spreader. SHA-256 verification and a signed Git commit are required before any strategy can be deployed.

Foundry API endpoints

The Forge exposes two HTTP endpoints on the QuanuX server.
EndpointPurpose
POST /api/foundry/forgeSubmit an AI generation job for a strategy component
POST /api/foundry/verifyTrigger equivalence testing between Python and generated code
Both endpoints accept a JSON body and return immediately with a job ID. The actual work runs asynchronously over the NATS mesh. You can monitor progress by subscribing to sys.foundry.request.forge and sys.foundry.request.verify on your NATS node.
The legacy POST /api/strategy/generate endpoint is deprecated. All strategy generation must go through the Foundry endpoints described above.

What the Forge produces

Depending on the target_lang you specify in your forge request, the Foundry outputs one of three artifact types:
  • Python — A clean, validated Python module conforming to the StrategyComponent base classes.
  • Cython — A .pyx file with typed declarations and C++ bindings, compiled into a shared object for use by the Crucible engine.
  • C++ — A native C++20 header and implementation targeting the spreader’s InjectionStub interface.
C++ generation is in active development. Python and Cython targets are stable and recommended for current use.

Explore the Forge

Write and generate strategies

Learn how to write strategies in Python and use the Foundry API to generate verified code.

Backtest with Crucible

Run your strategy against historical L3 data using the Crucible engine and quanuxctl.

Promote to C++

Understand the Python → Cython → C++ promotion pipeline and Git-as-Governance requirements.

quanuxctl reference

Full CLI reference for orchestrating Crucible, Foundry, and node management.