← 返回 Skills 市场
iamcooper2026

Crypto SAFE Portfolio Analyzer Pro

作者 iamcooper2026 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
191
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install crypto-safe-portfolio-analyzer-pro
功能描述
Safe cryptocurrency portfolio tracking and P&L analysis. Monitors portfolio value, calculates profit/loss with custom cost basis, tracks live prices via Coin...
使用说明 (SKILL.md)

Crypto SAFE Portfolio Analyzer Pro

Track cryptocurrency portfolios, calculate P&L with custom cost basis, and generate comprehensive reports with live market data.

Overview

This skill provides professional-grade portfolio tracking for cryptocurrency investors. It fetches live prices from CoinGecko, calculates accurate P&L based on your cost basis, and generates detailed reports showing position breakdown, allocations, and performance metrics.

Key Features:

  • Real-time price tracking for 20+ cryptocurrencies
  • Custom cost basis for accurate P&L calculation
  • Portfolio allocation analysis with target vs. actual comparisons
  • Market sentiment analysis across watchlists
  • Multiple output formats (text reports, JSON data)
  • Integration-ready for Discord bots, automated alerts, and cron jobs

Quick Start

1. Analyze Portfolio Holdings

For a quick portfolio analysis, provide holdings as a JSON object:

python3 scripts/portfolio-analyzer.py portfolio --holdings '{"BTC": 1.5, "ETH": 10.2, "SOL": 50, "DOGE": 10000}'

Expected Output:

📊 CRYPTO PORTFOLIO REPORT
==================================================
💰 Total Value: $125,750.50
🟢 Total P&L: $15,750.50 (+14.32%)

📈 POSITION BREAKDOWN:
BTC:
  💵 Value: $89,237.50 (71.0% of portfolio)
  🟢 P&L: $8,987.50 (+11.20%)
  🔴 24h: -3.92%

2. Market Overview

Get sentiment and price overview for your watchlist:

python3 scripts/portfolio-analyzer.py market

3. Set Up Configuration

For advanced features like cost basis tracking, create portfolio-config.json:

{
  "cost_basis": {
    "BTC": 45000,
    "ETH": 2800,
    "SOL": 85
  },
  "watchlist": ["BTC", "ETH", "SOL", "DOGE", "XRP"],
  "target_allocation": {
    "BTC": 40,
    "ETH": 30,
    "SOL": 20,
    "Other": 10
  }
}

Core Capabilities

1. Portfolio Value Calculation

Calculates total portfolio value with position-level breakdown:

  • Live pricing from CoinGecko API (no API key required)
  • Cost basis tracking for accurate P&L calculation
  • 24-hour change for each position
  • Portfolio allocation percentages
  • Total portfolio P&L with percentage gains/losses

Supported Coins: BTC, ETH, SOL, DOGE, XRP, ADA, AVAX, LINK, DOT, UNI, NEAR, ATOM, and more.

2. Market Analysis

Provides market sentiment analysis across your watchlist:

  • Market sentiment classification (Bullish/Bearish/Neutral)
  • Average 24-hour change across all tracked coins
  • Individual coin performance with prices and changes
  • Market cap data for supported cryptocurrencies

3. Report Generation

Multiple output formats for different use cases:

Text Format: Human-readable reports with emoji indicators and formatted numbers

# Generate text report
python3 scripts/portfolio-analyzer.py portfolio --holdings holdings.json

JSON Format: Structured data for automation and integrations

# Generate JSON data for automation
python3 scripts/portfolio-analyzer.py portfolio --holdings holdings.json --format json

4. Integration Ready

Designed for automation and integration:

  • Discord bot integration - Post daily portfolio updates
  • Cron job automation - Schedule regular portfolio checks
  • Alert systems - Monitor portfolio value thresholds
  • API consumption - JSON output ready for webhooks and APIs

Common Use Cases

Daily Portfolio Monitoring

Set up automated daily reports:

# Add to cron or OpenClaw cron jobs
python3 scripts/portfolio-analyzer.py portfolio --holdings ~/.crypto/holdings.json > daily-report.txt

Rebalancing Analysis

Compare current vs. target allocations:

  1. Set target allocations in portfolio-config.json
  2. Run portfolio analysis to see current allocations
  3. Identify positions that need rebalancing

Performance Tracking

Monitor P&L over time:

# Log daily values for trend analysis
echo "$(date): $(python3 scripts/portfolio-analyzer.py portfolio --holdings holdings.json --format json | jq '.total_value')" >> portfolio-history.log

Tax Reporting

Generate P&L data for tax calculations:

# Export detailed P&L breakdown
python3 scripts/portfolio-analyzer.py portfolio --holdings holdings.json --format json | jq '.breakdown'

Configuration Options

Cost Basis Setup

Define your average purchase prices for accurate P&L:

{
  "cost_basis": {
    "BTC": 45000,    // Your average BTC purchase price
    "ETH": 2800,     // Your average ETH purchase price
    "SOL": 85        // Your average SOL purchase price
  }
}

Without cost basis, P&L calculations use current price as basis (showing $0 P&L).

Watchlist Customization

Customize which coins to track in market overviews:

{
  "watchlist": ["BTC", "ETH", "SOL", "DOGE", "XRP", "ADA", "AVAX", "LINK"]
}

Target Allocation

Set portfolio allocation targets for rebalancing analysis:

{
  "target_allocation": {
    "BTC": 40,    // Target 40% Bitcoin
    "ETH": 30,    // Target 30% Ethereum
    "SOL": 20,    // Target 20% Solana
    "Other": 10   // Target 10% other assets
  }
}

Error Handling

The skill includes robust error handling:

  • API failures: Graceful fallback when CoinGecko is unavailable
  • Invalid holdings: Clear error messages for malformed JSON
  • Missing config: Uses sensible defaults when config files are missing
  • Network timeouts: 10-second timeout with error reporting

Integration Examples

Discord Bot Integration

const { exec } = require('child_process');

async function postPortfolioUpdate() {
  const command = 'python3 scripts/portfolio-analyzer.py portfolio --holdings holdings.json --format json';
  exec(command, (error, stdout) => {
    if (!error) {
      const portfolio = JSON.parse(stdout);
      const message = `📊 Portfolio: $${portfolio.total_value.toLocaleString()} | P&L: ${portfolio.total_pnl >= 0 ? '🟢' : '🔴'} ${portfolio.total_pnl_pct.toFixed(2)}%`;
      // Send to Discord channel
    }
  });
}

OpenClaw Automation

// In OpenClaw skills or cron jobs
const portfolioData = await exec('python3 ~/.openclaw/workspace/skills/crypto-portfolio-tracker/scripts/portfolio-analyzer.py portfolio --holdings holdings.json --format json');
const portfolio = JSON.parse(portfolioData);

if (portfolio.total_value > 100000) {
  await notify('Portfolio over $100k!');
}

Resources

scripts/

  • portfolio-analyzer.py: Main portfolio tracking and analysis script
  • portfolio-tracker.js: Node.js integration wrapper (adapted from crypto-alerts)

references/

  • usage-examples.md: Detailed examples, configurations, and integration patterns
  • config-example.json: Sample configuration file with all available options

For detailed examples and integration patterns, see references/usage-examples.md.

安全使用建议
This skill appears to do what it says (fetch public market data and produce portfolio reports). Before installing or running it: 1) Review and create a safe config file (it will try to load ./portfolio-config.json, ../references/config-example.json, or ~/.openclaw/workspace/crypto-portfolio-config.json if present). 2) Ensure you have required runtimes/deps (Python + requests for the Python script; Node.js for the JS script). 3) There is no built-in Discord webhook/posting — if you add Discord integration, don't paste secret tokens into repository files; store them securely and review any code that would send them out. 4) Note small inconsistencies: the JS script reads ../config.json (not provided) while SKILL.md references portfolio-config.json — make sure your config filenames are correct. 5) Run the scripts locally on sample data first to confirm behavior and inspect outputs. If you want higher assurance, request a signed provenance/source URL from the publisher or run the code in an isolated environment.
功能分析
Type: OpenClaw Skill Name: crypto-safe-portfolio-analyzer-pro Version: 1.0.1 The skill bundle provides legitimate cryptocurrency portfolio tracking and market analysis functionality. The Python script (portfolio-analyzer.py) and Node.js script (portfolio-tracker.js) fetch market data from reputable public APIs (CoinGecko, Coinbase, and Alternative.me) and perform P&L calculations based on user-provided holdings. There is no evidence of data exfiltration, credential theft, or malicious execution; the scripts use standard libraries for network requests and file handling, and the documentation aligns perfectly with the code's behavior.
能力评估
Purpose & Capability
Name/description describe portfolio tracking, P&L, and market scanning; the included Python and Node scripts call CoinGecko, Coinbase, and public sentiment APIs and produce reports/alerts — all consistent with the stated purpose.
Instruction Scope
SKILL.md instructs the agent to run the included scripts, supply holdings/config JSON, and integrate with cron/Discord. The runtime instructions and commands stay within portfolio/reporting scope. Notes: examples reference child_process.exec for integrations (expected), and the skill will read local config files if present (./portfolio-config.json, ../references/config-example.json, or ~/.openclaw/...); this means it may load user-local configuration files if they exist.
Install Mechanism
No install spec is provided (instruction-only), which is low-risk. However the Python script imports the third-party 'requests' library and the Node script expects a local config.json — these runtime dependencies are not declared in SKILL.md/registry metadata, so users must install Python requests and have Node available manually. No network downloads or obscure external install URLs are present.
Credentials
The skill requests no environment variables, no credentials, and only calls public APIs (CoinGecko, Coinbase, alternative.me). The config examples include Discord/exchange fields but no tokens are required by the provided code. There is no evidence of unrelated credential access.
Persistence & Privilege
The skill does not request elevated platform privileges and 'always' is false. It reads/writes only expected local config paths and does not modify other skills or system-wide settings. track_wallet only modifies an in-memory structure and prints output (no implicit persistent storage).
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install crypto-safe-portfolio-analyzer-pro
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /crypto-safe-portfolio-analyzer-pro 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Updated name for clarity and safety. Free version for community adoption.
元数据
Slug crypto-safe-portfolio-analyzer-pro
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Crypto SAFE Portfolio Analyzer Pro 是什么?

Safe cryptocurrency portfolio tracking and P&L analysis. Monitors portfolio value, calculates profit/loss with custom cost basis, tracks live prices via Coin... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 191 次。

如何安装 Crypto SAFE Portfolio Analyzer Pro?

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

Crypto SAFE Portfolio Analyzer Pro 是免费的吗?

是的,Crypto SAFE Portfolio Analyzer Pro 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Crypto SAFE Portfolio Analyzer Pro 支持哪些平台?

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

谁开发了 Crypto SAFE Portfolio Analyzer Pro?

由 iamcooper2026(@iamcooper2026)开发并维护,当前版本 v1.0.1。

💬 留言讨论