@qtsurfer/api-client 0.4.0 → 0.5.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/README.md +22 -22
- package/dist/index.d.ts +346 -110
- package/dist/index.js +69 -26
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +379 -0
- package/src/generated/sdk.gen.ts +93 -32
- package/src/generated/types.gen.ts +327 -91
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var client = createClient(createConfig({
|
|
|
5
5
|
}));
|
|
6
6
|
|
|
7
7
|
// src/generated/sdk.gen.ts
|
|
8
|
-
var
|
|
8
|
+
var authenticate = (options) => {
|
|
9
9
|
return (options?.client ?? client).post({
|
|
10
10
|
security: [
|
|
11
11
|
{
|
|
@@ -17,37 +17,37 @@ var auth = (options) => {
|
|
|
17
17
|
...options
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
|
-
var
|
|
20
|
+
var listExchanges = (options) => {
|
|
21
21
|
return (options?.client ?? client).get({
|
|
22
22
|
url: "/exchanges",
|
|
23
23
|
...options
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
|
-
var
|
|
26
|
+
var listInstruments = (options) => {
|
|
27
27
|
return (options.client ?? client).get({
|
|
28
28
|
url: "/exchange/{exchangeId}/instruments",
|
|
29
29
|
...options
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
|
-
var
|
|
32
|
+
var listSegmentInstruments = (options) => {
|
|
33
33
|
return (options.client ?? client).get({
|
|
34
34
|
url: "/exchange/{exchangeId}/{segment}/instruments",
|
|
35
35
|
...options
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
-
var
|
|
38
|
+
var downloadTickers = (options) => {
|
|
39
39
|
return (options.client ?? client).get({
|
|
40
40
|
url: "/exchange/{exchangeId}/tickers/{base}/{quote}",
|
|
41
41
|
...options
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
var
|
|
44
|
+
var downloadKlines = (options) => {
|
|
45
45
|
return (options.client ?? client).get({
|
|
46
46
|
url: "/exchange/{exchangeId}/klines/{base}/{quote}",
|
|
47
47
|
...options
|
|
48
48
|
});
|
|
49
49
|
};
|
|
50
|
-
var
|
|
50
|
+
var compileStrategy = (options) => {
|
|
51
51
|
return (options.client ?? client).post({
|
|
52
52
|
bodySerializer: null,
|
|
53
53
|
security: [
|
|
@@ -64,7 +64,7 @@ var postStrategy = (options) => {
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
-
var
|
|
67
|
+
var getStrategy = (options) => {
|
|
68
68
|
return (options.client ?? client).get({
|
|
69
69
|
security: [
|
|
70
70
|
{
|
|
@@ -76,7 +76,7 @@ var getStrategyStatus = (options) => {
|
|
|
76
76
|
...options
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
var
|
|
79
|
+
var prepareBacktest = (options) => {
|
|
80
80
|
return (options.client ?? client).post({
|
|
81
81
|
security: [
|
|
82
82
|
{
|
|
@@ -92,7 +92,7 @@ var prepareBacktesting = (options) => {
|
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
94
|
};
|
|
95
|
-
var
|
|
95
|
+
var getPrepareStatus = (options) => {
|
|
96
96
|
return (options.client ?? client).get({
|
|
97
97
|
security: [
|
|
98
98
|
{
|
|
@@ -104,7 +104,47 @@ var getPreparationStatus = (options) => {
|
|
|
104
104
|
...options
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
var
|
|
107
|
+
var executeSweep = (options) => {
|
|
108
|
+
return (options.client ?? client).post({
|
|
109
|
+
security: [
|
|
110
|
+
{
|
|
111
|
+
scheme: "bearer",
|
|
112
|
+
type: "http"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
url: "/backtest/{exchangeId}/{type}/executeSweep/{requestId}",
|
|
116
|
+
...options,
|
|
117
|
+
headers: {
|
|
118
|
+
"Content-Type": "application/json",
|
|
119
|
+
...options?.headers
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
var cancelSweep = (options) => {
|
|
124
|
+
return (options.client ?? client).delete({
|
|
125
|
+
security: [
|
|
126
|
+
{
|
|
127
|
+
scheme: "bearer",
|
|
128
|
+
type: "http"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
url: "/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}",
|
|
132
|
+
...options
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
var getSweepResult = (options) => {
|
|
136
|
+
return (options.client ?? client).get({
|
|
137
|
+
security: [
|
|
138
|
+
{
|
|
139
|
+
scheme: "bearer",
|
|
140
|
+
type: "http"
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
url: "/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}",
|
|
144
|
+
...options
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
var executeBacktest = (options) => {
|
|
108
148
|
return (options.client ?? client).post({
|
|
109
149
|
security: [
|
|
110
150
|
{
|
|
@@ -120,7 +160,7 @@ var executeBacktesting = (options) => {
|
|
|
120
160
|
}
|
|
121
161
|
});
|
|
122
162
|
};
|
|
123
|
-
var
|
|
163
|
+
var cancelBacktest = (options) => {
|
|
124
164
|
return (options.client ?? client).delete({
|
|
125
165
|
security: [
|
|
126
166
|
{
|
|
@@ -132,7 +172,7 @@ var cancelExecution = (options) => {
|
|
|
132
172
|
...options
|
|
133
173
|
});
|
|
134
174
|
};
|
|
135
|
-
var
|
|
175
|
+
var getBacktestResult = (options) => {
|
|
136
176
|
return (options.client ?? client).get({
|
|
137
177
|
security: [
|
|
138
178
|
{
|
|
@@ -145,19 +185,22 @@ var getExecutionResult = (options) => {
|
|
|
145
185
|
});
|
|
146
186
|
};
|
|
147
187
|
export {
|
|
148
|
-
|
|
149
|
-
|
|
188
|
+
authenticate,
|
|
189
|
+
cancelBacktest,
|
|
190
|
+
cancelSweep,
|
|
150
191
|
client,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
192
|
+
compileStrategy,
|
|
193
|
+
downloadKlines,
|
|
194
|
+
downloadTickers,
|
|
195
|
+
executeBacktest,
|
|
196
|
+
executeSweep,
|
|
197
|
+
getBacktestResult,
|
|
198
|
+
getPrepareStatus,
|
|
199
|
+
getStrategy,
|
|
200
|
+
getSweepResult,
|
|
201
|
+
listExchanges,
|
|
202
|
+
listInstruments,
|
|
203
|
+
listSegmentInstruments,
|
|
204
|
+
prepareBacktest
|
|
162
205
|
};
|
|
163
206
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ClientOptions } from './types.gen';\nimport { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions>({\n baseUrl: 'https://api.staging.qtsurfer.com/v1'\n}));","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';\nimport type { AuthData, AuthResponse, AuthError, GetExchangesData, GetExchangesResponse, GetInstrumentsData, GetInstrumentsResponse, GetInstrumentsError, GetSegmentInstrumentsData, GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, GetExchangeTickersHourData, GetExchangeTickersHourResponse, GetExchangeTickersHourError, GetExchangeKlinesHourData, GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, PostStrategyData, PostStrategyResponse, PostStrategyError, GetStrategyStatusData, GetStrategyStatusResponse, GetStrategyStatusError, PrepareBacktestingData, PrepareBacktestingResponse, PrepareBacktestingError, GetPreparationStatusData, GetPreparationStatusResponse, GetPreparationStatusError, ExecuteBacktestingData, ExecuteBacktestingResponse, ExecuteBacktestingError, CancelExecutionData, CancelExecutionResponse, CancelExecutionError, GetExecutionResultData, GetExecutionResultResponse, GetExecutionResultError } from './types.gen';\nimport { client as _heyApiClient } from './client.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Exchange API key for a short-lived JWT\n * Exchanges a long-lived API key for a short-lived JWT used by every other\n * endpoint. This is the only endpoint that accepts an API key directly —\n * callers should obtain a JWT here, then send it as `Authorization: Bearer\n * <token>` to all other operations.\n *\n * The returned JWT carries the caller's subscription `tier` as a claim and\n * expires after `expires_in` seconds. Callers should refresh the token\n * before expiry (or on a `401` response) by calling this endpoint again.\n *\n */\nexport const auth = <ThrowOnError extends boolean = false>(options?: Options<AuthData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).post<AuthResponse, AuthError, ThrowOnError>({\n security: [\n {\n name: 'X-API-Key',\n type: 'apiKey'\n }\n ],\n url: '/auth/token',\n ...options\n });\n};\n\n/**\n * Get a list of available exchanges\n */\nexport const getExchanges = <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).get<GetExchangesResponse, unknown, ThrowOnError>({\n url: '/exchanges',\n ...options\n });\n};\n\n/**\n * Get an exchange's instruments (default spot segment)\n * \"Give me binance instruments\" — returns the exchange's DEFAULT segment (`spot`)\n * in `data`, each instrument with per-data-type coverage and market info. `meta`\n * confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links.\n *\n */\nexport const getInstruments = <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetInstrumentsResponse, GetInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/instruments',\n ...options\n });\n};\n\n/**\n * Get the instruments for a specific exchange segment\n * Returns the instruments for one market segment of the exchange, each with\n * per-data-type coverage and market info. HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links; the default-segment shortcut is\n * `GET /exchange/{exchangeId}/instruments` (spot).\n *\n */\nexport const getSegmentInstruments = <ThrowOnError extends boolean = false>(options: Options<GetSegmentInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetSegmentInstrumentsResponse, GetSegmentInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/{segment}/instruments',\n ...options\n });\n};\n\n/**\n * Download one hour of tickers for an instrument as a Lastra segment\n * Serves exactly one hour of raw ticker data for the given instrument on the\n * requested exchange. The payload is a native [Lastra](https://github.com/QTSurfer/lastra-java)\n * file — QTSurfer's columnar format for tick-precision timeseries — with\n * no JSON envelope.\n *\n * One segment = one hour, aligned to UTC. The `hour` query parameter selects\n * the segment and must match `YYYY-MM-DDTHH` (no minutes/seconds, no timezone\n * suffix). Example: `hour=2026-01-15T10` returns `h10.lastra` for\n * 2026-01-15, covering `[10:00:00Z, 11:00:00Z)`. Hours not yet available\n * return `404`.\n *\n * A `format=parquet` query parameter switches the response to on-the-fly\n * Parquet conversion via [lastra-convert](https://github.com/QTSurfer/lastra-convert)\n * for clients that don't yet read Lastra. Lastra is the primary format\n * and cheaper when the client can consume it.\n *\n * Clients:\n * - [lastra-java](https://github.com/QTSurfer/lastra-java) — reference\n * Java reader/writer with per-column codecs (ALP, Gorilla, delta-varint,\n * ZSTD) and CRC32 integrity.\n * - [lastra-ts](https://github.com/QTSurfer/lastra-ts) — TypeScript reader\n * (~4 kB bundle, browser + Node.js).\n * - [duckdb-lastra](https://github.com/QTSurfer/duckdb-lastra) — DuckDB\n * extension for ad-hoc SQL over Lastra files.\n * - [lastra-convert](https://github.com/QTSurfer/lastra-convert) — CLI + Java\n * API for converting to/from Parquet, Reef, and CSV.\n * - `curl -OJ` for offline dumps (the `Content-Disposition` header sets a\n * descriptive filename).\n *\n */\nexport const getExchangeTickersHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeTickersHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeTickersHourResponse, GetExchangeTickersHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/tickers/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Download one hour of klines for an instrument as a Lastra segment\n * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,\n * but serves klines (aggregated bars) instead of raw ticks. One\n * [Lastra](https://github.com/QTSurfer/lastra-java) segment = one hour of\n * klines at the exchange's native kline cadence, aligned to UTC.\n *\n * Klines use the same columnar layout as tickers — readers that handle one\n * format read the other with the same code. Use this endpoint when a\n * per-tick payload would be too large for the window of interest.\n *\n */\nexport const getExchangeKlinesHour = <ThrowOnError extends boolean = false>(options: Options<GetExchangeKlinesHourData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExchangeKlinesHourResponse, GetExchangeKlinesHourError, ThrowOnError>({\n url: '/exchange/{exchangeId}/klines/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Compile a strategy from source code\n * Submits raw strategy source for compilation. By default the call is synchronous and returns\n * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue\n * the compile task and return immediately with a `jobId` — poll\n * `GET /strategy/{strategyId}` to check status.\n *\n * The `strategyId` is deterministic: the same source for the same user always produces the\n * same id.\n *\n */\nexport const postStrategy = <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PostStrategyResponse, PostStrategyError, ThrowOnError>({\n bodySerializer: null,\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy',\n ...options,\n headers: {\n 'Content-Type': 'text/plain',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of an async compile task\n * Polls the status of a strategy compilation. Useful when the strategy was submitted with\n * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.\n *\n */\nexport const getStrategyStatus = <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetStrategyStatusResponse, GetStrategyStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy/{strategyId}',\n ...options\n });\n};\n\n/**\n * Prepare backtesting data\n * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;\n * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.\n *\n * The same params always return the same `jobId` (idempotent). Repeated calls with identical\n * params do not enqueue duplicate work — they reuse the existing job.\n *\n */\nexport const prepareBacktesting = <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PrepareBacktestingResponse, PrepareBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of a prepare job\n * Retrieves the current state of the prepare job identified by `jobId`.\n * Poll until `status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getPreparationStatus = <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetPreparationStatusResponse, GetPreparationStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',\n ...options\n });\n};\n\n/**\n * Execute a compiled strategy against a prepared dataset\n * Enqueues an execute task that runs the strategy identified by `strategyId` over the data\n * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are\n * recovered from the prepare job — they do not need to be sent again.\n *\n * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`\n * for the result.\n *\n * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same\n * `jobId` (idempotent).\n *\n */\nexport const executeBacktesting = <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<ExecuteBacktestingResponse, ExecuteBacktestingError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Cancel a running backtest execution\n * Requests cancellation of the specified execution. The execution\n * status will transition to `Aborted` once the cancellation is\n * processed. Cancellation is asynchronous — poll the GET endpoint\n * to confirm the final status.\n *\n */\nexport const cancelExecution = <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).delete<CancelExecutionResponse, CancelExecutionError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};\n\n/**\n * Get the result of a backtest execution job\n * Retrieves the current state and results of the execute job identified by `jobId`.\n * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getExecutionResult = <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetExecutionResultResponse, GetExecutionResultError, ThrowOnError>({\n security: [\n {\n sche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,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAQO,IAAM,qBAAqB,CAAuC,YAA2D;AAChI,UAAQ,QAAQ,UAAU,QAAe,IAAuE;AAAA,IAC5G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/generated/client.gen.ts","../src/generated/sdk.gen.ts"],"sourcesContent":["// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { ClientOptions } from './types.gen';\nimport { type Config, type ClientOptions as DefaultClientOptions, createClient, createConfig } from '@hey-api/client-fetch';\n\n/**\n * The `createClientConfig()` function will be called on client initialization\n * and the returned object will become the client's initial configuration.\n *\n * You may want to initialize your client this way instead of calling\n * `setConfig()`. This is useful for example if you're using Next.js\n * to ensure your client always has the correct values.\n */\nexport type CreateClientConfig<T extends DefaultClientOptions = ClientOptions> = (override?: Config<DefaultClientOptions & T>) => Config<Required<DefaultClientOptions> & T>;\n\nexport const client = createClient(createConfig<ClientOptions>({\n baseUrl: 'https://api.staging.qtsurfer.com/v1'\n}));","// This file is auto-generated by @hey-api/openapi-ts\n\nimport type { Options as ClientOptions, TDataShape, Client } from '@hey-api/client-fetch';\nimport type { AuthenticateData, AuthenticateResponse, AuthenticateError, ListExchangesData, ListExchangesResponse, ListInstrumentsData, ListInstrumentsResponse, ListInstrumentsError, ListSegmentInstrumentsData, ListSegmentInstrumentsResponse, ListSegmentInstrumentsError, DownloadTickersData, DownloadTickersResponse, DownloadTickersError, DownloadKlinesData, DownloadKlinesResponse, DownloadKlinesError, CompileStrategyData, CompileStrategyResponse, CompileStrategyError, GetStrategyData, GetStrategyResponse, GetStrategyError, PrepareBacktestData, PrepareBacktestResponse, PrepareBacktestError, GetPrepareStatusData, GetPrepareStatusResponse, GetPrepareStatusError, ExecuteSweepData, ExecuteSweepResponse, ExecuteSweepError, CancelSweepData, CancelSweepResponse, CancelSweepError, GetSweepResultData, GetSweepResultResponse, GetSweepResultError, ExecuteBacktestData, ExecuteBacktestResponse, ExecuteBacktestError, CancelBacktestData, CancelBacktestResponse, CancelBacktestError, GetBacktestResultData, GetBacktestResultResponse, GetBacktestResultError } from './types.gen';\nimport { client as _heyApiClient } from './client.gen';\n\nexport type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = ClientOptions<TData, ThrowOnError> & {\n /**\n * You can provide a client instance returned by `createClient()` instead of\n * individual options. This might be also useful if you want to implement a\n * custom client.\n */\n client?: Client;\n /**\n * You can pass arbitrary values through the `meta` object. This can be\n * used to access values that aren't defined as part of the SDK function.\n */\n meta?: Record<string, unknown>;\n};\n\n/**\n * Exchange API key for a short-lived JWT\n * Exchanges a long-lived API key for a short-lived JWT used by every other\n * endpoint. This is the only endpoint that accepts an API key directly —\n * callers should obtain a JWT here, then send it as `Authorization: Bearer\n * <token>` to all other operations.\n *\n * The returned JWT carries the caller's subscription `tier` as a claim and\n * expires after `expires_in` seconds. Callers should refresh the token\n * before expiry (or on a `401` response) by calling this endpoint again.\n *\n */\nexport const authenticate = <ThrowOnError extends boolean = false>(options?: Options<AuthenticateData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).post<AuthenticateResponse, AuthenticateError, ThrowOnError>({\n security: [\n {\n name: 'X-API-Key',\n type: 'apiKey'\n }\n ],\n url: '/auth/token',\n ...options\n });\n};\n\n/**\n * List the available exchanges\n */\nexport const listExchanges = <ThrowOnError extends boolean = false>(options?: Options<ListExchangesData, ThrowOnError>) => {\n return (options?.client ?? _heyApiClient).get<ListExchangesResponse, unknown, ThrowOnError>({\n url: '/exchanges',\n ...options\n });\n};\n\n/**\n * List an exchange's instruments (default spot segment)\n * \"Give me binance instruments\" — returns the exchange's DEFAULT segment (`spot`)\n * in `data`, each instrument with per-data-type coverage and market info. `meta`\n * confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links.\n *\n */\nexport const listInstruments = <ThrowOnError extends boolean = false>(options: Options<ListInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<ListInstrumentsResponse, ListInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/instruments',\n ...options\n });\n};\n\n/**\n * List an exchange segment's instruments\n * Returns the instruments for one market segment of the exchange, each with\n * per-data-type coverage and market info. HAL `_links` carry `self` plus the\n * `spot` / `futures` segment-discovery links; the default-segment shortcut is\n * `GET /exchange/{exchangeId}/instruments` (spot).\n *\n */\nexport const listSegmentInstruments = <ThrowOnError extends boolean = false>(options: Options<ListSegmentInstrumentsData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<ListSegmentInstrumentsResponse, ListSegmentInstrumentsError, ThrowOnError>({\n url: '/exchange/{exchangeId}/{segment}/instruments',\n ...options\n });\n};\n\n/**\n * Download one hour of tickers for an instrument as a Lastra segment\n * Serves exactly one hour of raw ticker data for the given instrument on the\n * requested exchange. The payload is a native [Lastra](https://github.com/QTSurfer/lastra-java)\n * file — QTSurfer's columnar format for tick-precision timeseries — with\n * no JSON envelope.\n *\n * One segment = one hour, aligned to UTC. The `hour` query parameter selects\n * the segment and must match `YYYY-MM-DDTHH` (no minutes/seconds, no timezone\n * suffix). Example: `hour=2026-01-15T10` returns `h10.lastra` for\n * 2026-01-15, covering `[10:00:00Z, 11:00:00Z)`. Hours not yet available\n * return `404`.\n *\n * A `format=parquet` query parameter switches the response to on-the-fly\n * Parquet conversion via [lastra-convert](https://github.com/QTSurfer/lastra-convert)\n * for clients that don't yet read Lastra. Lastra is the primary format\n * and cheaper when the client can consume it.\n *\n * Clients:\n * - [lastra-java](https://github.com/QTSurfer/lastra-java) — reference\n * Java reader/writer with per-column codecs (ALP, Gorilla, delta-varint,\n * ZSTD) and CRC32 integrity.\n * - [lastra-ts](https://github.com/QTSurfer/lastra-ts) — TypeScript reader\n * (~4 kB bundle, browser + Node.js).\n * - [duckdb-lastra](https://github.com/QTSurfer/duckdb-lastra) — DuckDB\n * extension for ad-hoc SQL over Lastra files.\n * - [lastra-convert](https://github.com/QTSurfer/lastra-convert) — CLI + Java\n * API for converting to/from Parquet, Reef, and CSV.\n * - `curl -OJ` for offline dumps (the `Content-Disposition` header sets a\n * descriptive filename).\n *\n */\nexport const downloadTickers = <ThrowOnError extends boolean = false>(options: Options<DownloadTickersData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<DownloadTickersResponse, DownloadTickersError, ThrowOnError>({\n url: '/exchange/{exchangeId}/tickers/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Download one hour of klines for an instrument as a Lastra segment\n * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,\n * but serves klines (aggregated bars) instead of raw ticks. One\n * [Lastra](https://github.com/QTSurfer/lastra-java) segment = one hour of\n * klines at the exchange's native kline cadence, aligned to UTC.\n *\n * Klines use the same columnar layout as tickers — readers that handle one\n * format read the other with the same code. Use this endpoint when a\n * per-tick payload would be too large for the window of interest.\n *\n */\nexport const downloadKlines = <ThrowOnError extends boolean = false>(options: Options<DownloadKlinesData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<DownloadKlinesResponse, DownloadKlinesError, ThrowOnError>({\n url: '/exchange/{exchangeId}/klines/{base}/{quote}',\n ...options\n });\n};\n\n/**\n * Compile a strategy from source code\n * Submits raw strategy source for compilation. By default the call is synchronous and returns\n * the `strategyId` once compilation succeeds. Set the header `X-Compile-Async: true` to enqueue\n * the compile task and return immediately with a `jobId` — poll\n * `GET /strategy/{strategyId}` to check status.\n *\n * The `strategyId` is deterministic: the same source for the same user always produces the\n * same id.\n *\n */\nexport const compileStrategy = <ThrowOnError extends boolean = false>(options: Options<CompileStrategyData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<CompileStrategyResponse, CompileStrategyError, ThrowOnError>({\n bodySerializer: null,\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy',\n ...options,\n headers: {\n 'Content-Type': 'text/plain',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get a strategy by id, including its compile status\n * Polls the status of a strategy compilation. Useful when the strategy was submitted with\n * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.\n *\n */\nexport const getStrategy = <ThrowOnError extends boolean = false>(options: Options<GetStrategyData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetStrategyResponse, GetStrategyError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/strategy/{strategyId}',\n ...options\n });\n};\n\n/**\n * Prepare backtest data\n * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;\n * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.\n *\n * The same params always return the same `jobId` (idempotent). Repeated calls with identical\n * params do not enqueue duplicate work — they reuse the existing job.\n *\n */\nexport const prepareBacktest = <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<PrepareBacktestResponse, PrepareBacktestError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Get the status of a prepare job\n * Retrieves the current state of the prepare job identified by `jobId`.\n * Poll until `status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getPrepareStatus = <ThrowOnError extends boolean = false>(options: Options<GetPrepareStatusData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetPrepareStatusResponse, GetPrepareStatusError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/prepare/{jobId}',\n ...options\n });\n};\n\n/**\n * Execute a parameter sweep over prepared data\n * Runs a parameter matrix over the single immutable dataset identified by `requestId`.\n * The backend expands and executes the matrix internally; clients poll the returned\n * `sweepId` for incremental results.\n *\n */\nexport const executeSweep = <ThrowOnError extends boolean = false>(options: Options<ExecuteSweepData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<ExecuteSweepResponse, ExecuteSweepError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Cancel a running parameter sweep\n * Requests cancellation between parameter vectors. Completed rows remain readable.\n */\nexport const cancelSweep = <ThrowOnError extends boolean = false>(options: Options<CancelSweepData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).delete<CancelSweepResponse, CancelSweepError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}',\n ...options\n });\n};\n\n/**\n * Get sweep progress and results\n * Returns incremental sweep progress. The default `ranked` view sorts and may truncate the\n * display leaderboard. `order=natural` returns every available row, untruncated, ordered by\n * deterministic `runIx`; use that view when materialising durable trial rows.\n *\n */\nexport const getSweepResult = <ThrowOnError extends boolean = false>(options: Options<GetSweepResultData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetSweepResultResponse, GetSweepResultError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}',\n ...options\n });\n};\n\n/**\n * Execute a compiled strategy against a prepared dataset\n * Enqueues an execute task that runs the strategy identified by `strategyId` over the data\n * prepared by the prepare job identified by `prepareJobId`. The instrument and date range are\n * recovered from the prepare job — they do not need to be sent again.\n *\n * Returns immediately with a `jobId`; poll `GET /backtest/{exchangeId}/{type}/execute/{jobId}`\n * for the result.\n *\n * The same params (same `prepareJobId`, `strategyId`, `storeSignals`) always return the same\n * `jobId` (idempotent).\n *\n */\nexport const executeBacktest = <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).post<ExecuteBacktestResponse, ExecuteBacktestError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute',\n ...options,\n headers: {\n 'Content-Type': 'application/json',\n ...options?.headers\n }\n });\n};\n\n/**\n * Cancel a running backtest execution\n * Requests cancellation of the specified execution. The execution\n * status will transition to `Aborted` once the cancellation is\n * processed. Cancellation is asynchronous — poll the GET endpoint\n * to confirm the final status.\n *\n */\nexport const cancelBacktest = <ThrowOnError extends boolean = false>(options: Options<CancelBacktestData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).delete<CancelBacktestResponse, CancelBacktestError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};\n\n/**\n * Get the result of a backtest execution job\n * Retrieves the current state and results of the execute job identified by `jobId`.\n * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.\n *\n */\nexport const getBacktestResult = <ThrowOnError extends boolean = false>(options: Options<GetBacktestResultData, ThrowOnError>) => {\n return (options.client ?? _heyApiClient).get<GetBacktestResultResponse, GetBacktestResultError, ThrowOnError>({\n security: [\n {\n scheme: 'bearer',\n type: 'http'\n }\n ],\n url: '/backtest/{exchangeId}/{type}/execute/{jobId}',\n ...options\n });\n};"],"mappings":";AAGA,SAAkE,cAAc,oBAAoB;AAY7F,IAAM,SAAS,aAAa,aAA4B;AAAA,EAC3D,SAAS;AACb,CAAC,CAAC;;;ACeK,IAAM,eAAe,CAAuC,YAAsD;AACrH,UAAQ,SAAS,UAAU,QAAe,KAA4D;AAAA,IAClG,UAAU;AAAA,MACN;AAAA,QACI,MAAM;AAAA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AA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAeO,IAAM,kBAAkB,CAAuC,YAAwD;AAC1H,UAAQ,QAAQ,UAAU,QAAe,KAAkE;AAAA,IACvG,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,IACH,SAAS;AAAA,MACL,gBAAgB;AAAA,MAChB,GAAG,SAAS;AAAA,IAChB;AAAA,EACJ,CAAC;AACL;AAUO,IAAM,iBAAiB,CAAuC,YAAuD;AACxH,UAAQ,QAAQ,UAAU,QAAe,OAAkE;AAAA,IACvG,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;AAQO,IAAM,oBAAoB,CAAuC,YAA0D;AAC9H,UAAQ,QAAQ,UAAU,QAAe,IAAqE;AAAA,IAC1G,UAAU;AAAA,MACN;AAAA,QACI,QAAQ;AAAA,QACR,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,IACL,GAAG;AAAA,EACP,CAAC;AACL;","names":[]}
|
package/package.json
CHANGED
|
@@ -237,6 +237,51 @@ export const DataSourceTypeSchema = {
|
|
|
237
237
|
example: 'ticker'
|
|
238
238
|
} as const;
|
|
239
239
|
|
|
240
|
+
export const PrepareRequestSchema = {
|
|
241
|
+
type: 'object',
|
|
242
|
+
required: ['instrument', 'from', 'to'],
|
|
243
|
+
properties: {
|
|
244
|
+
instrument: {
|
|
245
|
+
'$ref': '#/components/schemas/Instrument'
|
|
246
|
+
},
|
|
247
|
+
from: {
|
|
248
|
+
type: 'string',
|
|
249
|
+
description: `Start date for the preparation process. Supports the following formats:
|
|
250
|
+
- ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
251
|
+
- ISO DATE (e.g. 2024-12-14)
|
|
252
|
+
- BASIC ISO DATE (e.g., 20241214)
|
|
253
|
+
`,
|
|
254
|
+
example: '2024-12-13T00:00:00Z'
|
|
255
|
+
},
|
|
256
|
+
to: {
|
|
257
|
+
type: 'string',
|
|
258
|
+
description: `End date for the preparation process. Supports the following formats:
|
|
259
|
+
- ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
260
|
+
- ISO DATE (e.g. 2024-12-14)
|
|
261
|
+
- BASIC ISO DATE (e.g., 20241214)
|
|
262
|
+
`,
|
|
263
|
+
example: '2024-12-14'
|
|
264
|
+
},
|
|
265
|
+
cadence: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: `Output bar cadence for the prepared range. Defaults to the publisher's
|
|
268
|
+
native cadence (\`1s\`); coarser cadences are produced on demand via
|
|
269
|
+
resampling and stored alongside the native blob in cache. Coarser-than-
|
|
270
|
+
source values must be exact multiples of the source cadence — invalid
|
|
271
|
+
labels return \`400\`.
|
|
272
|
+
`,
|
|
273
|
+
enum: ['1s', '5s', '1m', '5m', '15m', '1h', '4h', '1d'],
|
|
274
|
+
default: '1s'
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
example: {
|
|
278
|
+
instrument: 'BTC/USDT',
|
|
279
|
+
from: '2024-12-13T00:00:00Z',
|
|
280
|
+
to: '2024-12-14T00:00:00Z',
|
|
281
|
+
cadence: '1m'
|
|
282
|
+
}
|
|
283
|
+
} as const;
|
|
284
|
+
|
|
240
285
|
export const JobStateSchema = {
|
|
241
286
|
type: 'object',
|
|
242
287
|
description: 'Information about a single job',
|
|
@@ -370,6 +415,340 @@ instrument did not trade that hour. \`unknown\`: no data to classify by.
|
|
|
370
415
|
]
|
|
371
416
|
} as const;
|
|
372
417
|
|
|
418
|
+
export const SweepAxisSchema = {
|
|
419
|
+
description: 'A numeric range or an explicit list of values for one strategy property.',
|
|
420
|
+
oneOf: [
|
|
421
|
+
{
|
|
422
|
+
type: 'object',
|
|
423
|
+
required: ['from', 'to', 'step'],
|
|
424
|
+
additionalProperties: false,
|
|
425
|
+
properties: {
|
|
426
|
+
from: {
|
|
427
|
+
type: 'number',
|
|
428
|
+
format: 'double'
|
|
429
|
+
},
|
|
430
|
+
to: {
|
|
431
|
+
type: 'number',
|
|
432
|
+
format: 'double'
|
|
433
|
+
},
|
|
434
|
+
step: {
|
|
435
|
+
type: 'number',
|
|
436
|
+
format: 'double',
|
|
437
|
+
exclusiveMinimum: 0
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
type: 'object',
|
|
443
|
+
required: ['values'],
|
|
444
|
+
additionalProperties: false,
|
|
445
|
+
properties: {
|
|
446
|
+
values: {
|
|
447
|
+
type: 'array',
|
|
448
|
+
minItems: 1,
|
|
449
|
+
items: {
|
|
450
|
+
oneOf: [
|
|
451
|
+
{
|
|
452
|
+
type: 'number'
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
type: 'boolean'
|
|
456
|
+
}
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
} as const;
|
|
464
|
+
|
|
465
|
+
export const SweepSpecRequestSchema = {
|
|
466
|
+
type: 'object',
|
|
467
|
+
required: ['params'],
|
|
468
|
+
properties: {
|
|
469
|
+
sampler: {
|
|
470
|
+
type: 'string',
|
|
471
|
+
enum: ['grid', 'random', 'lhs'],
|
|
472
|
+
default: 'grid'
|
|
473
|
+
},
|
|
474
|
+
seed: {
|
|
475
|
+
type: 'integer',
|
|
476
|
+
format: 'int64',
|
|
477
|
+
minimum: -9007199254740991,
|
|
478
|
+
maximum: 9007199254740991,
|
|
479
|
+
description: `Reproducibility seed. If omitted, the server generates one with Java's
|
|
480
|
+
\`L64X128MixRandom\` generator and returns the effective value. The range
|
|
481
|
+
is limited to JavaScript-safe integers so generated clients can replay it exactly.
|
|
482
|
+
`
|
|
483
|
+
},
|
|
484
|
+
samples: {
|
|
485
|
+
type: 'integer',
|
|
486
|
+
minimum: 1,
|
|
487
|
+
description: 'Number of samples for `random` and `lhs`; ignored by `grid`.'
|
|
488
|
+
},
|
|
489
|
+
objective: {
|
|
490
|
+
type: 'string',
|
|
491
|
+
enum: ['sharpe', 'sortino', 'pnl', 'maxdd'],
|
|
492
|
+
default: 'sharpe'
|
|
493
|
+
},
|
|
494
|
+
params: {
|
|
495
|
+
type: 'object',
|
|
496
|
+
minProperties: 1,
|
|
497
|
+
additionalProperties: {
|
|
498
|
+
'$ref': '#/components/schemas/SweepAxis'
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
example: {
|
|
503
|
+
sampler: 'lhs',
|
|
504
|
+
seed: 487221,
|
|
505
|
+
samples: 100,
|
|
506
|
+
objective: 'sharpe',
|
|
507
|
+
params: {
|
|
508
|
+
rsiPeriod: {
|
|
509
|
+
from: 7,
|
|
510
|
+
to: 28,
|
|
511
|
+
step: 1
|
|
512
|
+
},
|
|
513
|
+
useTrendFilter: {
|
|
514
|
+
values: [true, false]
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
} as const;
|
|
519
|
+
|
|
520
|
+
export const SweepBaseConfigSchema = {
|
|
521
|
+
type: 'object',
|
|
522
|
+
properties: {
|
|
523
|
+
initialFunding: {
|
|
524
|
+
type: 'number',
|
|
525
|
+
format: 'double',
|
|
526
|
+
exclusiveMinimum: 0,
|
|
527
|
+
default: 10000
|
|
528
|
+
},
|
|
529
|
+
feeRate: {
|
|
530
|
+
type: 'number',
|
|
531
|
+
format: 'double',
|
|
532
|
+
minimum: 0,
|
|
533
|
+
default: 0.001
|
|
534
|
+
},
|
|
535
|
+
buyFeeRate: {
|
|
536
|
+
type: 'number',
|
|
537
|
+
format: 'double',
|
|
538
|
+
minimum: 0
|
|
539
|
+
},
|
|
540
|
+
sellFeeRate: {
|
|
541
|
+
type: 'number',
|
|
542
|
+
format: 'double',
|
|
543
|
+
minimum: 0
|
|
544
|
+
},
|
|
545
|
+
feeLeg: {
|
|
546
|
+
type: 'string',
|
|
547
|
+
enum: ['RECEIVED', 'QUOTE', 'BASE'],
|
|
548
|
+
default: 'RECEIVED'
|
|
549
|
+
},
|
|
550
|
+
percentAmountToLock: {
|
|
551
|
+
type: 'number',
|
|
552
|
+
format: 'double',
|
|
553
|
+
exclusiveMinimum: 0,
|
|
554
|
+
maximum: 100
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
} as const;
|
|
558
|
+
|
|
559
|
+
export const ExecuteSweepRequestSchema = {
|
|
560
|
+
type: 'object',
|
|
561
|
+
required: ['strategyId', 'sweep'],
|
|
562
|
+
properties: {
|
|
563
|
+
strategyId: {
|
|
564
|
+
'$ref': '#/components/schemas/strategyId'
|
|
565
|
+
},
|
|
566
|
+
sweep: {
|
|
567
|
+
'$ref': '#/components/schemas/SweepSpecRequest'
|
|
568
|
+
},
|
|
569
|
+
baseConfig: {
|
|
570
|
+
'$ref': '#/components/schemas/SweepBaseConfig'
|
|
571
|
+
},
|
|
572
|
+
storeSignals: {
|
|
573
|
+
type: 'boolean',
|
|
574
|
+
default: false,
|
|
575
|
+
description: 'Store signals for every trial. Keep false for normal sweeps.'
|
|
576
|
+
},
|
|
577
|
+
shards: {
|
|
578
|
+
type: 'integer',
|
|
579
|
+
minimum: 0,
|
|
580
|
+
description: 'Requested horizontal shard count; 0 or omitted selects automatically.',
|
|
581
|
+
default: 0
|
|
582
|
+
},
|
|
583
|
+
minTradeFloor: {
|
|
584
|
+
type: 'integer',
|
|
585
|
+
minimum: 0,
|
|
586
|
+
default: 30,
|
|
587
|
+
description: 'Trials below this trade count are flagged but remain in the results.'
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
} as const;
|
|
591
|
+
|
|
592
|
+
export const ExecuteSweepAcceptedSchema = {
|
|
593
|
+
type: 'object',
|
|
594
|
+
required: ['sweepId', 'requestId', 'totalRuns', 'shards', 'seed', 'queued'],
|
|
595
|
+
properties: {
|
|
596
|
+
sweepId: {
|
|
597
|
+
type: 'string',
|
|
598
|
+
example: 'swp_95e47a7f0966ce11'
|
|
599
|
+
},
|
|
600
|
+
requestId: {
|
|
601
|
+
type: 'string'
|
|
602
|
+
},
|
|
603
|
+
totalRuns: {
|
|
604
|
+
type: 'integer',
|
|
605
|
+
minimum: 1
|
|
606
|
+
},
|
|
607
|
+
shards: {
|
|
608
|
+
type: 'integer',
|
|
609
|
+
minimum: 1
|
|
610
|
+
},
|
|
611
|
+
seed: {
|
|
612
|
+
type: 'integer',
|
|
613
|
+
format: 'int64',
|
|
614
|
+
minimum: -9007199254740991,
|
|
615
|
+
maximum: 9007199254740991,
|
|
616
|
+
description: 'Effective seed used to expand the sweep.'
|
|
617
|
+
},
|
|
618
|
+
queued: {
|
|
619
|
+
type: 'boolean',
|
|
620
|
+
description: 'False when an identical sweep already exists and was not enqueued again.'
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
} as const;
|
|
624
|
+
|
|
625
|
+
export const SweepProgressSchema = {
|
|
626
|
+
type: 'object',
|
|
627
|
+
required: ['done', 'total', 'aborted', 'shardCount', 'pendingShards'],
|
|
628
|
+
properties: {
|
|
629
|
+
done: {
|
|
630
|
+
type: 'integer',
|
|
631
|
+
format: 'int64'
|
|
632
|
+
},
|
|
633
|
+
total: {
|
|
634
|
+
type: 'integer'
|
|
635
|
+
},
|
|
636
|
+
aborted: {
|
|
637
|
+
type: 'integer',
|
|
638
|
+
format: 'int64'
|
|
639
|
+
},
|
|
640
|
+
shardCount: {
|
|
641
|
+
type: 'integer'
|
|
642
|
+
},
|
|
643
|
+
pendingShards: {
|
|
644
|
+
type: 'integer'
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
} as const;
|
|
648
|
+
|
|
649
|
+
export const SweepRunRowSchema = {
|
|
650
|
+
type: 'object',
|
|
651
|
+
required: ['runIx', 'params', 'sharpe', 'sortino', 'pnl', 'pnlPct', 'cagr', 'maxDdPct', 'trades', 'winRate', 'belowTradeFloor', 'aborted', 'runtimeMs'],
|
|
652
|
+
properties: {
|
|
653
|
+
runIx: {
|
|
654
|
+
type: 'integer',
|
|
655
|
+
minimum: 0,
|
|
656
|
+
description: 'Deterministic zero-based expansion index, stable across shards and ranking.'
|
|
657
|
+
},
|
|
658
|
+
rank: {
|
|
659
|
+
type: 'integer',
|
|
660
|
+
minimum: 1,
|
|
661
|
+
description: 'Present only in the `ranked` view.'
|
|
662
|
+
},
|
|
663
|
+
params: {
|
|
664
|
+
type: 'object',
|
|
665
|
+
additionalProperties: true
|
|
666
|
+
},
|
|
667
|
+
sharpe: {
|
|
668
|
+
type: 'number',
|
|
669
|
+
format: 'double'
|
|
670
|
+
},
|
|
671
|
+
sortino: {
|
|
672
|
+
type: 'number',
|
|
673
|
+
format: 'double'
|
|
674
|
+
},
|
|
675
|
+
pnl: {
|
|
676
|
+
type: 'number',
|
|
677
|
+
format: 'double',
|
|
678
|
+
description: 'Absolute net PnL in the output currency.'
|
|
679
|
+
},
|
|
680
|
+
pnlPct: {
|
|
681
|
+
type: 'number',
|
|
682
|
+
format: 'double'
|
|
683
|
+
},
|
|
684
|
+
cagr: {
|
|
685
|
+
type: 'number',
|
|
686
|
+
format: 'double'
|
|
687
|
+
},
|
|
688
|
+
maxDdPct: {
|
|
689
|
+
type: 'number',
|
|
690
|
+
format: 'double'
|
|
691
|
+
},
|
|
692
|
+
trades: {
|
|
693
|
+
type: 'integer',
|
|
694
|
+
format: 'int64'
|
|
695
|
+
},
|
|
696
|
+
winRate: {
|
|
697
|
+
type: 'number',
|
|
698
|
+
format: 'double'
|
|
699
|
+
},
|
|
700
|
+
belowTradeFloor: {
|
|
701
|
+
type: 'boolean'
|
|
702
|
+
},
|
|
703
|
+
aborted: {
|
|
704
|
+
type: 'boolean'
|
|
705
|
+
},
|
|
706
|
+
runtimeMs: {
|
|
707
|
+
type: 'integer',
|
|
708
|
+
format: 'int64'
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
} as const;
|
|
712
|
+
|
|
713
|
+
export const ExecuteSweepResultSchema = {
|
|
714
|
+
type: 'object',
|
|
715
|
+
required: ['sweepId', 'status', 'objective', 'order', 'progress', 'leaderboardSize', 'truncated', 'leaderboard'],
|
|
716
|
+
properties: {
|
|
717
|
+
sweepId: {
|
|
718
|
+
type: 'string'
|
|
719
|
+
},
|
|
720
|
+
status: {
|
|
721
|
+
type: 'string',
|
|
722
|
+
enum: ['RUNNING', 'COMPLETED', 'PARTIAL', 'CANCELLED']
|
|
723
|
+
},
|
|
724
|
+
objective: {
|
|
725
|
+
type: 'string',
|
|
726
|
+
enum: ['sharpe', 'sortino', 'pnl', 'maxdd']
|
|
727
|
+
},
|
|
728
|
+
order: {
|
|
729
|
+
type: 'string',
|
|
730
|
+
enum: ['ranked', 'natural']
|
|
731
|
+
},
|
|
732
|
+
progress: {
|
|
733
|
+
'$ref': '#/components/schemas/SweepProgress'
|
|
734
|
+
},
|
|
735
|
+
leaderboardSize: {
|
|
736
|
+
type: 'integer',
|
|
737
|
+
description: 'Total result rows currently available.'
|
|
738
|
+
},
|
|
739
|
+
truncated: {
|
|
740
|
+
type: 'boolean',
|
|
741
|
+
description: 'True only when the ranked view exceeds its display limit.'
|
|
742
|
+
},
|
|
743
|
+
leaderboard: {
|
|
744
|
+
type: 'array',
|
|
745
|
+
items: {
|
|
746
|
+
'$ref': '#/components/schemas/SweepRunRow'
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
} as const;
|
|
751
|
+
|
|
373
752
|
export const AcceptedJobSchema = {
|
|
374
753
|
type: 'object',
|
|
375
754
|
description: `Response returned by async endpoints (\`202 Accepted\`). The \`jobId\` is deterministic for the
|