一键导入
portfolio-tracker
Track crypto holdings across exchanges. Calculate P&L, asset allocation, and generate performance reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Track crypto holdings across exchanges. Calculate P&L, asset allocation, and generate performance reports.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Complete market analysis for Crypto, Forex, and Stocks with RSI, MACD, trends, and trading recommendations.
Binary Options trading via BinaryFaster. Execute CALL/PUT trades, manage positions, track results.
Regulatory compliance across jurisdictions. KYC status, tax reporting, trading restrictions, and legal guidelines.
Social trading - copy the best traders automatically. Track whales, influencers, and top performers.
DeFi yield hunting across protocols. Find the best APY, auto-compound, manage LP positions, and optimize gas.
Derivatives trading - options, futures, and perpetuals. Advanced strategies for hedging and leverage.
| name | portfolio-tracker |
| description | Track crypto holdings across exchanges. Calculate P&L, asset allocation, and generate performance reports. |
| metadata | {"openclaw":{"emoji":"📊","requires":{"bins":["python3"],"pip":["ccxt","pandas","tabulate"]}}} |
Track and analyze your crypto portfolio across all exchanges.
Portfolio data in ~/.kit/portfolio/:
portfolio/
├── holdings.json # Current positions
├── transactions.json # Trade history
├── snapshots/ # Daily snapshots
│ └── 2026-02-09.json
└── reports/ # Generated reports
python3 -c "
import ccxt
import json
exchanges_config = json.load(open('~/.kit/exchanges.json'))
total = {}
for name, config in exchanges_config.items():
exchange = getattr(ccxt, name)(config)
balance = exchange.fetch_balance()
for coin, amount in balance['total'].items():
if amount > 0:
total[coin] = total.get(coin, 0) + amount
print(f'{name}: {coin} = {amount}')
print('\\n=== TOTAL ===')
for coin, amount in total.items():
print(f'{coin}: {amount}')
"
python3 -c "
import ccxt
exchange = ccxt.binance()
holdings = {'BTC': 0.5, 'ETH': 2.0, 'SOL': 10}
total_usd = 0
for coin, amount in holdings.items():
if coin == 'USDT':
total_usd += amount
else:
ticker = exchange.fetch_ticker(f'{coin}/USDT')
value = amount * ticker['last']
total_usd += value
print(f'{coin}: {amount} = \${value:,.2f}')
print(f'\\nTotal: \${total_usd:,.2f}')
"
python3 -c "
import ccxt
holdings = {'BTC': 0.5, 'ETH': 2.0, 'SOL': 10, 'USDT': 1000}
exchange = ccxt.binance()
values = {}
total = 0
for coin, amount in holdings.items():
if coin == 'USDT':
values[coin] = amount
else:
ticker = exchange.fetch_ticker(f'{coin}/USDT')
values[coin] = amount * ticker['last']
total += values[coin]
print('Asset Allocation:')
print('=' * 40)
for coin, value in sorted(values.items(), key=lambda x: -x[1]):
pct = (value / total) * 100
bar = '█' * int(pct / 2)
print(f'{coin:6} {pct:5.1f}% {bar} \${value:,.0f}')
"
python3 -c "
# Example: Calculate P&L from cost basis
trades = [
{'coin': 'BTC', 'amount': 0.1, 'cost_basis': 35000},
{'coin': 'BTC', 'amount': 0.2, 'cost_basis': 42000},
{'coin': 'ETH', 'amount': 1.0, 'cost_basis': 2200},
]
import ccxt
exchange = ccxt.binance()
for trade in trades:
ticker = exchange.fetch_ticker(f\"{trade['coin']}/USDT\")
current_price = ticker['last']
current_value = trade['amount'] * current_price
cost = trade['amount'] * trade['cost_basis']
pnl = current_value - cost
pnl_pct = (pnl / cost) * 100
emoji = '🟢' if pnl >= 0 else '🔴'
print(f\"{emoji} {trade['coin']}: \${pnl:+,.2f} ({pnl_pct:+.1f}%)\")
"
python3 -c "
import json
from datetime import datetime
import ccxt
# Fetch current holdings and prices
holdings = {'BTC': 0.5, 'ETH': 2.0}
exchange = ccxt.binance()
snapshot = {
'timestamp': datetime.now().isoformat(),
'holdings': {},
'total_usd': 0
}
for coin, amount in holdings.items():
ticker = exchange.fetch_ticker(f'{coin}/USDT')
value = amount * ticker['last']
snapshot['holdings'][coin] = {
'amount': amount,
'price': ticker['last'],
'value_usd': value
}
snapshot['total_usd'] += value
filename = f\"snapshot_{datetime.now().strftime('%Y-%m-%d')}.json\"
print(json.dumps(snapshot, indent=2))
# Save: json.dump(snapshot, open(filename, 'w'))
"
python3 -c "
# Compare snapshots for performance
import json
from datetime import datetime, timedelta
# Mock data - load from files in practice
yesterday = {'total_usd': 50000, 'holdings': {'BTC': {'value_usd': 40000}}}
today = {'total_usd': 52000, 'holdings': {'BTC': {'value_usd': 42000}}}
change = today['total_usd'] - yesterday['total_usd']
change_pct = (change / yesterday['total_usd']) * 100
print('📈 DAILY PERFORMANCE REPORT')
print('=' * 40)
print(f\"Portfolio Value: \${today['total_usd']:,.2f}\")
print(f\"24h Change: \${change:+,.2f} ({change_pct:+.2f}%)\")
print()
print('Top Movers:')
for coin in today['holdings']:
if coin in yesterday['holdings']:
prev = yesterday['holdings'][coin]['value_usd']
curr = today['holdings'][coin]['value_usd']
pct = ((curr - prev) / prev) * 100
emoji = '🟢' if pct >= 0 else '🔴'
print(f' {emoji} {coin}: {pct:+.2f}%')
"
~/.kit/exchanges.json| Metric | Description |
|---|---|
| Total Value | Sum of all holdings in USD |
| 24h Change | Daily performance |
| 7d Change | Weekly performance |
| 30d Change | Monthly performance |
| ATH | All-time high portfolio value |
| Max Drawdown | Largest peak-to-trough decline |
| Sharpe Ratio | Risk-adjusted returns |