Once a strategy is validated in backtest, the same strategy file can be promoted to paper trading for real-time simulation or to live trading for actual exchange execution — without changing a single line of strategy logic. Both modes share the sameDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/backtest-kit/backtest-monorepo-parallel/llms.txt
Use this file to discover all available pages before exploring further.
--entry gate pattern as Mode A and iterate the same CC_SYMBOL_LIST, but they swap in Mongo-backed persistence adapters and connect to live exchange feeds instead of replaying cached candles.
Commands
- Paper trading
- Live trading
How each mode works
Bothlive.ts and paper.ts share the same structure. The only difference is the mode flag they check (--live vs --paper). When the matching flag is present alongside --entry, the file calls Live.background(symbol, ...) for each symbol in CC_SYMBOL_LIST:
frameName. Live and paper trading consume real-time candles from the exchange rather than replaying a historical window, so there is no frame schema to resolve.
Persistence differences vs backtest
Backtest mode uses in-memory or local-file adapters for maximum replay speed. Live and paper modes switch all six transient subsystems to Mongo-backedPersist adapters so that state survives process restarts and is queryable after the fact. This is configured once in config/setup.config.ts:
| Subsystem | Live / Paper | Backtest |
|---|---|---|
| Session | Persist (Mongo) | Local file |
| Storage | Persist (Mongo) | Memory |
| Recent | Persist (Mongo) | Memory |
| Notification | Persist (Mongo) | Memory |
| Memory | Persist (Mongo) | Local file |
| State | Persist (Mongo) | Local file |
| Markdown | Dummy (no-op) | Dummy |
| Log | JSONL | JSONL |
config/setup.config.ts.
Telegram session authentication
Strategies that useScraperService to ingest Telegram signals require a valid MTProto session before the strategy is started. The --session flag triggers packages/main/src/main/session.ts, which opens a QR code in your terminal and saves the resulting session string to ./session.txt.
The
--session step is a prerequisite, not part of the normal start command. Run it once ahead of your first live or paper deployment if your strategy consumes ScraperService. The saved ./session.txt is reused on all subsequent starts.Authenticating
Scan the QR code
The terminal clears and prints a QR code alongside the instruction:Open Telegram on your phone, go to Settings → Devices → Link Desktop Device, and point your camera at the QR.
Enter your 2FA password (if enabled)
If your Telegram account has two-factor authentication enabled, the terminal prompts:Type your password and press Enter.
telegram (GramJS) package with MTProto via QR login:
CC_TELEGRAM_API_ID and CC_TELEGRAM_API_HASH are read from environment variables (with development fallbacks in packages/main/src/config/params.ts). Set these in your .env before running --session in production.