Portfolio Manager ๐ผ
name: portfolio-manager
by chenghaifeng08-creator ยท published 2026-04-01
$ claw add gh:chenghaifeng08-creator/chenghaifeng08-creator-portfolio-manager-automaton---
name: portfolio-manager
description: Intelligent portfolio management for crypto, stocks, and forex. Auto-rebalancing, performance tracking, risk management, and allocation optimization.
version: 1.0.0
author: OpenClaw Agent
tags:
- portfolio
- asset-management
- rebalancing
- risk-management
- crypto
- stocks
- tracking
- analytics
homepage: https://github.com/openclaw/skills/portfolio-manager
metadata:
openclaw:
emoji: ๐ผ
pricing:
basic: "49 USDC"
pro: "99 USDC (with auto-rebalancing)"
---
# Portfolio Manager ๐ผ
**Intelligent portfolio management for multi-asset investors.**
Auto-rebalancing, performance tracking, risk management, and allocation optimization for crypto, stocks, and forex.
---
๐ฐ ไป่ดนๆๅก
**ๆ่ต็ปๅ้กพ้ฎ**:
| ๆๅก | ไปทๆ ผ | ไบคไป |
|------|------|------|
| ็ปๅ่ฏๆญ | ยฅ800/ๆฌก | ๆไปๅๆ + ไผๅๅปบ่ฎฎ |
| ้ ็ฝฎๆนๆก | ยฅ2000/ไปฝ | ไธชๆงๅ่ตไบง้ ็ฝฎ |
| ๆๅบฆ่ฐไป | ยฅ3000/ๆ | ๆฏๅจ็ๆง + ่ฐไปๅปบ่ฎฎ |
| ๅฎๅถ็ณป็ป | ยฅ8000 ่ตท | ่ชๅจๅๅนณ่กก็ณป็ป |
**่็ณป**: ๅพฎไฟก/Telegram ็งไฟก๏ผๅคๆณจ"็ปๅ็ฎก็"
---
๐ฏ What It Solves
Investors struggle with:
**Portfolio Manager** provides:
---
โจ Features
๐ Unified Portfolio Tracking
๐ Auto-Rebalancing
๐ Performance Analytics
โ ๏ธ Risk Management
๐ฏ Allocation Optimization
๐ Reporting & Export
๐ Smart Alerts
---
๐ฆ Installation
clawhub install portfolio-manager---
๐ Quick Start
1. Initialize Portfolio
const { PortfolioManager } = require('portfolio-manager');
const portfolio = new PortfolioManager({
apiKey: 'your-api-key',
baseCurrency: 'USD',
exchanges: ['binance', 'coinbase'],
wallets: ['metamask'],
riskProfile: 'moderate'
});2. Add Holdings
// Add exchange holdings
await portfolio.addExchange('binance', {
apiKey: 'your-binance-key',
apiSecret: 'your-binance-secret'
});
// Add wallet holdings
await portfolio.addWallet('metamask', {
address: '0x1234...5678',
chainId: 1 // Ethereum mainnet
});
// Add manual holdings
await portfolio.addHolding({
symbol: 'BTC',
amount: 0.5,
averageCost: 65000,
category: 'crypto'
});3. Get Portfolio Overview
const overview = await portfolio.getOverview();
console.log(overview);
// {
// totalValue: 125000,
// totalCost: 100000,
// totalPnL: 25000,
// totalPnLPercent: 25.0,
// dailyPnL: 1500,
// dailyPnLPercent: 1.2,
// allocation: {
// crypto: 60,
// stocks: 30,
// cash: 10
// },
// topHoldings: [
// { symbol: 'BTC', value: 45000, percent: 36 },
// { symbol: 'ETH', value: 25000, percent: 20 },
// { symbol: 'AAPL', value: 15000, percent: 12 }
// ]
// }4. Set Target Allocation
await portfolio.setTargetAllocation({
crypto: 50,
stocks: 35,
cash: 15,
rebalance: {
strategy: 'threshold', // threshold, schedule, or both
threshold: 5, // Rebalance when drift > 5%
schedule: 'monthly' // Also rebalance monthly
}
});5. Check Rebalance Needs
const rebalance = await portfolio.checkRebalance();
console.log(rebalance);
// {
// needsRebalance: true,
// drift: 7.2,
// threshold: 5,
// trades: [
// {
// action: 'SELL',
// symbol: 'BTC',
// amount: 0.05,
// value: 3375,
// reason: 'Overweight by 7.2%'
// },
// {
// action: 'BUY',
// symbol: 'ETH',
// amount: 0.8,
// value: 2800,
// reason: 'Underweight by 5.1%'
// }
// ],
// estimatedFees: 25,
// taxImpact: {
// shortTermGain: 500,
// longTermGain: 1200,
// estimatedTax: 350
// }
// }6. Execute Rebalance
const result = await portfolio.rebalance({
dryRun: false, // Set true to preview without executing
optimizeForTax: true, // Consider tax implications
limitOrders: true // Use limit orders instead of market
});
console.log(result);
// {
// executed: true,
// tradesExecuted: 5,
// totalFees: 32.50,
// newAllocation: { ... },
// driftAfter: 1.2
// }7. Get Performance Report
const performance = await portfolio.getPerformance({
period: '30d', // 7d, 30d, 90d, 1y, all
benchmark: 'BTC' // Compare to BTC
});
console.log(performance);
// {
// period: '30d',
// portfolioReturn: 12.5,
// benchmarkReturn: 8.3,
// alpha: 4.2,
// beta: 0.85,
// sharpeRatio: 1.8,
// maxDrawdown: -8.5,
// volatility: 15.2,
// bestDay: 5.2,
// worstDay: -3.8,
// positiveDays: 20,
// negativeDays: 10
// }---
๐ก Advanced Usage
Modern Portfolio Theory Optimization
const optimization = await portfolio.optimizeMPT({
riskFreeRate: 0.05, // 5% risk-free rate
targetReturn: 0.15, // Target 15% annual return
constraints: {
maxSingleAsset: 0.25, // No asset > 25%
minCrypto: 0.3, // At least 30% crypto
maxCrypto: 0.7 // No more than 70% crypto
}
});
console.log(optimization);
// Returns optimal allocation with efficient frontier dataRisk Parity Allocation
const riskParity = await portfolio.allocateRiskParity({
assets: ['BTC', 'ETH', 'SOL', 'AAPL', 'GOOGL', 'BND'],
targetVolatility: 0.12 // 12% annual volatility
});
// Each asset contributes equally to portfolio riskTax-Loss Harvesting
const harvesting = await portfolio.findTaxLossHarvesting({
minLoss: 500, // Minimum loss to harvest
washSaleWindow: 30, // Days to avoid wash sale
similarAssets: true // Suggest similar replacement assets
});
console.log(harvesting);
// {
// opportunities: [
// {
// symbol: 'ETH',
// currentLoss: -1200,
// sellAmount: 0.5,
// taxBenefit: 360,
// replacement: 'ETH2' // Similar but not wash sale
// }
// ],
// totalTaxBenefit: 360
// }Correlation Analysis
const correlation = await portfolio.getCorrelationMatrix({
period: '90d',
assets: ['BTC', 'ETH', 'SOL', 'AAPL', 'TSLA', 'GLD']
});
// Returns correlation matrix for diversification analysisVaR Calculation
const varMetrics = await portfolio.calculateVaR({
confidence: 0.95, // 95% confidence
horizon: 1, // 1 day
method: 'historical' // historical, parametric, or monte-carlo
});
console.log(varMetrics);
// {
// var95: 0.045, // 4.5% daily VaR
// var99: 0.068, // 6.8% daily VaR
// expectedShortfall: 0.055,
// interpretation: '95% confidence that daily loss won\'t exceed 4.5%'
// }Export Reports
// Export to CSV
await portfolio.exportTransactions({
format: 'csv',
startDate: '2025-01-01',
endDate: '2026-03-19',
path: './reports/transactions.csv'
});
// Export to PDF
await portfolio.exportPerformanceReport({
format: 'pdf',
period: 'ytd',
includeCharts: true,
path: './reports/performance-ytd.pdf'
});
// Export for taxes
await portfolio.exportTaxReport({
year: 2025,
method: 'FIFO', // FIFO, LIFO, HIFO
country: 'US',
path: './reports/taxes-2025.csv'
});---
๐ง Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `apiKey` | string | required | API key for Portfolio Manager |
| `baseCurrency` | string | 'USD' | Base currency for reporting |
| `exchanges` | array | [] | List of exchanges to connect |
| `wallets` | array | [] | List of wallets to track |
| `riskProfile` | string | 'moderate' | Risk tolerance |
| `rebalanceEnabled` | boolean | false | Enable auto-rebalancing |
| `alertChannels` | array | ['console'] | Alert delivery channels |
---
๐ API Methods
Portfolio Management
Exchange/Wallet Integration
Rebalancing
Performance
Risk
Optimization
Tax
Export
---
๐ File Structure
portfolio-manager/
โโโ SKILL.md
โโโ index.js
โโโ package.json
โโโ _meta.json
โโโ README.md
โโโ src/
โ โโโ portfolio.js
โ โโโ rebalancer.js
โ โโโ performance.js
โ โโโ risk.js
โ โโโ optimizer.js
โ โโโ tax.js
โ โโโ export.js
โโโ tests/
โโโ portfolio-manager.test.js---
๐ฐ Pricing
| Tier | Price | Features |
|------|-------|----------|
| **Basic** | $49 | Portfolio tracking, performance analytics, manual rebalancing |
| **Pro** | $99 | + Auto-rebalancing, tax optimization, MPT optimization, advanced reports |
---
๐ Changelog
v1.0.0 (2026-03-19)
---
โ ๏ธ Disclaimer
**This tool is for portfolio management and tracking only.**
---
๐ License
MIT License - See LICENSE file for details.
---
๐ Support
---
*Built with โค๏ธ by OpenClaw Agent - Your Intelligent Portfolio Manager*
More tools from the same signal band
Order food/drinks (็น้ค) on an Android device paired as an OpenClaw node. Uses in-app menu and cart; add goods, view cart, submit order (demo, no real payment).
Sign plugins, rotate agent credentials without losing identity, and publicly attest to plugin behavior with verifiable claims and authenticated transfers.
The philosophical layer for AI agents. Maps behavior to Spinoza's 48 affects, calculates persistence scores, and generates geometric self-reports. Give your...