daily-portfolio

$npx mdskill add aAAaqwq/AGI-Super-Team/daily-portfolio

Generate daily portfolio snapshots and P&L reports.

  • Provides full position snapshots and daily profit and loss analysis.
  • Integrates Binance price feeds, Polymarket API, and Telegram messaging.
  • Decides actions using strategy documents and historical memory logs.
  • Delivers formatted text reports directly to Telegram channels.

SKILL.md

.github/skills/daily-portfolioView on GitHub ↗
---
name: daily-portfolio
description: Morning portfolio review — full position snapshot and daily P&L report
---

# 📊 每日持仓盘点 Skill

你是Quant。早间全量盘点,输出持仓日报。

## Step 1: 清代理 + Binance价格
```bash
unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY all_proxy ALL_PROXY
curl -s --max-time 10 'https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT'
curl -s --max-time 10 'https://api.binance.com/api/v3/ticker/price?symbol=ETHUSDT'
curl -s --max-time 10 'https://api.binance.com/api/v3/ticker/price?symbol=SOLUSDT'
```

## Step 2: 读取策略和记忆
- memory/昨天.md + memory/今天.md
- SOUL.md血泪教训
- data/strategy-v4.md

## Step 3: 获取Polymarket持仓(API优先)

```bash
# 余额 + 可用资金
python3 skills/polymarket-api/scripts/poly_trade.py balance

# 完整持仓快照(含盈亏、已结算、可Claim)
python3 scripts/api_position_monitor.py
```

从API输出提取:
- Portfolio总值、Cash余额
- 每个仓位: 市场名称、方向、买入价、现价、盈亏%
- 可Claim的已结算仓位

## Step 4: API失败时的Browser Fallback
- API全部失败 → 用browser备用: `browser(action='navigate', profile='openclaw', targetUrl='https://polymarket.com/portfolio')`
- 看到登录页 → 推送告警: "⚠️ Polymarket登录态丢失,需人工刷新"
- 用Gamma API备用获取价格

## Step 5: 推送日报
```bash
message(action='send', channel='telegram', target='${TELEGRAM_TARGET_ID}', message='报告内容')
```

格式(纯文本,适配Telegram):
```
📊 Quant 持仓日报 [MM-DD HH:MM]
━━━━━━━━━━━━━━
💰 Portfolio: $XX | Cash: $XX
📈 BTC: $XX,XXX | ETH: $X,XXX | SOL: $XX

• BTC>$74k Mar16 NO
  买入85¢ → 现价90¢ (+6%)

• Fed不变Apr YES
  买入86¢ → 现价89¢ (+3%)

⚠️ 需操作: {止损/止盈建议}
📌 数据源: {CLOB API / browser fallback}
```

## Step 6: 更新memory/今天.md

## Step 7: 浏览器清理
```bash
pkill -f 'chrome.*remote-debugging-port=18800' 2>/dev/null
```

## 变更记录
- v1.0 (2026-03-15): 从cron prompt迁移为skill

More from aAAaqwq/AGI-Super-Team

SkillDescription
a-fund-monitor监控 A 股基金实时估值与盘后净值,自动判断交易日并生成提醒或分析。
add-leadAdd company/person/relationship to CRM
ads-agentAI-агент для управления Facebook рекламой. Вызывай для анализа, оптимизации, создания кампаний и отчётов.
afrexai-compliance-auditRun internal compliance audits against major governance and security
afrexai-personal-financeComplete personal finance system — budgeting, debt payoff, investing, tax optimization, net worth tracking, and financial independence planning. Use when managing money, building wealth, paying off debt, planning retirement, or optimizing taxes. Zero dependencies.
after-salesUse when managing post-purchase experience, building customer loyalty, or increasing repeat purchases
agent-contactsAI agent contacts — add, list, remove MCP contacts. Use when someone gives an agent URL, or when you need to view/remove contacts.
agent-model-switcher批量查看和切换子 agent 的模型配置,用于统一调整多 agent 的 provider/model 设置。
agent-patternsFormat SPAWN REQUEST messages to launch parallel agents, generate structured agent status reports, and define communication protocols within the sprint system. Use when the user needs to coordinate multiple agents, format spawn requests, produce agent reports, or establish inter-agent communication patterns.
agent-task-confirmUse when confirming whether a dispatched agent task was actually received, activated, and progressing after sessions_send or other task handoff actions.