A-share fund NAV monitoring, supporting intraday real-time estimates and after-hours actual NAV, pushed to a Telegram private chat via OpenClaw cron.
Architecture
fund_monitor.py (纯 Python,无外部依赖)
├── estimate 模式 → fundgz.1234567.com.cn (盘中实时估值)
└── nav 模式 → api.fund.eastmoney.com/f10/lsjz (收盘净值)
OpenClaw cron (isolated agentTurn)
├── 09:30-19:00 → estimate 模式(收盘后先推估值,净值当晚才公布)
└── 19:00 之后 → nav 模式(收盘实际净值)
└── stdout → delivery announce → Telegram 私聊
Key path: skills/a-fund-monitor/scripts/(this repository)
Manual execution
# 盘中估值(控制台输出)
python3 scripts/fund_monitor.py estimate
# 收盘净值(控制台输出)
python3 scripts/fund_monitor.py nav
Cron scheduled task
OpenClaw cron, using the Asia/Shanghai time zone.
| Beijing time | Mode | Data source |
|---|---|---|
| 10:30 | Intraday estimate | fundgz API |
| 12:30 | Intraday estimate | Same as above |
| 14:30 | Intraday estimate | Same as above |
| 22:00 | Closing NAV | lsjz API (avoiding 20:30 when data is not yet published; QDII lags by 1 day) |
Merged into 1 cron job: 04a185b2-f8ae-454e-b454-bc1944ca5c00
Cron: 30 10,12,14,22 * * 1-5 (Asia/Shanghai)
Runtime: isolated agentTurn (changqing)
Model: minimax/MiniMax-M3 (fallback: deepseek/deepseek-v4-pro)
Timeout: 300s
Delivery: announce → telegram:8518085684 (Daniel 私聊)
v2.1.1 (2026-06-22) adjustment: 20:30 → 22:00. Most funds do not publish NAV until 21:00-22:30; the old time would fetch stale data from 4-5 days ago. At the same time, triple protection of "today filter + QDII tag + HTTP retry" is added.
Mode determination logic
北京时间 ∈ [09:30, 19:00) → estimate
北京时间 ∈ [19:00, 次日) → nav
Delivery target: telegram:8518085684(Daniel Li private chat), accountId changqing
Add/remove funds
Edit the fund_monitor.py in FUNDS list:
FUNDS = [
("003304", "前海开源核心资源A"),
# ... 添加 ("代码", "简称")
]
API reference
See references/eastmoney-api.md。
Change log
| Date | Version | Change |
|---|---|---|
| 2026-06-22 | v2.1.1 | 20:30 → 22:00 to avoid stale data; script upgraded to "today filter + QDII tag 🌏 + HTTP retry"; cron model changed to minimax primary (to avoid glm-5.1 rate limiting); timeout raised to 300s |
| 2026-05-25 | v2.1.0 | Merged 4 crons into 1 (comma-separated hours); migrated from Hermes to OpenClaw cron; push target changed to Daniel private chat (8518085684); timeout raised to 180s; before 19:00 use estimates to avoid stale data |
| 2026-05-22 | v2.0.0 | Initial Hermes cron version |
Pitfalls
- Timeout: 14 funds requested sequentially, the API is occasionally slow, cron timeout set to 180s.
- NAV change percentage field: The change percentage field of the East Money lsjz API is
JZZZL(NAV growth rate), notNAVCHGRT。 - Estimate API returns JSONP:
fundgz.1234567.com.cnreturnsjsonpgz({...});format, JSON needs to be extracted with a regex. - HTTP request headers: Both APIs require
Referer: https://fund.eastmoney.com/andUser-Agent, otherwise a 403 may occur. - NAV publication times are uneven: Most funds do not publish NAV until 21:00-22:30 (QDII lags by 1 day); the script has been upgraded to "today filter + QDII tag 🌏 + HTTP retry 2 times". Funds not yet published are shown as "⏳ Pending (last: date)" and are not mixed into the average.
- Early 20:30 trigger pitfall: Before v2.1.0, running nav at 20:30 would fetch stale data from 4-5 days ago (the script only took items[0] without filtering by date); it has been upgraded to today filtering.
- QDII fund estimate time: The estimate time of GF Nasdaq 100 Feeder is shown as 04:00 (US stock market close time), not A-share 15:00.
- Weekends/holidays:cron
1-5Only weekends are excluded; Chinese statutory holidays still trigger (producing data from the previous trading day).