riskprism
riskprism
米国株式ポートフォリオのリスクを、そのファクタースペクトラムに分解します。
エクスプローラー: https://risk-prism-production.up.railway.app · エージェント用モデルカード: /model.md
オープンソースのBarraスタイルのファンダメンタルファクターリスクモデルで、AIエージェントがそのまま使えるように設計されています。Pythonライブラリ、MCPサーバー、そして最も流動性の高い米国普通株式をカバーする週次公開のモデルアーティファクトを提供します。
7つのスタイルファクター(size、value、momentum、volatility、liquidity、quality、leverage)+ 12業種(Fama-Frenchスキーム)+ マーケットファクター
無料で再配布可能なデータチェーン: SEC EDGAR(パブリックドメイン)からのファンダメンタルズとSICコード、プラグイン可能なプロバイダーからの価格
ハイブリッド配布: 事前計算されたアーティファクト(エクスポージャー、ファクター共分散、固有リスク)は週次スケジュールで公開され、さらにパイプライン全体がオープンなので、誰でも再現または拡張できます
免責事項: 研究用ソフトウェアであり、現状のまま提供されます。ここに記載されている内容は投資助言ではありません。
AIエージェント向け(MCP)
{
"mcpServers": {
"riskprism": {
"command": "riskprism-mcp",
"env": { "RISKPRISM_ARTIFACTS": "/path/to/artifacts" }
}
}
}公開されているツール: get_model_info、get_portfolio_risk、get_factor_exposures、stress_test、check_coverage。ウェイトはポートフォリオのウェイトです(空売りはマイナス)。ボラティリティは年率換算の小数です。
Related MCP server: Portfolio Rotation MCP Server
人間向け(Python)
from riskprism import RiskModel
model = RiskModel.load("artifacts")
report = model.portfolio_risk({"AAPL": 0.4, "MSFT": 0.3, "XOM": 0.3})
print(report["total_vol"], report["factor_var_contributions"])
model.stress_test({"AAPL": 1.0}, {"market": -0.10, "momentum": -0.05})モデルを自分で構築する
pip install -e ".[dev]"
export RISKPRISM_EDGAR_UA="your-project (you@example.com)" # SEC fair-access policy
riskprism-build --max-names 3000 --out artifacts # yahoo prices, no key needed
riskprism-build --prior artifacts_prev --out artifacts # append new weeks to a prior build
riskprism-build --provider tiingo ... # licensed data, needs TIINGO_API_KEY週次のGitHub Actionはまさにこれを実行し、アーティファクトディレクトリを公開します。.github/workflows/build-model.yml を参照してください。
エクスプローラー
モデルを探索するためのバックエンド不要の静的サイト(Railwayでホストされ、週次のビルドごとに再レンダリングされます)。累積ファクターリターン、ファクターのボラティリティと相関、ストレステスト用スライダー付きのクライアントサイドのポートフォリオリスクサンドボックス、銘柄別のファクタープロファイル、そして手法を視覚的に解説するウォークスルーを備えています。すべての計算は、埋め込まれたアーティファクト上でブラウザ内で実行されます。
エージェントは、各ビルドのプレーンMarkdownミラーを /model.md(/llms.txt によってインデックス化)で取得できます。モデルカード、ファクター定義、相関、完全なカバレッジリストが含まれており、DOM解析は不要です。
すべてをローカルでレンダリング:
riskprism-site --artifacts artifacts --out site # index.html + model.md + llms.txtモデル概要
コンポーネント | 選択 |
期間 | 中期(週次リターン、年率換算の出力) |
推定 | クロスセクションWLS(√時価総額ウェイト)、時価総額加重の業種制約 |
ファクター共分散 | EWMA — ボラティリティ半減期13週、相関半減期26週、PSD修復済み |
固有リスク | EWMA残差ボラティリティを、履歴の長さに応じて構造的(特性ベース)事前分布とブレンド |
ユニバース | 推定: 株価≥$2、ADV≥$100万、26週以上の履歴 · カバレッジ: 存続中の全銘柄で株価≥$1、事前分布がギャップを補完 |
履歴 | キャプチャーフォワード: 週次ビルドは前回リリースに追記。上場廃止は補完され、サバイバーシップバイアスは時間とともに減衰 |
完全な手法はdocs/METHODOLOGY.mdに、設計上の決定とその根拠はdocs/DECISIONS.mdに記載されています。
ライセンス
コードはMITライセンスです。公開されているモデルアーティファクトは、SEC EDGAR(パブリックドメイン)およびサードパーティの価格プロバイダーから構築された派生データです。データライセンスに関する議論はdocs/DECISIONS.mdを参照してください。
Available Tools
7 toolscheck_coverageC
Which of the given tickers the current model build covers.
Inputs: tickers (required).
get_etf_riskA
Look-through risk report for one ETF or mutual fund: the latest
SEC N-PORT holdings resolve to model tickers and the portfolio math
runs on those weights. Reports total/factor/specific vol, factor
exposures, top contributions, and the fund block with the holdings
date and coverage. Returns an error dict when the ticker locates no
fund, or when the model covers less than half of the holdings (bond
and international funds). Needs RISKPRISM_EDGAR_UA (an identifying
User-Agent, per SEC fair-access policy) for the EDGAR fetches.
Inputs: ticker (required), horizon.
get_factor_exposuresB
Per-asset factor exposures and total/factor/specific vol for each ticker.
Inputs: tickers (required), horizon.
get_model_infoA
Model version, as-of date, factor list, and asset coverage count.
horizon: "medium" (default) or "short" — the responsive variant with
halved risk half-lives, when available.
Inputs: horizon.
get_portfolio_riskA
Full risk report for a portfolio: total/factor/specific vol, factor
exposures, top factor variance contributions, and top asset risk
contributions. weights maps ticker -> portfolio weight. ETF and
mutual fund tickers expand into their filed holdings before the math
runs (set lookthrough=false to disable); funds the model cannot
cover are reported in lookthrough.notes. Set optimized=true if
the weights came from optimizing against this model: reported vols
then include the Shepard second-order correction (optimizers exploit
covariance estimation noise, so raw forecasts understate an optimized
portfolio's risk). horizon: "medium" or "short" (responsive
variant, when available).
Inputs: weights (required), horizon, optimized, lookthrough.
list_model_versionsA
Catalog of published model builds (the versioned registry): release tag, model version, publish date, available horizons, and artifact download URLs. The hosted server always serves the latest build; any historical build can be downloaded by its tag's asset URL.
Inputs: limit.
stress_testB
Estimate portfolio P&L under factor shocks (return units: -0.10 = -10%). Example: {"market": -0.10, "momentum": -0.05}. Use get_model_info for valid factor names.
Inputs: weights (required), factor_shocks (required), horizon.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Most tools target distinct actions: check_coverage checks ticker coverage, get_factor_exposures returns per-asset exposures, get_portfolio_risk returns a full portfolio report, and stress_test applies factor shocks. However, get_model_info also reports asset coverage count, which slightly overlaps with check_coverage, and get_portfolio_risk duplicates some get_factor_exposures output. Descriptions clarify boundaries, so misselection is unlikely.
All names use snake_case with a verb_noun pattern (check_coverage, get_factor_exposures, list_model_versions, etc.). stress_test is the only minor deviation from the get_* prefix but still fits the verb_noun convention. Consistent and predictable throughout.
Seven tools is well-scoped for a risk-model analytics server. Each tool addresses a distinct capability—coverage, exposures, metadata, versions, portfolio risk, ETF look-through, and stress testing—without redundant endpoints.
Core workflows are covered: coverage checks, model metadata/versions, per-asset exposures, portfolio/ETF risk, and stress testing. Minor gaps include no direct factor covariance/correlation retrieval or historical backtesting, though these are mostly available indirectly or outside the stated scope.
Maintenance
Related MCP Connectors
Production MCP server for US equity and options intelligence: real-time IV radar, Monte Carlo simulation, options pressure, strategy backtesting, AI prediction, pre-trade risk analysis, and automated stock research reports.
Portfolio risk analytics — VaR, Monte Carlo, optimization, options Greeks, stress testing.
Quantitative equity toolkit: factor data, backtests, risk model, attribution, optimizer.
Factor exposures and risk contribution for a portfolio, computed on the prices you send.
Related MCP Servers
- AlicenseAqualityDmaintenancePortfolio risk analytics MCP server — VaR, Monte Carlo simulation, stress testing, portfolio optimization, options Greeks, and correlation analysis. Real market data via Yahoo Finance. Free tier available, Pro at $29/mo.102MIT
- AlicenseAqualityDmaintenanceMCP server for portfolio rotation analysis. Score holdings and candidates across 5 dimensions, identify optimal swaps, validate with risk checks and backtests.11MIT
- FlicenseAqualityDmaintenanceMCP server providing portfolio analytics tools: beta to a benchmark, sector correlation, and FIFO trade matching with realized/unrealized P&L using Yahoo Finance prices.3-
- AlicenseAqualityAmaintenanceMCP server exposing Interactive Brokers' portfolio risk analysis, including model greeks, implied volatility surface, what-if margin, and a local stress engine for P&L curve analysis.9MIT