riskprism
riskprism
미국 주식 포트폴리오 리스크를 팩터 스펙트럼으로 분해합니다.
탐색기: https://risk-prism-production.up.railway.app · Agent 모델 카드: /model.md
AI 에이전트가 바로 사용할 수 있도록 설계된 오픈소스 Barra 스타일 기초 팩터 리스크 모델입니다. Python 라이브러리, MCP 서버, 그리고 대부분의 유동성 있는 미국 보통주를 다루는 주간 배포 모델 아티팩트를 포함합니다.
7가지 스타일 팩터 (규모, 가치, 모멘텀, 변동성, 유동성, 품질, 레버리지) + 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에서 서비스되며, 매주 빌드될 때마다 다시 렌더링됨)입니다: 누적 팩터 수익률, 팩터 변동성 및 상관관계, 스트레스 테스트 슬라이더가 포함된 클라이언트 사이드 포트폴리오 리스크 샌드박스, 주식별 팩터 프로필, 그리고 시각적 방법론 안내를 제공합니다. 모든 계산은 임베디드 아티팩트를 기반으로 브라우저에서 실행됩니다.
에이전트는 모든 빌드의 일반 마크다운 미러를 /model.md ( /llms.txt로 인덱싱)에서 얻을 수 있습니다: 모델 카드, 팩터 정의, 상관관계, 전체 커버리지 목록 — DOM 파싱 없이 제공됩니다.
모든 것을 로컬에서 렌더링:
riskprism-site --artifacts artifacts --out site # index.html + model.md + llms.txt모델 요약
구성 요소 | 선택 |
기간 | 중기 (주간 수익률, 연환산 출력) |
추정 | 횡단면 WLS (√cap 가중치), cap 가중 산업 제약 |
팩터 공분산 | EWMA — 변동성 반감기 26주, 상관관계 반감기 26주, PSD 복구됨 |
특이 리스크 | EWMA 잔여 변동성과 구조적(특성 기반) 사전 분포를 이력 길이에 따라 혼합 |
유니버스 | 추정: 주가 ≥ $2, ADV ≥ $1M, 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