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
- No upward dependencies. A higher layer can depend on a lower layer, never the reverse.
- No circular dependencies. Enforced by
tests/contracts/test_dependency_direction.pyin every repo's CI. mts1b-foundationhas zero runtime deps (exceptpydantic+typing-extensions).- All types cross the boundary in
mts1b-foundationform. No direct service-to-service custom types. - 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 ─────┘
operationsobserves everything via the NATS event bus and enforces compliance + halts.reportslibraryreads result parquets and generates trade reports + postmortems.llmis 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-foundationinterface. - 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-marketdatadoesn't need to understandmts1b-researchto make a useful PR.
See dependency-graph for the full edge list.