opentool 0.20.1 → 0.21.0
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/dist/adapters/hyperliquid/browser.d.ts +2 -2
- package/dist/adapters/hyperliquid/index.d.ts +3 -3
- package/dist/adapters/polymarket/index.d.ts +1 -1
- package/dist/{browser-z97Ptt32.d.ts → browser-Bf-eTSwj.d.ts} +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1262 -5
- package/dist/index.js.map +1 -1
- package/dist/mpp/index.d.ts +64 -0
- package/dist/mpp/index.js +75 -0
- package/dist/mpp/index.js.map +1 -0
- package/dist/quant/index.d.ts +579 -0
- package/dist/quant/index.js +1103 -0
- package/dist/quant/index.js.map +1 -0
- package/dist/{types-BaTmu0gS.d.ts → types-D8s9zx-U.d.ts} +18 -1
- package/dist/wallet/browser.d.ts +1 -1
- package/dist/wallet/browser.js +27 -1
- package/dist/wallet/browser.js.map +1 -1
- package/dist/wallet/index.d.ts +2 -2
- package/dist/wallet/index.js +96 -4
- package/dist/wallet/index.js.map +1 -1
- package/package.json +11 -2
- package/templates/base/package.json +1 -1
- package/templates/polymarket-simple-trade/package.json +1 -1
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const quantStrategyFamilySchema: z.ZodEnum<{
|
|
4
|
+
execution: "execution";
|
|
5
|
+
benchmark: "benchmark";
|
|
6
|
+
signal_rule: "signal_rule";
|
|
7
|
+
trend: "trend";
|
|
8
|
+
mean_reversion: "mean_reversion";
|
|
9
|
+
stat_arb: "stat_arb";
|
|
10
|
+
carry: "carry";
|
|
11
|
+
hedge: "hedge";
|
|
12
|
+
market_making: "market_making";
|
|
13
|
+
options: "options";
|
|
14
|
+
regime_ml: "regime_ml";
|
|
15
|
+
prediction_market: "prediction_market";
|
|
16
|
+
defi_lp: "defi_lp";
|
|
17
|
+
}>;
|
|
18
|
+
type QuantStrategyFamily = z.infer<typeof quantStrategyFamilySchema>;
|
|
19
|
+
declare const quantTestKindSchema: z.ZodEnum<{
|
|
20
|
+
prompt_plan_check: "prompt_plan_check";
|
|
21
|
+
data_availability: "data_availability";
|
|
22
|
+
signal_study: "signal_study";
|
|
23
|
+
idea_rule_simulation: "idea_rule_simulation";
|
|
24
|
+
variant_sensitivity: "variant_sensitivity";
|
|
25
|
+
leakage_check: "leakage_check";
|
|
26
|
+
cost_stress: "cost_stress";
|
|
27
|
+
}>;
|
|
28
|
+
type QuantTestKind = z.infer<typeof quantTestKindSchema>;
|
|
29
|
+
declare const quantResolutionSchema: z.ZodEnum<{
|
|
30
|
+
1: "1";
|
|
31
|
+
5: "5";
|
|
32
|
+
15: "15";
|
|
33
|
+
30: "30";
|
|
34
|
+
60: "60";
|
|
35
|
+
240: "240";
|
|
36
|
+
"1D": "1D";
|
|
37
|
+
"1W": "1W";
|
|
38
|
+
}>;
|
|
39
|
+
type QuantResolution = z.infer<typeof quantResolutionSchema>;
|
|
40
|
+
declare const quantBarSchema: z.ZodObject<{
|
|
41
|
+
time: z.ZodNumber;
|
|
42
|
+
open: z.ZodNumber;
|
|
43
|
+
high: z.ZodNumber;
|
|
44
|
+
low: z.ZodNumber;
|
|
45
|
+
close: z.ZodNumber;
|
|
46
|
+
volume: z.ZodOptional<z.ZodNumber>;
|
|
47
|
+
fundingRate: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
type QuantBar = z.infer<typeof quantBarSchema>;
|
|
50
|
+
declare const quantFeatureSpecSchema: z.ZodObject<{
|
|
51
|
+
id: z.ZodString;
|
|
52
|
+
kind: z.ZodString;
|
|
53
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
type QuantFeatureSpec = z.infer<typeof quantFeatureSpecSchema>;
|
|
56
|
+
declare const quantRuleSpecSchema: z.ZodObject<{
|
|
57
|
+
kind: z.ZodString;
|
|
58
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
type QuantRuleSpec = z.infer<typeof quantRuleSpecSchema>;
|
|
61
|
+
declare const quantIdeaSpecV1Schema: z.ZodObject<{
|
|
62
|
+
version: z.ZodLiteral<"1">;
|
|
63
|
+
family: z.ZodEnum<{
|
|
64
|
+
execution: "execution";
|
|
65
|
+
benchmark: "benchmark";
|
|
66
|
+
signal_rule: "signal_rule";
|
|
67
|
+
trend: "trend";
|
|
68
|
+
mean_reversion: "mean_reversion";
|
|
69
|
+
stat_arb: "stat_arb";
|
|
70
|
+
carry: "carry";
|
|
71
|
+
hedge: "hedge";
|
|
72
|
+
market_making: "market_making";
|
|
73
|
+
options: "options";
|
|
74
|
+
regime_ml: "regime_ml";
|
|
75
|
+
prediction_market: "prediction_market";
|
|
76
|
+
defi_lp: "defi_lp";
|
|
77
|
+
}>;
|
|
78
|
+
thesis: z.ZodObject<{
|
|
79
|
+
title: z.ZodString;
|
|
80
|
+
belief: z.ZodString;
|
|
81
|
+
expectedDirection: z.ZodEnum<{
|
|
82
|
+
unknown: "unknown";
|
|
83
|
+
down: "down";
|
|
84
|
+
up: "up";
|
|
85
|
+
carry: "carry";
|
|
86
|
+
hedge: "hedge";
|
|
87
|
+
relative: "relative";
|
|
88
|
+
mean_revert: "mean_revert";
|
|
89
|
+
volatility: "volatility";
|
|
90
|
+
}>;
|
|
91
|
+
horizon: z.ZodArray<z.ZodString>;
|
|
92
|
+
}, z.core.$strict>;
|
|
93
|
+
market: z.ZodObject<{
|
|
94
|
+
venue: z.ZodEnum<{
|
|
95
|
+
hyperliquid: "hyperliquid";
|
|
96
|
+
derive: "derive";
|
|
97
|
+
polymarket: "polymarket";
|
|
98
|
+
external_fixture: "external_fixture";
|
|
99
|
+
}>;
|
|
100
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
101
|
+
universe: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
}, z.core.$strict>;
|
|
103
|
+
requiredSources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
104
|
+
features: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
105
|
+
id: z.ZodString;
|
|
106
|
+
kind: z.ZodString;
|
|
107
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
108
|
+
}, z.core.$strict>>>;
|
|
109
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
110
|
+
kind: z.ZodString;
|
|
111
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
112
|
+
}, z.core.$strict>>;
|
|
113
|
+
risk: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
maxPositionUsd: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
maxLeverage: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
stopLossPct: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
takeProfitPct: z.ZodOptional<z.ZodNumber>;
|
|
118
|
+
maxDrawdownPct: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
}, z.core.$strict>>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
type QuantIdeaSpecV1 = z.infer<typeof quantIdeaSpecV1Schema>;
|
|
122
|
+
declare const quantTestRequestV1Schema: z.ZodObject<{
|
|
123
|
+
version: z.ZodLiteral<"1">;
|
|
124
|
+
idea: z.ZodObject<{
|
|
125
|
+
version: z.ZodLiteral<"1">;
|
|
126
|
+
family: z.ZodEnum<{
|
|
127
|
+
execution: "execution";
|
|
128
|
+
benchmark: "benchmark";
|
|
129
|
+
signal_rule: "signal_rule";
|
|
130
|
+
trend: "trend";
|
|
131
|
+
mean_reversion: "mean_reversion";
|
|
132
|
+
stat_arb: "stat_arb";
|
|
133
|
+
carry: "carry";
|
|
134
|
+
hedge: "hedge";
|
|
135
|
+
market_making: "market_making";
|
|
136
|
+
options: "options";
|
|
137
|
+
regime_ml: "regime_ml";
|
|
138
|
+
prediction_market: "prediction_market";
|
|
139
|
+
defi_lp: "defi_lp";
|
|
140
|
+
}>;
|
|
141
|
+
thesis: z.ZodObject<{
|
|
142
|
+
title: z.ZodString;
|
|
143
|
+
belief: z.ZodString;
|
|
144
|
+
expectedDirection: z.ZodEnum<{
|
|
145
|
+
unknown: "unknown";
|
|
146
|
+
down: "down";
|
|
147
|
+
up: "up";
|
|
148
|
+
carry: "carry";
|
|
149
|
+
hedge: "hedge";
|
|
150
|
+
relative: "relative";
|
|
151
|
+
mean_revert: "mean_revert";
|
|
152
|
+
volatility: "volatility";
|
|
153
|
+
}>;
|
|
154
|
+
horizon: z.ZodArray<z.ZodString>;
|
|
155
|
+
}, z.core.$strict>;
|
|
156
|
+
market: z.ZodObject<{
|
|
157
|
+
venue: z.ZodEnum<{
|
|
158
|
+
hyperliquid: "hyperliquid";
|
|
159
|
+
derive: "derive";
|
|
160
|
+
polymarket: "polymarket";
|
|
161
|
+
external_fixture: "external_fixture";
|
|
162
|
+
}>;
|
|
163
|
+
symbol: z.ZodOptional<z.ZodString>;
|
|
164
|
+
universe: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
requiredSources: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
167
|
+
features: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
168
|
+
id: z.ZodString;
|
|
169
|
+
kind: z.ZodString;
|
|
170
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
|
+
}, z.core.$strict>>>;
|
|
172
|
+
rule: z.ZodOptional<z.ZodObject<{
|
|
173
|
+
kind: z.ZodString;
|
|
174
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
175
|
+
}, z.core.$strict>>;
|
|
176
|
+
risk: z.ZodOptional<z.ZodObject<{
|
|
177
|
+
maxPositionUsd: z.ZodOptional<z.ZodNumber>;
|
|
178
|
+
maxLeverage: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
stopLossPct: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
takeProfitPct: z.ZodOptional<z.ZodNumber>;
|
|
181
|
+
maxDrawdownPct: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
}, z.core.$strict>>;
|
|
183
|
+
}, z.core.$strict>;
|
|
184
|
+
testKinds: z.ZodArray<z.ZodEnum<{
|
|
185
|
+
prompt_plan_check: "prompt_plan_check";
|
|
186
|
+
data_availability: "data_availability";
|
|
187
|
+
signal_study: "signal_study";
|
|
188
|
+
idea_rule_simulation: "idea_rule_simulation";
|
|
189
|
+
variant_sensitivity: "variant_sensitivity";
|
|
190
|
+
leakage_check: "leakage_check";
|
|
191
|
+
cost_stress: "cost_stress";
|
|
192
|
+
}>>;
|
|
193
|
+
window: z.ZodObject<{
|
|
194
|
+
resolution: z.ZodEnum<{
|
|
195
|
+
1: "1";
|
|
196
|
+
5: "5";
|
|
197
|
+
15: "15";
|
|
198
|
+
30: "30";
|
|
199
|
+
60: "60";
|
|
200
|
+
240: "240";
|
|
201
|
+
"1D": "1D";
|
|
202
|
+
"1W": "1W";
|
|
203
|
+
}>;
|
|
204
|
+
timeframeStart: z.ZodString;
|
|
205
|
+
timeframeEnd: z.ZodString;
|
|
206
|
+
warmupBars: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
}, z.core.$strict>;
|
|
208
|
+
assumptions: z.ZodDefault<z.ZodObject<{
|
|
209
|
+
initialEquityUsd: z.ZodOptional<z.ZodNumber>;
|
|
210
|
+
makerFeeBps: z.ZodOptional<z.ZodNumber>;
|
|
211
|
+
takerFeeBps: z.ZodOptional<z.ZodNumber>;
|
|
212
|
+
slippageBps: z.ZodOptional<z.ZodNumber>;
|
|
213
|
+
fundingModel: z.ZodOptional<z.ZodEnum<{
|
|
214
|
+
ignore: "ignore";
|
|
215
|
+
historical: "historical";
|
|
216
|
+
estimated: "estimated";
|
|
217
|
+
}>>;
|
|
218
|
+
}, z.core.$strict>>;
|
|
219
|
+
variantSpace: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
220
|
+
}, z.core.$strict>;
|
|
221
|
+
type QuantTestRequestV1 = z.infer<typeof quantTestRequestV1Schema>;
|
|
222
|
+
declare const quantDecisionActionSchema: z.ZodEnum<{
|
|
223
|
+
flat: "flat";
|
|
224
|
+
hold: "hold";
|
|
225
|
+
long: "long";
|
|
226
|
+
short: "short";
|
|
227
|
+
exit: "exit";
|
|
228
|
+
}>;
|
|
229
|
+
type QuantDecisionAction = z.infer<typeof quantDecisionActionSchema>;
|
|
230
|
+
declare const quantDecisionSchema: z.ZodObject<{
|
|
231
|
+
time: z.ZodNumber;
|
|
232
|
+
symbol: z.ZodString;
|
|
233
|
+
action: z.ZodEnum<{
|
|
234
|
+
flat: "flat";
|
|
235
|
+
hold: "hold";
|
|
236
|
+
long: "long";
|
|
237
|
+
short: "short";
|
|
238
|
+
exit: "exit";
|
|
239
|
+
}>;
|
|
240
|
+
targetPosition: z.ZodNumber;
|
|
241
|
+
reason: z.ZodString;
|
|
242
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
243
|
+
}, z.core.$strict>;
|
|
244
|
+
type QuantDecision = z.infer<typeof quantDecisionSchema>;
|
|
245
|
+
declare const quantDecisionArtifactV1Schema: z.ZodObject<{
|
|
246
|
+
version: z.ZodLiteral<"1">;
|
|
247
|
+
family: z.ZodEnum<{
|
|
248
|
+
execution: "execution";
|
|
249
|
+
benchmark: "benchmark";
|
|
250
|
+
signal_rule: "signal_rule";
|
|
251
|
+
trend: "trend";
|
|
252
|
+
mean_reversion: "mean_reversion";
|
|
253
|
+
stat_arb: "stat_arb";
|
|
254
|
+
carry: "carry";
|
|
255
|
+
hedge: "hedge";
|
|
256
|
+
market_making: "market_making";
|
|
257
|
+
options: "options";
|
|
258
|
+
regime_ml: "regime_ml";
|
|
259
|
+
prediction_market: "prediction_market";
|
|
260
|
+
defi_lp: "defi_lp";
|
|
261
|
+
}>;
|
|
262
|
+
symbol: z.ZodString;
|
|
263
|
+
resolution: z.ZodEnum<{
|
|
264
|
+
1: "1";
|
|
265
|
+
5: "5";
|
|
266
|
+
15: "15";
|
|
267
|
+
30: "30";
|
|
268
|
+
60: "60";
|
|
269
|
+
240: "240";
|
|
270
|
+
"1D": "1D";
|
|
271
|
+
"1W": "1W";
|
|
272
|
+
}>;
|
|
273
|
+
decisions: z.ZodArray<z.ZodObject<{
|
|
274
|
+
time: z.ZodNumber;
|
|
275
|
+
symbol: z.ZodString;
|
|
276
|
+
action: z.ZodEnum<{
|
|
277
|
+
flat: "flat";
|
|
278
|
+
hold: "hold";
|
|
279
|
+
long: "long";
|
|
280
|
+
short: "short";
|
|
281
|
+
exit: "exit";
|
|
282
|
+
}>;
|
|
283
|
+
targetPosition: z.ZodNumber;
|
|
284
|
+
reason: z.ZodString;
|
|
285
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
}, z.core.$strict>>;
|
|
287
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
288
|
+
}, z.core.$strict>;
|
|
289
|
+
type QuantDecisionArtifactV1 = z.infer<typeof quantDecisionArtifactV1Schema>;
|
|
290
|
+
declare const quantTesterReportV1Schema: z.ZodObject<{
|
|
291
|
+
ok: z.ZodBoolean;
|
|
292
|
+
testRunKind: z.ZodEnum<{
|
|
293
|
+
prompt_plan_check: "prompt_plan_check";
|
|
294
|
+
data_availability: "data_availability";
|
|
295
|
+
signal_study: "signal_study";
|
|
296
|
+
idea_rule_simulation: "idea_rule_simulation";
|
|
297
|
+
variant_sensitivity: "variant_sensitivity";
|
|
298
|
+
}>;
|
|
299
|
+
supported: z.ZodBoolean;
|
|
300
|
+
unsupportedReason: z.ZodOptional<z.ZodString>;
|
|
301
|
+
summary: z.ZodString;
|
|
302
|
+
dataLineage: z.ZodObject<{
|
|
303
|
+
venue: z.ZodString;
|
|
304
|
+
symbols: z.ZodArray<z.ZodString>;
|
|
305
|
+
resolution: z.ZodEnum<{
|
|
306
|
+
1: "1";
|
|
307
|
+
5: "5";
|
|
308
|
+
15: "15";
|
|
309
|
+
30: "30";
|
|
310
|
+
60: "60";
|
|
311
|
+
240: "240";
|
|
312
|
+
"1D": "1D";
|
|
313
|
+
"1W": "1W";
|
|
314
|
+
}>;
|
|
315
|
+
timeframeStart: z.ZodString;
|
|
316
|
+
timeframeEnd: z.ZodString;
|
|
317
|
+
sourceIds: z.ZodArray<z.ZodString>;
|
|
318
|
+
warnings: z.ZodArray<z.ZodString>;
|
|
319
|
+
}, z.core.$strict>;
|
|
320
|
+
signalStudy: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
321
|
+
ideaSimulation: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
322
|
+
decisionArtifact: z.ZodOptional<z.ZodObject<{
|
|
323
|
+
version: z.ZodLiteral<"1">;
|
|
324
|
+
family: z.ZodEnum<{
|
|
325
|
+
execution: "execution";
|
|
326
|
+
benchmark: "benchmark";
|
|
327
|
+
signal_rule: "signal_rule";
|
|
328
|
+
trend: "trend";
|
|
329
|
+
mean_reversion: "mean_reversion";
|
|
330
|
+
stat_arb: "stat_arb";
|
|
331
|
+
carry: "carry";
|
|
332
|
+
hedge: "hedge";
|
|
333
|
+
market_making: "market_making";
|
|
334
|
+
options: "options";
|
|
335
|
+
regime_ml: "regime_ml";
|
|
336
|
+
prediction_market: "prediction_market";
|
|
337
|
+
defi_lp: "defi_lp";
|
|
338
|
+
}>;
|
|
339
|
+
symbol: z.ZodString;
|
|
340
|
+
resolution: z.ZodEnum<{
|
|
341
|
+
1: "1";
|
|
342
|
+
5: "5";
|
|
343
|
+
15: "15";
|
|
344
|
+
30: "30";
|
|
345
|
+
60: "60";
|
|
346
|
+
240: "240";
|
|
347
|
+
"1D": "1D";
|
|
348
|
+
"1W": "1W";
|
|
349
|
+
}>;
|
|
350
|
+
decisions: z.ZodArray<z.ZodObject<{
|
|
351
|
+
time: z.ZodNumber;
|
|
352
|
+
symbol: z.ZodString;
|
|
353
|
+
action: z.ZodEnum<{
|
|
354
|
+
flat: "flat";
|
|
355
|
+
hold: "hold";
|
|
356
|
+
long: "long";
|
|
357
|
+
short: "short";
|
|
358
|
+
exit: "exit";
|
|
359
|
+
}>;
|
|
360
|
+
targetPosition: z.ZodNumber;
|
|
361
|
+
reason: z.ZodString;
|
|
362
|
+
price: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
}, z.core.$strict>>;
|
|
364
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
365
|
+
}, z.core.$strict>>;
|
|
366
|
+
warnings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
367
|
+
}, z.core.$strict>;
|
|
368
|
+
type QuantTesterReportV1 = z.infer<typeof quantTesterReportV1Schema>;
|
|
369
|
+
|
|
370
|
+
declare function normalizeQuantBars(input: unknown): QuantBar[];
|
|
371
|
+
declare function closePrices(bars: QuantBar[]): number[];
|
|
372
|
+
declare function typicalPrices(bars: QuantBar[]): number[];
|
|
373
|
+
declare function sliceBarsToWindow(params: {
|
|
374
|
+
bars: QuantBar[];
|
|
375
|
+
endSeconds: number;
|
|
376
|
+
startSeconds: number;
|
|
377
|
+
warmupBars?: number;
|
|
378
|
+
}): QuantBar[];
|
|
379
|
+
|
|
380
|
+
declare function validateDecisionArtifact(value: unknown): QuantDecisionArtifactV1;
|
|
381
|
+
declare function compactDecisionChanges(decisions: QuantDecision[]): QuantDecision[];
|
|
382
|
+
|
|
383
|
+
declare function beta(assetReturns: number[], benchmarkReturns: number[]): number | null;
|
|
384
|
+
|
|
385
|
+
declare function correlation(a: number[], b: number[]): number | null;
|
|
386
|
+
declare function rollingCorrelation(a: number[], b: number[], period?: number): Array<number | null>;
|
|
387
|
+
|
|
388
|
+
declare function fundingRates(bars: QuantBar[]): number[];
|
|
389
|
+
declare function cumulativeFunding(bars: QuantBar[]): number[];
|
|
390
|
+
|
|
391
|
+
declare function momentum(values: number[], lookbackBars: number): Array<number | null>;
|
|
392
|
+
|
|
393
|
+
declare function relativeStrength(assetPrices: number[], benchmarkPrices: number[], lookbackBars: number): Array<number | null>;
|
|
394
|
+
|
|
395
|
+
declare function simpleReturns(values: number[]): number[];
|
|
396
|
+
declare function logReturns(values: number[]): number[];
|
|
397
|
+
declare function forwardReturns(values: number[], horizonBars: number): Array<number | null>;
|
|
398
|
+
|
|
399
|
+
declare function volumes(bars: QuantBar[]): number[];
|
|
400
|
+
declare function relativeVolume(bars: QuantBar[], period?: number): Array<number | null>;
|
|
401
|
+
|
|
402
|
+
declare function trueRanges(bars: QuantBar[]): number[];
|
|
403
|
+
declare function atr(bars: QuantBar[], period?: number): Array<number | null>;
|
|
404
|
+
|
|
405
|
+
type BollingerPoint = {
|
|
406
|
+
lower: number | null;
|
|
407
|
+
middle: number | null;
|
|
408
|
+
upper: number | null;
|
|
409
|
+
width: number | null;
|
|
410
|
+
};
|
|
411
|
+
declare function bollinger(values: number[], period?: number, standardDeviations?: number): BollingerPoint[];
|
|
412
|
+
|
|
413
|
+
type DonchianPoint = {
|
|
414
|
+
lower: number | null;
|
|
415
|
+
upper: number | null;
|
|
416
|
+
};
|
|
417
|
+
declare function donchian(highs: number[], lows: number[], period?: number): DonchianPoint[];
|
|
418
|
+
|
|
419
|
+
declare function ema(values: number[], period: number): Array<number | null>;
|
|
420
|
+
|
|
421
|
+
type MacdPoint = {
|
|
422
|
+
histogram: number | null;
|
|
423
|
+
macd: number | null;
|
|
424
|
+
signal: number | null;
|
|
425
|
+
};
|
|
426
|
+
declare function macd(values: number[], fastPeriod?: number, slowPeriod?: number, signalPeriod?: number): MacdPoint[];
|
|
427
|
+
|
|
428
|
+
declare function rsi(values: number[], period?: number): Array<number | null>;
|
|
429
|
+
|
|
430
|
+
declare function sma(values: number[], period: number): Array<number | null>;
|
|
431
|
+
|
|
432
|
+
declare function rollingVolatility(returns: number[], period?: number, annualization?: number): Array<number | null>;
|
|
433
|
+
|
|
434
|
+
declare function rollingZScore(values: number[], period?: number): Array<number | null>;
|
|
435
|
+
|
|
436
|
+
declare function buildQuantDataLineage(params: {
|
|
437
|
+
bars: QuantBar[];
|
|
438
|
+
request: QuantTestRequestV1;
|
|
439
|
+
warnings?: string[];
|
|
440
|
+
}): {
|
|
441
|
+
venue: "hyperliquid" | "derive" | "polymarket" | "external_fixture";
|
|
442
|
+
symbols: string[];
|
|
443
|
+
resolution: "1" | "5" | "15" | "30" | "60" | "240" | "1D" | "1W";
|
|
444
|
+
timeframeStart: string;
|
|
445
|
+
timeframeEnd: string;
|
|
446
|
+
sourceIds: string[];
|
|
447
|
+
warnings: string[];
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
type QuantMetricSummary = {
|
|
451
|
+
count: number;
|
|
452
|
+
max: number | null;
|
|
453
|
+
mean: number | null;
|
|
454
|
+
median: number | null;
|
|
455
|
+
min: number | null;
|
|
456
|
+
positiveRate: number | null;
|
|
457
|
+
standardDeviation: number | null;
|
|
458
|
+
};
|
|
459
|
+
declare function summarizeNumbers(values: number[]): QuantMetricSummary;
|
|
460
|
+
|
|
461
|
+
type ExcursionSummary = {
|
|
462
|
+
averageAdverse: number | null;
|
|
463
|
+
averageFavorable: number | null;
|
|
464
|
+
count: number;
|
|
465
|
+
};
|
|
466
|
+
declare function summarizeExcursions(params: {
|
|
467
|
+
bars: QuantBar[];
|
|
468
|
+
condition: boolean[];
|
|
469
|
+
horizonBars: number;
|
|
470
|
+
}): ExcursionSummary;
|
|
471
|
+
|
|
472
|
+
type EventWindow = {
|
|
473
|
+
endTime: number;
|
|
474
|
+
eventTime: number;
|
|
475
|
+
startTime: number;
|
|
476
|
+
};
|
|
477
|
+
declare function buildEventWindows(params: {
|
|
478
|
+
bars: QuantBar[];
|
|
479
|
+
condition: boolean[];
|
|
480
|
+
postBars: number;
|
|
481
|
+
preBars: number;
|
|
482
|
+
}): EventWindow[];
|
|
483
|
+
|
|
484
|
+
type ForwardReturnStudy = {
|
|
485
|
+
conditioned: QuantMetricSummary;
|
|
486
|
+
horizonBars: number;
|
|
487
|
+
unconditional: QuantMetricSummary;
|
|
488
|
+
};
|
|
489
|
+
declare function studyForwardReturns(params: {
|
|
490
|
+
condition: boolean[];
|
|
491
|
+
horizonBars: number;
|
|
492
|
+
prices: number[];
|
|
493
|
+
}): ForwardReturnStudy;
|
|
494
|
+
|
|
495
|
+
declare function hitRate(values: number[]): number | null;
|
|
496
|
+
|
|
497
|
+
declare function informationCoefficient(params: {
|
|
498
|
+
forwardReturns: Array<number | null>;
|
|
499
|
+
signal: Array<number | null>;
|
|
500
|
+
}): number | null;
|
|
501
|
+
|
|
502
|
+
declare function signalStudySummary(params: {
|
|
503
|
+
conditionedCount: number;
|
|
504
|
+
conditionedMean: number | null;
|
|
505
|
+
unconditionalMean: number | null;
|
|
506
|
+
}): string;
|
|
507
|
+
|
|
508
|
+
declare const DONCHIAN_BREAKOUT_RULE_KIND: "donchian_breakout";
|
|
509
|
+
|
|
510
|
+
declare const FUNDING_CARRY_RULE_KIND: "funding_carry";
|
|
511
|
+
|
|
512
|
+
declare const MACD_CROSSOVER_RULE_KIND: "macd_crossover";
|
|
513
|
+
|
|
514
|
+
declare const MA_CROSS_RULE_KIND: "ma_cross";
|
|
515
|
+
|
|
516
|
+
declare const MOMENTUM_RULE_KIND: "momentum";
|
|
517
|
+
|
|
518
|
+
type QuantSupportLevel = "v1_replayable" | "v1_signal_or_idea_test" | "advanced_research" | "unsupported_until_data";
|
|
519
|
+
type QuantFamilyCapability = {
|
|
520
|
+
aliases: string[];
|
|
521
|
+
family: QuantStrategyFamily;
|
|
522
|
+
supportLevel: QuantSupportLevel;
|
|
523
|
+
supportedTestKinds: QuantTestKind[];
|
|
524
|
+
};
|
|
525
|
+
declare const QUANT_FAMILY_CAPABILITIES: QuantFamilyCapability[];
|
|
526
|
+
declare function resolveQuantFamilyCapability(value: string): QuantFamilyCapability | null;
|
|
527
|
+
|
|
528
|
+
declare const RSI_MEAN_REVERSION_RULE_KIND: "rsi_mean_reversion";
|
|
529
|
+
|
|
530
|
+
type EvaluatedRuleSeries = {
|
|
531
|
+
condition: boolean[];
|
|
532
|
+
positions: number[];
|
|
533
|
+
signal: Array<number | null>;
|
|
534
|
+
warnings: string[];
|
|
535
|
+
};
|
|
536
|
+
declare function evaluateQuantRule(params: {
|
|
537
|
+
bars: QuantBar[];
|
|
538
|
+
idea: QuantIdeaSpecV1;
|
|
539
|
+
}): EvaluatedRuleSeries;
|
|
540
|
+
|
|
541
|
+
declare const ZSCORE_MEAN_REVERSION_RULE_KIND: "zscore_mean_reversion";
|
|
542
|
+
|
|
543
|
+
type QuantTestPlan = {
|
|
544
|
+
supportedTestKinds: QuantTestKind[];
|
|
545
|
+
supportLevel: string;
|
|
546
|
+
warnings: string[];
|
|
547
|
+
};
|
|
548
|
+
declare function buildQuantTestPlan(idea: QuantIdeaSpecV1): QuantTestPlan;
|
|
549
|
+
|
|
550
|
+
declare function finalizeQuantTesterReport(report: QuantTesterReportV1): QuantTesterReportV1;
|
|
551
|
+
|
|
552
|
+
declare function runQuantIdeaTest(params: {
|
|
553
|
+
bars: QuantBar[] | unknown;
|
|
554
|
+
request: QuantTestRequestV1 | unknown;
|
|
555
|
+
}): QuantTesterReportV1;
|
|
556
|
+
|
|
557
|
+
declare function runSignalStudy(params: {
|
|
558
|
+
bars: QuantBar[] | unknown;
|
|
559
|
+
request: QuantTestRequestV1 | unknown;
|
|
560
|
+
}): QuantTesterReportV1;
|
|
561
|
+
|
|
562
|
+
declare function quantDataWarnings(params: {
|
|
563
|
+
bars: QuantBar[];
|
|
564
|
+
request: QuantTestRequestV1;
|
|
565
|
+
}): string[];
|
|
566
|
+
declare function quantCostBps(request: QuantTestRequestV1): number;
|
|
567
|
+
|
|
568
|
+
declare const QUANT_RESOLUTION_SECONDS: Record<QuantResolution, number>;
|
|
569
|
+
declare function quantResolutionToSeconds(resolution: QuantResolution): number;
|
|
570
|
+
declare function parseQuantTimeToSeconds(value: unknown): number | null;
|
|
571
|
+
declare function assertQuantWindow(params: {
|
|
572
|
+
timeframeEnd: string;
|
|
573
|
+
timeframeStart: string;
|
|
574
|
+
}): {
|
|
575
|
+
endSeconds: number;
|
|
576
|
+
startSeconds: number;
|
|
577
|
+
};
|
|
578
|
+
|
|
579
|
+
export { type BollingerPoint, DONCHIAN_BREAKOUT_RULE_KIND, type DonchianPoint, type EvaluatedRuleSeries, type EventWindow, type ExcursionSummary, FUNDING_CARRY_RULE_KIND, type ForwardReturnStudy, MACD_CROSSOVER_RULE_KIND, MA_CROSS_RULE_KIND, MOMENTUM_RULE_KIND, type MacdPoint, QUANT_FAMILY_CAPABILITIES, QUANT_RESOLUTION_SECONDS, type QuantBar, type QuantDecision, type QuantDecisionAction, type QuantDecisionArtifactV1, type QuantFamilyCapability, type QuantFeatureSpec, type QuantIdeaSpecV1, type QuantMetricSummary, type QuantResolution, type QuantRuleSpec, type QuantStrategyFamily, type QuantSupportLevel, type QuantTestKind, type QuantTestPlan, type QuantTestRequestV1, type QuantTesterReportV1, RSI_MEAN_REVERSION_RULE_KIND, ZSCORE_MEAN_REVERSION_RULE_KIND, assertQuantWindow, atr, beta, bollinger, buildEventWindows, buildQuantDataLineage, buildQuantTestPlan, closePrices, compactDecisionChanges, correlation, cumulativeFunding, donchian, ema, evaluateQuantRule, finalizeQuantTesterReport, forwardReturns, fundingRates, hitRate, informationCoefficient, logReturns, macd, momentum, normalizeQuantBars, parseQuantTimeToSeconds, quantBarSchema, quantCostBps, quantDataWarnings, quantDecisionActionSchema, quantDecisionArtifactV1Schema, quantDecisionSchema, quantFeatureSpecSchema, quantIdeaSpecV1Schema, quantResolutionSchema, quantResolutionToSeconds, quantRuleSpecSchema, quantStrategyFamilySchema, quantTestKindSchema, quantTestRequestV1Schema, quantTesterReportV1Schema, relativeStrength, relativeVolume, resolveQuantFamilyCapability, rollingCorrelation, rollingVolatility, rollingZScore, rsi, runQuantIdeaTest, runSignalStudy, signalStudySummary, simpleReturns, sliceBarsToWindow, sma, studyForwardReturns, summarizeExcursions, summarizeNumbers, trueRanges, typicalPrices, validateDecisionArtifact, volumes };
|