Skip to main content

mts1b-githubbot, mts1b-discordbot, mts1b-frontends, mts1b-tradingview, mts1b-reportslibrary — public API surface

mts1b-githubbot

from mts1b_githubbot.app import handle_webhook

# Webhook entry (FastAPI route)
@app.post("/githubbot/webhook")
async def webhook(req: Request, signature: str = Header()):
return await handle_webhook(req.body(), signature=signature)

Setup:

mts1b-githubbot install \
--org MTS1B \
--app-id <github_app_id> \
--private-key-path /etc/mts1b/githubbot.pem

gh app installation list --org MTS1B

Personas (in mts1b-llm): triager, code_reviewer, bug_fixer.

Budget:

budget:
daily_usd: 5.0
per_repo_daily_cap: 1.0
expensive_actions:
bug_fixer: 0.20

Safety:

  • Always opens PR (never direct push)
  • No contents: write on protected branches
  • .github/workflows/ is CODEOWNERS-protected
  • Every comment prefixed with 🤖 AI

mts1b-discordbot

Slash commands:

/ask QUESTION ← RAG-based answer from docs
/search QUERY ← Algolia top-5 doc links
/report-bug TITLE ← Opens GitHub issue from thread
/learn TOPIC ← Suggests doc reading order
/roles ← Show current Discord roles
/link-github ← OAuth flow to claim contributor role

Auto-grant roles via GitHub OAuth:

GitHub statusDiscord role
Member of MTS1B org@member
Merged ≥ 1 PR@contributor
Maintainer (CODEOWNERS)@maintainer
GitHub Sponsor@sponsor (gold)
Merged ≥ 10 PRs@core-contributor

Cross-posts:

SourceDestination
GitHub Releases#announcements
mts1b-research/drift (zscore < -1.5)#announcements
Security advisory#announcements (pinned 7d)

Budget:

budget:
daily_usd: 3.0
per_channel_daily_cap_usd: 1.0
cooldown_per_user_seconds: 30

mts1b-frontends

CLI

mts # show top-level help
mts auth login # OAuth via Authentik
mts auth whoami
mts auth logout

mts mts1b-treasury funds list
mts mts1b-oms positions list --fund-id X
mts mts1b-research strategies list
mts cmd halt
mts logs <service>
mts ls # shorthand: positions across all funds

Pipe-friendly:

mts mts1b-treasury funds list --json | jq '.[] | select(.broker == "ibkr")'
mts mts1b-oms positions list --fund-id X --format csv > positions.csv

TUI

mts tui # full-screen Textual app

Keyboard shortcuts:

  • p — positions
  • o — orders
  • f — funds
  • r — risk dashboard
  • h — halt menu
  • q — quit

webui

Next.js app under webui/. Desks:

DeskURL
Replay/replay
Matrix/matrix
LAB/lab
Signals/signals
Zilla/zilla
Funds/funds
Risk/risk
Ops/ops

API client (auto-generated from OpenAPI):

import { OmsClient } from "@mts1b/api-client";
const oms = new OmsClient({ baseUrl: "http://localhost:8001" });
const positions = await oms.getPositions({ fundId: "paper-momentum" });

mts1b-tradingview

Webhook endpoint:

POST https://mts1b.investmentparadisellc.com/tradingview/webhook

Payload schema:

{
"secret": "<shared secret>",
"strategy_id": "tv_breakout_v1",
"fund_id": "paper-tv-test",
"symbol": "BTC-USD",
"side": "buy",
"quantity": "0.05",
"order_type": "limit",
"limit_price": "95000",
"tif": "day",
"actor": "tradingview",
"idempotency_key": "{{strategy.id}}-{{time}}",
"thesis": "20-bar breakout"
}

Validation:

  • Shared secret matches secret/mts1b/tradingview/<fund_id>
  • IP in TradingView's published egress list
  • idempotency_key unique in 5-min window
  • Body ≤ 4 KB
  • Rate-limited 10 req/sec per fund

Symbology translation:

TV formatMTS1B canonical
BINANCE:BTCUSDTBTC-USDT
COINBASE:BTCUSDBTC-USD
NASDAQ:AAPLAAPL

mts1b-reportslibrary

from mts1b_reportslibrary import (
trade_report, nav_report, postmortem_auto_rca, alpha_decay,
settlement_report, risk_envelope_report, tca_report,
regime_attribution, factor_attribution, position_attribution,
)


html = await trade_report(
fund_id="paper-momentum",
start=date(2026, 1, 1), end=date(2026, 5, 23),
format="html",
include=["equity_curve", "trade_table", "regime_attribution"],
)


postmortem = await postmortem_auto_rca(
fund_id="paper-momentum",
drawdown_start=date(2026, 4, 12),
drawdown_end=date(2026, 4, 18),
)
# HTML with timeline + attribution + LLM narrative + suggested fixes

CLI:

mts1b-report trade --fund-id X --start ... --end ... --output reports/trade.html
mts1b-report nav --fund-id X --window mtd --output reports/nav.pdf
mts1b-report postmortem --fund-id X --drawdown-start ... --drawdown-end ...
mts1b-report settlement --fund-id Y --year 2026 --output reports/2026-settlement.pdf
mts1b-report tca --fund-id X --window 7d --output reports/tca.html

Scheduling:

reports:
daily_nav:
cron: "0 18 * * 1-5"
funds: [paper-momentum, live-crypto]
distribute: [email, telegram]
weekly_tca:
cron: "0 8 * * 1"
distribute: [pdf-to-s3]

See also