Skip to main content

Frequently asked questions

What is MTS1B?

A 29-repo open-source institutional-grade quantitative trading stack under Apache 2.0. Covers the full lifecycle: data ingest → research → portfolio construction → execution → operations → reporting.

Why 29 repos instead of one?

A monolith pays for everything every time. A hard-split lets contributors clone the 3 repos they care about and ignore the 26 they don't. We documented the design rationale in detail.

Where do I start?

Is MTS1B production-ready?

The current state is pre-alpha. Foundation (the types library) is real code, tested. Other repos have code ported from the source monorepo but with bridge-stage import paths — full internal consistency is still a work-in-progress. See STATUS.md for the latest.

Don't run live money through this stack until you've validated end-to-end against your own funds.

What's the license?

Apache 2.0. Use it for anything — commercial, internal, research. No copyleft. Explicit patent grant.

Can I sell a product built on MTS1B?

Yes. Apache 2.0 permits commercial use without obligation to open-source your additions. Attribution required (keep the LICENSE files).

How does MTS1B compare to backtrader / zipline / vectorbt?

MTS1Bbacktraderziplinevectorbt
LicenseApache 2.0GPL-3.0Apache 2.0Apache 2.0
Backtest engineGPU-accelerated (mts1b-GPUbacktester)CPU, event-drivenCPU, event-drivenCPU, vectorized
Live tradingYes (via mts1b-oms + mts1b-brokers)YesQuantopian only (dead)No (separate vectorbt PRO)
Multi-assetEquities + options + fx + futures + crypto + sports + PMMostly equitiesEquities onlyEquities + crypto
Multi-fund treasuryYesNoNoNo
Risk gates7-gate pipelineNoneBasicNone
Plugin SDKYes (mts1b-pluginsdk)LimitedLimitedLimited
Docs siteYes (this one)OKOK (frozen)OK
MaintenanceActiveMostly abandonedAbandoned 2020Active (PRO is paid)

We owe debt to all three. They handled real-world cases we draw from.

I'm a current backtrader user. How do I migrate?

See Migration from backtrader.

What Python version?

3.11+. We use modern type hints (X | Y instead of Union[X, Y]) and match statements. 3.13 is supported.

Why Python? Why not Rust / Go / C++?

Quant primitives are dominated by NumPy/SciPy/pandas + CUDA kernels (cupy). The hot path is C-bound. Python is the right glue language for accessibility + ecosystem.

For latency-critical OMS state machines, we have a clean Protocol boundary — a Rust implementation could plug in via pluginsdk. Not yet contributed; PRs welcome.

Do I need GPUs?

No. mts1b-GPUbacktester has a CPU fallback (numpy + scipy). GPU gives 10-100x speedup for large universes but isn't required.

Why pydantic v2?

  • Validation: every cross-repo message is shape-checked
  • Performance: pydantic v2 is rust-native, fast
  • Schema export: model_json_schema() + OpenAPI integration
  • Frozen-by-default: immutable wire models

What's NATS for? Why not Kafka / RabbitMQ / Redis Streams?

NATS hits a sweet spot for MTS1B's scale:

  • Sub-millisecond pub/sub for live data
  • JetStream gives durable streams + ack semantics (Kafka-style)
  • Single Go binary; runs on a Proxmox LXC with 256 MB
  • TLS + JWT auth out of the box
  • Subject hierarchy (mts.v1.oms.>) is excellent for filtering

Kafka is heavier than we need. Redis Streams aren't durable enough. RabbitMQ is operationally finicky.

Where are secrets stored?

HashiCorp Vault. Every service reads from secret/mts1b/<service> via mts1b_platform.config.load_config. The mts1b-deploy tool can bootstrap a Vault for you with mts1b-deploy vault bootstrap.

Local development can use a .env file — but never in production.

Where do logs go?

OpenTelemetry → Loki / Grafana Cloud (configurable). Structured JSON via mts1b_platform.logging.get_logger. Secrets are auto-redacted by the redact filter.

Where does metrics + tracing go?

OpenTelemetry → Prometheus / Tempo / Jaeger (configurable). Every primitive in mts1b-platform emits counters + spans labeled by service + operation.

How do I add a new factor?

Tutorial 3 walks through the full lifecycle. Short version:

from mts1b_quantkit.factors import register

@register("f_my_factor")
def f_my_factor(panel, /, h=21):
return zscore_cross_sectional(panel.close[-1] / panel.close[-h] - 1)

The name must start with f_. Then it's discoverable via mts1b_quantkit.factors.get("f_my_factor").

How do I add a new broker?

Tutorial 5. Implement BrokerProtocol, register via entry points, ship as a plugin via pluginsdk.

How do I add a new market-data provider?

Same pattern as brokers but with MarketDataProtocol. See foundation.protocols.

How does the dedupe contract work?

Across the source monorepo we found 17 patterns duplicated 3-6 times each (HRP, Black-Litterman, Sharpe, Telegram dispatch, etc). Each is consolidated into exactly one canonical implementation. CI runs an AST scan to verify no duplicates outside the canonical home.

Full table: Concept — Dedupe contract.

Can I use just one repo?

Yes. Each repo is independent. You can:

  • Use just mts1b-quantkit for HRP / walk-forward in your own pipeline
  • Use just mts1b-brokers to talk to IBKR / Coinbase with a unified API
  • Use just mts1b-foundation for the typed wire format

How do I run the test suite?

# Per repo
cd mts1b-foundation
pip install -e ".[dev]"
pytest -v

# Cross-repo integration tests (require running NATS + Postgres)
cd /apps/MTS1B-oss
docker compose -f extraction/tests/docker-compose.yml up -d
pytest extraction/tests/

What's the release cadence?

  • v1 (foundational 12 repos): months 1-3
  • v2 (engines 11 repos): months 4-7
  • v3 (community 6 repos): months 8-12
  • LTS v1.0: month 18

See Release waves for the full schedule.

How do I report a security issue?

DO NOT use GitHub issues. Email [email protected] or use the GitHub Security Advisory interface on the affected repo.

How do I contribute?

PRs welcome. Read CONTRIBUTING.md in any repo. Sign off your commits with git commit -s.

For non-trivial changes, open a Discussion first.

I have a bug. What do I do?

  1. Search existing issues
  2. If new: open an issue on the relevant repo, include repro steps + Python version + OS
  3. For urgent issues: tag in Discord #help

I have a question. Where do I ask?

Will MTS1B always be free?

The code is Apache 2.0 in perpetuity. We may eventually offer hosted services (managed deploy, managed alerting, managed bot infra) but the core code stays free.

Who runs MTS1B?

A small group of contributors. Maintainer cohort visible on each repo's CODEOWNERS. The project is independent (no corporate parent).

Why is the documentation so good?

We wrote it as the implementation contract for the code itself. Per the docs-first workflow, the API surface lives in docs BEFORE it lives in code. Hard to ship a function whose docs you can't write.

What's a "session" in MTS1B?

A trading session — a market-open-to-close window. MTS1B distinguishes:

  • RTH (regular trading hours) — 9:30-16:00 ET for U.S. equities
  • Pre — 4:00-9:30 ET
  • Post — 16:00-20:00 ET
  • IBEOS — 20:00-3:50 ET (IBKR overnight for select symbols)
  • 24h — for crypto, FX (24×5)

See platform.calendars and MarketCalendar.

What's a "fund" in MTS1B?

A NAV-attributed sub-account. Every order belongs to exactly one fund. Funds have:

  • A target NAV
  • A broker + broker account id
  • A list of strategies that can write to it
  • A risk envelope
  • Tax-lot accounting

mts1b-treasury allocates capital between funds.

What's a "strategy" in MTS1B?

A configured-and-named factor application. momentum_v3 = factor f_momentum_12_1 + params {h_long: 252, h_skip: 21} + universe us-large-cap + sizing kelly_voltarget_12 + ... registered via mts1b-research.

Strategies are first-class objects in the registry; you can list, enable, disable, shadow.

What's a "factor" in MTS1B?

A pure function that takes a UniversePanel and returns a (T, A) ranking. Convention: name starts with f_. Registered via @register("f_name"). See Concept — Factor system.

What's a "signal" in MTS1B?

The output of a strategy at one rebalance — target weights per symbol + metadata (IC, t-stat, etc). Published to mts.v1.research.signals.published.

What's the difference between Order.idempotency_key and Order.order_id?

  • order_id: UUID assigned by mts1b-oms when the order is created. Globally unique.
  • idempotency_key: caller-provided dedupe key. Multiple submissions with the same key within the dedupe window resolve to the same order_id.

The caller (strategy) generates idempotency_key. The OMS generates order_id.

How do I trace an order through the system?

mts mts1b-platform tail --subject "mts.v1.>" --filter "order_id=ord-abc"

Will show every NATS event mentioning that order across every service. Plus check the audit chain:

mts mts1b-operations audit show --subject-id ord-abc

How do I roll back a release?

mts1b-deploy rollback --to <commit_sha>

The deploy tool maintains a history of installed configs. Rollback restores the prior state.

Glossary of terms?

Glossary page.