Skip to main content

Architecture

MTS1B is a 7-layer ecosystem of 29 small, focused repos. Dependencies flow downward only; no upward arrows, no cycles.

The seven layers

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 7 — Frontends + AI bots │
│ mts1b-frontends mts1b-githubbot mts1b-discordbot │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 6 — Asset-class services │
│ mts1b-treasury mts1b-sports mts1b-prediction-markets │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 5 — Strategy + execution │
│ mts1b-research mts1b-oms mts1b-tradingview │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 4 — Engines + ops + data lake + LLM │
│ mts1b-GPUbacktester mts1b-datalake mts1b-llm mts1b-operations │
│ mts1b-cloudburst mts1b-reportslibrary │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 3 — Risk + portfolio + execution algos │
│ mts1b-riskengine mts1b-portfolio mts1b-oms-algos │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 2 — Adapters + quant library │
│ mts1b-brokers mts1b-marketdata mts1b-altdata │
│ mts1b-cryptodata mts1b-macrodata mts1b-quantkit │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 1 — Platform │
│ mts1b-platform mts1b-deploy mts1b-pluginsdk │
└────────────────────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────────────────────┐
│ Layer 0 — Foundation │
│ mts1b-foundation (pydantic types + NATS schemas, zero runtime deps) │
└────────────────────────────────────────────────────────────────────────┘

Why this shape

One concept per repo, one direction of dependencies, zero duplicate implementations. Reading code at layer 5 you should never wonder "what's available?" — the answer is "everything at layers 0-4."

PropertyEnforcement
No upward dependenciestests/contracts/test_dependency_direction.py (AST walk on every PR)
No cyclesSame lint, recursive check
Foundation has zero depspip-compile --strict mts1b-foundation/pyproject.toml must yield ≤ 2 deps
Protected symbols defined onceAST scan of 17 canonical names (HRP, BL, Kelly, ...)
All cross-repo types pass through foundationmypy --strict per repo

Runtime dataflow (live trading)

┌─────────────┐
│ marketdata │──┐
├─────────────┤ │
│ altdata │──┤
├─────────────┤ │ ┌──────────┐ ┌──────────┐ ┌─────────────┐ ┌──────────┐ ┌─────────┐
│ cryptodata │──┼────▶│ datalake │───▶│ research │───▶│ portfolio │───▶│riskengine│───▶│ oms │
├─────────────┤ │ └──────────┘ └────┬─────┘ └──────┬──────┘ └──────────┘ └────┬────┘
│ macrodata │──┘ │ ▲ │
└─────────────┘ ▼ │ ▼
quantkit ───────────────┘ ┌──────────┐
(HRP/BL/Kelly/ │ brokers │
walk-forward/ └────┬─────┘
Sharpe/metrics) │

(IBKR/Coinbase/
Schwab/...)

GPUbacktester (offline): same engines, different data path
────────────────────────────────────────────────────────────
datalake → GPUbacktester (parquet results) → research (ladder)

operations: observes everything via NATS event bus
reportslibrary: reads result parquets → trade reports, RCA, NAV
llm: callable from any repo for AI assistance

Two side-cars not shown above: treasury allocates capital between sleeves (sets fund-level NAV targets that feed portfolio), and operations subscribes to the NATS event bus for compliance + drawdown halt + watchdog rules.

Two pre-launch corollaries

1. The 17-pattern dedupe contract

Across the source monorepo we found 17 implementations that are duplicated across 3-6 repos. Each becomes one canonical impl in its target repo before extraction. See the dedupe contract for the full table.

PatternSources mergedCanonical home
HRP4mts1b-quantkit
Black-Litterman3+mts1b-quantkit
Walk-forward CV3mts1b-quantkit
Sharpe / Calmar / MaxDD4mts1b-quantkit
Kelly / VolTarget5+mts1b-portfolio
Telegram / Slack dispatch6mts1b-platform/messaging
Fee / slippage models4+mts1b-quantkit/cost_models
Calendars / holidays5+mts1b-platform/calendars
Symbol normalization3+mts1b-platform/symbology
ADV / liquidity filters4+mts1b-quantkit/universe_filters
Logging setupmanymts1b-platform/logging
Config (Pydantic Settings)manymts1b-platform/config
DB connection poolsmanymts1b-platform/db
Retry/backoff (tenacity)manymts1b-platform/retry
Rate limitersmanymts1b-platform/ratelimit
HTTP client factorymanymts1b-platform/http
Secrets redactionscatteredmts1b-platform/security

CI fails on any duplicate definition outside the canonical home.

2. Wave-based public release

Repos are created private invite-only. Each is flipped public via manual gh repo edit --visibility public only when:

  1. CI consistently green for 30 days
  2. README + per-repo docs complete
  3. License audit clean
  4. Maintainer sign-off

Wave 1 (months 1-3): foundation, platform, deploy, brokers, marketdata, quantkit, portfolio, riskengine, oms, oms-algos, GPUbacktester, docs.

Wave 2 (months 4-7): the 11 engines (datalake, research, llm, ...).

Wave 3 (months 8-12): treasury, sports, prediction-markets + community + plugin SDK.

See release waves for the full schedule.

Where to next