@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/dist/index.d.ts CHANGED
@@ -153,6 +153,34 @@ type Exchange = {
153
153
  * Managed exchange data sources available for backtesting.
154
154
  */
155
155
  type DataSourceType = 'ticker';
156
+ type PrepareRequest = {
157
+ instrument: Instrument;
158
+ /**
159
+ * Start date for the preparation process. Supports the following formats:
160
+ * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
161
+ * - ISO DATE (e.g. 2024-12-14)
162
+ * - BASIC ISO DATE (e.g., 20241214)
163
+ *
164
+ */
165
+ from: string;
166
+ /**
167
+ * End date for the preparation process. Supports the following formats:
168
+ * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
169
+ * - ISO DATE (e.g. 2024-12-14)
170
+ * - BASIC ISO DATE (e.g., 20241214)
171
+ *
172
+ */
173
+ to: string;
174
+ /**
175
+ * Output bar cadence for the prepared range. Defaults to the publisher's
176
+ * native cadence (`1s`); coarser cadences are produced on demand via
177
+ * resampling and stored alongside the native blob in cache. Coarser-than-
178
+ * source values must be exact multiples of the source cadence — invalid
179
+ * labels return `400`.
180
+ *
181
+ */
182
+ cadence?: '1s' | '5s' | '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
183
+ };
156
184
  /**
157
185
  * Information about a single job
158
186
  */
@@ -245,6 +273,123 @@ type PrepareJobState = JobState & {
245
273
  rationale?: 'pending_conversion' | 'low_activity' | 'unknown';
246
274
  }>;
247
275
  };
276
+ /**
277
+ * A numeric range or an explicit list of values for one strategy property.
278
+ */
279
+ type SweepAxis = {
280
+ from: number;
281
+ to: number;
282
+ step: number;
283
+ } | {
284
+ values: Array<number | boolean>;
285
+ };
286
+ type SweepSpecRequest = {
287
+ sampler?: 'grid' | 'random' | 'lhs';
288
+ /**
289
+ * Reproducibility seed. If omitted, the server generates one with Java's
290
+ * `L64X128MixRandom` generator and returns the effective value. The range
291
+ * is limited to JavaScript-safe integers so generated clients can replay it exactly.
292
+ *
293
+ */
294
+ seed?: number;
295
+ /**
296
+ * Number of samples for `random` and `lhs`; ignored by `grid`.
297
+ */
298
+ samples?: number;
299
+ objective?: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
300
+ params: {
301
+ [key: string]: SweepAxis;
302
+ };
303
+ };
304
+ type SweepBaseConfig = {
305
+ initialFunding?: number;
306
+ feeRate?: number;
307
+ buyFeeRate?: number;
308
+ sellFeeRate?: number;
309
+ feeLeg?: 'RECEIVED' | 'QUOTE' | 'BASE';
310
+ percentAmountToLock?: number;
311
+ };
312
+ type ExecuteSweepRequest = {
313
+ strategyId: StrategyId;
314
+ sweep: SweepSpecRequest;
315
+ baseConfig?: SweepBaseConfig;
316
+ /**
317
+ * Store signals for every trial. Keep false for normal sweeps.
318
+ */
319
+ storeSignals?: boolean;
320
+ /**
321
+ * Requested horizontal shard count; 0 or omitted selects automatically.
322
+ */
323
+ shards?: number;
324
+ /**
325
+ * Trials below this trade count are flagged but remain in the results.
326
+ */
327
+ minTradeFloor?: number;
328
+ };
329
+ type ExecuteSweepAccepted = {
330
+ sweepId: string;
331
+ requestId: string;
332
+ totalRuns: number;
333
+ shards: number;
334
+ /**
335
+ * Effective seed used to expand the sweep.
336
+ */
337
+ seed: number;
338
+ /**
339
+ * False when an identical sweep already exists and was not enqueued again.
340
+ */
341
+ queued: boolean;
342
+ };
343
+ type SweepProgress = {
344
+ done: number;
345
+ total: number;
346
+ aborted: number;
347
+ shardCount: number;
348
+ pendingShards: number;
349
+ };
350
+ type SweepRunRow = {
351
+ /**
352
+ * Deterministic zero-based expansion index, stable across shards and ranking.
353
+ */
354
+ runIx: number;
355
+ /**
356
+ * Present only in the `ranked` view.
357
+ */
358
+ rank?: number;
359
+ params: {
360
+ [key: string]: unknown;
361
+ };
362
+ sharpe: number;
363
+ sortino: number;
364
+ /**
365
+ * Absolute net PnL in the output currency.
366
+ */
367
+ pnl: number;
368
+ pnlPct: number;
369
+ cagr: number;
370
+ maxDdPct: number;
371
+ trades: number;
372
+ winRate: number;
373
+ belowTradeFloor: boolean;
374
+ aborted: boolean;
375
+ runtimeMs: number;
376
+ };
377
+ type ExecuteSweepResult = {
378
+ sweepId: string;
379
+ status: 'RUNNING' | 'COMPLETED' | 'PARTIAL' | 'CANCELLED';
380
+ objective: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
381
+ order: 'ranked' | 'natural';
382
+ progress: SweepProgress;
383
+ /**
384
+ * Total result rows currently available.
385
+ */
386
+ leaderboardSize: number;
387
+ /**
388
+ * True only when the ranked view exceeds its display limit.
389
+ */
390
+ truncated: boolean;
391
+ leaderboard: Array<SweepRunRow>;
392
+ };
248
393
  /**
249
394
  * Response returned by async endpoints (`202 Accepted`). The `jobId` is deterministic for the
250
395
  * same input parameters — repeated calls with identical params return the same id.
@@ -400,13 +545,13 @@ type AuthTokenError = {
400
545
  */
401
546
  message: string;
402
547
  };
403
- type AuthData = {
548
+ type AuthenticateData = {
404
549
  body?: never;
405
550
  path?: never;
406
551
  query?: never;
407
552
  url: '/auth/token';
408
553
  };
409
- type AuthErrors = {
554
+ type AuthenticateErrors = {
410
555
  /**
411
556
  * API key is invalid, revoked, or expired.
412
557
  */
@@ -416,28 +561,28 @@ type AuthErrors = {
416
561
  */
417
562
  429: unknown;
418
563
  };
419
- type AuthError = AuthErrors[keyof AuthErrors];
420
- type AuthResponses = {
564
+ type AuthenticateError = AuthenticateErrors[keyof AuthenticateErrors];
565
+ type AuthenticateResponses = {
421
566
  /**
422
567
  * API key accepted; JWT returned.
423
568
  */
424
569
  200: AuthTokenResponse;
425
570
  };
426
- type AuthResponse = AuthResponses[keyof AuthResponses];
427
- type GetExchangesData = {
571
+ type AuthenticateResponse = AuthenticateResponses[keyof AuthenticateResponses];
572
+ type ListExchangesData = {
428
573
  body?: never;
429
574
  path?: never;
430
575
  query?: never;
431
576
  url: '/exchanges';
432
577
  };
433
- type GetExchangesResponses = {
578
+ type ListExchangesResponses = {
434
579
  /**
435
580
  * A JSON array of Exchanges
436
581
  */
437
582
  200: Array<Exchange>;
438
583
  };
439
- type GetExchangesResponse = GetExchangesResponses[keyof GetExchangesResponses];
440
- type GetInstrumentsData = {
584
+ type ListExchangesResponse = ListExchangesResponses[keyof ListExchangesResponses];
585
+ type ListInstrumentsData = {
441
586
  body?: never;
442
587
  path: {
443
588
  /**
@@ -448,21 +593,21 @@ type GetInstrumentsData = {
448
593
  query?: never;
449
594
  url: '/exchange/{exchangeId}/instruments';
450
595
  };
451
- type GetInstrumentsErrors = {
596
+ type ListInstrumentsErrors = {
452
597
  /**
453
598
  * Exchange not found or instrument catalog not available
454
599
  */
455
600
  404: ResponseError;
456
601
  };
457
- type GetInstrumentsError = GetInstrumentsErrors[keyof GetInstrumentsErrors];
458
- type GetInstrumentsResponses = {
602
+ type ListInstrumentsError = ListInstrumentsErrors[keyof ListInstrumentsErrors];
603
+ type ListInstrumentsResponses = {
459
604
  /**
460
605
  * The default (spot) segment's instruments in `data`, `meta`, and HAL `_links` (self + spot/futures segment discovery)
461
606
  */
462
607
  200: InstrumentListResponse;
463
608
  };
464
- type GetInstrumentsResponse = GetInstrumentsResponses[keyof GetInstrumentsResponses];
465
- type GetSegmentInstrumentsData = {
609
+ type ListInstrumentsResponse = ListInstrumentsResponses[keyof ListInstrumentsResponses];
610
+ type ListSegmentInstrumentsData = {
466
611
  body?: never;
467
612
  path: {
468
613
  /**
@@ -477,21 +622,21 @@ type GetSegmentInstrumentsData = {
477
622
  query?: never;
478
623
  url: '/exchange/{exchangeId}/{segment}/instruments';
479
624
  };
480
- type GetSegmentInstrumentsErrors = {
625
+ type ListSegmentInstrumentsErrors = {
481
626
  /**
482
627
  * Exchange, segment, or instrument catalog not found
483
628
  */
484
629
  404: ResponseError;
485
630
  };
486
- type GetSegmentInstrumentsError = GetSegmentInstrumentsErrors[keyof GetSegmentInstrumentsErrors];
487
- type GetSegmentInstrumentsResponses = {
631
+ type ListSegmentInstrumentsError = ListSegmentInstrumentsErrors[keyof ListSegmentInstrumentsErrors];
632
+ type ListSegmentInstrumentsResponses = {
488
633
  /**
489
634
  * An object with a `data` array of instrument details (each with per-data-type coverage) and a `meta` block
490
635
  */
491
636
  200: InstrumentListResponse;
492
637
  };
493
- type GetSegmentInstrumentsResponse = GetSegmentInstrumentsResponses[keyof GetSegmentInstrumentsResponses];
494
- type GetExchangeTickersHourData = {
638
+ type ListSegmentInstrumentsResponse = ListSegmentInstrumentsResponses[keyof ListSegmentInstrumentsResponses];
639
+ type DownloadTickersData = {
495
640
  body?: never;
496
641
  path: {
497
642
  /**
@@ -524,7 +669,7 @@ type GetExchangeTickersHourData = {
524
669
  };
525
670
  url: '/exchange/{exchangeId}/tickers/{base}/{quote}';
526
671
  };
527
- type GetExchangeTickersHourErrors = {
672
+ type DownloadTickersErrors = {
528
673
  /**
529
674
  * Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
530
675
  */
@@ -538,8 +683,8 @@ type GetExchangeTickersHourErrors = {
538
683
  */
539
684
  500: ResponseError;
540
685
  };
541
- type GetExchangeTickersHourError = GetExchangeTickersHourErrors[keyof GetExchangeTickersHourErrors];
542
- type GetExchangeTickersHourResponses = {
686
+ type DownloadTickersError = DownloadTickersErrors[keyof DownloadTickersErrors];
687
+ type DownloadTickersResponses = {
543
688
  /**
544
689
  * One hour of tickers for the instrument. `Content-Type` is
545
690
  * `application/vnd.lastra` by default or
@@ -549,8 +694,8 @@ type GetExchangeTickersHourResponses = {
549
694
  */
550
695
  200: Blob | File;
551
696
  };
552
- type GetExchangeTickersHourResponse = GetExchangeTickersHourResponses[keyof GetExchangeTickersHourResponses];
553
- type GetExchangeKlinesHourData = {
697
+ type DownloadTickersResponse = DownloadTickersResponses[keyof DownloadTickersResponses];
698
+ type DownloadKlinesData = {
554
699
  body?: never;
555
700
  path: {
556
701
  /**
@@ -582,7 +727,7 @@ type GetExchangeKlinesHourData = {
582
727
  };
583
728
  url: '/exchange/{exchangeId}/klines/{base}/{quote}';
584
729
  };
585
- type GetExchangeKlinesHourErrors = {
730
+ type DownloadKlinesErrors = {
586
731
  /**
587
732
  * Missing or malformed parameters (e.g. `hour` not `YYYY-MM-DDTHH`).
588
733
  */
@@ -596,8 +741,8 @@ type GetExchangeKlinesHourErrors = {
596
741
  */
597
742
  500: ResponseError;
598
743
  };
599
- type GetExchangeKlinesHourError = GetExchangeKlinesHourErrors[keyof GetExchangeKlinesHourErrors];
600
- type GetExchangeKlinesHourResponses = {
744
+ type DownloadKlinesError = DownloadKlinesErrors[keyof DownloadKlinesErrors];
745
+ type DownloadKlinesResponses = {
601
746
  /**
602
747
  * One hour of klines for the instrument. `Content-Type` is
603
748
  * `application/vnd.lastra` by default or
@@ -606,8 +751,8 @@ type GetExchangeKlinesHourResponses = {
606
751
  */
607
752
  200: Blob | File;
608
753
  };
609
- type GetExchangeKlinesHourResponse = GetExchangeKlinesHourResponses[keyof GetExchangeKlinesHourResponses];
610
- type PostStrategyData = {
754
+ type DownloadKlinesResponse = DownloadKlinesResponses[keyof DownloadKlinesResponses];
755
+ type CompileStrategyData = {
611
756
  /**
612
757
  * Raw strategy Java source code
613
758
  */
@@ -622,14 +767,14 @@ type PostStrategyData = {
622
767
  query?: never;
623
768
  url: '/strategy';
624
769
  };
625
- type PostStrategyErrors = {
770
+ type CompileStrategyErrors = {
626
771
  /**
627
772
  * Invalid strategy (compilation error)
628
773
  */
629
774
  400: ResponseError;
630
775
  };
631
- type PostStrategyError = PostStrategyErrors[keyof PostStrategyErrors];
632
- type PostStrategyResponses = {
776
+ type CompileStrategyError = CompileStrategyErrors[keyof CompileStrategyErrors];
777
+ type CompileStrategyResponses = {
633
778
  /**
634
779
  * Strategy compiled successfully (sync mode)
635
780
  */
@@ -641,8 +786,8 @@ type PostStrategyResponses = {
641
786
  */
642
787
  202: AcceptedJob;
643
788
  };
644
- type PostStrategyResponse = PostStrategyResponses[keyof PostStrategyResponses];
645
- type GetStrategyStatusData = {
789
+ type CompileStrategyResponse = CompileStrategyResponses[keyof CompileStrategyResponses];
790
+ type GetStrategyData = {
646
791
  body?: never;
647
792
  path: {
648
793
  /**
@@ -653,14 +798,14 @@ type GetStrategyStatusData = {
653
798
  query?: never;
654
799
  url: '/strategy/{strategyId}';
655
800
  };
656
- type GetStrategyStatusErrors = {
801
+ type GetStrategyErrors = {
657
802
  /**
658
803
  * Strategy compile job not found
659
804
  */
660
805
  404: ResponseError;
661
806
  };
662
- type GetStrategyStatusError = GetStrategyStatusErrors[keyof GetStrategyStatusErrors];
663
- type GetStrategyStatusResponses = {
807
+ type GetStrategyError = GetStrategyErrors[keyof GetStrategyErrors];
808
+ type GetStrategyResponses = {
664
809
  /**
665
810
  * Strategy compile state
666
811
  */
@@ -677,39 +822,12 @@ type GetStrategyStatusResponses = {
677
822
  statusDetail?: string | null;
678
823
  };
679
824
  };
680
- type GetStrategyStatusResponse = GetStrategyStatusResponses[keyof GetStrategyStatusResponses];
681
- type PrepareBacktestingData = {
825
+ type GetStrategyResponse = GetStrategyResponses[keyof GetStrategyResponses];
826
+ type PrepareBacktestData = {
682
827
  /**
683
828
  * The required data to prepare a backtesting
684
829
  */
685
- body: {
686
- instrument: Instrument;
687
- /**
688
- * Start date for the preparation process. Supports the following formats:
689
- * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
690
- * - ISO DATE (e.g. 2024-12-14)
691
- * - BASIC ISO DATE (e.g., 20241214)
692
- *
693
- */
694
- from: string;
695
- /**
696
- * End date for the preparation process. Supports the following formats:
697
- * - ISO-8601 (e.g. 2024-12-14T23:59:59Z)
698
- * - ISO DATE (e.g. 2024-12-14)
699
- * - BASIC ISO DATE (e.g., 20241214)
700
- *
701
- */
702
- to: string;
703
- /**
704
- * Output bar cadence for the prepared range. Defaults to the publisher's
705
- * native cadence (`1s`); coarser cadences are produced on demand via
706
- * resampling and stored alongside the native blob in cache. Coarser-than-
707
- * source values must be exact multiples of the source cadence — invalid
708
- * labels return `400`.
709
- *
710
- */
711
- cadence?: '1s' | '5s' | '1m' | '5m' | '15m' | '1h' | '4h' | '1d';
712
- };
830
+ body: PrepareRequest;
713
831
  path: {
714
832
  /**
715
833
  * ID of the exchange to prepare the backtesting for
@@ -723,7 +841,7 @@ type PrepareBacktestingData = {
723
841
  query?: never;
724
842
  url: '/backtest/{exchangeId}/{type}/prepare';
725
843
  };
726
- type PrepareBacktestingErrors = {
844
+ type PrepareBacktestErrors = {
727
845
  /**
728
846
  * Invalid request or parameters. Also returned when `from` is older than the configured
729
847
  * lookback window or `to` is in the future.
@@ -741,15 +859,15 @@ type PrepareBacktestingErrors = {
741
859
  */
742
860
  429: ResponseError;
743
861
  };
744
- type PrepareBacktestingError = PrepareBacktestingErrors[keyof PrepareBacktestingErrors];
745
- type PrepareBacktestingResponses = {
862
+ type PrepareBacktestError = PrepareBacktestErrors[keyof PrepareBacktestErrors];
863
+ type PrepareBacktestResponses = {
746
864
  /**
747
865
  * Prepare task accepted (queued for processing)
748
866
  */
749
867
  202: AcceptedJob;
750
868
  };
751
- type PrepareBacktestingResponse = PrepareBacktestingResponses[keyof PrepareBacktestingResponses];
752
- type GetPreparationStatusData = {
869
+ type PrepareBacktestResponse = PrepareBacktestResponses[keyof PrepareBacktestResponses];
870
+ type GetPrepareStatusData = {
753
871
  body?: never;
754
872
  path: {
755
873
  /**
@@ -768,7 +886,7 @@ type GetPreparationStatusData = {
768
886
  query?: never;
769
887
  url: '/backtest/{exchangeId}/{type}/prepare/{jobId}';
770
888
  };
771
- type GetPreparationStatusErrors = {
889
+ type GetPrepareStatusErrors = {
772
890
  /**
773
891
  * Invalid request or parameters
774
892
  */
@@ -778,15 +896,109 @@ type GetPreparationStatusErrors = {
778
896
  */
779
897
  404: ResponseError;
780
898
  };
781
- type GetPreparationStatusError = GetPreparationStatusErrors[keyof GetPreparationStatusErrors];
782
- type GetPreparationStatusResponses = {
899
+ type GetPrepareStatusError = GetPrepareStatusErrors[keyof GetPrepareStatusErrors];
900
+ type GetPrepareStatusResponses = {
783
901
  /**
784
902
  * Current prepare job state
785
903
  */
786
904
  200: PrepareJobState;
787
905
  };
788
- type GetPreparationStatusResponse = GetPreparationStatusResponses[keyof GetPreparationStatusResponses];
789
- type ExecuteBacktestingData = {
906
+ type GetPrepareStatusResponse = GetPrepareStatusResponses[keyof GetPrepareStatusResponses];
907
+ type ExecuteSweepData = {
908
+ body: ExecuteSweepRequest;
909
+ path: {
910
+ exchangeId: string;
911
+ type: DataSourceType;
912
+ /**
913
+ * Job ID returned by `POST /backtest/{exchangeId}/{type}/prepare`.
914
+ */
915
+ requestId: string;
916
+ };
917
+ query?: never;
918
+ url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}';
919
+ };
920
+ type ExecuteSweepErrors = {
921
+ /**
922
+ * Invalid sweep specification or the expanded grid exceeds the server limit.
923
+ */
924
+ 400: ResponseError;
925
+ /**
926
+ * Prepared request not found or expired.
927
+ */
928
+ 404: ResponseError;
929
+ /**
930
+ * Sweep queue or user concurrency limit reached.
931
+ */
932
+ 429: ResponseError;
933
+ };
934
+ type ExecuteSweepError = ExecuteSweepErrors[keyof ExecuteSweepErrors];
935
+ type ExecuteSweepResponses = {
936
+ /**
937
+ * Sweep accepted. The effective seed is returned for reproducibility.
938
+ */
939
+ 202: ExecuteSweepAccepted;
940
+ };
941
+ type ExecuteSweepResponse = ExecuteSweepResponses[keyof ExecuteSweepResponses];
942
+ type CancelSweepData = {
943
+ body?: never;
944
+ path: {
945
+ exchangeId: string;
946
+ type: DataSourceType;
947
+ requestId: string;
948
+ sweepId: string;
949
+ };
950
+ query?: never;
951
+ url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}';
952
+ };
953
+ type CancelSweepErrors = {
954
+ /**
955
+ * Sweep not found.
956
+ */
957
+ 404: ResponseError;
958
+ };
959
+ type CancelSweepError = CancelSweepErrors[keyof CancelSweepErrors];
960
+ type CancelSweepResponses = {
961
+ /**
962
+ * Cancellation requested.
963
+ */
964
+ 200: {
965
+ status: 'cancelling';
966
+ sweepId: string;
967
+ };
968
+ };
969
+ type CancelSweepResponse = CancelSweepResponses[keyof CancelSweepResponses];
970
+ type GetSweepResultData = {
971
+ body?: never;
972
+ path: {
973
+ exchangeId: string;
974
+ type: DataSourceType;
975
+ requestId: string;
976
+ sweepId: string;
977
+ };
978
+ query?: {
979
+ objective?: 'sharpe' | 'sortino' | 'pnl' | 'maxdd';
980
+ /**
981
+ * `natural` is stable materialisation order; `ranked` is the display view.
982
+ */
983
+ order?: 'ranked' | 'natural';
984
+ };
985
+ url: '/backtest/{exchangeId}/{type}/executeSweep/{requestId}/{sweepId}';
986
+ };
987
+ type GetSweepResultErrors = {
988
+ /**
989
+ * Sweep not found or expired.
990
+ */
991
+ 404: ResponseError;
992
+ };
993
+ type GetSweepResultError = GetSweepResultErrors[keyof GetSweepResultErrors];
994
+ type GetSweepResultResponses = {
995
+ /**
996
+ * Current sweep snapshot and all currently available result rows for the selected view.
997
+ */
998
+ 200: ExecuteSweepResult;
999
+ };
1000
+ type GetSweepResultResponse = GetSweepResultResponses[keyof GetSweepResultResponses];
1001
+ type ExecuteBacktestData = {
790
1002
  /**
791
1003
  * Execute task parameters
792
1004
  */
@@ -816,7 +1028,7 @@ type ExecuteBacktestingData = {
816
1028
  query?: never;
817
1029
  url: '/backtest/{exchangeId}/{type}/execute';
818
1030
  };
819
- type ExecuteBacktestingErrors = {
1031
+ type ExecuteBacktestErrors = {
820
1032
  /**
821
1033
  * Invalid request or parameters
822
1034
  */
@@ -830,15 +1042,15 @@ type ExecuteBacktestingErrors = {
830
1042
  */
831
1043
  429: ResponseError;
832
1044
  };
833
- type ExecuteBacktestingError = ExecuteBacktestingErrors[keyof ExecuteBacktestingErrors];
834
- type ExecuteBacktestingResponses = {
1045
+ type ExecuteBacktestError = ExecuteBacktestErrors[keyof ExecuteBacktestErrors];
1046
+ type ExecuteBacktestResponses = {
835
1047
  /**
836
1048
  * Execute task accepted (queued for processing)
837
1049
  */
838
1050
  202: AcceptedJob;
839
1051
  };
840
- type ExecuteBacktestingResponse = ExecuteBacktestingResponses[keyof ExecuteBacktestingResponses];
841
- type CancelExecutionData = {
1052
+ type ExecuteBacktestResponse = ExecuteBacktestResponses[keyof ExecuteBacktestResponses];
1053
+ type CancelBacktestData = {
842
1054
  body?: never;
843
1055
  path: {
844
1056
  exchangeId: string;
@@ -851,14 +1063,14 @@ type CancelExecutionData = {
851
1063
  query?: never;
852
1064
  url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
853
1065
  };
854
- type CancelExecutionErrors = {
1066
+ type CancelBacktestErrors = {
855
1067
  /**
856
1068
  * Execution not found
857
1069
  */
858
1070
  404: ResponseError;
859
1071
  };
860
- type CancelExecutionError = CancelExecutionErrors[keyof CancelExecutionErrors];
861
- type CancelExecutionResponses = {
1072
+ type CancelBacktestError = CancelBacktestErrors[keyof CancelBacktestErrors];
1073
+ type CancelBacktestResponses = {
862
1074
  /**
863
1075
  * Cancellation request accepted
864
1076
  */
@@ -867,8 +1079,8 @@ type CancelExecutionResponses = {
867
1079
  jobId?: string;
868
1080
  };
869
1081
  };
870
- type CancelExecutionResponse = CancelExecutionResponses[keyof CancelExecutionResponses];
871
- type GetExecutionResultData = {
1082
+ type CancelBacktestResponse = CancelBacktestResponses[keyof CancelBacktestResponses];
1083
+ type GetBacktestResultData = {
872
1084
  body?: never;
873
1085
  path: {
874
1086
  /**
@@ -887,7 +1099,7 @@ type GetExecutionResultData = {
887
1099
  query?: never;
888
1100
  url: '/backtest/{exchangeId}/{type}/execute/{jobId}';
889
1101
  };
890
- type GetExecutionResultErrors = {
1102
+ type GetBacktestResultErrors = {
891
1103
  /**
892
1104
  * Invalid request or parameters
893
1105
  */
@@ -897,14 +1109,29 @@ type GetExecutionResultErrors = {
897
1109
  */
898
1110
  404: ResponseError;
899
1111
  };
900
- type GetExecutionResultError = GetExecutionResultErrors[keyof GetExecutionResultErrors];
901
- type GetExecutionResultResponses = {
1112
+ type GetBacktestResultError = GetBacktestResultErrors[keyof GetBacktestResultErrors];
1113
+ type GetBacktestResultResponses = {
902
1114
  /**
903
1115
  * Backtesting execution result
904
1116
  */
905
1117
  200: BacktestJobResult;
1118
+ /**
1119
+ * The job is known but its result is not readable yet — keep polling.
1120
+ *
1121
+ * Returned in two situations, both of which mean "ask again", never "you are done":
1122
+ * the job has not produced its result yet, or the job reached a terminal status while
1123
+ * its stored result could not be read back. The response body is an empty object: it
1124
+ * deliberately carries no `state`, so a client cannot mistake it for a finished result.
1125
+ *
1126
+ * Treat any `202` as a signal to continue the poll loop under your existing timeout.
1127
+ * Never treat it as a terminal outcome.
1128
+ *
1129
+ */
1130
+ 202: {
1131
+ [key: string]: never;
1132
+ };
906
1133
  };
907
- type GetExecutionResultResponse = GetExecutionResultResponses[keyof GetExecutionResultResponses];
1134
+ type GetBacktestResultResponse = GetBacktestResultResponses[keyof GetBacktestResultResponses];
908
1135
  type ClientOptions = {
909
1136
  baseUrl: 'https://api.staging.qtsurfer.com/v1' | 'https://api.qtsurfer.com/v1' | (string & {});
910
1137
  };
@@ -934,29 +1161,29 @@ type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean
934
1161
  * before expiry (or on a `401` response) by calling this endpoint again.
935
1162
  *
936
1163
  */
937
- declare const auth: <ThrowOnError extends boolean = false>(options?: Options<AuthData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AuthTokenResponse, unknown, ThrowOnError>;
1164
+ declare const authenticate: <ThrowOnError extends boolean = false>(options?: Options<AuthenticateData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AuthTokenResponse, unknown, ThrowOnError>;
938
1165
  /**
939
- * Get a list of available exchanges
1166
+ * List the available exchanges
940
1167
  */
941
- declare const getExchanges: <ThrowOnError extends boolean = false>(options?: Options<GetExchangesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Exchange[], unknown, ThrowOnError>;
1168
+ declare const listExchanges: <ThrowOnError extends boolean = false>(options?: Options<ListExchangesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Exchange[], unknown, ThrowOnError>;
942
1169
  /**
943
- * Get an exchange's instruments (default spot segment)
1170
+ * List an exchange's instruments (default spot segment)
944
1171
  * "Give me binance instruments" — returns the exchange's DEFAULT segment (`spot`)
945
1172
  * in `data`, each instrument with per-data-type coverage and market info. `meta`
946
1173
  * confirms the served `segment` (`spot`); HAL `_links` carry `self` plus the
947
1174
  * `spot` / `futures` segment-discovery links.
948
1175
  *
949
1176
  */
950
- declare const getInstruments: <ThrowOnError extends boolean = false>(options: Options<GetInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
1177
+ declare const listInstruments: <ThrowOnError extends boolean = false>(options: Options<ListInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
951
1178
  /**
952
- * Get the instruments for a specific exchange segment
1179
+ * List an exchange segment's instruments
953
1180
  * Returns the instruments for one market segment of the exchange, each with
954
1181
  * per-data-type coverage and market info. HAL `_links` carry `self` plus the
955
1182
  * `spot` / `futures` segment-discovery links; the default-segment shortcut is
956
1183
  * `GET /exchange/{exchangeId}/instruments` (spot).
957
1184
  *
958
1185
  */
959
- declare const getSegmentInstruments: <ThrowOnError extends boolean = false>(options: Options<GetSegmentInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
1186
+ declare const listSegmentInstruments: <ThrowOnError extends boolean = false>(options: Options<ListSegmentInstrumentsData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<InstrumentListResponse, ResponseError, ThrowOnError>;
960
1187
  /**
961
1188
  * Download one hour of tickers for an instrument as a Lastra segment
962
1189
  * Serves exactly one hour of raw ticker data for the given instrument on the
@@ -989,7 +1216,7 @@ declare const getSegmentInstruments: <ThrowOnError extends boolean = false>(opti
989
1216
  * descriptive filename).
990
1217
  *
991
1218
  */
992
- declare const getExchangeTickersHour: <ThrowOnError extends boolean = false>(options: Options<GetExchangeTickersHourData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
1219
+ declare const downloadTickers: <ThrowOnError extends boolean = false>(options: Options<DownloadTickersData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
993
1220
  /**
994
1221
  * Download one hour of klines for an instrument as a Lastra segment
995
1222
  * Same shape and semantics as `/exchange/{exchangeId}/tickers/{base}/{quote}`,
@@ -1002,7 +1229,7 @@ declare const getExchangeTickersHour: <ThrowOnError extends boolean = false>(opt
1002
1229
  * per-tick payload would be too large for the window of interest.
1003
1230
  *
1004
1231
  */
1005
- declare const getExchangeKlinesHour: <ThrowOnError extends boolean = false>(options: Options<GetExchangeKlinesHourData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
1232
+ declare const downloadKlines: <ThrowOnError extends boolean = false>(options: Options<DownloadKlinesData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<Blob | File, ResponseError, ThrowOnError>;
1006
1233
  /**
1007
1234
  * Compile a strategy from source code
1008
1235
  * Submits raw strategy source for compilation. By default the call is synchronous and returns
@@ -1014,21 +1241,21 @@ declare const getExchangeKlinesHour: <ThrowOnError extends boolean = false>(opti
1014
1241
  * same id.
1015
1242
  *
1016
1243
  */
1017
- declare const postStrategy: <ThrowOnError extends boolean = false>(options: Options<PostStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PostStrategyResponse, ResponseError, ThrowOnError>;
1244
+ declare const compileStrategy: <ThrowOnError extends boolean = false>(options: Options<CompileStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<CompileStrategyResponse, ResponseError, ThrowOnError>;
1018
1245
  /**
1019
- * Get the status of an async compile task
1246
+ * Get a strategy by id, including its compile status
1020
1247
  * Polls the status of a strategy compilation. Useful when the strategy was submitted with
1021
1248
  * `X-Compile-Async: true`. Returns the resolved `strategyId` once compilation completes.
1022
1249
  *
1023
1250
  */
1024
- declare const getStrategyStatus: <ThrowOnError extends boolean = false>(options: Options<GetStrategyStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
1251
+ declare const getStrategy: <ThrowOnError extends boolean = false>(options: Options<GetStrategyData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
1025
1252
  jobId?: string;
1026
1253
  status: "New" | "Started" | "Completed" | "Aborted" | "Failed";
1027
1254
  strategyId?: StrategyId;
1028
1255
  statusDetail?: string | null;
1029
1256
  }, ResponseError, ThrowOnError>;
1030
1257
  /**
1031
- * Prepare backtesting data
1258
+ * Prepare backtest data
1032
1259
  * Enqueues a prepare task over the requested date range. Returns immediately with a `jobId`;
1033
1260
  * poll `GET /backtest/{exchangeId}/{type}/prepare/{jobId}` for completion.
1034
1261
  *
@@ -1036,14 +1263,38 @@ declare const getStrategyStatus: <ThrowOnError extends boolean = false>(options:
1036
1263
  * params do not enqueue duplicate work — they reuse the existing job.
1037
1264
  *
1038
1265
  */
1039
- declare const prepareBacktesting: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
1266
+ declare const prepareBacktest: <ThrowOnError extends boolean = false>(options: Options<PrepareBacktestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
1040
1267
  /**
1041
1268
  * Get the status of a prepare job
1042
1269
  * Retrieves the current state of the prepare job identified by `jobId`.
1043
1270
  * Poll until `status` is `Completed`, `Failed`, or `Aborted`.
1044
1271
  *
1045
1272
  */
1046
- declare const getPreparationStatus: <ThrowOnError extends boolean = false>(options: Options<GetPreparationStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PrepareJobState, ResponseError, ThrowOnError>;
1273
+ declare const getPrepareStatus: <ThrowOnError extends boolean = false>(options: Options<GetPrepareStatusData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<PrepareJobState, ResponseError, ThrowOnError>;
1274
+ /**
1275
+ * Execute a parameter sweep over prepared data
1276
+ * Runs a parameter matrix over the single immutable dataset identified by `requestId`.
1277
+ * The backend expands and executes the matrix internally; clients poll the returned
1278
+ * `sweepId` for incremental results.
1279
+ *
1280
+ */
1281
+ declare const executeSweep: <ThrowOnError extends boolean = false>(options: Options<ExecuteSweepData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ExecuteSweepAccepted, ResponseError, ThrowOnError>;
1282
+ /**
1283
+ * Cancel a running parameter sweep
1284
+ * Requests cancellation between parameter vectors. Completed rows remain readable.
1285
+ */
1286
+ declare const cancelSweep: <ThrowOnError extends boolean = false>(options: Options<CancelSweepData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
1287
+ status: "cancelling";
1288
+ sweepId: string;
1289
+ }, ResponseError, ThrowOnError>;
1290
+ /**
1291
+ * Get sweep progress and results
1292
+ * Returns incremental sweep progress. The default `ranked` view sorts and may truncate the
1293
+ * display leaderboard. `order=natural` returns every available row, untruncated, ordered by
1294
+ * deterministic `runIx`; use that view when materialising durable trial rows.
1295
+ *
1296
+ */
1297
+ declare const getSweepResult: <ThrowOnError extends boolean = false>(options: Options<GetSweepResultData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<ExecuteSweepResult, ResponseError, ThrowOnError>;
1047
1298
  /**
1048
1299
  * Execute a compiled strategy against a prepared dataset
1049
1300
  * Enqueues an execute task that runs the strategy identified by `strategyId` over the data
@@ -1057,7 +1308,7 @@ declare const getPreparationStatus: <ThrowOnError extends boolean = false>(optio
1057
1308
  * `jobId` (idempotent).
1058
1309
  *
1059
1310
  */
1060
- declare const executeBacktesting: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestingData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
1311
+ declare const executeBacktest: <ThrowOnError extends boolean = false>(options: Options<ExecuteBacktestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<AcceptedJob, ResponseError, ThrowOnError>;
1061
1312
  /**
1062
1313
  * Cancel a running backtest execution
1063
1314
  * Requests cancellation of the specified execution. The execution
@@ -1066,7 +1317,7 @@ declare const executeBacktesting: <ThrowOnError extends boolean = false>(options
1066
1317
  * to confirm the final status.
1067
1318
  *
1068
1319
  */
1069
- declare const cancelExecution: <ThrowOnError extends boolean = false>(options: Options<CancelExecutionData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
1320
+ declare const cancelBacktest: <ThrowOnError extends boolean = false>(options: Options<CancelBacktestData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<{
1070
1321
  status?: "cancelling";
1071
1322
  jobId?: string;
1072
1323
  }, ResponseError, ThrowOnError>;
@@ -1075,9 +1326,13 @@ declare const cancelExecution: <ThrowOnError extends boolean = false>(options: O
1075
1326
  * Retrieves the current state and results of the execute job identified by `jobId`.
1076
1327
  * Poll until `state.status` is `Completed`, `Failed`, or `Aborted`.
1077
1328
  *
1329
+ * A `202` means the result is not readable yet — keep polling. It is never a terminal
1330
+ * outcome, and it carries no `state`, so a poll loop that stops on a terminal status will
1331
+ * not stop on it.
1332
+ *
1078
1333
  */
1079
- declare const getExecutionResult: <ThrowOnError extends boolean = false>(options: Options<GetExecutionResultData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<BacktestJobResult, ResponseError, ThrowOnError>;
1334
+ declare const getBacktestResult: <ThrowOnError extends boolean = false>(options: Options<GetBacktestResultData, ThrowOnError>) => _hey_api_client_fetch.RequestResult<GetBacktestResultResponse, ResponseError, ThrowOnError>;
1080
1335
 
1081
1336
  declare const client: _hey_api_client_fetch.Client;
1082
1337
 
1083
- export { type AcceptedJob, type AuthData, type AuthError, type AuthErrors, type AuthResponse, type AuthResponses, type AuthTokenError, type AuthTokenResponse, type BacktestJobResult, type CancelExecutionData, type CancelExecutionError, type CancelExecutionErrors, type CancelExecutionResponse, type CancelExecutionResponses, type ClientOptions, type CoverageWindow, type DataSourceType, type EquityPoint, type Exchange, type ExecuteBacktestingData, type ExecuteBacktestingError, type ExecuteBacktestingErrors, type ExecuteBacktestingResponse, type ExecuteBacktestingResponses, type GetExchangeKlinesHourData, type GetExchangeKlinesHourError, type GetExchangeKlinesHourErrors, type GetExchangeKlinesHourResponse, type GetExchangeKlinesHourResponses, type GetExchangeTickersHourData, type GetExchangeTickersHourError, type GetExchangeTickersHourErrors, type GetExchangeTickersHourResponse, type GetExchangeTickersHourResponses, type GetExchangesData, type GetExchangesResponse, type GetExchangesResponses, type GetExecutionResultData, type GetExecutionResultError, type GetExecutionResultErrors, type GetExecutionResultResponse, type GetExecutionResultResponses, type GetInstrumentsData, type GetInstrumentsError, type GetInstrumentsErrors, type GetInstrumentsResponse, type GetInstrumentsResponses, type GetPreparationStatusData, type GetPreparationStatusError, type GetPreparationStatusErrors, type GetPreparationStatusResponse, type GetPreparationStatusResponses, type GetSegmentInstrumentsData, type GetSegmentInstrumentsError, type GetSegmentInstrumentsErrors, type GetSegmentInstrumentsResponse, type GetSegmentInstrumentsResponses, type GetStrategyStatusData, type GetStrategyStatusError, type GetStrategyStatusErrors, type GetStrategyStatusResponse, type GetStrategyStatusResponses, type HalLink, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type Options, type PostStrategyData, type PostStrategyError, type PostStrategyErrors, type PostStrategyResponse, type PostStrategyResponses, type PrepareBacktestingData, type PrepareBacktestingError, type PrepareBacktestingErrors, type PrepareBacktestingResponse, type PrepareBacktestingResponses, type PrepareJobState, type ResponseError, type ResultMap, type StrategyId, auth, cancelExecution, client, executeBacktesting, getExchangeKlinesHour, getExchangeTickersHour, getExchanges, getExecutionResult, getInstruments, getPreparationStatus, getSegmentInstruments, getStrategyStatus, postStrategy, prepareBacktesting };
1338
+ export { type AcceptedJob, type AuthTokenError, type AuthTokenResponse, type AuthenticateData, type AuthenticateError, type AuthenticateErrors, type AuthenticateResponse, type AuthenticateResponses, type BacktestJobResult, type CancelBacktestData, type CancelBacktestError, type CancelBacktestErrors, type CancelBacktestResponse, type CancelBacktestResponses, type CancelSweepData, type CancelSweepError, type CancelSweepErrors, type CancelSweepResponse, type CancelSweepResponses, type ClientOptions, type CompileStrategyData, type CompileStrategyError, type CompileStrategyErrors, type CompileStrategyResponse, type CompileStrategyResponses, type CoverageWindow, type DataSourceType, type DownloadKlinesData, type DownloadKlinesError, type DownloadKlinesErrors, type DownloadKlinesResponse, type DownloadKlinesResponses, type DownloadTickersData, type DownloadTickersError, type DownloadTickersErrors, type DownloadTickersResponse, type DownloadTickersResponses, type EquityPoint, type Exchange, type ExecuteBacktestData, type ExecuteBacktestError, type ExecuteBacktestErrors, type ExecuteBacktestResponse, type ExecuteBacktestResponses, type ExecuteSweepAccepted, type ExecuteSweepData, type ExecuteSweepError, type ExecuteSweepErrors, type ExecuteSweepRequest, type ExecuteSweepResponse, type ExecuteSweepResponses, type ExecuteSweepResult, type GetBacktestResultData, type GetBacktestResultError, type GetBacktestResultErrors, type GetBacktestResultResponse, type GetBacktestResultResponses, type GetPrepareStatusData, type GetPrepareStatusError, type GetPrepareStatusErrors, type GetPrepareStatusResponse, type GetPrepareStatusResponses, type GetStrategyData, type GetStrategyError, type GetStrategyErrors, type GetStrategyResponse, type GetStrategyResponses, type GetSweepResultData, type GetSweepResultError, type GetSweepResultErrors, type GetSweepResultResponse, type GetSweepResultResponses, type HalLink, type Instrument, type InstrumentCoverage, type InstrumentDetail, type InstrumentLinks, type InstrumentListMeta, type InstrumentListResponse, type JobState, type ListExchangesData, type ListExchangesResponse, type ListExchangesResponses, type ListInstrumentsData, type ListInstrumentsError, type ListInstrumentsErrors, type ListInstrumentsResponse, type ListInstrumentsResponses, type ListSegmentInstrumentsData, type ListSegmentInstrumentsError, type ListSegmentInstrumentsErrors, type ListSegmentInstrumentsResponse, type ListSegmentInstrumentsResponses, type Options, type PrepareBacktestData, type PrepareBacktestError, type PrepareBacktestErrors, type PrepareBacktestResponse, type PrepareBacktestResponses, type PrepareJobState, type PrepareRequest, type ResponseError, type ResultMap, type StrategyId, type SweepAxis, type SweepBaseConfig, type SweepProgress, type SweepRunRow, type SweepSpecRequest, authenticate, cancelBacktest, cancelSweep, client, compileStrategy, downloadKlines, downloadTickers, executeBacktest, executeSweep, getBacktestResult, getPrepareStatus, getStrategy, getSweepResult, listExchanges, listInstruments, listSegmentInstruments, prepareBacktest };