@openfinclaw/findoo-datahub-plugin 2026.3.2 → 2026.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/DESIGN.md +492 -151
  2. package/_vendor/claude-skills-finance/SKILL.md +192 -0
  3. package/_vendor/claude-skills-finance/assets/dcf_analysis_template.md +184 -0
  4. package/_vendor/claude-skills-finance/assets/expected_output.json +161 -0
  5. package/_vendor/claude-skills-finance/assets/forecast_report_template.md +177 -0
  6. package/_vendor/claude-skills-finance/assets/sample_financial_data.json +219 -0
  7. package/_vendor/claude-skills-finance/assets/variance_report_template.md +122 -0
  8. package/_vendor/claude-skills-finance/references/financial-ratios-guide.md +396 -0
  9. package/_vendor/claude-skills-finance/references/forecasting-best-practices.md +294 -0
  10. package/_vendor/claude-skills-finance/references/valuation-methodology.md +255 -0
  11. package/_vendor/claude-skills-finance/scripts/budget_variance_analyzer.py +406 -0
  12. package/_vendor/claude-skills-finance/scripts/dcf_valuation.py +449 -0
  13. package/_vendor/claude-skills-finance/scripts/forecast_builder.py +494 -0
  14. package/_vendor/claude-skills-finance/scripts/ratio_calculator.py +432 -0
  15. package/index.ts +332 -14
  16. package/openclaw.plugin.json +2 -2
  17. package/package.json +1 -1
  18. package/references/cn-market-specifics.md +165 -0
  19. package/references/crypto-analysis.md +635 -0
  20. package/references/financial-ratios-cn.md +452 -0
  21. package/references/hk-market-specifics.md +166 -0
  22. package/references/macro-cycle-cn.md +409 -0
  23. package/references/valuation-cn.md +427 -0
  24. package/skills/README.md +294 -0
  25. package/skills/a-concept-cycle/skill.md +200 -0
  26. package/skills/a-convertible-arb/skill.md +294 -0
  27. package/skills/a-dividend-king/skill.md +187 -0
  28. package/skills/a-earnings-season/skill.md +221 -0
  29. package/skills/a-index-timer/skill.md +192 -0
  30. package/skills/a-ipo-new/skill.md +297 -0
  31. package/skills/a-northbound-decoder/skill.md +185 -0
  32. package/skills/a-quant-board/skill.md +286 -0
  33. package/skills/a-share/skill.md +347 -0
  34. package/skills/a-share-radar/skill.md +185 -0
  35. package/skills/cross-asset/skill.md +202 -0
  36. package/skills/crypto/skill.md +269 -0
  37. package/skills/crypto-altseason/skill.md +208 -0
  38. package/skills/crypto-btc-cycle/skill.md +231 -0
  39. package/skills/crypto-defi-yield/skill.md +181 -0
  40. package/skills/crypto-funding-arb/skill.md +158 -0
  41. package/skills/crypto-stablecoin-flow/skill.md +149 -0
  42. package/skills/data-query/skill.md +124 -30
  43. package/skills/derivatives/skill.md +188 -35
  44. package/skills/etf-fund/skill.md +216 -0
  45. package/skills/factor-screen/skill.md +186 -0
  46. package/skills/hk-china-internet/skill.md +190 -0
  47. package/skills/hk-dividend-harvest/skill.md +192 -0
  48. package/skills/hk-hsi-pulse/skill.md +154 -0
  49. package/skills/hk-southbound-alpha/skill.md +163 -0
  50. package/skills/hk-stock/skill.md +295 -0
  51. package/skills/macro/skill.md +244 -53
  52. package/skills/risk-monitor/skill.md +171 -0
  53. package/skills/us-dividend/skill.md +162 -0
  54. package/skills/us-earnings/skill.md +149 -0
  55. package/skills/us-equity/skill.md +235 -0
  56. package/skills/us-etf/skill.md +261 -0
  57. package/skills/us-sector-rotation/skill.md +223 -0
  58. package/src/config.ts +4 -5
  59. package/src/datahub-client.test.ts +4 -7
  60. package/src/datahub-client.ts +6 -1
  61. package/src/register-tools.ts +720 -0
  62. package/src/tool-helpers.ts +89 -0
  63. package/test/e2e/l3-gateway-bootstrap.live.test.ts +339 -0
  64. package/test/e2e/l4-skill-tool-chain.live.test.ts +465 -0
  65. package/skills/crypto-defi/skill.md +0 -69
  66. package/skills/equity/skill.md +0 -64
  67. package/skills/market-radar/skill.md +0 -47
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: fin-us-earnings
3
+ description: "US earnings season analysis — earnings calendar, historical beat/miss patterns, pre-earnings IV/straddle pricing, post-earnings price reaction stats, earnings surprise quantification. Use when: user asks about earnings dates, beat/miss history, earnings straddle, IV crush, or earnings season overview. NOT for: single-stock fundamentals/valuation (use fin-us-equity), A-share earnings (use fin-a-share), options Greeks lookup (use fin-derivatives), macro rates (use fin-macro)."
4
+ metadata: { "openclaw": { "emoji": "📅", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
5
+ ---
6
+
7
+ # US Earnings Season Analysis
8
+
9
+ Specialized in earnings **event-driven** analysis: calendar timing, beat/miss pattern recognition, pre-earnings options pricing, and post-earnings price reaction. Complements fin-us-equity's static fundamentals with temporal/event intelligence.
10
+
11
+ ## When to Use
12
+
13
+ - "AAPL 财报什么时候出" / "When does AAPL report earnings"
14
+ - "NVDA 上季度 beat 了吗" / "Did NVDA beat last quarter"
15
+ - "财报前期权怎么玩" / "Pre-earnings straddle strategy"
16
+ - "这个财报季整体情况如何" / "How is this earnings season going"
17
+ - "TSLA 历史上财报后涨还是跌" / "TSLA post-earnings price reaction history"
18
+ - "哪些大公司下周报财报" / "Which mega-caps report next week"
19
+ - "GOOGL earnings surprise 有多大" / "GOOGL earnings surprise magnitude"
20
+
21
+ ## When NOT to Use
22
+
23
+ - 个股基本面/估值/财务报表深度分析 (PE/PB/DCF) -> use `/fin-us-equity`
24
+ - A 股/港股财报分析 -> use `/fin-a-share` / `/fin-hk-stock`
25
+ - 纯期权 Greeks 查询 (非 earnings 相关) -> use `/fin-derivatives`
26
+ - 宏观利率/GDP/CPI -> use `/fin-macro`
27
+ - 股息/分红相关 -> use `/fin-us-dividend`
28
+ - 全市场雷达/涨跌幅排行 -> use `/fin-a-share-radar`
29
+
30
+ ## Tools & Parameters
31
+
32
+ ### fin_stock
33
+
34
+ | Parameter | Type | Required | Format | Default | Example |
35
+ | ---------- | ------ | -------- | --------------- | ------- | ---------- |
36
+ | symbol | string | Yes | US ticker | — | AAPL |
37
+ | endpoint | string | Yes | see table below | — | us/income |
38
+ | start_date | string | No | YYYY-MM-DD | — | 2025-01-01 |
39
+ | end_date | string | No | YYYY-MM-DD | — | 2026-03-07 |
40
+ | limit | number | No | 1-5000 | 200 | 20 |
41
+ | provider | string | No | yfinance | auto | yfinance |
42
+
43
+ #### Endpoints
44
+
45
+ | endpoint | Description | Example |
46
+ | ------------------------------- | ------------------------------ | ---------------------------------------------------------------------------- |
47
+ | `fundamental/earnings_forecast` | Analyst consensus EPS/Revenue | `fin_stock(symbol="AAPL", endpoint="fundamental/earnings_forecast")` |
48
+ | `us/income` | Actual GAAP EPS/Revenue | `fin_stock(symbol="AAPL", endpoint="us/income")` |
49
+ | `price/historical` | OHLCV for post-earnings moves | `fin_stock(symbol="AAPL", endpoint="price/historical", provider="yfinance")` |
50
+ | `fundamental/ratios` | Forward PE for re-rate context | `fin_stock(symbol="AAPL", endpoint="fundamental/ratios")` |
51
+ | `us/trade_cal` | US trading calendar | `fin_stock(endpoint="us/trade_cal")` |
52
+
53
+ ### fin_derivatives
54
+
55
+ | endpoint | Description | Example |
56
+ | ---------------- | -------------------------- | ----------------------------------------------------------- |
57
+ | `options/chains` | Option chain + IV + Greeks | `fin_derivatives(endpoint="options/chains", symbol="AAPL")` |
58
+
59
+ ### Auxiliary
60
+
61
+ | tool | endpoint | use case |
62
+ | -------------- | --------------- | ------------------------------- |
63
+ | `fin_currency` | `news/company` | Earnings-related news catalyst |
64
+ | `fin_ta` | `rsi`, `bbands` | Post-earnings technical context |
65
+
66
+ ## Earnings Season Calendar
67
+
68
+ **Quarterly cadence:** Jan (Q4 results), Apr (Q1), Jul (Q2), Oct (Q3).
69
+
70
+ **Reporting order:** Banks (week 2) -> Mega-cap tech (weeks 3-4) -> Mid/small-cap (weeks 4-6).
71
+
72
+ **Detection method:** When no dedicated earnings calendar API is available, use `fundamental/earnings_forecast` revision activity as a proxy — a spike in consensus revisions within 2-3 weeks signals an approaching report date.
73
+
74
+ ## Earnings Analysis Pattern
75
+
76
+ 1. **Consensus snapshot** `fin_stock(endpoint="fundamental/earnings_forecast", symbol="AAPL")` — Get analyst consensus EPS and Revenue estimates
77
+ - Record: consensus EPS, number of analysts, high/low range
78
+ - ⚠️ If analyst count < 5 -> small-cap coverage thin, consensus less reliable
79
+ - 💡 Wide high-low range (spread > 30% of consensus) -> high uncertainty, larger potential surprise
80
+
81
+ 2. **Historical beat/miss pattern** `fin_stock(endpoint="us/income", symbol="AAPL", limit=12)` — Pull last 8-12 quarters of actual EPS
82
+ - Compare each quarter's actual EPS vs that quarter's consensus (from step 1 historical data)
83
+ - Count consecutive beats/misses
84
+ - ⚠️ If 4+ consecutive beats -> market expects a beat, whisper number is 2-5% above consensus; a mere "inline" beat may trade like a miss
85
+ - ⚠️ If 2+ consecutive misses with downward revisions -> negative revision cycle, de-rate risk
86
+ - 💡 Cross-reference: beat magnitude trending smaller each Q -> "beat fatigue", re-rate ceiling forming
87
+
88
+ 3. **Pre-earnings IV & straddle pricing** `fin_derivatives(endpoint="options/chains", symbol="AAPL")` — Get ATM options near next expiry
89
+ - Calculate ATM straddle price = (ATM Call + ATM Put) / Stock Price = implied move %
90
+ - Get current IV and compare to 30-day historical IV -> IV percentile
91
+ - ⚠️ If IV percentile > 80th -> premium expensive, selling premium (short straddle/strangle) has edge IF expected move < implied move
92
+ - ⚠️ If IV percentile < 40th -> unusual for pre-earnings, possible complacency or low-vol name
93
+ - 💡 Compare implied move vs actual moves from last 4 earnings (step 2 price data): implied > average actual -> sell bias; implied < average actual -> buy bias
94
+
95
+ 4. **Post-earnings price reaction** `fin_stock(endpoint="price/historical", symbol="AAPL", limit=60, provider="yfinance")` — Analyze open-to-open moves on earnings days
96
+ - For each of last 8 earnings dates: Gap % = (Next-day Open - Prior Close) / Prior Close
97
+ - Build reaction table: Date | Actual EPS | Consensus | Beat/Miss | 1-day Move | 5-day Move
98
+ - ⚠️ If beat + price drops pattern (3 of last 4 Qs) -> "sell the news" regime, market pricing perfection
99
+ - ⚠️ If miss + price rises pattern -> market looking through to forward guidance
100
+ - 💡 Large gap (>5%) after earnings fills only ~40% within 30 days vs common gaps (~70% fill in 3 days)
101
+
102
+ 5. **Earnings surprise quantification**
103
+ - Surprise % = (Actual EPS - Consensus EPS) / |Consensus EPS| \* 100
104
+ - Revenue surprise % = (Actual Revenue - Consensus Revenue) / Consensus Revenue \* 100
105
+ - ⚠️ If EPS beat but Revenue miss -> cost-cutting driven, not sustainable growth
106
+ - ⚠️ If Revenue beat but EPS miss -> investment phase (bullish if margin trajectory intact)
107
+ - 💡 Cross-validate with step 4: large positive surprise + negative price reaction = high bar already embedded
108
+
109
+ 6. **Earnings season dashboard** (when user asks about overall season)
110
+ - Identify current season phase (early/mid/late) based on calendar
111
+ - Estimate sector-level beat rates from mega-cap bellwethers already reported
112
+ - 💡 If bank earnings (JPM/GS) set negative tone -> historically drags sentiment for 1-2 weeks
113
+ - 💡 If mega-cap tech all beat -> risk-on for rest of season, but concentration risk caveat
114
+
115
+ ## Data Notes
116
+
117
+ - **Earnings calendar**: No dedicated calendar API. Use `fundamental/earnings_forecast` revision spikes + seasonal pattern (Jan/Apr/Jul/Oct) as proxy. Mega-cap dates are well-known and can be stated.
118
+ - **US quotes**: yfinance, ~15min delay. Use `provider="yfinance"` for `price/historical`.
119
+ - **Consensus EPS**: `fundamental/earnings_forecast` (tushare). Small-cap (<$2B) may lack analyst coverage.
120
+ - **Options chains**: yfinance, ~15min delay. Greeks included (Delta/Gamma/Vega/Theta/IV).
121
+ - **Whisper numbers**: Not available via API. Approximate as consensus + 2-5% for mega-cap names with strong beat streaks.
122
+ - **Guidance**: Structured guidance data not available. Infer from `us/income` revenue trajectory and `earnings_forecast` revision direction.
123
+
124
+ ## Response Guidelines
125
+
126
+ ### Dollar Format
127
+
128
+ - EPS: $1.52 / -$0.08 (2 decimal places, always show sign for surprise)
129
+ - Revenue: $94.3B / $2.1B (use $B/$M shorthand)
130
+ - Stock price: $192.53 (2 decimal places)
131
+ - Surprise: +4.2% / -1.8% (always show +/- sign)
132
+ - IV: 45.2% (1 decimal place)
133
+ - Implied move: +/-3.8% (show as range)
134
+
135
+ ### Must Include
136
+
137
+ - Data cutoff date ("Data as of 2026-03-07")
138
+ - Consensus source note when citing EPS estimates
139
+ - Beat/miss streak count (e.g., "Beat 6 of last 8 quarters")
140
+ - Pre-earnings: days until report + market session (before/after market)
141
+ - Post-earnings: actual vs consensus + surprise % + price reaction
142
+
143
+ ### Display Format
144
+
145
+ - Single stock earnings deep-dive -> structured sections: Consensus | Beat/Miss History | IV Analysis | Price Reaction Table
146
+ - Beat/miss history -> table with columns: Quarter | Actual EPS | Consensus | Surprise % | 1-Day Move
147
+ - Earnings season overview -> sector-level summary table
148
+ - Pre-earnings options -> show implied move vs historical average move comparison
149
+ - Always end with actionable insight: "Based on patterns, key risk/opportunity is..."
@@ -0,0 +1,235 @@
1
+ ---
2
+ name: fin-us-equity
3
+ description: "US equity analysis — GAAP financials (us/income), earnings beat/miss with revision cycle, options strategy selection (IV/Greeks via options/chains), Fed rate sensitivity, sector rotation. Data via massive + yfinance. Use when: user mentions US tickers (AAPL/NVDA/TSLA/MSFT), asks about US earnings, options strategies, or Fed impact on equities. NOT for: A-shares (use fin-a-share), HK stocks (use fin-hk-stock), crypto (use fin-crypto), US macro rates only (use fin-macro), US index options (use fin-derivatives)."
4
+ metadata: { "openclaw": { "emoji": "🇺🇸", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
5
+ ---
6
+
7
+ # US Equity Analysis
8
+
9
+ Use **fin_stock**, **fin_derivatives**, and auxiliary tools for US equity analysis. All data routes through DataHub.
10
+
11
+ ## Symbol Format
12
+
13
+ US tickers: `AAPL`, `NVDA`, `TSLA`, `MSFT` (no suffix, no exchange code)
14
+
15
+ ## Available Endpoints (US)
16
+
17
+ ### fin_stock (12 endpoints)
18
+
19
+ | endpoint | data | use case |
20
+ | ------------------------------- | -------------------------- | ---------------------------------------- |
21
+ | `price/historical` | OHLCV | price trend, technical overlay |
22
+ | `us/income` | US GAAP income statement | revenue/EPS/margin, quarterly comparison |
23
+ | `fundamental/ratios` | PE/PB/ROE/margins | valuation snapshot, sector comparison |
24
+ | `fundamental/metrics` | EV/EBITDA | cross-method valuation, comps |
25
+ | `fundamental/earnings_forecast` | analyst consensus EPS | PEG calc, earnings surprise detection |
26
+ | `fundamental/dividends` | dividend history | DDM input, yield analysis |
27
+ | `profile` | company overview | sector, description, market cap |
28
+ | `discovery/gainers` | top US gainers (no symbol) | market scan |
29
+ | `discovery/losers` | top US losers (no symbol) | market scan |
30
+ | `us/adj_factor` | 复权因子 | 长期回测价格调整 |
31
+ | `us/trade_cal` | 美股交易日历 | 财报季/节假日自动化 |
32
+ | `historical_splits` | 拆股历史 | 长期回测需要拆股调整 |
33
+
34
+ ### fin_derivatives (US Options)
35
+
36
+ | endpoint | data | use case |
37
+ | ---------------- | ---------------------------------------------------------- | ------------------------------- |
38
+ | `options/chains` | full option chain with Greeks (Delta/Gamma/Vega/Theta, IV) | strategy selection, IV analysis |
39
+
40
+ ### Auxiliary Tools
41
+
42
+ | tool | endpoint | use case |
43
+ | ----------------- | ------------------------------------- | -------------------------------- |
44
+ | `fin_macro` | `treasury_us` | 10Y yield for DCF risk-free rate |
45
+ | `fin_macro` | `libor` | USD rate reference |
46
+ | `fin_macro` | `news/company` | company news for US tickers |
47
+ | `fin_ta` | `sma`, `ema`, `rsi`, `macd`, `bbands` | technical overlay |
48
+ | `fin_data_ohlcv` | `symbol=AAPL, market=equity` | OHLCV time series |
49
+ | `fin_data_regime` | `symbol=AAPL, market=equity` | bull/bear/sideways regime |
50
+
51
+ **预计算技术因子:** `fin_stock(fundamental/stock_factor)` → MACD/KDJ/RSI/BOLL/CCI 预计算值(tushare 美股覆盖),可替代逐个 fin_ta 调用。
52
+
53
+ ## Data Sources
54
+
55
+ | Provider | Coverage | Notes |
56
+ | -------- | ------------------------------ | ------------------ |
57
+ | massive | OHLCV + fundamentals | needs API key |
58
+ | yfinance | price + fundamentals + options | free, ~15min delay |
59
+
60
+ > **⚠️ US 股票 Provider 注意事项:**
61
+ >
62
+ > - `price/historical` 默认 tushare provider,对 US 股票返回 500;**必须添加 `provider="yfinance"`**
63
+ > - `fundamental/ratios` 仅 tushare provider 可用,对 US 股票返回 204;改用 `fundamental/metrics` (massive) 或 `us/income` 手动计算
64
+ > - `fundamental/balance` 路径正确(非 `us/balance`),需确认 provider 支持
65
+
66
+ ## Analysis Patterns
67
+
68
+ ### Earnings Analysis Tree (US Core)
69
+
70
+ ```
71
+ Step 1: fin_stock(endpoint="fundamental/earnings_forecast", symbol="AAPL") -> consensus EPS
72
+ Step 2: fin_stock(endpoint="us/income", symbol="AAPL") -> actual EPS/revenue
73
+ |-- Beat + guidance raised -> "beat and raise" -> positive revision cycle -> re-rate
74
+ |-- Beat + guidance cut -> "beat and lower" -> mixed -> watch next Q
75
+ |-- Miss + guidance raised -> market forgives -> potential opportunity
76
+ +-- Miss + guidance cut -> negative revision cycle -> valuation compression
77
+ Step 3: fin_stock(endpoint="price/historical", symbol="AAPL") -> post-earnings price reaction
78
+ |-- Beat + price drops -> "sell the news" / priced-in / whisper number was higher
79
+ +-- Miss + price rises -> market looks through to forward guidance
80
+ ```
81
+
82
+ **Revision cycle:** 3+ consecutive beats with upward revisions -> re-rate; 2+ misses with downward revisions -> de-rate. Track via `earnings_forecast` consensus changes QoQ.
83
+
84
+ 注意: `estimates/consensus` 通过 yfinance 获取,存在频率限制 (rate limit),高频调用可能 429。备选: `fundamental/earnings_forecast` (tushare, 无限流)。
85
+
86
+ **Whisper number:** Buy-side "whisper" is typically 2-5% above consensus. A <2% beat on high-expectations names often trades like a miss.
87
+
88
+ **Earnings season:** Jan (Q4), Apr (Q1), Jul (Q2), Oct (Q3). Banks (week 2) -> mega-cap tech (week 3-4) -> mid/small-cap (weeks 4-6). Consensus revision spike in `earnings_forecast` = approaching report.
89
+
90
+ ### Options Strategy Selector (US Only)
91
+
92
+ `fin_derivatives(endpoint="options/chains", symbol="AAPL")` -> ATM IV, Greeks, expiry chain. Rank IV against historical percentile:
93
+
94
+ | IV Level | Bullish | Bearish | Neutral |
95
+ | ------------- | -------------------------- | --------------------- | -------------- |
96
+ | Low (<30th) | Buy Call / Bull Spread | Buy Put | Long Straddle |
97
+ | Mid (30-70th) | Bull Call Spread | Bear Put Spread | Iron Condor |
98
+ | High (>70th) | Sell Put / Bull Put Spread | Sell Call / Bear Call | Short Strangle |
99
+
100
+ **Earnings straddle:** Pre-earnings IV = 1.5-3x normal. Expected move = ATM straddle / stock price. Compare to last 4 Qs actual moves (`price/historical` open-to-open). Expected > avg -> sell bias; < avg -> buy bias. IV crush collapses 40-60%. Entry: 5-7 days before; exit: at announcement.
101
+
102
+ ### Fed Rate Sensitivity (US Only)
103
+
104
+ ```
105
+ fin_macro(endpoint="treasury_us") -> 10Y yield; fin_stock(endpoint="fundamental/ratios") -> PE
106
+ |-- Rate rising + high PE -> rotate to value | Rate falling + low PE -> growth rebounds
107
+ +-- Rate stable -> fundamentals-driven stock picking
108
+ ```
109
+
110
+ **Rate chain:** Fed funds -> 2Y -> 10Y -> ERP -> PE compression/expansion. Duration: tech (high), financials (inverse), utilities (high), energy (low).
111
+
112
+ | Phase | Favored | Avoid | Signal |
113
+ | ---------------- | -------------------------- | ------------------------ | ----------------------------- |
114
+ | Early easing | Tech, Cons Disc, RE | Energy, Materials | 10Y falling, curve steepening |
115
+ | Late easing | Mega-cap growth, Small-cap | Utilities, Staples | 10Y bottoming, spreads tight |
116
+ | Early tightening | Financials, Energy | Long-duration, REITs | 10Y rising, curve flattening |
117
+ | Late tightening | Staples, Healthcare, Utils | Cyclicals, high-leverage | 10Y peaking, curve inverting |
118
+
119
+ ### US Valuation (DCF)
120
+
121
+ ```
122
+ Step 1: fin_macro(endpoint="treasury_us") -> Rf (10Y yield)
123
+ Step 2: WACC = Rf + Beta * ERP(4-6%) + spread; Terminal growth = 2-3% (US GDP proxy)
124
+ Step 3: fin_stock(endpoint="fundamental/metrics") -> EV/EBITDA comps cross-check
125
+ ```
126
+
127
+ ### Technical + Regime
128
+
129
+ ```
130
+ Step 1: fin_data_ohlcv(symbol="AAPL", market="equity") -> OHLCV
131
+ Step 2: fin_ta(indicator="sma/rsi/macd/bbands") -> overlay
132
+ Step 3: fin_data_regime(symbol="AAPL", market="equity")
133
+ |-- Bull + RSI<40 -> pullback buy | Bear + RSI>70 -> rally sell
134
+ +-- Sideways + BBands squeeze -> breakout imminent
135
+ ```
136
+
137
+ ## US-Specific Patterns
138
+
139
+ ### Magnificent 7 / Mega-Cap Concentration
140
+
141
+ Mag7 (AAPL, MSFT, NVDA, GOOG, AMZN, META, TSLA) = 25-35% of S&P 500 weight.
142
+
143
+ ```
144
+ Step 1: For each Mag7: fin_stock(endpoint="fundamental/metrics") -> market cap, FCF
145
+ fin_stock(endpoint="fundamental/ratios") -> PE; fin_stock(endpoint="us/income") -> revenue growth
146
+ Step 2: fin_data_ohlcv(market="equity") -> price perf; compare vs fin_index(endpoint="global_index") SPX
147
+ |-- Mag7 outperforming + breadth narrowing -> concentration risk -> hedging warranted
148
+ |-- Mag7 lagging + breadth expanding -> healthy rotation -> equal-weight favored
149
+ +-- Mag7 diverging -> stock-pick within group via earnings/growth differential
150
+ ```
151
+
152
+ **Key Mag7 metrics:** Forward PE (`earnings_forecast`), revenue growth (`us/income` sequential Qs), FCF yield (`fundamental/metrics`). NVDA at 2-3x group PE justified only if AI growth sustains 40%+ YoY.
153
+
154
+ ### Dividend Aristocrats
155
+
156
+ ```
157
+ Step 1: fin_stock(endpoint="fundamental/dividends", symbol="JNJ") -> dividend history
158
+ Step 2: Count consecutive years of dividend growth (annual totals YoY)
159
+ |-- 25+ years -> Aristocrat | 10-24 -> Achiever | <10 or any cut -> not qualified
160
+ Step 3: fin_stock(endpoint="fundamental/ratios", symbol="JNJ") -> payout ratio, ROE
161
+ |-- Payout < 60% + ROE > 15% -> sustainable | 60-80% -> watch | >80% -> at risk
162
+ Step 4: Yield vs 10Y Treasury (fin_macro endpoint="treasury_us")
163
+ |-- Spread > 1.5% -> attractive income | Spread < 0% -> bonds win
164
+ ```
165
+
166
+ Classic sectors: Industrials (MMM, CAT), Healthcare (JNJ, ABT), Staples (PG, KO, PEP).
167
+
168
+ ### Revenue Quality — SaaS (Rule of 40)
169
+
170
+ ```
171
+ Step 1: fin_stock(endpoint="us/income", symbol="CRM") -> last 8 quarterly revenues
172
+ Step 2: Revenue growth % = (Q_latest / Q_year_ago - 1) * 100
173
+ Gross margin = gross profit / revenue; Op margin = op income / revenue
174
+ Rule of 40 = Revenue growth % + Op margin %
175
+ |-- >40% -> elite SaaS (premium PE) | 25-40% -> solid | <25% -> problem
176
+ Step 3: QoQ revenue acceleration across 4 quarters
177
+ |-- Accelerating + margin expanding -> strongest signal
178
+ +-- Decelerating + margin compressing -> re-rate risk
179
+ ```
180
+
181
+ ### Total Shareholder Yield (Dividend + Buyback)
182
+
183
+ S&P 500: ~$1T buybacks vs ~$600B dividends annually. Mega-cap tech: buyback yield 3-5%, dividend <1%.
184
+
185
+ ```
186
+ fin_stock(endpoint="fundamental/dividends") -> div/share
187
+ fin_stock(endpoint="fundamental/metrics") -> market cap, FCF
188
+ Buyback yield = (FCF - Dividends) / Mkt cap; Total yield = Div yield + Buyback yield
189
+ |-- >5% -> aggressive (AAPL/META) | 2-5% -> moderate | <2% -> growth reinvestor
190
+ ```
191
+
192
+ ### Pre/Post-Market Gap Analysis
193
+
194
+ ```
195
+ Step 1: fin_stock(endpoint="price/historical", symbol="TSLA") -> multi-day OHLCV
196
+ Step 2: Gap % = (Open - prior Close) / prior Close * 100
197
+ |-- >3% + vol >2x -> breakaway | >3% + normal vol -> exhaustion | <-3% + vol >2x -> breakdown
198
+ +-- 0.5-3% -> common gap (fills ~70% in 3 days); earnings gaps >5% fill only ~40% in 30 days
199
+ ```
200
+
201
+ ### Short Squeeze & Institutional Proxies
202
+
203
+ No short interest / 13F — use price + volume signatures.
204
+
205
+ ```
206
+ Squeeze: fin_data_ohlcv + fin_ta(rsi) -> price >10%/day + vol >5x avg + RSI <30->70 in 5 days
207
+ + fundamental/metrics -> small/mid (<$10B) = high squeeze prob; large = news-driven
208
+ Institutional: price/historical vol >3x avg + news/company no catalyst = stealth accumulation
209
+ + fin_data_regime bear->bull + vol spike = institutional re-entry
210
+ ```
211
+
212
+ ## DataHub Gaps (US)
213
+
214
+ | Missing | Workaround |
215
+ | ----------------- | ------------------------------------------------------------------------------------------------- |
216
+ | Earnings calendar | `earnings_forecast` revision spikes signal approaching report + season calendar (Jan/Apr/Jul/Oct) |
217
+ | 13F holdings | `price/historical` vol >2x avg without news = institutional flow proxy |
218
+ | Short interest | Price >10%/day + vol >5x avg + RSI whipsaw = squeeze proxy (see pattern above) |
219
+ | Sector ETF flows | `discovery/gainers`+`losers` sector clustering + `fundamental/ratios` PE expansion |
220
+ | Real-time quotes | `fin_data_ohlcv` (~15min delay); caveat to user for time-sensitive analysis |
221
+ | Intraday OHLCV | Daily only; gap analysis (open vs prior close) as partial substitute |
222
+
223
+ ## Data Boundaries
224
+
225
+ | Data | Frequency | Notes |
226
+ | ------------------ | ------------ | ------------------------------------------------------------------ |
227
+ | US quotes | ~15min delay | yfinance |
228
+ | US GAAP financials | quarterly | 10-Q (45d), 10-K (60d) |
229
+ | Earnings forecast | consensus | small-cap may lack coverage; mega-cap (20+ analysts) most reliable |
230
+ | Options chains | ~15min delay | full Greeks (Delta/Gamma/Vega/Theta/IV) |
231
+ | Dividends | historical | ex-date + amount |
232
+ | Company news | event-driven | `news/company`; may lag real-time by minutes-hours |
233
+ | US 复权因子 | Daily | tushare `us/adj_factor` (11397 records) |
234
+ | US 交易日历 | — | tushare `us/trade_cal` (预生成至 2026-12-31) |
235
+ | 拆股历史 | event-driven | `fundamental/historical_splits` (e.g. AAPL 3 records) |
@@ -0,0 +1,261 @@
1
+ ---
2
+ name: fin-us-etf
3
+ description: "US ETF analysis — SPY/QQQ/VOO/VTI/SCHD comparison, expense ratio + AUM + tracking error framework, core-satellite portfolio construction, sector ETF rotation (XLK/XLF/XLE), DCA simulation. Use when: user asks about US ETF selection, passive investing, ETF comparison, sector ETFs, or ETF portfolio allocation. NOT for: A-share ETFs/funds (use fin-etf-fund), individual US stocks (use fin-us-equity), crypto (use fin-crypto), macro rates (use fin-macro)."
4
+ metadata: { "openclaw": { "emoji": "🏦", "requires": { "extensions": ["findoo-datahub-plugin"] } } }
5
+ ---
6
+
7
+ # US ETF Analysis
8
+
9
+ US ETFs = the safest entry point for retail investors into US equities. Compare, construct portfolios, and simulate DCA returns.
10
+
11
+ > **Scope boundary:** This skill covers US-listed ETFs (SPY, QQQ, VOO, etc.). For A-share ETFs (510300.SH) and mainland funds, use `/fin-etf-fund`. For individual US stocks, use `/fin-us-equity`.
12
+
13
+ ## When to Use
14
+
15
+ - "SPY 和 VOO 哪个好" / "SPY vs VOO comparison"
16
+ - "科技 ETF 有哪些" / "What tech ETFs are available"
17
+ - "怎么配置 ETF 组合" / "How to build an ETF portfolio"
18
+ - "QQQ 今年表现怎么样" / "QQQ performance this year"
19
+ - "定投 VOO 30 年能赚多少" / "DCA into VOO for 30 years"
20
+ - "SCHD 和 VYM 哪个分红更好" / "SCHD vs VYM dividend comparison"
21
+ - "行业 ETF 现在买什么" / "Which sector ETF to buy now"
22
+
23
+ ## When NOT to Use
24
+
25
+ - A 股 ETF / 场内基金 (510300.SH, 159919.SZ) -> use `/fin-etf-fund`
26
+ - 场外基金 / 基金经理分析 -> use `/fin-etf-fund`
27
+ - US 个股深度分析 (AAPL, NVDA) -> use `/fin-us-equity`
28
+ - 加密货币 / DeFi -> use `/fin-crypto`
29
+ - 宏观利率 / 国债收益率 -> use `/fin-macro`
30
+ - US options/derivatives -> use `/fin-us-equity` (options section)
31
+
32
+ ## Tools & Parameters
33
+
34
+ ### fin_stock (ETF price + fundamentals)
35
+
36
+ | Parameter | Type | Required | Format | Default | Example |
37
+ | --------- | ------ | -------- | --------- | ------- | ---------------- |
38
+ | symbol | string | Yes | US ticker | — | SPY |
39
+ | endpoint | string | Yes | see below | — | price/historical |
40
+ | provider | string | No | yfinance | auto | yfinance |
41
+ | limit | number | No | 1-5000 | 200 | 250 |
42
+
43
+ > **Important:** For US ETFs, always use `provider="yfinance"` with `price/historical`. Default tushare provider returns 500 for US symbols.
44
+
45
+ #### Endpoints for ETFs
46
+
47
+ | endpoint | Description | Example |
48
+ | ----------------------- | ------------------------ | --------------------------------------------------------------------------- |
49
+ | `price/historical` | ETF OHLCV price history | `fin_stock(symbol="SPY", endpoint="price/historical", provider="yfinance")` |
50
+ | `fundamental/dividends` | ETF dividend history | `fin_stock(symbol="SPY", endpoint="fundamental/dividends")` |
51
+ | `fundamental/ratios` | Basic ratios (yield) | `fin_stock(symbol="SPY", endpoint="fundamental/ratios")` |
52
+ | `fundamental/metrics` | Key metrics (market cap) | `fin_stock(symbol="SPY", endpoint="fundamental/metrics")` |
53
+ | `profile` | ETF description + sector | `fin_stock(symbol="SPY", endpoint="profile")` |
54
+
55
+ ### fin_index (for benchmark comparison)
56
+
57
+ | endpoint | Description | Example |
58
+ | -------------- | ------------------------- | -------------------------------------------------------- |
59
+ | `constituents` | Index constituents | `fin_index(endpoint="constituents", symbol="000300.SH")` |
60
+ | `daily_basic` | Index valuation (A-share) | N/A for US — use `price/historical` on index ETF instead |
61
+
62
+ ### fin_data_ohlcv (K-line data)
63
+
64
+ | Parameter | Type | Required | Default | Example |
65
+ | --------- | ------ | -------- | ------- | ------- |
66
+ | symbol | string | Yes | — | SPY |
67
+ | market | string | No | equity | equity |
68
+ | timeframe | string | No | 1d | 1w |
69
+ | limit | number | No | 200 | 250 |
70
+
71
+ ### Auxiliary Tools
72
+
73
+ | tool | use case |
74
+ | ----------------- | ----------------------------------- |
75
+ | `fin_macro` | `treasury_us` for risk-free rate |
76
+ | `fin_ta` | RSI/SMA/MACD for timing |
77
+ | `fin_data_regime` | Market regime for allocation adjust |
78
+
79
+ ## US ETF Knowledge Base
80
+
81
+ > DataHub cannot directly query expense ratio, AUM, or tracking error. The following reference data enables analysis.
82
+
83
+ ### Core Broad Market ETFs
84
+
85
+ | Ticker | Index | Expense Ratio | AUM ($B) | Style |
86
+ | ------ | --------------- | ------------- | -------- | ------------ |
87
+ | SPY | S&P 500 | 0.09% | ~550 | Large Cap |
88
+ | VOO | S&P 500 | 0.03% | ~450 | Large Cap |
89
+ | IVV | S&P 500 | 0.03% | ~500 | Large Cap |
90
+ | VTI | Total US Market | 0.03% | ~400 | Total Market |
91
+ | QQQ | Nasdaq 100 | 0.20% | ~280 | Large Growth |
92
+ | QQQM | Nasdaq 100 | 0.15% | ~30 | Large Growth |
93
+ | IWM | Russell 2000 | 0.19% | ~70 | Small Cap |
94
+ | DIA | Dow Jones 30 | 0.16% | ~35 | Large Value |
95
+ | RSP | S&P 500 EW | 0.20% | ~50 | Equal Weight |
96
+
97
+ ### Dividend/Income ETFs
98
+
99
+ | Ticker | Focus | Expense Ratio | Yield | Style |
100
+ | ------ | ------------------- | ------------- | ----- | ----------- |
101
+ | SCHD | Dividend Growth | 0.06% | ~3.5% | Quality Div |
102
+ | VYM | High Dividend Yield | 0.06% | ~3.0% | High Yield |
103
+ | DVY | Select Dividend | 0.38% | ~3.8% | High Yield |
104
+ | DGRO | Dividend Growth | 0.08% | ~2.3% | Growth Div |
105
+ | HDV | High Dividend | 0.08% | ~3.5% | Defensive |
106
+
107
+ ### Sector ETFs (SPDR Select Sector)
108
+
109
+ | Ticker | Sector | Expense Ratio | Economic Cycle Phase |
110
+ | ------ | ---------------- | ------------- | -------------------- |
111
+ | XLK | Technology | 0.09% | Early/Late Expansion |
112
+ | XLF | Financials | 0.09% | Early Recovery |
113
+ | XLE | Energy | 0.09% | Late Cycle/Inflation |
114
+ | XLV | Healthcare | 0.09% | Defensive/Late Cycle |
115
+ | XLU | Utilities | 0.09% | Recession/Defensive |
116
+ | XLI | Industrials | 0.09% | Early Recovery |
117
+ | XLB | Materials | 0.09% | Mid Cycle/Inflation |
118
+ | XLP | Consumer Staples | 0.09% | Recession/Defensive |
119
+ | XLY | Consumer Disc | 0.09% | Early Recovery |
120
+ | XLRE | Real Estate | 0.09% | Rate Sensitive |
121
+ | XLC | Communication | 0.09% | Growth-oriented |
122
+
123
+ ### Factor ETFs
124
+
125
+ | Ticker | Factor | Expense Ratio | Use Case |
126
+ | ------ | --------- | ------------- | --------------------------- |
127
+ | MTUM | Momentum | 0.15% | Trend following |
128
+ | QUAL | Quality | 0.15% | Defensive growth |
129
+ | VLUE | Value | 0.15% | Mean reversion / contrarian |
130
+ | SIZE | Small Cap | 0.15% | Small cap premium |
131
+ | USMV | Min Vol | 0.15% | Low volatility |
132
+
133
+ ### Bond ETFs (for portfolio construction)
134
+
135
+ | Ticker | Focus | Expense Ratio | Duration | Use Case |
136
+ | ------ | ----------------- | ------------- | -------- | ----------------- |
137
+ | AGG | US Aggregate Bond | 0.03% | ~6yr | Core bond holding |
138
+ | BND | Total Bond Market | 0.03% | ~6yr | Core bond holding |
139
+ | TLT | 20+ Year Treasury | 0.15% | ~17yr | Rate bet / hedge |
140
+ | SHV | Short Treasury | 0.15% | <1yr | Cash equivalent |
141
+ | TIP | TIPS | 0.19% | ~7yr | Inflation hedge |
142
+
143
+ ## ETF Comparison Analysis Pattern
144
+
145
+ 1. **Price Performance** `fin_stock(endpoint="price/historical", symbol="SPY", provider="yfinance", limit=250)` — YTD + 1Y price comparison
146
+ - Pull historical prices for each ETF being compared
147
+ - Calculate: YTD return, 1Y return, 3Y annualized, max drawdown
148
+ - ⚠️ If comparing SPY vs VOO, note they track the same index — difference is mainly expense ratio and liquidity
149
+ - 💡 For fair comparison, use total return (price + dividends reinvested) — approximate by adding annual dividend yield
150
+
151
+ 2. **Dividend Analysis** `fin_stock(endpoint="fundamental/dividends", symbol="SCHD")` — Yield + growth
152
+ - Compare: current yield, 5-year dividend CAGR, payout consistency
153
+ - ⚠️ High yield (>5%) in equity ETFs may indicate value trap constituents
154
+ - 💡 Dividend growth rate matters more than current yield for long-term compounding
155
+
156
+ 3. **Risk Metrics** — Calculate from price history
157
+ - Annualized volatility = stdev(daily returns) \* sqrt(252)
158
+ - Sharpe ratio = (annualized return - risk-free rate) / annualized volatility
159
+ - Max drawdown = largest peak-to-trough decline
160
+ - Use `fin_macro(endpoint="treasury_us")` for risk-free rate
161
+ - ⚠️ Sharpe < 0.5 = poor risk-adjusted return; > 1.0 = excellent
162
+ - 💡 Compare Sharpe across ETFs rather than raw returns for quality assessment
163
+
164
+ 4. **Cost Analysis** — Reference knowledge base above
165
+ - Expense ratio difference impact: $100K invested, 0.06% difference = $60/year, ~$3,000 over 30 years (compounded)
166
+ - ⚠️ For identical-index ETFs (SPY/VOO/IVV), always recommend lowest expense ratio unless liquidity requirements differ
167
+
168
+ ## Portfolio Construction Patterns
169
+
170
+ ### Core-Satellite Strategy
171
+
172
+ | Component | Weight | ETF Selection | Criteria |
173
+ | --------- | ------ | -------------------- | --------------------------------- |
174
+ | Core | 60-70% | VOO or VTI | Lowest cost broad market exposure |
175
+ | Satellite | 20-30% | Sector/thematic ETFs | Momentum + conviction-based |
176
+ | Income | 0-15% | SCHD or AGG | Dividend income or bond ballast |
177
+
178
+ ### Classic Portfolio Templates
179
+
180
+ | Portfolio | Allocation | Risk Level | Best For |
181
+ | --------------- | ------------------------------------- | ---------- | ----------------- |
182
+ | US 60/40 | 60% VOO + 40% AGG | Moderate | Conservative |
183
+ | All-Weather | 30% VTI + 40% TLT + 15% TIP + 15% GLD | Low-Med | All conditions |
184
+ | Growth | 50% QQQ + 30% VOO + 20% IWM | High | Long-term growth |
185
+ | Dividend Income | 40% SCHD + 30% VYM + 30% AGG | Low-Med | Income generation |
186
+ | Lazy 3-Fund | 60% VTI + 30% VXUS + 10% BND | Moderate | Set-and-forget |
187
+
188
+ ### DCA Simulation Pattern
189
+
190
+ ```
191
+ Input: monthly_amount, etf_symbol, years
192
+ Step 1: fin_stock(price/historical, limit=years*250) -> daily prices
193
+ Step 2: For each month, calculate shares_bought = monthly_amount / price_on_date
194
+ Step 3: Total shares * current price = current value
195
+ Step 4: Total invested = monthly_amount * months
196
+ Step 5: Return = (current_value - total_invested) / total_invested
197
+ ```
198
+
199
+ Historical DCA benchmarks (for context, not prediction):
200
+
201
+ - SPY 10-year DCA: ~10-12% annualized (2015-2025)
202
+ - QQQ 10-year DCA: ~15-18% annualized (2015-2025)
203
+ - SCHD 10-year DCA: ~9-11% annualized (2015-2025)
204
+
205
+ ### Sector ETF Rotation Pattern
206
+
207
+ 1. **Sector Scoreboard** — Pull price/historical for all 11 sector ETFs (XLK through XLC)
208
+ - Calculate: 1W, 1M, 3M relative returns vs SPY
209
+ - Rank by momentum (3M relative return)
210
+ - ⚠️ Sector leading for > 6 months with decelerating momentum = potential mean reversion
211
+ - 💡 Cross-validate with `fin_data_regime` — defensive sectors (XLU/XLP/XLV) outperform in bear/volatile regimes
212
+
213
+ 2. **Economic Cycle Mapping** — Use `fin_macro(endpoint="treasury_us")` for yield curve context
214
+ - Early recovery: XLF, XLY, XLI (rate-sensitive, cyclical)
215
+ - Mid cycle: XLK, XLC (growth acceleration)
216
+ - Late cycle: XLE, XLB (commodity/inflation beneficiaries)
217
+ - Recession: XLU, XLP, XLV (defensive, low beta)
218
+ - ⚠️ If 2Y-10Y spread inverted (< 0) -> late cycle/recession signal, rotate to defensives
219
+
220
+ 3. **Rebalancing Signal** — Monthly check
221
+ - If top sector 3M return > SPY +10% AND RSI > 70 -> overbought, consider trimming
222
+ - If bottom sector 3M return < SPY -10% AND RSI < 30 -> oversold, consider adding
223
+ - 💡 Sector rotation is not about catching tops/bottoms — it's about gradual tilt adjustments
224
+
225
+ ## Data Notes
226
+
227
+ - **yfinance ETF data**: ~15min delay, covers price/dividends/basic fundamentals. Always specify `provider="yfinance"` for US ETFs
228
+ - **Missing from DataHub**: ETF holdings (constituent weights), AUM (assets under management), expense ratio (use knowledge base above), tracking error, fund flows, net asset value (use closing price as proxy)
229
+ - **Expense ratio / AUM**: Hardcoded in knowledge base above. Values are approximate and updated periodically. For exact current figures, advise user to check fund provider website
230
+ - **Dividend data**: `fundamental/dividends` returns historical ex-date + amount. Calculate trailing 12M yield = sum of last 4 quarterly dividends / current price
231
+ - **Total return approximation**: Daily price return + (annual dividend yield / 252) for rough total return. Not perfectly accurate but sufficient for comparison
232
+ - **Bond ETFs**: Price history available but duration/credit quality metrics are from knowledge base, not live data
233
+
234
+ ## Response Guidelines
235
+
236
+ ### Number Formats
237
+
238
+ - ETF price: $452.30 (2 decimal places)
239
+ - Returns: +12.5% / -3.2% (always with +/- sign, 1 decimal)
240
+ - Expense ratio: 0.03% (2 decimal places)
241
+ - AUM: $450B / $35B (use $B)
242
+ - Dividend yield: 3.5% (1 decimal)
243
+ - Sharpe ratio: 1.05 (2 decimal)
244
+ - Dollar amounts in DCA: $10,000 -> $285,000 (round to nearest thousand for large projections)
245
+
246
+ ### Must Include
247
+
248
+ - Data timestamp ("Data as of YYYY-MM-DD")
249
+ - Expense ratio for every ETF mentioned (from knowledge base)
250
+ - Performance comparison must include at least 1Y timeframe
251
+ - Risk disclaimer for any forward-looking projection ("Past performance does not guarantee future results")
252
+ - Note when data comes from embedded knowledge base vs live DataHub query
253
+
254
+ ### Display Format
255
+
256
+ - ETF comparison -> side-by-side table (ticker, expense ratio, 1Y return, yield, Sharpe)
257
+ - Portfolio construction -> allocation table with weights + rationale
258
+ - DCA simulation -> input assumptions + result table + compound growth note
259
+ - Sector rotation -> ranked table with momentum scores + economic cycle annotation
260
+ - Single ETF analysis -> structured sections: Overview, Performance, Risk, Dividend, Verdict
261
+ - Always include actionable takeaway: "For most investors, [recommendation] because [reason]"