@quantbrasil/cli 0.1.0-beta.3 → 0.1.0-beta.4
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/README.md +14 -11
- package/dist/cli/index.d.ts +2 -3
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +2 -10
- package/dist/commands/portfolios.d.ts +133 -8
- package/dist/commands/portfolios.d.ts.map +1 -1
- package/dist/commands/portfolios.js +434 -55
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/vendor/core/capabilities/index.d.ts +0 -1
- package/dist/vendor/core/capabilities/index.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/index.js +0 -1
- package/dist/vendor/core/capabilities/portfolios.d.ts +401 -56
- package/dist/vendor/core/capabilities/portfolios.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/portfolios.js +383 -115
- package/dist/vendor/core/capabilities/registry.d.ts +586 -266
- package/dist/vendor/core/capabilities/registry.d.ts.map +1 -1
- package/dist/vendor/core/capabilities/registry.js +0 -2
- package/dist/vendor/core/capabilities/types.d.ts +1 -1
- package/dist/vendor/core/capabilities/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/skills/quantbrasil/SKILL.md +8 -6
- package/skills/quantbrasil/references/cli.md +20 -25
- package/skills/quantbrasil/references/costs.md +4 -4
- package/skills/quantbrasil/references/errors.md +6 -5
- package/skills/quantbrasil/references/portfolios.md +92 -0
- package/skills/quantbrasil/references/unsupported.md +2 -2
- package/skills/quantbrasil/references/workflows.md +32 -25
- package/dist/commands/analytics.d.ts +0 -131
- package/dist/commands/analytics.d.ts.map +0 -1
- package/dist/commands/analytics.js +0 -291
- package/dist/vendor/core/capabilities/analytics.d.ts +0 -187
- package/dist/vendor/core/capabilities/analytics.d.ts.map +0 -1
- package/dist/vendor/core/capabilities/analytics.js +0 -214
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import { publicRuntimeVisibility, standardOutputModes } from "./shared.js";
|
|
2
|
-
export const analyticsCapabilities = [
|
|
3
|
-
{
|
|
4
|
-
id: "analytics.historical-return",
|
|
5
|
-
kind: "read",
|
|
6
|
-
visibility: publicRuntimeVisibility,
|
|
7
|
-
description: "Calculate historical return for a saved portfolio or an ad-hoc weighted basket.",
|
|
8
|
-
http: {
|
|
9
|
-
method: "POST",
|
|
10
|
-
path: "/api/desk/tools/portfolio/historical_return",
|
|
11
|
-
inputMode: "json_body",
|
|
12
|
-
schemas: {
|
|
13
|
-
request: "PortfolioHistoricalReturnRequest",
|
|
14
|
-
response: "HistoricalReturnResponse",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
cli: {
|
|
18
|
-
group: "analytics",
|
|
19
|
-
command: "historical-return",
|
|
20
|
-
summary: "Calculate historical return for a saved portfolio or repeated --asset inputs.",
|
|
21
|
-
positional: [],
|
|
22
|
-
options: [
|
|
23
|
-
{
|
|
24
|
-
kind: "option",
|
|
25
|
-
flag: "--portfolio",
|
|
26
|
-
name: "portfolio_id",
|
|
27
|
-
type: "integer",
|
|
28
|
-
required: false,
|
|
29
|
-
placeholder: "ID",
|
|
30
|
-
exclusiveGroup: "source",
|
|
31
|
-
description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
kind: "option",
|
|
35
|
-
flag: "--asset",
|
|
36
|
-
name: "assets",
|
|
37
|
-
type: "string_array",
|
|
38
|
-
required: false,
|
|
39
|
-
placeholder: "TICKER[:PESO]",
|
|
40
|
-
multiple: true,
|
|
41
|
-
collectionFormat: "repeatable",
|
|
42
|
-
exclusiveGroup: "source",
|
|
43
|
-
description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:50.",
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
kind: "option",
|
|
47
|
-
flag: "--from",
|
|
48
|
-
name: "start_date",
|
|
49
|
-
type: "string",
|
|
50
|
-
required: true,
|
|
51
|
-
placeholder: "AAAA-MM-DD",
|
|
52
|
-
description: "Inclusive start date in ISO format.",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
kind: "option",
|
|
56
|
-
flag: "--to",
|
|
57
|
-
name: "end_date",
|
|
58
|
-
type: "string",
|
|
59
|
-
required: true,
|
|
60
|
-
placeholder: "AAAA-MM-DD",
|
|
61
|
-
description: "Inclusive end date in ISO format.",
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
examples: [
|
|
65
|
-
"quantbrasil analytics historical-return --portfolio 123 --from 2024-01-01 --to 2025-01-01",
|
|
66
|
-
"quantbrasil analytics historical-return --asset PRIO3:50 --asset VALE3:50 --from 2021-01-01 --to 2025-01-01",
|
|
67
|
-
],
|
|
68
|
-
},
|
|
69
|
-
tool: {
|
|
70
|
-
name: "qb_historical_return",
|
|
71
|
-
title: "Calculate historical return",
|
|
72
|
-
},
|
|
73
|
-
outputModes: standardOutputModes,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
id: "analytics.beta",
|
|
77
|
-
kind: "read",
|
|
78
|
-
visibility: publicRuntimeVisibility,
|
|
79
|
-
description: "Calculate portfolio beta against IBOV for a saved portfolio or an ad-hoc basket.",
|
|
80
|
-
http: {
|
|
81
|
-
method: "POST",
|
|
82
|
-
path: "/api/desk/tools/portfolio/beta",
|
|
83
|
-
inputMode: "json_body",
|
|
84
|
-
schemas: {
|
|
85
|
-
request: "PortfolioBetaRequest",
|
|
86
|
-
response: "PortfolioBetaResponse",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
cli: {
|
|
90
|
-
group: "analytics",
|
|
91
|
-
command: "beta",
|
|
92
|
-
summary: "Calculate portfolio beta against IBOV.",
|
|
93
|
-
positional: [],
|
|
94
|
-
options: [
|
|
95
|
-
{
|
|
96
|
-
kind: "option",
|
|
97
|
-
flag: "--portfolio",
|
|
98
|
-
name: "portfolio_id",
|
|
99
|
-
type: "integer",
|
|
100
|
-
required: false,
|
|
101
|
-
placeholder: "ID",
|
|
102
|
-
exclusiveGroup: "source",
|
|
103
|
-
description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
kind: "option",
|
|
107
|
-
flag: "--asset",
|
|
108
|
-
name: "assets",
|
|
109
|
-
type: "string_array",
|
|
110
|
-
required: false,
|
|
111
|
-
placeholder: "TICKER[:PESO]",
|
|
112
|
-
multiple: true,
|
|
113
|
-
collectionFormat: "repeatable",
|
|
114
|
-
exclusiveGroup: "source",
|
|
115
|
-
description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PETR4:120 or WINFUT:-20.",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
kind: "option",
|
|
119
|
-
flag: "--years",
|
|
120
|
-
name: "years",
|
|
121
|
-
type: "enum",
|
|
122
|
-
required: false,
|
|
123
|
-
placeholder: "ANOS",
|
|
124
|
-
defaultValue: 1,
|
|
125
|
-
enumValues: ["1", "3", "5"],
|
|
126
|
-
description: "Historical lookback window in years. Accepted values: 1, 3, or 5.",
|
|
127
|
-
},
|
|
128
|
-
],
|
|
129
|
-
examples: [
|
|
130
|
-
"quantbrasil analytics beta --portfolio 123 --years 3",
|
|
131
|
-
"quantbrasil analytics beta --asset PRIO3:120 --asset WINFUT:-20 --years 1",
|
|
132
|
-
],
|
|
133
|
-
},
|
|
134
|
-
tool: {
|
|
135
|
-
name: "qb_portfolio_beta",
|
|
136
|
-
title: "Calculate portfolio beta",
|
|
137
|
-
},
|
|
138
|
-
outputModes: standardOutputModes,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
id: "analytics.var",
|
|
142
|
-
kind: "read",
|
|
143
|
-
visibility: publicRuntimeVisibility,
|
|
144
|
-
description: "Calculate one-day Value-at-Risk for a saved portfolio or an ad-hoc basket.",
|
|
145
|
-
http: {
|
|
146
|
-
method: "POST",
|
|
147
|
-
path: "/api/desk/tools/portfolio/var",
|
|
148
|
-
inputMode: "json_body",
|
|
149
|
-
schemas: {
|
|
150
|
-
request: "PortfolioVaRRequest",
|
|
151
|
-
response: "PortfolioVaRResponse",
|
|
152
|
-
},
|
|
153
|
-
},
|
|
154
|
-
cli: {
|
|
155
|
-
group: "analytics",
|
|
156
|
-
command: "var",
|
|
157
|
-
summary: "Calculate one-day Value-at-Risk for a portfolio or basket.",
|
|
158
|
-
positional: [],
|
|
159
|
-
options: [
|
|
160
|
-
{
|
|
161
|
-
kind: "option",
|
|
162
|
-
flag: "--portfolio",
|
|
163
|
-
name: "portfolio_id",
|
|
164
|
-
type: "integer",
|
|
165
|
-
required: false,
|
|
166
|
-
placeholder: "ID",
|
|
167
|
-
exclusiveGroup: "source",
|
|
168
|
-
description: "Saved portfolio id. Use exactly one source: --portfolio or repeated --asset.",
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
kind: "option",
|
|
172
|
-
flag: "--asset",
|
|
173
|
-
name: "assets",
|
|
174
|
-
type: "string_array",
|
|
175
|
-
required: false,
|
|
176
|
-
placeholder: "TICKER[:PESO]",
|
|
177
|
-
multiple: true,
|
|
178
|
-
collectionFormat: "repeatable",
|
|
179
|
-
exclusiveGroup: "source",
|
|
180
|
-
description: "Repeatable ad-hoc asset input using TICKER[:WEIGHT_PCT], for example PRIO3:120 or WINFUT:-20.",
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
kind: "option",
|
|
184
|
-
flag: "--years",
|
|
185
|
-
name: "years",
|
|
186
|
-
type: "integer",
|
|
187
|
-
required: false,
|
|
188
|
-
placeholder: "ANOS",
|
|
189
|
-
defaultValue: 1,
|
|
190
|
-
description: "Historical lookback window in years. The VaR horizon remains one day.",
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
kind: "option",
|
|
194
|
-
flag: "--confidence",
|
|
195
|
-
name: "confidence_pct",
|
|
196
|
-
type: "number",
|
|
197
|
-
required: false,
|
|
198
|
-
placeholder: "PERCENTUAL",
|
|
199
|
-
defaultValue: 95,
|
|
200
|
-
description: "Confidence level in percent, for example 95 or 99.",
|
|
201
|
-
},
|
|
202
|
-
],
|
|
203
|
-
examples: [
|
|
204
|
-
"quantbrasil analytics var --portfolio 123 --years 1 --confidence 95",
|
|
205
|
-
"quantbrasil analytics var --asset PRIO3:50 --asset VALE3:50 --years 3 --confidence 99",
|
|
206
|
-
],
|
|
207
|
-
},
|
|
208
|
-
tool: {
|
|
209
|
-
name: "qb_portfolio_var",
|
|
210
|
-
title: "Calculate portfolio VaR",
|
|
211
|
-
},
|
|
212
|
-
outputModes: standardOutputModes,
|
|
213
|
-
},
|
|
214
|
-
];
|