Skip to main content

Architecture

MTS1B is a layered ecosystem. Each repo has exactly one role; dependencies flow downward only.

Dependency layers

┌────────────────────────────────────────────────────────────────────┐
│ Layer 7 — Frontends + Community │
│ 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 │
│ 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 ← types + schemas, zero runtime deps │
└────────────────────────────────────────────────────────────────────┘

Hard rules

  1. No upward dependencies. A higher layer can depend on a lower layer, never the reverse.
  2. No circular dependencies. Enforced by tests/contracts/test_dependency_direction.py in every repo's CI.
  3. mts1b-foundation has zero runtime deps (except pydantic + typing-extensions).
  4. All types cross the boundary in mts1b-foundation form. No direct service-to-service custom types.
  5. AST-based deduplication — 17 protected symbols (HRP, BL, Kelly, Sharpe, ...) are defined in exactly one repo each. CI fails on duplicates.

Data flow at runtime

marketdata ──┐
altdata ──┼─→ datalake ──→ research ──→ portfolio ──→ riskengine ──→ oms ──→ brokers
cryptodata ──┤ ▲ ▲
macrodata ──┘ quantkit ─────┘ │

GPUbacktester (offline) │

treasury ─── allocates NAV ─────┘
  • operations observes everything via the NATS event bus and enforces compliance + halts.
  • reportslibrary reads result parquets and generates trade reports + postmortems.
  • llm is available to any service that wants AI assistance.

Why this layering?

  • Replaceability. You should be able to swap any repo for an alternative implementation as long as it speaks the mts1b-foundation interface.
  • Clarity. Reading layer 5 code, you know exactly which lower-layer primitives are available.
  • Testability. Lower layers have stricter test coverage requirements (foundation = 100%, platform = 90%, ...).
  • Community contribution. A contributor working on mts1b-marketdata doesn't need to understand mts1b-research to make a useful PR.

See dependency-graph for the full edge list.