Token导航 LogoToken导航TokenDH.com
yats (Skyliquid22) logo
金融服务stdio官方级别未说明来源级核验

yats (Skyliquid22)

MCP Server

YATS是一个机构级的交易研究和执行平台,自动化全生命周期交易流程,包括数据摄取、特征计算、强化学习训练、实验评估、资格审核、影子执行及风险合约下的模拟/实盘交易。

工具数

0

提示词数

0

GitHub Stars

2

资源数

0
Python风险管理金融数据

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

skyliquid22

提供方

skyliquid22

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e ".[dev]"

详细介绍

YATS——又一种交易系统

机构级交易研究和执行平台。YATS自动化了整个生命周期:多供应商数据摄取、确定性特征计算、强化学习训练、实验评估、资格门控、影子执行以及静态风险合约下的纸上/现场交易。

YATS是 MCP本地 --所有功能都以MCP工具的形式公开,可由代理或笔记本电脑调用。没有CLI或仪表板。

建筑

┌─────────────────────────────────────────────────────────┐
│  Layer 1: Interface (TypeScript)                        │
│  MCP Server — @modelcontextprotocol/sdk                 │
│  76 tools across 12 domains                             │
├─────────────────────────────────────────────────────────┤
│  Layer 2: Orchestration (TypeScript → Python bridge)    │
│  Dagster GraphQL │ Python subprocess │ QuestDB client   │
├─────────────────────────────────────────────────────────┤
│  Layer 3: Compute + Storage (Python + QuestDB)          │
│  Dagster pipelines │ research/ modules │ QuestDB        │
│  .yats_data/ filesystem artifacts                       │
└─────────────────────────────────────────────────────────┘

TypeScript 处理MCP协议层和网桥。 python 处理所有计算:RL训练、评估、特征计算、执行。 QuestDB 是所有时间序列、元数据和审计跟踪的共享数据平面。 Dagster 以完全可观察性编排管道。

先决条件

  • Node.js>=20
  • Python>=3.11
  • QuestDB(PG线在默认端口8812上运行,ILP在默认端口9009上运行)
  • Dagster(pip install dagster dagster-webserver)

API密钥

变量来源必需
APCA_API_KEY_ID羊驼市场数据+纸质/实时交易
APCA_API_SECRET_KEY羊驼市场数据+纸质/实时交易
FD_API_KEY财务数据集.ai基本面、指标、收益

设置

# TypeScript (MCP server)
npm install
npm run build

# Python (pipelines + research)
pip install -e ".[dev]"

# QuestDB tables
python -c "from pipelines.yats_pipelines.utils.create_tables import create_all_tables; create_all_tables()"

# Dagster
dagster dev -m pipelines.yats_pipelines.definitions

快速入门

YATS工具通过MCP调用。以下是典型的工作流程:

1. Ingest data         →  data.ingest (Alpaca OHLCV + FD fundamentals)
2. Canonicalize        →  data.canonicalize (raw → canonical with lineage)
3. Compute features    →  features.compute (32 v1 features)
4. Create experiment   →  experiment.create (spec with policy, universe, params)
5. Train + evaluate    →  experiment.run (PPO/SAC training + deterministic eval)
6. Shadow replay       →  shadow.run (forward-only historical replay)
7. Qualify             →  qualify.run (candidate vs baseline, hard/soft gates)
8. Promote             →  promote.to_candidate → promote.to_production
9. Paper trade         →  execution.start_paper (Alpaca paper endpoint)

目录结构

yats/
  src/                    # TypeScript MCP server
    server.ts             # Entry point (stdio transport)
    tools/                # 12 tool domains (data, features, experiment, ...)
    bridge/               # dagster-client, python-runner, questdb-client
    auth/                 # Role-based permissions, SQL safety, rate limiting
    types/                # TypeScript type definitions
    vendors/              # Alpaca + financialdatasets.ai API clients

  pipelines/              # Python Dagster pipelines
    yats_pipelines/
      jobs/               # 14 pipeline jobs (ingest, canonicalize, train, ...)
      resources/          # QuestDB, Alpaca, FD resources
      io/                 # QuestDB I/O manager

  research/               # Python research modules
    envs/                 # SignalWeightEnv (old Gym API)
    training/             # PPO + SAC trainers (SB3), reward shaping
    eval/                 # Deterministic evaluation, regime slicing
    experiments/          # ExperimentSpec, registry
    shadow/               # ShadowEngine, ReplayMarketDataSource
    execution/            # Paper/live trading, broker adapter, kill switches
    promotion/            # Qualification gates, promotion tiers
    features/             # Feature registry, OHLCV/fundamental/regime features
    hierarchy/            # ModeController, per-mode allocators
    policies/             # SMA, equal-weight policies
    risk/                 # Risk config, weight projection

  compute/                # Standalone compute modules
    stats/                # ADF, bootstrap, deflated Sharpe, PBO
    risk/                 # Stress test, tail analysis, correlation

  configs/                # Configuration files
    risk.yml              # Risk policy thresholds (15 constraints)
    feature_sets/         # Feature set definitions (YAML)
    universes/            # Ticker lists (sp500, sectors)
    regime_detectors/     # Pluggable regime detection configs
    regime_thresholds.yml # Regime bucketing thresholds
    vendors.yml           # Vendor configuration

  .yats_data/             # Runtime artifacts (not in git)
    experiments/          # Per-experiment specs, checkpoints, metrics
    promotions/           # Immutable promotion records
    shadow/               # Shadow execution logs

  tests/                  # Test suite
    research/             # Python module tests
    pipelines/            # Dagster pipeline tests
    integration/          # End-to-end tests

数据供应商

供应商数据使用情况
羊驼OHLCV柱状图(每日)、实时WebSocket、纸/实时交易一级市场数据+执行
财务数据集.ai基本面、财务指标、收益、内幕交易、分析师估计研究数据

所有数据都通过一个两层模型流动: 原始 (仅附加,每个供应商)→ 规范的 (已对账,仅下游输入)。规范表包含完整的沿袭(源供应商、对账方法、验证状态)。

实验生命周期

ExperimentSpec (canonical config)
    ↓
experiment.create → content-addressed ID (SHA256)
    ↓
experiment.run → train (PPO/SAC) + evaluate
    ↓
qualify.run → candidate vs baseline (hard/soft gates)
    ↓
promote.to_candidate → promote.to_production
    ↓
execution.start_paper → paper trading via Alpaca

政策:PPO、SAC、SMA、等权重、分层(模式控制器+每模式分配器)

奖励版本:v1(身份日志返回),v2(形状:营业额+提款+成本处罚)

风险引擎

风险政策是 静态合同 --任何策略或模型都不能覆盖它。在运行时,在6个组中强制执行15个约束:

  1. 紧急停止开关:每日损失限额,追踪提款
  2. 全球限额:总/净敞口、杠杆率、日交易额
  3. 按符号:最大体重、位置计数、注意力、ADV参与度
  4. 波动性:vol缩放,vol状态制动器
  5. 信号:信心门控,最小保持期
  6. 现金下限:最低现金储备

所有风险决策均已记录至QuestDB。终止开关状态机:TRADING→ 停止→ 停止→ 恢复→ 贸易。

安全

基于角色的访问控制,分为5层: intern (只读)→ researcherrisk_officerpmmanaging_partner (完全控制)。SQL查询使用每个角色的表白名单进行参数化。Python子进程在沙盒中运行(无网络、受限制的文件系统、内存限制)。

文档

许可证

麻省理工学院

目录标签

目录标签

Python风险管理金融数据机构交易本地部署自动化交易强化学习多语言架构

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP