@qtsurfer/api-client 0.4.0 → 0.6.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 +365 -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 +97 -32
- package/src/generated/types.gen.ts +342 -91
|
@@ -163,6 +163,35 @@ export type Exchange = {
|
|
|
163
163
|
*/
|
|
164
164
|
export type DataSourceType = 'ticker';
|
|
165
165
|
|
|
166
|
+
export type PrepareRequest = {
|
|
167
|
+
instrument: Instrument;
|
|
168
|
+
/**
|
|
169
|
+
* Start date for the preparation process. Supports the following formats:
|
|
170
|
+
* - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
171
|
+
* - ISO DATE (e.g. 2024-12-14)
|
|
172
|
+
* - BASIC ISO DATE (e.g., 20241214)
|
|
173
|
+
*
|
|
174
|
+
*/
|
|
175
|
+
from: string;
|
|
176
|
+
/**
|
|
177
|
+
* End date for the preparation process. Supports the following formats:
|
|
178
|
+
* - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
179
|
+
* - ISO DATE (e.g. 2024-12-14)
|
|
180
|
+
* - BASIC ISO DATE (e.g., 20241214)
|
|
181
|
+
*
|
|
182
|
+
*/
|
|
183
|
+
to: string;
|
|
184
|
+
/**
|
|
185
|
+
* Output bar cadence for the prepared range. Defaults to the publisher's
|
|
186
|
+
* native cadence (`1s`); coarser cadences are produced on demand via
|
|
187
|
+
* resampling and stored alongside the native blob in cache. Coarser-than-
|
|
188
|
+
* source values must be exact multiples of the source cadence — invalid
|
|
189
|
+
* labels return `400`.
|
|
190
|
+
*
|
|
191
|
+
*/
|
|
192
|
+
cadence?: '1s' | '5s' | '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
|
|
193
|
+
};
|
|
194
|
+
|
|
166
195
|
/**
|
|
167
196
|
* Information about a single job
|
|
168
197
|
*/
|
|
@@ -257,6 +286,131 @@ export type PrepareJobState = JobState & {
|
|
|
257
286
|
}>;
|
|
258
287
|
};
|
|
259
288
|
|
|
289
|
+
/**
|
|
290
|
+
* A numeric range or an explicit list of values for one strategy property.
|
|
291
|
+
*/
|
|
292
|
+
export type SweepAxis = {
|
|
293
|
+
from: number;
|
|
294
|
+
to: number;
|
|
295
|
+
step: number;
|
|
296
|
+
} | {
|
|
297
|
+
values: Array<number | boolean>;
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
export type SweepSpecRequest = {
|
|
301
|
+
sampler?: 'grid' | 'random' | 'lhs';
|
|
302
|
+
/**
|
|
303
|
+
* Reproducibility seed. If omitted, the server generates one with Java's
|
|
304
|
+
* `L64X128MixRandom` generator and returns the effective value. The range
|
|
305
|
+
* is limited to JavaScript-safe integers so generated clients can replay it exactly.
|
|
306
|
+
*
|
|
307
|
+
*/
|
|
308
|
+
seed?: number;
|
|
309
|
+
/**
|
|
310
|
+
* Number of samples for `random` and `lhs`; ignored by `grid`.
|
|
311
|
+
*/
|
|
312
|
+
samples?: number;
|
|
313
|
+
objective?: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
|
|
314
|
+
params: {
|
|
315
|
+
[key: string]: SweepAxis;
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
|
|
319
|
+
export type SweepBaseConfig = {
|
|
320
|
+
initialFunding?: number;
|
|
321
|
+
feeRate?: number;
|
|
322
|
+
buyFeeRate?: number;
|
|
323
|
+
sellFeeRate?: number;
|
|
324
|
+
feeLeg?: 'RECEIVED' | 'QUOTE' | 'BASE';
|
|
325
|
+
percentAmountToLock?: number;
|
|
326
|
+
};
|
|
327
|
+
|
|
328
|
+
export type ExecuteSweepRequest = {
|
|
329
|
+
strategyId: StrategyId;
|
|
330
|
+
sweep: SweepSpecRequest;
|
|
331
|
+
baseConfig?: SweepBaseConfig;
|
|
332
|
+
/**
|
|
333
|
+
* Store signals for every trial. Keep false for normal sweeps.
|
|
334
|
+
*/
|
|
335
|
+
storeSignals?: boolean;
|
|
336
|
+
/**
|
|
337
|
+
* Requested horizontal shard count; 0 or omitted selects automatically.
|
|
338
|
+
*/
|
|
339
|
+
shards?: number;
|
|
340
|
+
/**
|
|
341
|
+
* Trials below this trade count are flagged but remain in the results.
|
|
342
|
+
*/
|
|
343
|
+
minTradeFloor?: number;
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export type ExecuteSweepAccepted = {
|
|
347
|
+
sweepId: string;
|
|
348
|
+
requestId: string;
|
|
349
|
+
totalRuns: number;
|
|
350
|
+
shards: number;
|
|
351
|
+
/**
|
|
352
|
+
* Effective seed used to expand the sweep.
|
|
353
|
+
*/
|
|
354
|
+
seed: number;
|
|
355
|
+
/**
|
|
356
|
+
* False when an identical sweep already exists and was not enqueued again.
|
|
357
|
+
*/
|
|
358
|
+
queued: boolean;
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
export type SweepProgress = {
|
|
362
|
+
done: number;
|
|
363
|
+
total: number;
|
|
364
|
+
aborted: number;
|
|
365
|
+
shardCount: number;
|
|
366
|
+
pendingShards: number;
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
export type SweepRunRow = {
|
|
370
|
+
/**
|
|
371
|
+
* Deterministic zero-based expansion index, stable across shards and ranking.
|
|
372
|
+
*/
|
|
373
|
+
runIx: number;
|
|
374
|
+
/**
|
|
375
|
+
* Present only in the `ranked` view.
|
|
376
|
+
*/
|
|
377
|
+
rank?: number;
|
|
378
|
+
params: {
|
|
379
|
+
[key: string]: unknown;
|
|
380
|
+
};
|
|
381
|
+
sharpe: number;
|
|
382
|
+
sortino: number;
|
|
383
|
+
/**
|
|
384
|
+
* Absolute net PnL in the output currency.
|
|
385
|
+
*/
|
|
386
|
+
pnl: number;
|
|
387
|
+
pnlPct: number;
|
|
388
|
+
cagr: number;
|
|
389
|
+
maxDdPct: number;
|
|
390
|
+
trades: number;
|
|
391
|
+
winRate: number;
|
|
392
|
+
belowTradeFloor: boolean;
|
|
393
|
+
aborted: boolean;
|
|
394
|
+
runtimeMs: number;
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
export type ExecuteSweepResult = {
|
|
398
|
+
sweepId: string;
|
|
399
|
+
status: 'RUNNING' | 'COMPLETED' | 'PARTIAL' | 'CANCELLED';
|
|
400
|
+
objective: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
|
|
401
|
+
order: 'ranked' | 'natural';
|
|
402
|
+
progress: SweepProgress;
|
|
403
|
+
/**
|
|
404
|
+
* Total result rows currently available.
|
|
405
|
+
*/
|
|
406
|
+
leaderboardSize: number;
|
|
407
|
+
/**
|
|
408
|
+
* True only when the ranked view exceeds its display limit.
|
|
409
|
+
*/
|
|
410
|
+
truncated: boolean;
|
|
411
|
+
leaderboard: Array<SweepRunRow>;
|
|
412
|
+
};
|
|
413
|
+
|
|
260
414
|
/**
|
|
261
415
|
* Response returned by async endpoints (`202 Accepted`). The `jobId` is deterministic for the
|
|
262
416
|
* same input parameters — repeated calls with identical params return the same id.
|
|
@@ -419,14 +573,14 @@ export type AuthTokenError = {
|
|
|
419
573
|
message: string;
|
|
420
574
|
};
|
|
421
575
|
|
|
422
|
-
export type
|
|
576
|
+
export type AuthenticateData = {
|
|
423
577
|
body?: never;
|
|
424
578
|
path?: never;
|
|
425
579
|
query?: never;
|
|
426
580
|
url: '/auth/token';
|
|
427
581
|
};
|
|
428
582
|
|
|
429
|
-
export type
|
|
583
|
+
export type AuthenticateErrors = {
|
|
430
584
|
/**
|
|
431
585
|
* API key is invalid, revoked, or expired.
|
|
432
586
|
*/
|
|
@@ -437,34 +591,34 @@ export type AuthErrors = {
|
|
|
437
591
|
429: unknown;
|
|
438
592
|
};
|
|
439
593
|
|
|
440
|
-
export type
|
|
594
|
+
export type AuthenticateError = AuthenticateErrors[keyof AuthenticateErrors];
|
|
441
595
|
|
|
442
|
-
export type
|
|
596
|
+
export type AuthenticateResponses = {
|
|
443
597
|
/**
|
|
444
598
|
* API key accepted; JWT returned.
|
|
445
599
|
*/
|
|
446
600
|
200: AuthTokenResponse;
|
|
447
601
|
};
|
|
448
602
|
|
|
449
|
-
export type
|
|
603
|
+
export type AuthenticateResponse = AuthenticateResponses[keyof AuthenticateResponses];
|
|
450
604
|
|
|
451
|
-
export type
|
|
605
|
+
export type ListExchangesData = {
|
|
452
606
|
body?: never;
|
|
453
607
|
path?: never;
|
|
454
608
|
query?: never;
|
|
455
609
|
url: '/exchanges';
|
|
456
610
|
};
|
|
457
611
|
|
|
458
|
-
export type
|
|
612
|
+
export type ListExchangesResponses = {
|
|
459
613
|
/**
|
|
460
614
|
* A JSON array of Exchanges
|
|
461
615
|
*/
|
|
462
616
|
200: Array<Exchange>;
|
|
463
617
|
};
|
|
464
618
|
|
|
465
|
-
export type
|
|
619
|
+
export type ListExchangesResponse = ListExchangesResponses[keyof ListExchangesResponses];
|
|
466
620
|
|
|
467
|
-
export type
|
|
621
|
+
export type ListInstrumentsData = {
|
|
468
622
|
body?: never;
|
|
469
623
|
path: {
|
|
470
624
|
/**
|
|
@@ -476,25 +630,25 @@ export type GetInstrumentsData = {
|
|
|
476
630
|
url: '/exchange/{exchangeId}/instruments';
|
|
477
631
|
};
|
|
478
632
|
|
|
479
|
-
export type
|
|
633
|
+
export type ListInstrumentsErrors = {
|
|
480
634
|
/**
|
|
481
635
|
* Exchange not found or instrument catalog not available
|
|
482
636
|
*/
|
|
483
637
|
404: ResponseError;
|
|
484
638
|
};
|
|
485
639
|
|
|
486
|
-
export type
|
|
640
|
+
export type ListInstrumentsError = ListInstrumentsErrors[keyof ListInstrumentsErrors];
|
|
487
641
|
|
|
488
|
-
export type
|
|
642
|
+
export type ListInstrumentsResponses = {
|
|
489
643
|
/**
|
|
490
644
|
* The default (spot) segment's instruments in `data`, `meta`, and HAL `_links` (self + spot/futures segment discovery)
|
|
491
645
|
*/
|
|
492
646
|
200: InstrumentListResponse;
|
|
493
647
|
};
|
|
494
648
|
|
|
495
|
-
export type
|
|
649
|
+
export type ListInstrumentsResponse = ListInstrumentsResponses[keyof ListInstrumentsResponses];
|
|
496
650
|
|
|
497
|
-
export type
|
|
651
|
+
export type ListSegmentInstrumentsData = {
|
|
498
652
|
body?: never;
|
|
499
653
|
path: {
|
|
500
654
|
/**
|
|
@@ -510,25 +664,25 @@ export type GetSegmentInstrumentsData = {
|
|
|
510
664
|
url: '/exchange/{exchangeId}/{segment}/instruments';
|
|
511
665
|
};
|
|
512
666
|
|
|
513
|
-
export type
|
|
667
|
+
export type ListSegmentInstrumentsErrors = {
|
|
514
668
|
/**
|
|
515
669
|
* Exchange, segment, or instrument catalog not found
|
|
516
670
|
*/
|
|
517
671
|
404: ResponseError;
|
|
518
672
|
};
|
|
519
673
|
|
|
520
|
-
export type
|
|
674
|
+
export type ListSegmentInstrumentsError = ListSegmentInstrumentsErrors[keyof ListSegmentInstrumentsErrors];
|
|
521
675
|
|
|
522
|
-
export type
|
|
676
|
+
export type ListSegmentInstrumentsResponses = {
|
|
523
677
|
/**
|
|
524
678
|
* An object with a `data` array of instrument details (each with per-data-type coverage) and a `meta` block
|
|
525
679
|
*/
|
|
526
680
|
200: InstrumentListResponse;
|
|
527
681
|
};
|
|
528
682
|
|
|
529
|
-
export type
|
|
683
|
+
export type ListSegmentInstrumentsResponse = ListSegmentInstrumentsResponses[keyof ListSegmentInstrumentsResponses];
|
|
530
684
|
|
|
531
|
-
export type
|
|
685
|
+
export type DownloadTickersData = {
|
|
532
686
|
body?: never;
|
|
533
687
|
path: {
|
|
534
688
|
/**
|
|
@@ -562,7 +716,7 @@ export type GetExchangeTickersHourData = {
|
|
|
562
716
|
url: '/exchange/{exchangeId}/tickers/{base}/{quote}';
|
|
563
717
|
};
|
|
564
718
|
|
|
565
|
-
export type
|
|
719
|
+
export type DownloadTickersErrors = {
|
|
566
720
|
/**
|
|
567
721
|
* Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
|
|
568
722
|
*/
|
|
@@ -577,9 +731,9 @@ export type GetExchangeTickersHourErrors = {
|
|
|
577
731
|
500: ResponseError;
|
|
578
732
|
};
|
|
579
733
|
|
|
580
|
-
export type
|
|
734
|
+
export type DownloadTickersError = DownloadTickersErrors[keyof DownloadTickersErrors];
|
|
581
735
|
|
|
582
|
-
export type
|
|
736
|
+
export type DownloadTickersResponses = {
|
|
583
737
|
/**
|
|
584
738
|
* One hour of tickers for the instrument. `Content-Type` is
|
|
585
739
|
* `application/vnd.lastra` by default or
|
|
@@ -590,9 +744,9 @@ export type GetExchangeTickersHourResponses = {
|
|
|
590
744
|
200: Blob | File;
|
|
591
745
|
};
|
|
592
746
|
|
|
593
|
-
export type
|
|
747
|
+
export type DownloadTickersResponse = DownloadTickersResponses[keyof DownloadTickersResponses];
|
|
594
748
|
|
|
595
|
-
export type
|
|
749
|
+
export type DownloadKlinesData = {
|
|
596
750
|
body?: never;
|
|
597
751
|
path: {
|
|
598
752
|
/**
|
|
@@ -625,7 +779,7 @@ export type GetExchangeKlinesHourData = {
|
|
|
625
779
|
url: '/exchange/{exchangeId}/klines/{base}/{quote}';
|
|
626
780
|
};
|
|
627
781
|
|
|
628
|
-
export type
|
|
782
|
+
export type DownloadKlinesErrors = {
|
|
629
783
|
/**
|
|
630
784
|
* Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
|
|
631
785
|
*/
|
|
@@ -640,9 +794,9 @@ export type GetExchangeKlinesHourErrors = {
|
|
|
640
794
|
500: ResponseError;
|
|
641
795
|
};
|
|
642
796
|
|
|
643
|
-
export type
|
|
797
|
+
export type DownloadKlinesError = DownloadKlinesErrors[keyof DownloadKlinesErrors];
|
|
644
798
|
|
|
645
|
-
export type
|
|
799
|
+
export type DownloadKlinesResponses = {
|
|
646
800
|
/**
|
|
647
801
|
* One hour of klines for the instrument. `Content-Type` is
|
|
648
802
|
* `application/vnd.lastra` by default or
|
|
@@ -652,9 +806,9 @@ export type GetExchangeKlinesHourResponses = {
|
|
|
652
806
|
200: Blob | File;
|
|
653
807
|
};
|
|
654
808
|
|
|
655
|
-
export type
|
|
809
|
+
export type DownloadKlinesResponse = DownloadKlinesResponses[keyof DownloadKlinesResponses];
|
|
656
810
|
|
|
657
|
-
export type
|
|
811
|
+
export type CompileStrategyData = {
|
|
658
812
|
/**
|
|
659
813
|
* Raw strategy Java source code
|
|
660
814
|
*/
|
|
@@ -670,16 +824,16 @@ export type PostStrategyData = {
|
|
|
670
824
|
url: '/strategy';
|
|
671
825
|
};
|
|
672
826
|
|
|
673
|
-
export type
|
|
827
|
+
export type CompileStrategyErrors = {
|
|
674
828
|
/**
|
|
675
829
|
* Invalid strategy (compilation error)
|
|
676
830
|
*/
|
|
677
831
|
400: ResponseError;
|
|
678
832
|
};
|
|
679
833
|
|
|
680
|
-
export type
|
|
834
|
+
export type CompileStrategyError = CompileStrategyErrors[keyof CompileStrategyErrors];
|
|
681
835
|
|
|
682
|
-
export type
|
|
836
|
+
export type CompileStrategyResponses = {
|
|
683
837
|
/**
|
|
684
838
|
* Strategy compiled successfully (sync mode)
|
|
685
839
|
*/
|
|
@@ -692,9 +846,9 @@ export type PostStrategyResponses = {
|
|
|
692
846
|
202: AcceptedJob;
|
|
693
847
|
};
|
|
694
848
|
|
|
695
|
-
export type
|
|
849
|
+
export type CompileStrategyResponse = CompileStrategyResponses[keyof CompileStrategyResponses];
|
|
696
850
|
|
|
697
|
-
export type
|
|
851
|
+
export type GetStrategyData = {
|
|
698
852
|
body?: never;
|
|
699
853
|
path: {
|
|
700
854
|
/**
|
|
@@ -706,16 +860,16 @@ export type GetStrategyStatusData = {
|
|
|
706
860
|
url: '/strategy/{strategyId}';
|
|
707
861
|
};
|
|
708
862
|
|
|
709
|
-
export type
|
|
863
|
+
export type GetStrategyErrors = {
|
|
710
864
|
/**
|
|
711
865
|
* Strategy compile job not found
|
|
712
866
|
*/
|
|
713
867
|
404: ResponseError;
|
|
714
868
|
};
|
|
715
869
|
|
|
716
|
-
export type
|
|
870
|
+
export type GetStrategyError = GetStrategyErrors[keyof GetStrategyErrors];
|
|
717
871
|
|
|
718
|
-
export type
|
|
872
|
+
export type GetStrategyResponses = {
|
|
719
873
|
/**
|
|
720
874
|
* Strategy compile state
|
|
721
875
|
*/
|
|
@@ -733,40 +887,13 @@ export type GetStrategyStatusResponses = {
|
|
|
733
887
|
};
|
|
734
888
|
};
|
|
735
889
|
|
|
736
|
-
export type
|
|
890
|
+
export type GetStrategyResponse = GetStrategyResponses[keyof GetStrategyResponses];
|
|
737
891
|
|
|
738
|
-
export type
|
|
892
|
+
export type PrepareBacktestData = {
|
|
739
893
|
/**
|
|
740
894
|
* The required data to prepare a backtesting
|
|
741
895
|
*/
|
|
742
|
-
body:
|
|
743
|
-
instrument: Instrument;
|
|
744
|
-
/**
|
|
745
|
-
* Start date for the preparation process. Supports the following formats:
|
|
746
|
-
* - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
747
|
-
* - ISO DATE (e.g. 2024-12-14)
|
|
748
|
-
* - BASIC ISO DATE (e.g., 20241214)
|
|
749
|
-
*
|
|
750
|
-
*/
|
|
751
|
-
from: string;
|
|
752
|
-
/**
|
|
753
|
-
* End date for the preparation process. Supports the following formats:
|
|
754
|
-
* - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
|
|
755
|
-
* - ISO DATE (e.g. 2024-12-14)
|
|
756
|
-
* - BASIC ISO DATE (e.g., 20241214)
|
|
757
|
-
*
|
|
758
|
-
*/
|
|
759
|
-
to: string;
|
|
760
|
-
/**
|
|
761
|
-
* Output bar cadence for the prepared range. Defaults to the publisher's
|
|
762
|
-
* native cadence (`1s`); coarser cadences are produced on demand via
|
|
763
|
-
* resampling and stored alongside the native blob in cache. Coarser-than-
|
|
764
|
-
* source values must be exact multiples of the source cadence — invalid
|
|
765
|
-
* labels return `400`.
|
|
766
|
-
*
|
|
767
|
-
*/
|
|
768
|
-
cadence?: '1s' | '5s' | '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
|
|
769
|
-
};
|
|
896
|
+
body: PrepareRequest;
|
|
770
897
|
path: {
|
|
771
898
|
/**
|
|
772
899
|
* ID of the exchange to prepare the backtesting for
|
|
@@ -781,7 +908,7 @@ export type PrepareBacktestingData = {
|
|
|
781
908
|
url: '/backtest/{exchangeId}/{type}/prepare';
|
|
782
909
|
};
|
|
783
910
|
|
|
784
|
-
export type
|
|
911
|
+
export type PrepareBacktestErrors = {
|
|
785
912
|
/**
|
|
786
913
|
* Invalid request or parameters. Also returned when `from` is older than the configured
|
|
787
914
|
* lookback window or `to` is in the future.
|
|
@@ -800,18 +927,18 @@ export type PrepareBacktestingErrors = {
|
|
|
800
927
|
429: ResponseError;
|
|
801
928
|
};
|
|
802
929
|
|
|
803
|
-
export type
|
|
930
|
+
export type PrepareBacktestError = PrepareBacktestErrors[keyof PrepareBacktestErrors];
|
|
804
931
|
|
|
805
|
-
export type
|
|
932
|
+
export type PrepareBacktestResponses = {
|
|
806
933
|
/**
|
|
807
934
|
* Prepare task accepted (queued for processing)
|
|
808
935
|
*/
|
|
809
936
|
202: AcceptedJob;
|
|
810
937
|
};
|
|
811
938
|
|
|
812
|
-
export type
|
|
939
|
+
export type PrepareBacktestResponse = PrepareBacktestResponses[keyof PrepareBacktestResponses];
|
|
813
940
|
|
|
814
|
-
export type
|
|
941
|
+
export type GetPrepareStatusData = {
|
|
815
942
|
body?: never;
|
|
816
943
|
path: {
|
|
817
944
|
/**
|
|
@@ -831,7 +958,7 @@ export type GetPreparationStatusData = {
|
|
|
831
958
|
url: '/backtest/{exchangeId}/{type}/prepare/{jobId}';
|
|
832
959
|
};
|
|
833
960
|
|
|
834
|
-
export type
|
|
961
|
+
export type GetPrepareStatusErrors = {
|
|
835
962
|
/**
|
|
836
963
|
* Invalid request or parameters
|
|
837
964
|
*/
|
|
@@ -842,18 +969,127 @@ export type GetPreparationStatusErrors = {
|
|
|
842
969
|
404: ResponseError;
|
|
843
970
|
};
|
|
844
971
|
|
|
845
|
-
export type
|
|
972
|
+
export type GetPrepareStatusError = GetPrepareStatusErrors[keyof GetPrepareStatusErrors];
|
|
846
973
|
|
|
847
|
-
export type
|
|
974
|
+
export type GetPrepareStatusResponses = {
|
|
848
975
|
/**
|
|
849
976
|
* Current prepare job state
|
|
850
977
|
*/
|
|
851
978
|
200: PrepareJobState;
|
|
852
979
|
};
|
|
853
980
|
|
|
854
|
-
export type
|
|
981
|
+
export type GetPrepareStatusResponse = GetPrepareStatusResponses[keyof GetPrepareStatusResponses];
|
|
855
982
|
|
|
856
|
-
export type
|
|
983
|
+
export type ExecuteSweepData = {
|
|
984
|
+
body: ExecuteSweepRequest;
|
|
985
|
+
path: {
|
|
986
|
+
exchangeId: string;
|
|
987
|
+
type: DataSourceType;
|
|
988
|
+
/**
|
|
989
|
+
* Job ID returned by `POST /backtest/{exchangeId}/{type}/prepare`.
|
|
990
|
+
*/
|
|
991
|
+
requestId: string;
|
|
992
|
+
};
|
|
993
|
+
query?: never;
|
|
994
|
+
url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}';
|
|
995
|
+
};
|
|
996
|
+
|
|
997
|
+
export type ExecuteSweepErrors = {
|
|
998
|
+
/**
|
|
999
|
+
* Invalid sweep specification or the expanded grid exceeds the server limit.
|
|
1000
|
+
*/
|
|
1001
|
+
400: ResponseError;
|
|
1002
|
+
/**
|
|
1003
|
+
* Prepared request not found or expired.
|
|
1004
|
+
*/
|
|
1005
|
+
404: ResponseError;
|
|
1006
|
+
/**
|
|
1007
|
+
* Sweep queue or user concurrency limit reached.
|
|
1008
|
+
*/
|
|
1009
|
+
429: ResponseError;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
export type ExecuteSweepError = ExecuteSweepErrors[keyof ExecuteSweepErrors];
|
|
1013
|
+
|
|
1014
|
+
export type ExecuteSweepResponses = {
|
|
1015
|
+
/**
|
|
1016
|
+
* Sweep accepted. The effective seed is returned for reproducibility.
|
|
1017
|
+
*/
|
|
1018
|
+
202: ExecuteSweepAccepted;
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
export type ExecuteSweepResponse = ExecuteSweepResponses[keyof ExecuteSweepResponses];
|
|
1022
|
+
|
|
1023
|
+
export type CancelSweepData = {
|
|
1024
|
+
body?: never;
|
|
1025
|
+
path: {
|
|
1026
|
+
exchangeId: string;
|
|
1027
|
+
type: DataSourceType;
|
|
1028
|
+
requestId: string;
|
|
1029
|
+
sweepId: string;
|
|
1030
|
+
};
|
|
1031
|
+
query?: never;
|
|
1032
|
+
url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}';
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1035
|
+
export type CancelSweepErrors = {
|
|
1036
|
+
/**
|
|
1037
|
+
* Sweep not found.
|
|
1038
|
+
*/
|
|
1039
|
+
404: ResponseError;
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
export type CancelSweepError = CancelSweepErrors[keyof CancelSweepErrors];
|
|
1043
|
+
|
|
1044
|
+
export type CancelSweepResponses = {
|
|
1045
|
+
/**
|
|
1046
|
+
* Cancellation requested.
|
|
1047
|
+
*/
|
|
1048
|
+
200: {
|
|
1049
|
+
status: 'cancelling';
|
|
1050
|
+
sweepId: string;
|
|
1051
|
+
};
|
|
1052
|
+
};
|
|
1053
|
+
|
|
1054
|
+
export type CancelSweepResponse = CancelSweepResponses[keyof CancelSweepResponses];
|
|
1055
|
+
|
|
1056
|
+
export type GetSweepResultData = {
|
|
1057
|
+
body?: never;
|
|
1058
|
+
path: {
|
|
1059
|
+
exchangeId: string;
|
|
1060
|
+
type: DataSourceType;
|
|
1061
|
+
requestId: string;
|
|
1062
|
+
sweepId: string;
|
|
1063
|
+
};
|
|
1064
|
+
query?: {
|
|
1065
|
+
objective?: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
|
|
1066
|
+
/**
|
|
1067
|
+
* `natural` is stable materialisation order; `ranked` is the display view.
|
|
1068
|
+
*/
|
|
1069
|
+
order?: 'ranked' | 'natural';
|
|
1070
|
+
};
|
|
1071
|
+
url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}';
|
|
1072
|
+
};
|
|
1073
|
+
|
|
1074
|
+
export type GetSweepResultErrors = {
|
|
1075
|
+
/**
|
|
1076
|
+
* Sweep not found or expired.
|
|
1077
|
+
*/
|
|
1078
|
+
404: ResponseError;
|
|
1079
|
+
};
|
|
1080
|
+
|
|
1081
|
+
export type GetSweepResultError = GetSweepResultErrors[keyof GetSweepResultErrors];
|
|
1082
|
+
|
|
1083
|
+
export type GetSweepResultResponses = {
|
|
1084
|
+
/**
|
|
1085
|
+
* Current sweep snapshot and all currently available result rows for the selected view.
|
|
1086
|
+
*/
|
|
1087
|
+
200: ExecuteSweepResult;
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
export type GetSweepResultResponse = GetSweepResultResponses[keyof GetSweepResultResponses];
|
|
1091
|
+
|
|
1092
|
+
export type ExecuteBacktestData = {
|
|
857
1093
|
/**
|
|
858
1094
|
* Execute task parameters
|
|
859
1095
|
*/
|
|
@@ -884,7 +1120,7 @@ export type ExecuteBacktestingData = {
|
|
|
884
1120
|
url: '/backtest/{exchangeId}/{type}/execute';
|
|
885
1121
|
};
|
|
886
1122
|
|
|
887
|
-
export type
|
|
1123
|
+
export type ExecuteBacktestErrors = {
|
|
888
1124
|
/**
|
|
889
1125
|
* Invalid request or parameters
|
|
890
1126
|
*/
|
|
@@ -899,18 +1135,18 @@ export type ExecuteBacktestingErrors = {
|
|
|
899
1135
|
429: ResponseError;
|
|
900
1136
|
};
|
|
901
1137
|
|
|
902
|
-
export type
|
|
1138
|
+
export type ExecuteBacktestError = ExecuteBacktestErrors[keyof ExecuteBacktestErrors];
|
|
903
1139
|
|
|
904
|
-
export type
|
|
1140
|
+
export type ExecuteBacktestResponses = {
|
|
905
1141
|
/**
|
|
906
1142
|
* Execute task accepted (queued for processing)
|
|
907
1143
|
*/
|
|
908
1144
|
202: AcceptedJob;
|
|
909
1145
|
};
|
|
910
1146
|
|
|
911
|
-
export type
|
|
1147
|
+
export type ExecuteBacktestResponse = ExecuteBacktestResponses[keyof ExecuteBacktestResponses];
|
|
912
1148
|
|
|
913
|
-
export type
|
|
1149
|
+
export type CancelBacktestData = {
|
|
914
1150
|
body?: never;
|
|
915
1151
|
path: {
|
|
916
1152
|
exchangeId: string;
|
|
@@ -924,16 +1160,16 @@ export type CancelExecutionData = {
|
|
|
924
1160
|
url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
|
|
925
1161
|
};
|
|
926
1162
|
|
|
927
|
-
export type
|
|
1163
|
+
export type CancelBacktestErrors = {
|
|
928
1164
|
/**
|
|
929
1165
|
* Execution not found
|
|
930
1166
|
*/
|
|
931
1167
|
404: ResponseError;
|
|
932
1168
|
};
|
|
933
1169
|
|
|
934
|
-
export type
|
|
1170
|
+
export type CancelBacktestError = CancelBacktestErrors[keyof CancelBacktestErrors];
|
|
935
1171
|
|
|
936
|
-
export type
|
|
1172
|
+
export type CancelBacktestResponses = {
|
|
937
1173
|
/**
|
|
938
1174
|
* Cancellation request accepted
|
|
939
1175
|
*/
|
|
@@ -943,9 +1179,9 @@ export type CancelExecutionResponses = {
|
|
|
943
1179
|
};
|
|
944
1180
|
};
|
|
945
1181
|
|
|
946
|
-
export type
|
|
1182
|
+
export type CancelBacktestResponse = CancelBacktestResponses[keyof CancelBacktestResponses];
|
|
947
1183
|
|
|
948
|
-
export type
|
|
1184
|
+
export type GetBacktestResultData = {
|
|
949
1185
|
body?: never;
|
|
950
1186
|
path: {
|
|
951
1187
|
/**
|
|
@@ -965,7 +1201,7 @@ export type GetExecutionResultData = {
|
|
|
965
1201
|
url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
|
|
966
1202
|
};
|
|
967
1203
|
|
|
968
|
-
export type
|
|
1204
|
+
export type GetBacktestResultErrors = {
|
|
969
1205
|
/**
|
|
970
1206
|
* Invalid request or parameters
|
|
971
1207
|
*/
|
|
@@ -976,16 +1212,31 @@ export type GetExecutionResultErrors = {
|
|
|
976
1212
|
404: ResponseError;
|
|
977
1213
|
};
|
|
978
1214
|
|
|
979
|
-
export type
|
|
1215
|
+
export type GetBacktestResultError = GetBacktestResultErrors[keyof GetBacktestResultErrors];
|
|
980
1216
|
|
|
981
|
-
export type
|
|
1217
|
+
export type GetBacktestResultResponses = {
|
|
982
1218
|
/**
|
|
983
1219
|
* Backtesting execution result
|
|
984
1220
|
*/
|
|
985
1221
|
200: BacktestJobResult;
|
|
1222
|
+
/**
|
|
1223
|
+
* The job is known but its result is not readable yet — keep polling.
|
|
1224
|
+
*
|
|
1225
|
+
* Returned in two situations, both of which mean "ask again", never "you are done":
|
|
1226
|
+
* the job has not produced its result yet, or the job reached a terminal status while
|
|
1227
|
+
* its stored result could not be read back. The response body is an empty object: it
|
|
1228
|
+
* deliberately carries no `state`, so a client cannot mistake it for a finished result.
|
|
1229
|
+
*
|
|
1230
|
+
* Treat any `202` as a signal to continue the poll loop under your existing timeout.
|
|
1231
|
+
* Never treat it as a terminal outcome.
|
|
1232
|
+
*
|
|
1233
|
+
*/
|
|
1234
|
+
202: {
|
|
1235
|
+
[key: string]: never;
|
|
1236
|
+
};
|
|
986
1237
|
};
|
|
987
1238
|
|
|
988
|
-
export type
|
|
1239
|
+
export type GetBacktestResultResponse = GetBacktestResultResponses[keyof GetBacktestResultResponses];
|
|
989
1240
|
|
|
990
1241
|
export type ClientOptions = {
|
|
991
1242
|
baseUrl: 'https://api.staging.qtsurfer.com/v1' | 'https://api.qtsurfer.com/v1' | (string & {});
|