← 返回
效率工具 Key 中文

portfolio tracking

An investment portfolio tracker that runs entirely locally. All data stays in ~/.portfolio-tracker/.
一款完全本地运行的投资组合追踪器。所有数据均存储在 ~/.portfolio-tracker/ 目录下。
aigeneralstore
效率工具 clawhub v1.0.0 1 版本 99893.7 Key: 需要
★ 2
Stars
📥 900
下载
💾 18
安装
1
版本
#latest

概述

Portfolio Tracker Skill

An investment portfolio tracker that runs entirely locally. All data stays in ~/.portfolio-tracker/.

Architecture

  • Data: ~/.portfolio-tracker/data.json (portfolios, assets, prices)
  • Config: ~/.portfolio-tracker/config.json (API keys, wallet addresses, user profile)
  • Scripts: TypeScript CLI tools in /scripts/, run via npx tsx

First-Time Setup

Before running any script, ensure dependencies are installed:

npm install --prefix <skill-path>/scripts

Replace with the actual installed path of this skill.

How Scripts Work

Each script is a standalone CLI tool. Run them with:

npx tsx <skill-path>/scripts/<script>.ts <command> [args]

Scripts read from stdin when needed and output JSON to stdout.

data-store.ts

  • load — Read portfolio data (creates default if missing)
  • save — Write portfolio data (JSON from stdin)
  • load-config — Read config
  • save-config — Write config (JSON from stdin)

fetch-prices.ts

  • crypto — Get crypto price (Binance → CoinGecko)
  • stock — Get stock price (Yahoo Finance)
  • fx — Get USD/CNY/HKD exchange rates
  • historical — Get 3yr monthly historical data
  • search — Search for assets by name/symbol
  • refresh — Batch refresh prices (assets JSON from stdin)

binance-sync.ts

  • sync — Fetch all Binance balances (6 account types)
  • validate — Validate API credentials

ibkr-sync.ts

  • sync — Fetch IBKR positions via Flex Query
  • validate — Validate IBKR credentials

blockchain-sync.ts

  • sync
    [chain] — Fetch wallet balances (single chain or all 5 EVM chains)
  • validate
    — Validate EVM address

Data Types

Asset

{
  "id": "unique-id",
  "type": "CRYPTO | USSTOCK | HKSTOCK | ASHARE | CASH",
  "symbol": "BTC",
  "name": "Bitcoin",
  "quantity": 1.5,
  "avgPrice": 40000,
  "currentPrice": 50000,
  "currency": "USD | CNY | HKD",
  "transactions": [],
  "source": { "type": "manual | binance | wallet | ibkr" }
}

Portfolio

{
  "id": "unique-id",
  "name": "Main",
  "assets": [...]
}

Workflow Patterns

Viewing Portfolio

  1. Load data via data-store.ts load
  2. Find current portfolio by currentPortfolioId
  3. Calculate total value using quantity * currentPrice per asset
  4. Convert to display currency using exchangeRates
  5. Present as a formatted table

Adding Assets

  1. Load data
  2. Search for the asset using fetch-prices.ts search
  3. Get current price via fetch-prices.ts crypto/stock
  4. Add asset to current portfolio with a generated unique ID
  5. Save data

Refreshing Prices

  1. Load data
  2. Pipe current portfolio assets to fetch-prices.ts refresh via stdin
  3. Also run fetch-prices.ts fx for exchange rates
  4. Update each asset's currentPrice and the exchangeRates
  5. Set lastPriceRefresh to current ISO timestamp
  6. Save data

Syncing from Exchange/Wallet

  1. Load config to get credentials
  2. Run the appropriate sync script
  3. Merge results: update existing assets (match by symbol+source), add new ones
  4. Save data

Commands

Available user commands:

  • /portfolio — View and manage portfolios
  • /prices — Refresh all prices
  • /setup — Configure API keys and wallets
  • /sync-binance — Sync from Binance
  • /sync-ibkr — Sync from Interactive Brokers
  • /sync-wallet — Sync from blockchain wallet
  • /advise — Get AI investment advice

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 14:29 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

productivity

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 433 📥 103,868
productivity

Nano Pdf

steipete
使用nano-pdf CLI通过自然语言指令编辑PDF
★ 275 📥 114,973
productivity

Word / DOCX

ivangdavila
创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。
★ 440 📥 148,188