TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/theonetrade/backtest-monorepo-parallel/llms.txt
Use this file to discover all available pages before exploring further.
config/ directory at the monorepo root contains three files that wire the runtime together. They are discovered and loaded by @backtest-kit/cli before any strategy file runs — you do not import them yourself. Together they map local packages to their built bundles, initialize the DI container and database connections, and configure every persistence adapter used by the strategy framework.
alias.config.ts — Package Alias Map
alias.config.ts exports a plain object that maps internal package names to their pre-built CommonJS bundles. @backtest-kit/cli uses this map to resolve @pro/core and @pro/main at runtime without requiring entries in node_modules.
Resolves to
packages/core/build/index.cjs — the compiled core package containing DI providers, schema definitions, services, and models.Resolves to
packages/main/build/index.cjs — the compiled main package containing the four entry-point mode modules.loader.config.ts — DI Bootstrap
loader.config.ts exports an async default function that @backtest-kit/cli calls after loading strategy files and before executing them. Importing @pro/core and @pro/main has side-effects that register all DI providers and set globalThis.core. waitForInit() then blocks until MongoDB and Redis connections are established.
Registers all core DI providers (services, schemas, repositories) and sets
globalThis.core. Must be imported before any code that calls inject().Registers the four mode dispatchers (
backtest, live, paper, session) into the DI container.Exported from
@backtest-kit/mongo. Resolves once the MongoDB connection pool and Redis client are both ready. Any code that reads from or writes to the database must await this implicitly via the loader.loader.config.ts is referenced by @backtest-kit/cli internally — you do not call this function yourself. The CLI discovers it by convention from the project root.setup.config.ts — Persistence Adapter Configuration
setup.config.ts configures every persistence subsystem exported by backtest-kit and then calls setup() from @backtest-kit/mongo to initialize the database connections. Each subsystem’s static methods (usePersist(), useMemory(), useLocal(), useDummy(), useJsonl()) select the storage backend for that subsystem.
Adapter Matrix
| Subsystem | Live adapter | Backtest adapter |
|---|---|---|
Session | usePersist() — MongoDB | useLocal() — local filesystem |
Storage | usePersist() — MongoDB | useMemory() — in-process map |
Recent | usePersist() — MongoDB | useMemory() — in-process map |
Notification | usePersist() — MongoDB | useMemory() — in-process map |
Memory | usePersist() — MongoDB | useLocal() — local filesystem |
State | usePersist() — MongoDB | useLocal() — local filesystem |
Dump | useMarkdown() | — |
Markdown | useDummy() | — |
Log | useJsonl() | — |
Stores data in MongoDB via
@backtest-kit/mongo. Used for live and paper trading subsystems where state must survive process restarts.Stores data in an in-process JavaScript
Map. Fast and zero-setup — appropriate for backtest runs that don’t need persistence between replays.Stores data on the local filesystem (JSON files). Used for backtest subsystems where persistence across runs is useful but MongoDB overhead is undesirable.
No-op adapter — discards all writes. Used for subsystems that are not relevant in the current mode (e.g.
Markdown in live mode).Appends structured log entries to a
.jsonl file on disk. Used for the Log subsystem.Writes dump output as Markdown files. Used for the
Dump subsystem.These config files are referenced by
@backtest-kit/cli internally — you don’t import them yourself. The CLI discovers them by convention from the project root.