← 返回 Skills 市场
clawdiri-ai

Einstein Research — Portfolio Risk Analyzer

作者 RunByDaVinci · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
130
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install einstein-research-portfolio-risk-dv
功能描述
Performs a comprehensive, portfolio-level risk analysis. Calculates VaR (Value at Risk), max drawdown, correlation matrix, stress tests against historical cr...
使用说明 (SKILL.md)

Portfolio Risk Analyzer

Overview

This skill performs a comprehensive, portfolio-level risk analysis. It goes beyond individual position risk to quantify systemic and correlated risks across the entire portfolio.

Core Features:

  • Value at Risk (VaR): Calculates 95% and 99% VaR using Parametric, Historical, and Monte Carlo methods.
  • Max Drawdown Analysis: Identifies historical and potential future maximum drawdowns.
  • Correlation Matrix: Visualizes how positions move in relation to each other, highlighting diversification benefits or weaknesses.
  • Stress Testing: Simulates portfolio performance during historical market crises (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hikes).
  • Concentration Risk: Identifies over-concentration in specific sectors, factors, or individual positions.
  • Beta Calculation: Measures portfolio volatility relative to benchmarks (SPY, QQQ).

When to Use This Skill

Explicit Triggers:

  • "Analyze the risk of my portfolio."
  • "What is my portfolio's Value at Risk?"
  • "How would my portfolio perform in another 2008-style crash?"
  • "Am I too concentrated in the tech sector?"
  • "Calculate the max drawdown of my holdings."
  • User asks about "portfolio risk," "drawdown," "VaR," "correlation," "stress test," or "concentration."

Implicit Triggers:

  • User is concerned about a market downturn.
  • User is adding a new large position and wants to understand its impact on overall portfolio risk.
  • User is reviewing their overall asset allocation.

Workflow

Step 1: Ingest Portfolio Data

The analysis requires the current portfolio holdings, typically from a CSV or JSON file.

Input Format (portfolio.json):

{
  "positions": [
    { "ticker": "AAPL", "quantity": 100, "avg_price": 150.00 },
    { "ticker": "TSLA", "quantity": 50, "avg_price": 200.00 },
    { "ticker": "SPY", "quantity": 200, "avg_price": 400.00 }
  ],
  "cash": 25000
}

Step 2: Execute the Risk Analysis Script

The portfolio-risk-analyzer CLI tool runs the full analysis suite.

portfolio-risk-analyzer run \
  --portfolio path/to/portfolio.json \
  --benchmark SPY

The script performs the following calculations:

  1. Fetches historical price data for all positions.
  2. Calculates daily returns for each position and the total portfolio.
  3. VaR:
    • Parametric: Assumes normal distribution of returns.
    • Historical: Uses the actual distribution of historical returns.
    • Monte Carlo: Simulates thousands of possible future return paths.
  4. Max Drawdown: Finds the largest peak-to-trough decline in the portfolio's history.
  5. Correlation: Computes the correlation matrix for all positions.
  6. Stress Tests: Re-prices the portfolio based on the returns of historical crisis periods.
  7. Concentration: Calculates weights by position, sector, and factor.

Step 3: Analyze the Output

The script generates a detailed report in both JSON and Markdown formats.

JSON Output (risk_report_YYYY-MM-DD.json):

  • Contains all the raw data, calculations, and simulation results for programmatic use.

Markdown Report (risk_report_YYYY-MM-DD.md):

  • Risk Summary:
    • Portfolio Beta: e.g., 1.15 vs. SPY
    • 99% VaR (1-day): e.g., "$5,200 (Your portfolio has a 1% chance of losing at least $5,200 on any given day)."
    • Historical Max Drawdown: e.g., "-28.5%"
  • Concentration Analysis:
    • Top 5 Positions by Weight
    • Sector Allocation Chart
  • Stress Test Results:
    • A table showing simulated P&L for 2008, 2020, and 2022 scenarios.
  • Correlation Hotspots:
    • Lists the most highly correlated pairs of assets in the portfolio.
  • Actionable Insights:
    • e.g., "Your portfolio is heavily concentrated in Technology (65%). Consider adding exposure to other sectors like Healthcare or Consumer Staples to improve diversification."
    • e.g., "The high correlation between AAPL and MSFT reduces diversification benefits. Consider trimming one or adding an uncorrelated asset."

Step 4: Present Findings to User

Synthesize the key findings from the Markdown report into a clear, actionable summary. Start with the most critical information (like high concentration or poor stress test results) and provide concrete suggestions for risk mitigation.

安全使用建议
This package appears to implement the risk analyses it claims and does not ask for unrelated credentials, but consider the following before installing or running: - The script requires Python plus yfinance/numpy/pandas/scipy; install packages from PyPI in a controlled environment (virtualenv). - The SKILL.md references a CLI name that isn't provided; run the included script (python3 scripts/portfolio_risk.py) per README. - The script fetches data from Yahoo Finance (network access). If you run it in a sensitive environment, be aware it will make outbound requests to retrieve price and metadata via yfinance. - Review the code yourself if you will feed it sensitive exports (account numbers, personally identifying info). The tool only reads portfolio files you supply and writes local JSON/MD reports — it does not contain obvious exfiltration to third-party endpoints. - For heavy Monte Carlo runs, consider CPU/time impact and run in an environment where resource usage is acceptable. If you need higher assurance, run the script in an isolated container and inspect network traffic or dependency install logs before providing private portfolio files.
功能分析
Type: OpenClaw Skill Name: einstein-research-portfolio-risk-dv Version: 0.1.0 The Einstein Research Portfolio Risk Analyzer is a legitimate financial analysis tool designed to calculate risk metrics like Value at Risk (VaR), drawdown, and sector concentration. The core logic in `scripts/portfolio_risk.py` uses standard libraries (yfinance, numpy, pandas, scipy) to fetch public market data and perform statistical calculations without any evidence of malicious behavior, data exfiltration, or unauthorized system access. The instructions in `SKILL.md` are clearly aligned with the stated purpose and do not contain any prompt injection attempts or hidden commands.
能力评估
Purpose & Capability
Name/description match the provided code and docs. The script implements VaR (parametric/historical/MC), max drawdown, correlation, stress tests, concentration and beta calculations and uses yfinance for historical prices — all expected for this purpose.
Instruction Scope
SKILL.md expects a CLI "portfolio-risk-analyzer run ..." but the repository provides scripts/portfolio_risk.py and README usage invoking python3 scripts/portfolio_risk.py. That is a minor inconsistency: there is no provided installer or wrapper that registers a 'portfolio-risk-analyzer' command. Otherwise, runtime instructions (read portfolio CSV/JSON, fetch historical prices, produce JSON/Markdown reports) stay within the stated scope and only access portfolio files and Yahoo Finance via yfinance.
Install Mechanism
There is no install spec (instruction-only), but a full Python script is included that requires third-party packages (yfinance, numpy, pandas, scipy). Installing those packages via pip is required to run the code; the package sources are public PyPI libraries. No downloads from untrusted URLs or obfuscated installers were found.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The only network calls are to Yahoo Finance through yfinance and to fetch asset metadata (yf.Ticker.info), which is consistent with the stated behavior. No unrelated secrets or cloud credentials are requested.
Persistence & Privilege
always is false and the skill does not request persistent system-wide privileges or modify other skills. It does not attempt to enable itself persistently or write to global agent config. Autonomous invocation (default) is allowed but not excessive for this type of skill.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install einstein-research-portfolio-risk-dv
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /einstein-research-portfolio-risk-dv 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Initial release
元数据
Slug einstein-research-portfolio-risk-dv
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Einstein Research — Portfolio Risk Analyzer 是什么?

Performs a comprehensive, portfolio-level risk analysis. Calculates VaR (Value at Risk), max drawdown, correlation matrix, stress tests against historical cr... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 130 次。

如何安装 Einstein Research — Portfolio Risk Analyzer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install einstein-research-portfolio-risk-dv」即可一键安装,无需额外配置。

Einstein Research — Portfolio Risk Analyzer 是免费的吗?

是的,Einstein Research — Portfolio Risk Analyzer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Einstein Research — Portfolio Risk Analyzer 支持哪些平台?

Einstein Research — Portfolio Risk Analyzer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Einstein Research — Portfolio Risk Analyzer?

由 RunByDaVinci(@clawdiri-ai)开发并维护,当前版本 v0.1.0。

💬 留言讨论