@riskmodels/mcp 1.0.1
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.
- package/INSTALL.md +130 -0
- package/README.md +196 -0
- package/data/capabilities.json +924 -0
- package/data/openapi.json +6760 -0
- package/data/schema-paths.json +16 -0
- package/data/schemas/error-v1.json +49 -0
- package/data/schemas/estimate-v1.json +49 -0
- package/data/schemas/factor-correlation-request-v1.json +55 -0
- package/data/schemas/factor-correlation-v1.json +31 -0
- package/data/schemas/health-v1.json +85 -0
- package/data/schemas/l3-decomposition-v1.json +125 -0
- package/data/schemas/macro-factors-series-v1.json +45 -0
- package/data/schemas/portfolio-risk-index-v1.json +48 -0
- package/data/schemas/portfolio-risk-snapshot-v1.json +134 -0
- package/data/schemas/risk-metadata-v1.json +35 -0
- package/data/schemas/telemetry-v1.json +122 -0
- package/data/schemas/ticker-returns-v2.json +114 -0
- package/data/schemas/tickers-list-v1.json +64 -0
- package/data/whitepaper/01-core-claim.md +10 -0
- package/data/whitepaper/02-aapl-vs-nvda.md +9 -0
- package/data/whitepaper/03-hedging.md +7 -0
- package/data/whitepaper/examples-aapl-nvda-crwd.md +7 -0
- package/data/whitepaper/one-position-four-bets.md +14 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/lib/mcp/tools/riskmodels-tools.d.ts +34 -0
- package/dist/lib/mcp/tools/riskmodels-tools.js +211 -0
- package/dist/mcp/src/index.d.ts +9 -0
- package/dist/mcp/src/index.js +19 -0
- package/dist/mcp/src/server.d.ts +25 -0
- package/dist/mcp/src/server.js +434 -0
- package/dist/server.d.ts +1 -0
- package/dist/server.js +1 -0
- package/package.json +39 -0
- package/scripts/write-dist-wrappers.mjs +29 -0
- package/src/index.ts +22 -0
- package/src/server.ts +555 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,924 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"id": "ticker-returns",
|
|
4
|
+
"name": "Get Ticker Returns",
|
|
5
|
+
"description": "Retrieve daily returns with L3 component hedge ratios (HR) and explained risk (ER) variance fractions. Returns include: l3_mkt_hr, l3_sec_hr, l3_sub_hr (market/sector/subsector hedge ratios) and l3_mkt_er, l3_sec_er, l3_sub_er, l3_res_er (explained risk fractions that sum to ~1.0). Note: Negative sector/subsector HRs are valid due to orthogonalization.",
|
|
6
|
+
"endpoint": "/api/ticker-returns",
|
|
7
|
+
"method": "GET",
|
|
8
|
+
"parameters": {
|
|
9
|
+
"ticker": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"required": true,
|
|
12
|
+
"description": "Stock ticker symbol (e.g., AAPL, NVDA, TSLA)"
|
|
13
|
+
},
|
|
14
|
+
"years": {
|
|
15
|
+
"type": "integer",
|
|
16
|
+
"required": false,
|
|
17
|
+
"description": "Years of historical data to return",
|
|
18
|
+
"default": 1,
|
|
19
|
+
"min": 1,
|
|
20
|
+
"max": 15
|
|
21
|
+
},
|
|
22
|
+
"array": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"required": false,
|
|
25
|
+
"description": "Array name for returns data",
|
|
26
|
+
"default": "return"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"pricing": {
|
|
30
|
+
"model": "per_request",
|
|
31
|
+
"cost_usd": 0.005,
|
|
32
|
+
"currency": "USD",
|
|
33
|
+
"billing_code": "ticker_returns_v2"
|
|
34
|
+
},
|
|
35
|
+
"performance": {
|
|
36
|
+
"avg_latency_ms": 150,
|
|
37
|
+
"p95_latency_ms": 250,
|
|
38
|
+
"availability_sla": 99.9,
|
|
39
|
+
"rate_limit_per_minute": 60
|
|
40
|
+
},
|
|
41
|
+
"confidence": {
|
|
42
|
+
"data_quality_score": 0.98,
|
|
43
|
+
"update_frequency": "daily",
|
|
44
|
+
"sources": ["market_data", "proprietary_models", "erm3_regression"],
|
|
45
|
+
"methodology_url": "https://riskmodels.app/docs/methodology"
|
|
46
|
+
},
|
|
47
|
+
"tags": ["returns", "hedging", "risk-analysis"],
|
|
48
|
+
"examples": [
|
|
49
|
+
{
|
|
50
|
+
"request": {
|
|
51
|
+
"ticker": "NVDA",
|
|
52
|
+
"years": 2
|
|
53
|
+
},
|
|
54
|
+
"response": {
|
|
55
|
+
"ticker": "NVDA",
|
|
56
|
+
"data": [
|
|
57
|
+
{
|
|
58
|
+
"date": "2023-01-01",
|
|
59
|
+
"returns_gross": 0.012,
|
|
60
|
+
"l3_mkt_hr": 0.98,
|
|
61
|
+
"l3_sec_hr": -0.15,
|
|
62
|
+
"l3_sub_hr": 0.25,
|
|
63
|
+
"l3_mkt_er": 0.45,
|
|
64
|
+
"l3_sec_er": 0.12,
|
|
65
|
+
"l3_sub_er": 0.18,
|
|
66
|
+
"l3_res_er": 0.25
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": "metrics",
|
|
75
|
+
"name": "Latest Risk Metrics",
|
|
76
|
+
"description": "Fetch latest hedge ratios (HR), explained risk (ER), volatility, and stock variance for a ticker from security_history (V3)",
|
|
77
|
+
"endpoint": "/api/metrics/{ticker}",
|
|
78
|
+
"method": "GET",
|
|
79
|
+
"parameters": {
|
|
80
|
+
"ticker": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"required": true,
|
|
83
|
+
"description": "Stock ticker symbol (e.g., AAPL, NVDA)"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"pricing": {
|
|
87
|
+
"model": "per_request",
|
|
88
|
+
"cost_usd": 0.001,
|
|
89
|
+
"currency": "USD",
|
|
90
|
+
"billing_code": "metrics_v3"
|
|
91
|
+
},
|
|
92
|
+
"performance": {
|
|
93
|
+
"avg_latency_ms": 80,
|
|
94
|
+
"p95_latency_ms": 150,
|
|
95
|
+
"availability_sla": 99.9,
|
|
96
|
+
"rate_limit_per_minute": 120
|
|
97
|
+
},
|
|
98
|
+
"confidence": {
|
|
99
|
+
"data_quality_score": 0.98,
|
|
100
|
+
"update_frequency": "daily",
|
|
101
|
+
"sources": ["security_history", "erm3_regression"]
|
|
102
|
+
},
|
|
103
|
+
"tags": ["metrics", "hedge-ratios", "explained-risk"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "rankings",
|
|
107
|
+
"name": "Cross-Sectional Rankings",
|
|
108
|
+
"description": "Analyzes where a security sits in its sector/universe percentile for risk and return. Per-ticker grid: GET /api/rankings/{ticker}. Leaderboard: GET /api/rankings/top?metric=&cohort=&window=&limit=. Shields badge JSON: GET /api/rankings/{ticker}/badge (public; optional RANKINGS_BADGE_TOKEN + ?token=). rank_percentile 100=best.",
|
|
109
|
+
"endpoint": "/api/rankings/{ticker}",
|
|
110
|
+
"method": "GET",
|
|
111
|
+
"parameters": {
|
|
112
|
+
"ticker": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"required": true,
|
|
115
|
+
"description": "Stock ticker symbol"
|
|
116
|
+
},
|
|
117
|
+
"metric": {
|
|
118
|
+
"type": "string",
|
|
119
|
+
"required": false,
|
|
120
|
+
"description": "Metric: subsector_residual, sector_residual, gross_return, mkt_cap, er_l1, er_l2, er_l3"
|
|
121
|
+
},
|
|
122
|
+
"cohort": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"required": false,
|
|
125
|
+
"description": "Cohort: universe, sector, subsector"
|
|
126
|
+
},
|
|
127
|
+
"window": {
|
|
128
|
+
"type": "string",
|
|
129
|
+
"required": false,
|
|
130
|
+
"description": "Window: 1d, 21d, 63d, 252d"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"pricing": {
|
|
134
|
+
"model": "per_request",
|
|
135
|
+
"cost_usd": 0.001,
|
|
136
|
+
"currency": "USD",
|
|
137
|
+
"billing_code": "rankings_v3"
|
|
138
|
+
},
|
|
139
|
+
"performance": {
|
|
140
|
+
"avg_latency_ms": 80,
|
|
141
|
+
"p95_latency_ms": 150,
|
|
142
|
+
"availability_sla": 99.9,
|
|
143
|
+
"rate_limit_per_minute": 120
|
|
144
|
+
},
|
|
145
|
+
"confidence": {
|
|
146
|
+
"data_quality_score": 0.98,
|
|
147
|
+
"update_frequency": "daily",
|
|
148
|
+
"sources": ["security_history", "erm3_regression"]
|
|
149
|
+
},
|
|
150
|
+
"tags": ["rankings", "cross-sectional", "percentile"]
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"id": "risk-decomposition",
|
|
154
|
+
"name": "L3 Risk Decomposition",
|
|
155
|
+
"description": "Decompose stock risk into market, sector, and idiosyncratic components using 3-level hierarchical model",
|
|
156
|
+
"endpoint": "/api/l3-decomposition",
|
|
157
|
+
"method": "GET",
|
|
158
|
+
"parameters": {
|
|
159
|
+
"ticker": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"required": true,
|
|
162
|
+
"description": "Stock ticker symbol"
|
|
163
|
+
},
|
|
164
|
+
"date": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"required": false,
|
|
167
|
+
"description": "Specific date for decomposition (YYYY-MM-DD format)",
|
|
168
|
+
"default": "latest"
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"pricing": {
|
|
172
|
+
"model": "per_request",
|
|
173
|
+
"cost_usd": 0.02,
|
|
174
|
+
"currency": "USD",
|
|
175
|
+
"billing_code": "l3_decomp_v3"
|
|
176
|
+
},
|
|
177
|
+
"performance": {
|
|
178
|
+
"avg_latency_ms": 120,
|
|
179
|
+
"p95_latency_ms": 200,
|
|
180
|
+
"availability_sla": 99.9,
|
|
181
|
+
"rate_limit_per_minute": 60
|
|
182
|
+
},
|
|
183
|
+
"confidence": {
|
|
184
|
+
"data_quality_score": 0.99,
|
|
185
|
+
"update_frequency": "daily",
|
|
186
|
+
"sources": ["erm3_models", "factor_regression"],
|
|
187
|
+
"methodology_url": "https://riskmodels.app/docs/l3-methodology"
|
|
188
|
+
},
|
|
189
|
+
"tags": ["risk-analysis", "decomposition", "factors"]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"id": "chat-risk-analyst",
|
|
193
|
+
"name": "AI Risk Analyst",
|
|
194
|
+
"description": "Natural language risk analysis with live data via OpenAI tools (non-streaming JSON). Tools: get_risk_metrics, get_l3_decomposition, get_ticker_returns, get_rankings, get_factor_correlation, get_macro_factors, search_tickers (free), compute_portfolio_risk_index. LLM per-token billing plus per-tool charges at matching endpoint rates.",
|
|
195
|
+
"endpoint": "/api/chat",
|
|
196
|
+
"method": "POST",
|
|
197
|
+
"parameters": {
|
|
198
|
+
"messages": {
|
|
199
|
+
"type": "array",
|
|
200
|
+
"required": true,
|
|
201
|
+
"description": "Conversation messages",
|
|
202
|
+
"items": {
|
|
203
|
+
"type": "object",
|
|
204
|
+
"properties": {
|
|
205
|
+
"role": {
|
|
206
|
+
"type": "string",
|
|
207
|
+
"enum": ["user", "assistant"],
|
|
208
|
+
"required": true
|
|
209
|
+
},
|
|
210
|
+
"content": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"required": true
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
"model": {
|
|
218
|
+
"type": "string",
|
|
219
|
+
"required": false,
|
|
220
|
+
"description": "AI model to use",
|
|
221
|
+
"default": "gpt-4o-mini"
|
|
222
|
+
},
|
|
223
|
+
"response_mode": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"required": false,
|
|
226
|
+
"description": "Reserved for future streaming / A2UI; JSON tool-use responses today",
|
|
227
|
+
"default": "markdown",
|
|
228
|
+
"enum": ["markdown", "catalog", "hybrid"]
|
|
229
|
+
},
|
|
230
|
+
"parallel_tool_calls": {
|
|
231
|
+
"type": "boolean",
|
|
232
|
+
"required": false,
|
|
233
|
+
"description": "When false, disables OpenAI parallel_tool_calls for supported models"
|
|
234
|
+
},
|
|
235
|
+
"execute_tools_sequentially": {
|
|
236
|
+
"type": "boolean",
|
|
237
|
+
"required": false,
|
|
238
|
+
"description": "When true, server runs chat tools sequentially"
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"pricing": {
|
|
242
|
+
"model": "per_token",
|
|
243
|
+
"input_cost_per_1k": 0.001,
|
|
244
|
+
"output_cost_per_1k": 0.002,
|
|
245
|
+
"currency": "USD",
|
|
246
|
+
"billing_code": "chat_risk_analyst_v2"
|
|
247
|
+
},
|
|
248
|
+
"performance": {
|
|
249
|
+
"avg_latency_ms": 2000,
|
|
250
|
+
"p95_latency_ms": 5000,
|
|
251
|
+
"availability_sla": 99.5,
|
|
252
|
+
"rate_limit_per_minute": 30
|
|
253
|
+
},
|
|
254
|
+
"confidence": {
|
|
255
|
+
"data_quality_score": 0.95,
|
|
256
|
+
"update_frequency": "real-time",
|
|
257
|
+
"sources": ["openai_gpt4", "riskmodels_data"]
|
|
258
|
+
},
|
|
259
|
+
"tags": ["ai", "chat", "analysis", "natural-language", "a2ui", "streaming"]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"id": "plaid-link-token",
|
|
263
|
+
"name": "Plaid Link token (setup)",
|
|
264
|
+
"description": "Create a Plaid Link token for the authenticated user (Investments). Free; session auth.",
|
|
265
|
+
"endpoint": "/api/plaid/link-token",
|
|
266
|
+
"method": "POST",
|
|
267
|
+
"parameters": {},
|
|
268
|
+
"pricing": {
|
|
269
|
+
"model": "per_request",
|
|
270
|
+
"cost_usd": 0,
|
|
271
|
+
"currency": "USD",
|
|
272
|
+
"billing_code": "plaid_link_token_v1"
|
|
273
|
+
},
|
|
274
|
+
"performance": {
|
|
275
|
+
"avg_latency_ms": 200,
|
|
276
|
+
"p95_latency_ms": 500,
|
|
277
|
+
"availability_sla": 99.5,
|
|
278
|
+
"rate_limit_per_minute": 30
|
|
279
|
+
},
|
|
280
|
+
"confidence": {
|
|
281
|
+
"data_quality_score": 1,
|
|
282
|
+
"update_frequency": "real-time",
|
|
283
|
+
"sources": ["plaid"]
|
|
284
|
+
},
|
|
285
|
+
"tags": ["plaid", "setup"]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"id": "plaid-exchange-public-token",
|
|
289
|
+
"name": "Plaid public token exchange (setup)",
|
|
290
|
+
"description": "Exchange Plaid public_token and store encrypted item. Free; session auth.",
|
|
291
|
+
"endpoint": "/api/plaid/exchange-public-token",
|
|
292
|
+
"method": "POST",
|
|
293
|
+
"parameters": {},
|
|
294
|
+
"pricing": {
|
|
295
|
+
"model": "per_request",
|
|
296
|
+
"cost_usd": 0,
|
|
297
|
+
"currency": "USD",
|
|
298
|
+
"billing_code": "plaid_exchange_v1"
|
|
299
|
+
},
|
|
300
|
+
"performance": {
|
|
301
|
+
"avg_latency_ms": 400,
|
|
302
|
+
"p95_latency_ms": 1000,
|
|
303
|
+
"availability_sla": 99.5,
|
|
304
|
+
"rate_limit_per_minute": 30
|
|
305
|
+
},
|
|
306
|
+
"confidence": {
|
|
307
|
+
"data_quality_score": 1,
|
|
308
|
+
"update_frequency": "real-time",
|
|
309
|
+
"sources": ["plaid"]
|
|
310
|
+
},
|
|
311
|
+
"tags": ["plaid", "setup"]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"id": "plaid-holdings",
|
|
315
|
+
"name": "Plaid investment holdings",
|
|
316
|
+
"description": "Fetch Plaid-synced investment holdings, accounts, and securities for the authenticated user",
|
|
317
|
+
"endpoint": "/api/plaid/holdings",
|
|
318
|
+
"method": "GET",
|
|
319
|
+
"parameters": {},
|
|
320
|
+
"pricing": {
|
|
321
|
+
"model": "per_request",
|
|
322
|
+
"cost_usd": 0.02,
|
|
323
|
+
"currency": "USD",
|
|
324
|
+
"billing_code": "plaid_holdings_v2"
|
|
325
|
+
},
|
|
326
|
+
"performance": {
|
|
327
|
+
"avg_latency_ms": 400,
|
|
328
|
+
"p95_latency_ms": 1200,
|
|
329
|
+
"availability_sla": 99.5,
|
|
330
|
+
"rate_limit_per_minute": 60
|
|
331
|
+
},
|
|
332
|
+
"confidence": {
|
|
333
|
+
"data_quality_score": 0.95,
|
|
334
|
+
"update_frequency": "real-time",
|
|
335
|
+
"sources": ["plaid_investments"]
|
|
336
|
+
},
|
|
337
|
+
"tags": ["plaid", "holdings", "portfolio"]
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"id": "batch-analysis",
|
|
341
|
+
"name": "Portfolio Batch Analysis",
|
|
342
|
+
"description": "Analyze multiple positions for risk exposures, correlations, and hedge recommendations",
|
|
343
|
+
"endpoint": "/api/batch/analyze",
|
|
344
|
+
"method": "POST",
|
|
345
|
+
"parameters": {
|
|
346
|
+
"positions": {
|
|
347
|
+
"type": "array",
|
|
348
|
+
"required": true,
|
|
349
|
+
"description": "Portfolio positions to analyze",
|
|
350
|
+
"items": {
|
|
351
|
+
"type": "object",
|
|
352
|
+
"properties": {
|
|
353
|
+
"ticker": {
|
|
354
|
+
"type": "string",
|
|
355
|
+
"required": true
|
|
356
|
+
},
|
|
357
|
+
"quantity": {
|
|
358
|
+
"type": "number",
|
|
359
|
+
"required": true
|
|
360
|
+
},
|
|
361
|
+
"cost_basis": {
|
|
362
|
+
"type": "number",
|
|
363
|
+
"required": true
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"analysis_type": {
|
|
369
|
+
"type": "string",
|
|
370
|
+
"required": false,
|
|
371
|
+
"description": "Type of analysis to perform",
|
|
372
|
+
"default": "comprehensive",
|
|
373
|
+
"enum": ["risk", "hedging", "correlation", "comprehensive"]
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"pricing": {
|
|
377
|
+
"model": "per_position",
|
|
378
|
+
"cost_usd": 0.005,
|
|
379
|
+
"currency": "USD",
|
|
380
|
+
"min_charge": 0.01,
|
|
381
|
+
"billing_code": "batch_analysis_v3"
|
|
382
|
+
},
|
|
383
|
+
"performance": {
|
|
384
|
+
"avg_latency_ms": 300,
|
|
385
|
+
"p95_latency_ms": 500,
|
|
386
|
+
"availability_sla": 99.9,
|
|
387
|
+
"rate_limit_per_minute": 20
|
|
388
|
+
},
|
|
389
|
+
"confidence": {
|
|
390
|
+
"data_quality_score": 0.98,
|
|
391
|
+
"update_frequency": "daily",
|
|
392
|
+
"sources": ["portfolio_models", "correlation_matrices"]
|
|
393
|
+
},
|
|
394
|
+
"tags": ["portfolio", "batch", "analysis", "hedging"]
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
"id": "ticker-search",
|
|
398
|
+
"name": "Ticker Search",
|
|
399
|
+
"description": "Search for tickers by symbol or company name with metadata. Searches symbols first; falls back to internal company registry for broader company-name coverage.",
|
|
400
|
+
"endpoint": "/api/tickers",
|
|
401
|
+
"method": "GET",
|
|
402
|
+
"parameters": {
|
|
403
|
+
"search": {
|
|
404
|
+
"type": "string",
|
|
405
|
+
"required": false,
|
|
406
|
+
"description": "Search query for ticker symbol or company name. Falls back to internal company registry when symbols has no match."
|
|
407
|
+
},
|
|
408
|
+
"mag7": {
|
|
409
|
+
"type": "boolean",
|
|
410
|
+
"required": false,
|
|
411
|
+
"description": "Return only Magnificent 7 tickers",
|
|
412
|
+
"default": false
|
|
413
|
+
},
|
|
414
|
+
"include_metadata": {
|
|
415
|
+
"type": "boolean",
|
|
416
|
+
"required": false,
|
|
417
|
+
"description": "Include company name, sector, and sector_etf per ticker. Enriched from internal sources when symbols lacks company_name.",
|
|
418
|
+
"default": false
|
|
419
|
+
}
|
|
420
|
+
},
|
|
421
|
+
"pricing": {
|
|
422
|
+
"model": "per_request",
|
|
423
|
+
"cost_usd": 0.001,
|
|
424
|
+
"currency": "USD",
|
|
425
|
+
"billing_code": "ticker_search_v2"
|
|
426
|
+
},
|
|
427
|
+
"performance": {
|
|
428
|
+
"avg_latency_ms": 80,
|
|
429
|
+
"p95_latency_ms": 150,
|
|
430
|
+
"availability_sla": 99.9,
|
|
431
|
+
"rate_limit_per_minute": 120
|
|
432
|
+
},
|
|
433
|
+
"confidence": {
|
|
434
|
+
"data_quality_score": 0.99,
|
|
435
|
+
"update_frequency": "daily",
|
|
436
|
+
"sources": ["symbols", "company_data"]
|
|
437
|
+
},
|
|
438
|
+
"tags": ["search", "tickers", "metadata"]
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"id": "health-status",
|
|
442
|
+
"name": "Health Status",
|
|
443
|
+
"description": "Real-time health status of all API services and capabilities",
|
|
444
|
+
"endpoint": "/api/health",
|
|
445
|
+
"method": "GET",
|
|
446
|
+
"parameters": {},
|
|
447
|
+
"pricing": {
|
|
448
|
+
"model": "per_request",
|
|
449
|
+
"cost_usd": 0,
|
|
450
|
+
"currency": "USD",
|
|
451
|
+
"billing_code": "health_check"
|
|
452
|
+
},
|
|
453
|
+
"performance": {
|
|
454
|
+
"avg_latency_ms": 50,
|
|
455
|
+
"p95_latency_ms": 100,
|
|
456
|
+
"availability_sla": 99.99,
|
|
457
|
+
"rate_limit_per_minute": 300
|
|
458
|
+
},
|
|
459
|
+
"confidence": {
|
|
460
|
+
"data_quality_score": 1,
|
|
461
|
+
"update_frequency": "real-time",
|
|
462
|
+
"sources": ["system_monitoring"]
|
|
463
|
+
},
|
|
464
|
+
"tags": ["health", "status", "monitoring"]
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
"id": "telemetry-metrics",
|
|
468
|
+
"name": "Telemetry Metrics",
|
|
469
|
+
"description": "Detailed performance and reliability metrics for API capabilities",
|
|
470
|
+
"endpoint": "/api/telemetry",
|
|
471
|
+
"method": "GET",
|
|
472
|
+
"parameters": {
|
|
473
|
+
"capability": {
|
|
474
|
+
"type": "string",
|
|
475
|
+
"required": false,
|
|
476
|
+
"description": "Specific capability to get metrics for"
|
|
477
|
+
},
|
|
478
|
+
"days": {
|
|
479
|
+
"type": "integer",
|
|
480
|
+
"required": false,
|
|
481
|
+
"description": "Number of days of historical data",
|
|
482
|
+
"default": 30,
|
|
483
|
+
"min": 1,
|
|
484
|
+
"max": 90
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
"pricing": {
|
|
488
|
+
"model": "per_request",
|
|
489
|
+
"cost_usd": 0.002,
|
|
490
|
+
"currency": "USD",
|
|
491
|
+
"billing_code": "telemetry_v2"
|
|
492
|
+
},
|
|
493
|
+
"performance": {
|
|
494
|
+
"avg_latency_ms": 100,
|
|
495
|
+
"p95_latency_ms": 200,
|
|
496
|
+
"availability_sla": 99.9,
|
|
497
|
+
"rate_limit_per_minute": 60
|
|
498
|
+
},
|
|
499
|
+
"confidence": {
|
|
500
|
+
"data_quality_score": 0.99,
|
|
501
|
+
"update_frequency": "hourly",
|
|
502
|
+
"sources": ["telemetry_system", "performance_metrics"]
|
|
503
|
+
},
|
|
504
|
+
"tags": ["telemetry", "metrics", "performance"]
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"id": "metrics-snapshot",
|
|
508
|
+
"name": "Metrics Snapshot",
|
|
509
|
+
"description": "Latest risk metrics snapshot for a single ticker (volatility, hedge ratios, explained risk, hierarchical regression betas l1_mkt_beta/l2_sec_beta/l3_sub_beta, and combined factor returns / residual returns at L1/L2/L3)",
|
|
510
|
+
"endpoint": "/api/metrics",
|
|
511
|
+
"method": "GET",
|
|
512
|
+
"parameters": {
|
|
513
|
+
"ticker": {
|
|
514
|
+
"type": "string",
|
|
515
|
+
"required": true,
|
|
516
|
+
"description": "Stock ticker symbol"
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
"pricing": {
|
|
520
|
+
"model": "per_request",
|
|
521
|
+
"cost_usd": 0.001,
|
|
522
|
+
"currency": "USD",
|
|
523
|
+
"billing_code": "metrics_snapshot_v1"
|
|
524
|
+
},
|
|
525
|
+
"performance": {
|
|
526
|
+
"avg_latency_ms": 80,
|
|
527
|
+
"p95_latency_ms": 150,
|
|
528
|
+
"availability_sla": 99.9,
|
|
529
|
+
"rate_limit_per_minute": 120
|
|
530
|
+
},
|
|
531
|
+
"confidence": {
|
|
532
|
+
"data_quality_score": 0.98,
|
|
533
|
+
"update_frequency": "daily",
|
|
534
|
+
"sources": ["security_history", "symbols"]
|
|
535
|
+
},
|
|
536
|
+
"tags": ["metrics", "snapshot", "risk"]
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
"id": "l3-decomposition",
|
|
540
|
+
"name": "L3 Decomposition",
|
|
541
|
+
"description": "Decompose stock risk into market, sector, and idiosyncratic components",
|
|
542
|
+
"endpoint": "/api/l3-decomposition",
|
|
543
|
+
"method": "GET",
|
|
544
|
+
"parameters": {
|
|
545
|
+
"ticker": {
|
|
546
|
+
"type": "string",
|
|
547
|
+
"required": true,
|
|
548
|
+
"description": "Stock ticker symbol"
|
|
549
|
+
},
|
|
550
|
+
"market_factor_etf": {
|
|
551
|
+
"type": "string",
|
|
552
|
+
"required": false,
|
|
553
|
+
"description": "Market factor ETF",
|
|
554
|
+
"default": "SPY"
|
|
555
|
+
}
|
|
556
|
+
},
|
|
557
|
+
"pricing": {
|
|
558
|
+
"model": "per_request",
|
|
559
|
+
"cost_usd": 0.02,
|
|
560
|
+
"currency": "USD",
|
|
561
|
+
"billing_code": "l3_decomposition_v2"
|
|
562
|
+
},
|
|
563
|
+
"performance": {
|
|
564
|
+
"avg_latency_ms": 120,
|
|
565
|
+
"p95_latency_ms": 200,
|
|
566
|
+
"availability_sla": 99.9,
|
|
567
|
+
"rate_limit_per_minute": 60
|
|
568
|
+
},
|
|
569
|
+
"confidence": {
|
|
570
|
+
"data_quality_score": 0.99,
|
|
571
|
+
"update_frequency": "daily",
|
|
572
|
+
"sources": ["erm3_models", "security_history"]
|
|
573
|
+
},
|
|
574
|
+
"tags": ["risk", "decomposition", "l3"]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"id": "portfolio-returns",
|
|
578
|
+
"name": "Portfolio Returns",
|
|
579
|
+
"description": "Batch fetch returns for multiple tickers (portfolio analytics)",
|
|
580
|
+
"endpoint": "/api/portfolio/returns",
|
|
581
|
+
"method": "POST",
|
|
582
|
+
"parameters": {
|
|
583
|
+
"tickers": {
|
|
584
|
+
"type": "array",
|
|
585
|
+
"required": true,
|
|
586
|
+
"description": "Array of ticker symbols",
|
|
587
|
+
"items": {
|
|
588
|
+
"type": "string"
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
"years": {
|
|
592
|
+
"type": "integer",
|
|
593
|
+
"required": false,
|
|
594
|
+
"description": "Years of history",
|
|
595
|
+
"default": 3
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
"pricing": {
|
|
599
|
+
"model": "per_position",
|
|
600
|
+
"cost_usd": 0.004,
|
|
601
|
+
"currency": "USD",
|
|
602
|
+
"min_charge": 0.01,
|
|
603
|
+
"billing_code": "portfolio_returns_v2"
|
|
604
|
+
},
|
|
605
|
+
"performance": {
|
|
606
|
+
"avg_latency_ms": 200,
|
|
607
|
+
"p95_latency_ms": 400,
|
|
608
|
+
"availability_sla": 99.9,
|
|
609
|
+
"rate_limit_per_minute": 30
|
|
610
|
+
},
|
|
611
|
+
"confidence": {
|
|
612
|
+
"data_quality_score": 0.98,
|
|
613
|
+
"update_frequency": "daily",
|
|
614
|
+
"sources": ["security_history"]
|
|
615
|
+
},
|
|
616
|
+
"tags": ["portfolio", "returns", "batch"]
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
"id": "portfolio-risk-index",
|
|
620
|
+
"name": "Portfolio Risk Index",
|
|
621
|
+
"description": "Compute Portfolio Risk Index (variance decomposition)",
|
|
622
|
+
"endpoint": "/api/portfolio/risk-index",
|
|
623
|
+
"method": "POST",
|
|
624
|
+
"parameters": {
|
|
625
|
+
"positions": {
|
|
626
|
+
"type": "array",
|
|
627
|
+
"required": true,
|
|
628
|
+
"description": "Array of { ticker, weight }",
|
|
629
|
+
"items": {
|
|
630
|
+
"type": "object",
|
|
631
|
+
"properties": {
|
|
632
|
+
"ticker": {
|
|
633
|
+
"type": "string"
|
|
634
|
+
},
|
|
635
|
+
"weight": {
|
|
636
|
+
"type": "number"
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
},
|
|
641
|
+
"timeSeries": {
|
|
642
|
+
"type": "boolean",
|
|
643
|
+
"required": false,
|
|
644
|
+
"description": "Return PRI time series",
|
|
645
|
+
"default": false
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
"pricing": {
|
|
649
|
+
"model": "per_request",
|
|
650
|
+
"cost_usd": 0.03,
|
|
651
|
+
"currency": "USD",
|
|
652
|
+
"billing_code": "portfolio_risk_index_v2"
|
|
653
|
+
},
|
|
654
|
+
"performance": {
|
|
655
|
+
"avg_latency_ms": 300,
|
|
656
|
+
"p95_latency_ms": 500,
|
|
657
|
+
"availability_sla": 99.9,
|
|
658
|
+
"rate_limit_per_minute": 20
|
|
659
|
+
},
|
|
660
|
+
"confidence": {
|
|
661
|
+
"data_quality_score": 0.98,
|
|
662
|
+
"update_frequency": "daily",
|
|
663
|
+
"sources": ["security_history", "symbols"]
|
|
664
|
+
},
|
|
665
|
+
"tags": ["portfolio", "risk", "pri"]
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
"id": "portfolio-risk-snapshot",
|
|
669
|
+
"name": "Portfolio risk snapshot",
|
|
670
|
+
"description": "One-page portfolio risk report as PDF or structured JSON (L3 decomposition, hedge ratios). Bundled charge; internal DAL only.",
|
|
671
|
+
"endpoint": "/api/portfolio/risk-snapshot",
|
|
672
|
+
"method": "POST",
|
|
673
|
+
"parameters": {
|
|
674
|
+
"positions": {
|
|
675
|
+
"type": "array",
|
|
676
|
+
"required": true,
|
|
677
|
+
"description": "Positions { ticker, weight }",
|
|
678
|
+
"items": {
|
|
679
|
+
"type": "object",
|
|
680
|
+
"properties": {
|
|
681
|
+
"ticker": { "type": "string", "required": true },
|
|
682
|
+
"weight": { "type": "number", "required": true }
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
},
|
|
686
|
+
"title": { "type": "string", "required": false, "description": "Optional title" },
|
|
687
|
+
"as_of_date": { "type": "string", "required": false, "description": "YYYY-MM-DD label" },
|
|
688
|
+
"format": {
|
|
689
|
+
"type": "string",
|
|
690
|
+
"required": false,
|
|
691
|
+
"description": "pdf | json | png (png not implemented)",
|
|
692
|
+
"enum": ["pdf", "json", "png"],
|
|
693
|
+
"default": "json"
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
"pricing": {
|
|
697
|
+
"model": "per_request",
|
|
698
|
+
"cost_usd": 0.25,
|
|
699
|
+
"currency": "USD",
|
|
700
|
+
"billing_code": "risk_snapshot_pdf_v1"
|
|
701
|
+
},
|
|
702
|
+
"performance": {
|
|
703
|
+
"avg_latency_ms": 800,
|
|
704
|
+
"p95_latency_ms": 2500,
|
|
705
|
+
"availability_sla": 99.5,
|
|
706
|
+
"rate_limit_per_minute": 20
|
|
707
|
+
},
|
|
708
|
+
"confidence": {
|
|
709
|
+
"data_quality_score": 0.98,
|
|
710
|
+
"update_frequency": "daily",
|
|
711
|
+
"sources": ["security_history", "symbols"]
|
|
712
|
+
},
|
|
713
|
+
"tags": ["portfolio", "pdf", "risk", "report"]
|
|
714
|
+
},
|
|
715
|
+
{
|
|
716
|
+
"id": "factor-correlation",
|
|
717
|
+
"name": "Macro factor correlation",
|
|
718
|
+
"description": "Measures exposure to macro-economic drivers like interest rates and volatility. Pearson or Spearman correlation between a stock return series (gross or ERM3 L1/L2/L3 residual) and daily macro factor returns from macro_factors. Use POST /api/correlation or GET /api/metrics/{ticker}/correlation. JSON Schema for POST body: /schemas/factor-correlation-request-v1.json; single-ticker success: /schemas/factor-correlation-v1.json.",
|
|
719
|
+
"endpoint": "/api/correlation",
|
|
720
|
+
"method": "POST",
|
|
721
|
+
"parameters": {
|
|
722
|
+
"ticker": {
|
|
723
|
+
"type": "string",
|
|
724
|
+
"required": true,
|
|
725
|
+
"description": "Stock ticker or array of tickers (batch)"
|
|
726
|
+
},
|
|
727
|
+
"factors": {
|
|
728
|
+
"type": "array",
|
|
729
|
+
"required": false,
|
|
730
|
+
"description": "Macro factor keys: bitcoin, gold, oil, dxy, vix, ust10y2y (default all six)"
|
|
731
|
+
},
|
|
732
|
+
"return_type": {
|
|
733
|
+
"type": "string",
|
|
734
|
+
"required": false,
|
|
735
|
+
"description": "gross | l1 | l2 | l3_residual",
|
|
736
|
+
"default": "l3_residual"
|
|
737
|
+
},
|
|
738
|
+
"window_days": {
|
|
739
|
+
"type": "integer",
|
|
740
|
+
"required": false,
|
|
741
|
+
"description": "Trailing paired observations",
|
|
742
|
+
"default": 252,
|
|
743
|
+
"min": 20,
|
|
744
|
+
"max": 2000
|
|
745
|
+
},
|
|
746
|
+
"method": {
|
|
747
|
+
"type": "string",
|
|
748
|
+
"required": false,
|
|
749
|
+
"description": "pearson | spearman",
|
|
750
|
+
"default": "pearson"
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
"pricing": {
|
|
754
|
+
"model": "per_request",
|
|
755
|
+
"cost_usd": 0.002,
|
|
756
|
+
"currency": "USD",
|
|
757
|
+
"billing_code": "factor_correlation_v1"
|
|
758
|
+
},
|
|
759
|
+
"performance": {
|
|
760
|
+
"avg_latency_ms": 120,
|
|
761
|
+
"p95_latency_ms": 250,
|
|
762
|
+
"availability_sla": 99.5,
|
|
763
|
+
"rate_limit_per_minute": 60
|
|
764
|
+
},
|
|
765
|
+
"confidence": {
|
|
766
|
+
"data_quality_score": 0.95,
|
|
767
|
+
"update_frequency": "daily",
|
|
768
|
+
"sources": ["security_history", "macro_factors"]
|
|
769
|
+
},
|
|
770
|
+
"tags": ["correlation", "macro", "factors"]
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"id": "macro-factor-series",
|
|
774
|
+
"name": "Macro factor time series",
|
|
775
|
+
"description": "Read-only daily macro factor total returns from Supabase macro_factors (no stock ticker). GET /api/macro-factors with optional factors, start, end (YYYY-MM-DD). JSON Schema for 200 body: /schemas/macro-factors-series-v1.json.",
|
|
776
|
+
"endpoint": "/api/macro-factors",
|
|
777
|
+
"method": "GET",
|
|
778
|
+
"parameters": {
|
|
779
|
+
"factors": {
|
|
780
|
+
"type": "string",
|
|
781
|
+
"required": false,
|
|
782
|
+
"description": "Comma-separated factor keys (bitcoin, gold, oil, dxy, vix, ust10y2y); default all six"
|
|
783
|
+
},
|
|
784
|
+
"start": {
|
|
785
|
+
"type": "string",
|
|
786
|
+
"required": false,
|
|
787
|
+
"description": "Inclusive start date YYYY-MM-DD; default five calendar years before end"
|
|
788
|
+
},
|
|
789
|
+
"end": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"required": false,
|
|
792
|
+
"description": "Inclusive end date YYYY-MM-DD; default today UTC"
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"pricing": {
|
|
796
|
+
"model": "per_request",
|
|
797
|
+
"cost_usd": 0.001,
|
|
798
|
+
"currency": "USD",
|
|
799
|
+
"billing_code": "macro_factor_series_v1"
|
|
800
|
+
},
|
|
801
|
+
"performance": {
|
|
802
|
+
"avg_latency_ms": 80,
|
|
803
|
+
"p95_latency_ms": 200,
|
|
804
|
+
"availability_sla": 99.5,
|
|
805
|
+
"rate_limit_per_minute": 120
|
|
806
|
+
},
|
|
807
|
+
"confidence": {
|
|
808
|
+
"data_quality_score": 0.95,
|
|
809
|
+
"update_frequency": "daily",
|
|
810
|
+
"sources": ["macro_factors"]
|
|
811
|
+
},
|
|
812
|
+
"tags": ["macro", "factors", "time-series"]
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
"id": "cli-query",
|
|
816
|
+
"name": "CLI SQL Query",
|
|
817
|
+
"description": "Execute SQL SELECT queries against risk model data via CLI or programmatic access",
|
|
818
|
+
"endpoint": "/api/cli/query",
|
|
819
|
+
"method": "POST",
|
|
820
|
+
"parameters": {
|
|
821
|
+
"sql": {
|
|
822
|
+
"type": "string",
|
|
823
|
+
"required": true,
|
|
824
|
+
"description": "SQL SELECT query to execute"
|
|
825
|
+
},
|
|
826
|
+
"limit": {
|
|
827
|
+
"type": "integer",
|
|
828
|
+
"required": false,
|
|
829
|
+
"description": "Maximum rows to return",
|
|
830
|
+
"default": 100,
|
|
831
|
+
"min": 1,
|
|
832
|
+
"max": 10000
|
|
833
|
+
}
|
|
834
|
+
},
|
|
835
|
+
"pricing": {
|
|
836
|
+
"model": "per_request",
|
|
837
|
+
"cost_usd": 0.003,
|
|
838
|
+
"currency": "USD",
|
|
839
|
+
"billing_code": "cli_query_v1"
|
|
840
|
+
},
|
|
841
|
+
"performance": {
|
|
842
|
+
"avg_latency_ms": 200,
|
|
843
|
+
"p95_latency_ms": 500,
|
|
844
|
+
"availability_sla": 99.9,
|
|
845
|
+
"rate_limit_per_minute": 60
|
|
846
|
+
},
|
|
847
|
+
"confidence": {
|
|
848
|
+
"data_quality_score": 0.98,
|
|
849
|
+
"update_frequency": "daily",
|
|
850
|
+
"sources": ["supabase_db", "exec_sql_rpc"]
|
|
851
|
+
},
|
|
852
|
+
"tags": ["cli", "sql", "query", "data-access"],
|
|
853
|
+
"examples": [
|
|
854
|
+
{
|
|
855
|
+
"request": {
|
|
856
|
+
"sql": "SELECT ticker, latest_er_total FROM symbols LIMIT 5"
|
|
857
|
+
},
|
|
858
|
+
"response": {
|
|
859
|
+
"results": [
|
|
860
|
+
{
|
|
861
|
+
"ticker": "AAPL",
|
|
862
|
+
"l3_residual_er": 0.54
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"ticker": "NVDA",
|
|
866
|
+
"l3_residual_er": 0.38
|
|
867
|
+
}
|
|
868
|
+
],
|
|
869
|
+
"count": 2,
|
|
870
|
+
"cost_usd": 0.003
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
"id": "decompose-position",
|
|
877
|
+
"name": "Decompose Position",
|
|
878
|
+
"description": "Decompose a single ticker into four additive ERM3 layers (market, sector, subsector, residual) with tradable hedge ETFs and a consolidated hedge map. Thin semantic wrapper over the metrics DAL; same billing profile as GET /metrics/{ticker}.",
|
|
879
|
+
"endpoint": "/api/decompose",
|
|
880
|
+
"method": "POST",
|
|
881
|
+
"parameters": {
|
|
882
|
+
"ticker": {
|
|
883
|
+
"type": "string",
|
|
884
|
+
"required": true,
|
|
885
|
+
"description": "Stock ticker symbol (e.g., NVDA, AAPL)"
|
|
886
|
+
}
|
|
887
|
+
},
|
|
888
|
+
"pricing": {
|
|
889
|
+
"model": "per_request",
|
|
890
|
+
"cost_usd": 0.001,
|
|
891
|
+
"currency": "USD",
|
|
892
|
+
"billing_code": "metrics_v3"
|
|
893
|
+
},
|
|
894
|
+
"performance": {
|
|
895
|
+
"avg_latency_ms": 80,
|
|
896
|
+
"p95_latency_ms": 150,
|
|
897
|
+
"availability_sla": 99.9,
|
|
898
|
+
"rate_limit_per_minute": 120
|
|
899
|
+
},
|
|
900
|
+
"confidence": {
|
|
901
|
+
"data_quality_score": 0.98,
|
|
902
|
+
"update_frequency": "daily",
|
|
903
|
+
"sources": ["security_history", "symbols", "ticker_metadata"],
|
|
904
|
+
"methodology_url": "https://riskmodels.app/docs/methodology"
|
|
905
|
+
},
|
|
906
|
+
"tags": ["decompose", "hedge", "exposure", "agent"],
|
|
907
|
+
"examples": [
|
|
908
|
+
{
|
|
909
|
+
"request": { "ticker": "NVDA" },
|
|
910
|
+
"response": {
|
|
911
|
+
"ticker": "NVDA",
|
|
912
|
+
"data_as_of": "2026-04-21",
|
|
913
|
+
"exposure": {
|
|
914
|
+
"market": { "er": 0.45, "hr": 1.10, "hedge_etf": "SPY" },
|
|
915
|
+
"sector": { "er": 0.22, "hr": 0.35, "hedge_etf": "XLK" },
|
|
916
|
+
"subsector": { "er": 0.20, "hr": 0.60, "hedge_etf": "SMH" },
|
|
917
|
+
"residual": { "er": 0.13, "hr": null, "hedge_etf": null }
|
|
918
|
+
},
|
|
919
|
+
"hedge": { "SPY": -1.10, "XLK": -0.35, "SMH": -0.60 }
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
]
|