@qtsurfer/api-client 0.18.0 → 0.20.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.
@@ -119,12 +119,34 @@ export type Account = {
119
119
  * Your current subscription tier.
120
120
  */
121
121
  tier: string;
122
+ /**
123
+ * Maximum number of strategy executions (and sweeps) you can have running at the same time
124
+ * through the API. Starting one past this number is answered with `429`, whose message
125
+ * carries the same number. The value already includes any API allowance your plan has.
126
+ *
127
+ */
128
+ maxExecute: number;
129
+ /**
130
+ * Maximum length, in days, of the time range of a backtest on one of your own datasets.
131
+ */
132
+ maxRangeDays: number;
133
+ /**
134
+ * Largest full grid, in parameter combinations, a sweep may run with the `grid` sampler.
135
+ * A grid with more combinations is refused with `400`; the `random` and `lhs` samplers run
136
+ * only their `samples` and are not held to it.
137
+ *
138
+ */
139
+ maxSweepCartesian: number;
140
+ /**
141
+ * Maximum length, in hours, of the time range of one dataset import from an exchange.
142
+ */
143
+ maxImportRangeHours: number;
122
144
  /**
123
145
  * Maximum number of active datasets your tier allows.
124
146
  */
125
147
  maxDatasets: number;
126
148
  /**
127
- * Maximum size, in bytes, of a single dataset version.
149
+ * Maximum size, in bytes, of a single dataset version as stored, that is the `bytes` of its ready version. For a CSV upload that is the converted file, not the file you upload, so estimate from the number of rows. The Datasets guide has the details.
128
150
  */
129
151
  maxDatasetBytes: number;
130
152
  /**
@@ -512,6 +534,11 @@ export type SweepAxis =
512
534
  };
513
535
 
514
536
  export type SweepSpecRequest = {
537
+ /**
538
+ * `grid` runs every combination of the axes and is held to your plan's
539
+ * `maxSweepCartesian` (`GET /account`); `random` and `lhs` run `samples` combinations and are not.
540
+ *
541
+ */
515
542
  sampler?: "grid" | "random" | "lhs";
516
543
  /**
517
544
  * Reproducibility seed. If omitted, the server generates one with Java's
@@ -536,6 +563,9 @@ export type SweepBaseConfig = {
536
563
  buyFeeRate?: number;
537
564
  sellFeeRate?: number;
538
565
  feeLeg?: "RECEIVED" | "QUOTE" | "BASE";
566
+ /**
567
+ * Share of the free balance each entry locks, in percent (0-100]. Omitted, a backtest sizes every entry with everything available.
568
+ */
539
569
  percentAmountToLock?: number;
540
570
  };
541
571
 
@@ -1205,6 +1235,12 @@ export type StrategySummary = {
1205
1235
  *
1206
1236
  */
1207
1237
  requiredSources?: Array<string>;
1238
+ /**
1239
+ * When you deleted this strategy. Only ever present in `GET /strategies?includeDeleted=true`,
1240
+ * and only on strategies you have deleted.
1241
+ *
1242
+ */
1243
+ deletedAt?: string;
1208
1244
  };
1209
1245
 
1210
1246
  /**
@@ -1318,6 +1354,12 @@ export type Dataset = {
1318
1354
  *
1319
1355
  */
1320
1356
  currentVersionId?: string;
1357
+ /**
1358
+ * When you deleted this dataset. Only ever present in `GET /datasets?includeDeleted=true`,
1359
+ * and only on datasets you have deleted.
1360
+ *
1361
+ */
1362
+ deletedAt?: string;
1321
1363
  /**
1322
1364
  * When `currentVersionId` last changed. Absent until it has a value.
1323
1365
  */
@@ -1772,15 +1814,56 @@ export type StartLiveRequest = {
1772
1814
  [key: string]: unknown;
1773
1815
  };
1774
1816
  /**
1775
- * A `public` run appears in `GET /live/public` and its signal channel accepts subscriptions from anyone, not only you.
1817
+ * A `public` run appears in `GET /live/public` and its signal channel accepts subscriptions from anyone, not only you — from the moment it is promoted to `live`. While it is a `sandbox` trial, `public` is only what you asked for, and only you can read it.
1776
1818
  */
1777
1819
  visibility?: "private" | "public";
1778
1820
  /**
1779
- * Request that this run's signals be relayed over its WebSocket channel once it reaches the `live` stage — see the "Live execution" guide. Has no effect while the run is still in the `sandbox` stage, regardless of this value.
1821
+ * Request that this run's signals be relayed over its WebSocket channel, from its first signal — in the `sandbox` stage too, where only you can subscribe to it. See the "Live execution" guide.
1780
1822
  */
1781
1823
  relay?: boolean;
1782
1824
  name?: string;
1783
1825
  description?: string;
1826
+ paper?: LivePaperConfig;
1827
+ };
1828
+
1829
+ /**
1830
+ * Paper trading for this run: the same economics as a backtest's `baseConfig` (same fields,
1831
+ * defaults and limits), plus `output`. An empty object takes every default. Each quote
1832
+ * currency the run trades gets its own simulated account, opened with `initialFunding` in
1833
+ * that currency; accounts are never added together. As returned on a run, the block is
1834
+ * normalised: `feeRate` is resolved into `buyFeeRate`/`sellFeeRate` and defaults are filled
1835
+ * in.
1836
+ *
1837
+ */
1838
+ export type LivePaperConfig = {
1839
+ /**
1840
+ * Starting capital of each account, in that account's own quote currency.
1841
+ */
1842
+ initialFunding?: number;
1843
+ /**
1844
+ * Fee rate for both sides (0.001 = 0.1%). Accepted on start; returned resolved into the two fields below.
1845
+ */
1846
+ feeRate?: number;
1847
+ /**
1848
+ * Buy-side fee rate; overrides `feeRate`.
1849
+ */
1850
+ buyFeeRate?: number;
1851
+ /**
1852
+ * Sell-side fee rate; overrides `feeRate`.
1853
+ */
1854
+ sellFeeRate?: number;
1855
+ /**
1856
+ * Which asset fees are charged in. Case-insensitive on start.
1857
+ */
1858
+ feeLeg?: "RECEIVED" | "QUOTE" | "BASE";
1859
+ /**
1860
+ * Share of the account's free balance each entry locks, in percent. Omitted, the strategy's own setting applies, and without one 10%.
1861
+ */
1862
+ percentAmountToLock?: number;
1863
+ /**
1864
+ * `separate` keeps paper output out of the run's signals (read it with `GET /live/{runId}/paper`); `mix` also interleaves it into the run's signals as `type: paper`, right after the signal that caused it.
1865
+ */
1866
+ output?: "separate" | "mix";
1784
1867
  };
1785
1868
 
1786
1869
  export type UpdateLiveRequest = {
@@ -1798,6 +1881,19 @@ export type UpdateLiveParamsRequest = {
1798
1881
  };
1799
1882
  };
1800
1883
 
1884
+ export type SendLiveCommandRequest = {
1885
+ /**
1886
+ * The command's text — non-blank.
1887
+ */
1888
+ command: string;
1889
+ /**
1890
+ * An optional map of your own choosing, alongside command. Absent means none; when given, it must be a JSON object, and `command` and `properties` are the only keys the body may carry. Each entry lands as a top-level entry on the strategy's `CommandRequest` — no key is off limits, since the command's own text is kept separately.
1891
+ */
1892
+ properties?: {
1893
+ [key: string]: unknown;
1894
+ };
1895
+ };
1896
+
1801
1897
  /**
1802
1898
  * A live run's full state, as returned by starting, reading, or stopping it through its strategy.
1803
1899
  */
@@ -1811,11 +1907,11 @@ export type LiveRun = {
1811
1907
  description?: string;
1812
1908
  visibility: "private" | "public";
1813
1909
  /**
1814
- * A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
1910
+ * A new run always starts `SANDBOX`, a 24-hour trial in which it is compared against a second execution and checked for resource use and stability. A run that passes moves to `LIVE` automatically when the 24 hours are up.
1815
1911
  */
1816
1912
  stage: "SANDBOX" | "LIVE";
1817
1913
  /**
1818
- * `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
1914
+ * The run's health right now: `STARTING` (no runner has reported on it yet), `RUNNING`, `LAGGING` (behind the market data, usually while catching up; clears by itself), `HUNG` (stuck inside one strategy call for longer than allowed; clears when it returns), `DEGRADED` (its independent executions produced different signals), `FAILED` (refused, could not start or failed while running; `reason` says why) or `STOPPED`. `LAGGING`, `HUNG` and `DEGRADED` come and go on a running run. The set may grow: read an unknown value as a running run with something to look at. See the Live execution guide.
1819
1915
  */
1820
1916
  state: string;
1821
1917
  /**
@@ -1823,7 +1919,17 @@ export type LiveRun = {
1823
1919
  */
1824
1920
  desired: "RUNNING" | "STOPPED";
1825
1921
  /**
1826
- * Present only when the run stopped because it exceeded its resource allowance.
1922
+ * Why the run stopped or failed, when there is something to say; absent otherwise. It is never a
1923
+ * stack trace or an internal message. Either `resource: ...` (the platform stopped the run for
1924
+ * exceeding its resource allowance; the text says which limit) or one of a fixed set of sentences for
1925
+ * a `FAILED` run: the strategy cannot consume the source type the run was started with, the run's
1926
+ * definition was refused, the run could not start after several attempts, the strategy failed while
1927
+ * processing data, the run lost its data feed, or the generic `The run failed.`. The set may grow:
1928
+ * read an unrecognised sentence as a failure and do not parse it. A `FAILED` run usually stays
1929
+ * `desired: RUNNING` until you stop it, and counts as active (`409` on a new start, and toward your
1930
+ * live-run limit) until then; one that can never run because its strategy cannot consume its source
1931
+ * type is stopped by the platform itself (`desired: STOPPED`), so it holds no place.
1932
+ *
1827
1933
  */
1828
1934
  reason?: string;
1829
1935
  sources: Array<LiveSource>;
@@ -1835,7 +1941,7 @@ export type LiveRun = {
1835
1941
  */
1836
1942
  paramsVersion: number;
1837
1943
  /**
1838
- * Whether this run's signals are being relayed over the WebSocket channel described in the "Live execution" guide, right now. This is the effective value — `false` on a `sandbox` run regardless of what was requested at start; matches the requested value once `stage` reaches `live`.
1944
+ * Whether this run's signals are relayed over the WebSocket channel described in the "Live execution" guide. It is the value requested at start, in either stage.
1839
1945
  */
1840
1946
  relay: boolean;
1841
1947
  /**
@@ -1843,11 +1949,15 @@ export type LiveRun = {
1843
1949
  */
1844
1950
  startedAtMs: number;
1845
1951
  /**
1846
- * The sandbox trial's promotion verdict, once one exists. Shape is not yet stabilized as public API — treat as opaque diagnostics.
1952
+ * The sandbox trial's promotion verdict. Absent for the whole 24-hour trial and present once it ends, so an absent `gate` means the trial has not finished. `passed` is the verdict; the rest is diagnostic detail whose shape is not yet stabilized as public API: treat it as opaque.
1847
1953
  */
1848
1954
  gate?: {
1849
1955
  [key: string]: unknown;
1850
1956
  };
1957
+ /**
1958
+ * The run's paper trading configuration as accepted at start, normalised. Absent when the run has no paper trading.
1959
+ */
1960
+ paper?: LivePaperConfig;
1851
1961
  };
1852
1962
 
1853
1963
  /**
@@ -1876,17 +1986,31 @@ export type LiveRunSummary = {
1876
1986
  description?: string;
1877
1987
  visibility: "private" | "public";
1878
1988
  /**
1879
- * A new run always starts `SANDBOX` — a trial run compared against a second execution for agreement — and moves to `LIVE` once it passes.
1989
+ * A new run always starts `SANDBOX`, a 24-hour trial in which it is compared against a second execution and checked for resource use and stability. A run that passes moves to `LIVE` automatically when the 24 hours are up.
1880
1990
  */
1881
1991
  stage: "SANDBOX" | "LIVE";
1882
1992
  /**
1883
- * `STARTING` until first observed running; otherwise the runner's own reported state (e.g. `RUNNING`).
1993
+ * The run's health right now: `STARTING` (no runner has reported on it yet), `RUNNING`, `LAGGING` (behind the market data, usually while catching up; clears by itself), `HUNG` (stuck inside one strategy call for longer than allowed; clears when it returns), `DEGRADED` (its independent executions produced different signals), `FAILED` (refused, could not start or failed while running; `reason` says why) or `STOPPED`. `LAGGING`, `HUNG` and `DEGRADED` come and go on a running run. The set may grow: read an unknown value as a running run with something to look at. See the Live execution guide.
1884
1994
  */
1885
1995
  state: string;
1886
1996
  /**
1887
1997
  * What you last asked for. `state` can lag this briefly after `DELETE`.
1888
1998
  */
1889
1999
  desired: "RUNNING" | "STOPPED";
2000
+ /**
2001
+ * Why the run stopped or failed, when there is something to say; absent otherwise. It is never a
2002
+ * stack trace or an internal message. Either `resource: ...` (the platform stopped the run for
2003
+ * exceeding its resource allowance; the text says which limit) or one of a fixed set of sentences for
2004
+ * a `FAILED` run: the strategy cannot consume the source type the run was started with, the run's
2005
+ * definition was refused, the run could not start after several attempts, the strategy failed while
2006
+ * processing data, the run lost its data feed, or the generic `The run failed.`. The set may grow:
2007
+ * read an unrecognised sentence as a failure and do not parse it. A `FAILED` run usually stays
2008
+ * `desired: RUNNING` until you stop it, and counts as active (`409` on a new start, and toward your
2009
+ * live-run limit) until then; one that can never run because its strategy cannot consume its source
2010
+ * type is stopped by the platform itself (`desired: STOPPED`), so it holds no place.
2011
+ *
2012
+ */
2013
+ reason?: string;
1890
2014
  sources: Array<LiveSource>;
1891
2015
  /**
1892
2016
  * Epoch milliseconds this run was started.
@@ -1943,6 +2067,112 @@ export type LiveSignalPage = {
1943
2067
  _links?: PublicLiveListLinks;
1944
2068
  };
1945
2069
 
2070
+ export type LivePaper = {
2071
+ runId: string;
2072
+ stage: "SANDBOX" | "LIVE";
2073
+ accounts: Array<LivePaperAccount>;
2074
+ };
2075
+
2076
+ /**
2077
+ * One simulated account — one per quote currency the run trades.
2078
+ */
2079
+ export type LivePaperAccount = {
2080
+ /**
2081
+ * The account's quote currency; every amount below is in it.
2082
+ */
2083
+ currency: string;
2084
+ initialFunding: number;
2085
+ /**
2086
+ * Latest recorded equity — see `equityKind`.
2087
+ */
2088
+ equity: number;
2089
+ /**
2090
+ * Market time of that value. Absent while the account holds its starting capital.
2091
+ */
2092
+ equityAtMs?: number;
2093
+ /**
2094
+ * `equity` at a closed trade, `mark` at a periodic mark-to-market (includes open positions at market price).
2095
+ */
2096
+ equityKind?: "equity" | "mark";
2097
+ /**
2098
+ * Sum of the PnL of the closed trades.
2099
+ */
2100
+ realisedPnl: number;
2101
+ /**
2102
+ * Closed trades.
2103
+ */
2104
+ trades: number;
2105
+ /**
2106
+ * Times open positions were lost because the run was restarted with them open.
2107
+ */
2108
+ gaps: number;
2109
+ openPositions: Array<LivePaperPosition>;
2110
+ kpi?: LivePaperKpi;
2111
+ };
2112
+
2113
+ export type LivePaperPosition = {
2114
+ instrument: string;
2115
+ /**
2116
+ * Amount held, in the base asset.
2117
+ */
2118
+ base: number;
2119
+ /**
2120
+ * What it cost, in the account's currency.
2121
+ */
2122
+ cost: number;
2123
+ };
2124
+
2125
+ /**
2126
+ * The same KPIs a backtest reports, over the trades closed so far. Absent until the first closed trade is recorded.
2127
+ */
2128
+ export type LivePaperKpi = {
2129
+ totalTrades?: number;
2130
+ winCount?: number;
2131
+ lossCount?: number;
2132
+ /**
2133
+ * Ratio (0.5 = half the trades won).
2134
+ */
2135
+ winRate?: number;
2136
+ pnlTotal?: number;
2137
+ /**
2138
+ * Percent of `initialFunding` (0-100 scale).
2139
+ */
2140
+ pnlTotalPercent?: number;
2141
+ sharpeRatio?: number | null;
2142
+ sortinoRatio?: number | null;
2143
+ /**
2144
+ * Ratio (0.15 for 15%).
2145
+ */
2146
+ cagr?: number | null;
2147
+ maxDrawdown?: number;
2148
+ /**
2149
+ * Percent (0-100 scale).
2150
+ */
2151
+ maxDrawdownPercent?: number;
2152
+ };
2153
+
2154
+ export type LivePaperEquityPage = {
2155
+ points: Array<LivePaperEquityPoint>;
2156
+ _links?: {
2157
+ next?: {
2158
+ href?: string;
2159
+ };
2160
+ };
2161
+ };
2162
+
2163
+ export type LivePaperEquityPoint = {
2164
+ currency: string;
2165
+ kind: "equity" | "mark" | "gap";
2166
+ /**
2167
+ * Market time of the point.
2168
+ */
2169
+ eventTsMs: number;
2170
+ /**
2171
+ * Absent on a `gap`.
2172
+ */
2173
+ equity?: number;
2174
+ };
2175
+
1946
2176
  /**
1947
2177
  * One signal, in the same shape the real-time signal channel delivers.
1948
2178
  */
@@ -1964,9 +2194,12 @@ export type LiveSignal = {
1964
2194
  * The parameter set in force when this signal was produced.
1965
2195
  */
1966
2196
  paramsVersion?: number;
1967
- type: "hint" | "info" | "marker" | "command";
1968
2197
  /**
1969
- * `BUY`/`SELL` for a `hint`, the command name for a `command`, absent otherwise.
2198
+ * `paper` items appear only for a run whose `paper.output` is `mix`; they are not relayed over the WebSocket channel.
2199
+ */
2200
+ type: "hint" | "info" | "marker" | "command" | "paper";
2201
+ /**
2202
+ * `BUY`/`SELL` for a `hint`, the command name for a `command`; for `paper`, what the item is: `fill`, `trade`, `equity`, `mark`, `kpi` or `gap`. Absent otherwise.
1970
2203
  */
1971
2204
  kind?: string | null;
1972
2205
  /**
@@ -1977,10 +2210,13 @@ export type LiveSignal = {
1977
2210
  * Time it was published — always at or after `eventTsMs`.
1978
2211
  */
1979
2212
  emittedAtMs: number;
1980
- instrument: LiveSignalInstrument;
2213
+ /**
2214
+ * The instrument the signal is about. `null` only for a `paper` item about a whole account (`equity`, `mark`, `kpi`), whose `data.currency` names the account.
2215
+ */
2216
+ instrument: LiveSignalInstrument | null;
1981
2217
  order?: LiveSignalOrder;
1982
2218
  /**
1983
- * The signal's own free-form payload.
2219
+ * The signal's own free-form payload, what the strategy put there with `signal.set(...)`. Whoever may read the run may read it, so on a `public` run it is public. A signal whose `data` is over 8 KiB (8,192 bytes of its JSON) is not pushed on the WebSocket channel, and `GET /live/{runId}/signals` returns it whole.
1984
2220
  */
1985
2221
  data?: {
1986
2222
  [key: string]: unknown;
@@ -2032,6 +2268,18 @@ export type LiveParamsUpdateResult = {
2032
2268
  effectiveAtMs: number;
2033
2269
  };
2034
2270
 
2271
+ export type LiveCommandResult = {
2272
+ runId: string;
2273
+ /**
2274
+ * This command's own id, generated fresh for this call. A retried request is a second, distinct command — this endpoint takes no idempotency key.
2275
+ */
2276
+ commandId: string;
2277
+ /**
2278
+ * Epoch milliseconds — the market position every execution applies this command at.
2279
+ */
2280
+ effectiveAtMs: number;
2281
+ };
2282
+
2035
2283
  export type AuthenticateData = {
2036
2284
  body?: never;
2037
2285
  path?: never;
@@ -2313,7 +2561,14 @@ export type DownloadKlinesResponse =
2313
2561
  export type ListStrategiesData = {
2314
2562
  body?: never;
2315
2563
  path?: never;
2316
- query?: never;
2564
+ query?: {
2565
+ /**
2566
+ * `true` also lists the strategies you have deleted, each with its `deletedAt`. Any other
2567
+ * value, or leaving it out, lists only the ones you have not deleted.
2568
+ *
2569
+ */
2570
+ includeDeleted?: boolean;
2571
+ };
2317
2572
  url: "/strategies";
2318
2573
  };
2319
2574
 
@@ -2348,6 +2603,10 @@ export type CompileStrategyErrors = {
2348
2603
  *
2349
2604
  */
2350
2605
  400: ResponseError;
2606
+ /**
2607
+ * The source is larger than 32 KiB (32768 bytes). Every endpoint that reads a request body caps it, and the message names the cap; see the Strategy guide.
2608
+ */
2609
+ 413: ResponseError;
2351
2610
  /**
2352
2611
  * Too many compilations in flight. Retry later.
2353
2612
  */
@@ -2647,7 +2906,9 @@ export type ExecuteSweepData = {
2647
2906
  export type ExecuteSweepErrors = {
2648
2907
  /**
2649
2908
  * Invalid sweep specification, a `type` that cannot be swept yet (`funding`), or the
2650
- * expanded grid exceeds the server limit.
2909
+ * expanded grid exceeds the server limit. A full `grid` with more combinations than your
2910
+ * plan allows (`maxSweepCartesian` in `GET /account`) is refused with a message that asks
2911
+ * for the `random` or `lhs` sampler.
2651
2912
  *
2652
2913
  */
2653
2914
  400: ResponseError;
@@ -3042,7 +3303,14 @@ export type GetBacktestResultResponse =
3042
3303
  export type ListDatasetsData = {
3043
3304
  body?: never;
3044
3305
  path?: never;
3045
- query?: never;
3306
+ query?: {
3307
+ /**
3308
+ * `true` also lists the datasets you have deleted, each with its `deletedAt`. Any other
3309
+ * value, or leaving it out, lists only the ones you have not deleted.
3310
+ *
3311
+ */
3312
+ includeDeleted?: boolean;
3313
+ };
3046
3314
  url: "/datasets";
3047
3315
  };
3048
3316
 
@@ -3228,7 +3496,7 @@ export type FinalizeDatasetUploadErrors = {
3228
3496
  */
3229
3497
  409: ResponseError;
3230
3498
  /**
3231
- * The uploaded file exceeds your tier's size limit for a dataset.
3499
+ * The uploaded file is many times your tier's size limit for a dataset. The limit itself applies to the stored size, which is known only after conversion, so an upload that passes here can still end `failed` when ingest finishes.
3232
3500
  */
3233
3501
  413: ResponseError;
3234
3502
  /**
@@ -3451,7 +3719,7 @@ export type StartLiveData = {
3451
3719
 
3452
3720
  export type StartLiveErrors = {
3453
3721
  /**
3454
- * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), or an invalid `visibility`.
3722
+ * Malformed `sources` (not exactly one entry, missing field, unsupported `type`), a `type` the strategy cannot consume (a ticker strategy with a `kline` source, or the reverse; the message names both), an invalid `visibility`, an invalid `paper` block (an unknown field, a wrong type or an out-of-range value), or no `paper` block for a strategy that listens to its own execution events.
3455
3723
  */
3456
3724
  400: ResponseError;
3457
3725
  /**
@@ -3605,7 +3873,7 @@ export type UpdateLiveParamsErrors = {
3605
3873
  */
3606
3874
  404: ResponseError;
3607
3875
  /**
3608
- * This run's compilation has no declared properties on record — recompile the strategy to enable runtime parameter updates.
3876
+ * This run's compiled strategy has no record of the parameters it declares. Register the strategy again with `POST /strategy` and start a new run, since a run keeps the compiled version it started with.
3609
3877
  */
3610
3878
  409: ResponseError;
3611
3879
  };
@@ -3623,6 +3891,55 @@ export type UpdateLiveParamsResponses = {
3623
3891
  export type UpdateLiveParamsResponse =
3624
3892
  UpdateLiveParamsResponses[keyof UpdateLiveParamsResponses];
3625
3893
 
3894
+ export type SendLiveCommandData = {
3895
+ body: SendLiveCommandRequest;
3896
+ path: {
3897
+ runId: string;
3898
+ };
3899
+ query?: never;
3900
+ url: "/live/{runId}/commands";
3901
+ };
3902
+
3903
+ export type SendLiveCommandErrors = {
3904
+ /**
3905
+ * `command` missing, not a string, blank; `properties` given but not an object; or the body carries any key other than `command` and `properties`.
3906
+ */
3907
+ 400: ResponseError;
3908
+ /**
3909
+ * No such run, or you do not own it.
3910
+ */
3911
+ 404: ResponseError;
3912
+ /**
3913
+ * One of three reasons, each its own message: the run is not running, so there is nothing to tell;
3914
+ * this run's compiled strategy has no record of whether it handles commands — register the strategy
3915
+ * again with `POST /strategy` and start a new run, since a run keeps the compiled version it started
3916
+ * with; or the strategy does not implement `CommandRequestHandler` at all.
3917
+ *
3918
+ */
3919
+ 409: ResponseError;
3920
+ /**
3921
+ * The request body is larger than 2 KiB (2048 bytes). Every endpoint that reads a request body caps it, and the message names the cap.
3922
+ */
3923
+ 413: ResponseError;
3924
+ /**
3925
+ * The command could not be delivered right now, and it was not sent — unlike a parameter update, a command has no fallback path. Try again.
3926
+ */
3927
+ 503: ResponseError;
3928
+ };
3929
+
3930
+ export type SendLiveCommandError =
3931
+ SendLiveCommandErrors[keyof SendLiveCommandErrors];
3932
+
3933
+ export type SendLiveCommandResponses = {
3934
+ /**
3935
+ * Accepted — on its way to every execution behind the run.
3936
+ */
3937
+ 202: LiveCommandResult;
3938
+ };
3939
+
3940
+ export type SendLiveCommandResponse =
3941
+ SendLiveCommandResponses[keyof SendLiveCommandResponses];
3942
+
3626
3943
  export type GetLiveRunSignalsData = {
3627
3944
  body?: never;
3628
3945
  path: {
@@ -3645,6 +3962,10 @@ export type GetLiveRunSignalsData = {
3645
3962
  *
3646
3963
  */
3647
3964
  instrument?: string;
3965
+ /**
3966
+ * Narrow to one or more signal types, comma-separated (`hint`, `info`, `marker`, `command`, `paper`). Combines with `instrument`.
3967
+ */
3968
+ type?: string;
3648
3969
  /**
3649
3970
  * Continue from a previous page's `_links.next`. Takes precedence over `sinceMs`.
3650
3971
  */
@@ -3659,7 +3980,7 @@ export type GetLiveRunSignalsData = {
3659
3980
 
3660
3981
  export type GetLiveRunSignalsErrors = {
3661
3982
  /**
3662
- * `instrument`, `sinceMs`, `limit` or `cursor` is malformed.
3983
+ * `instrument`, `type`, `sinceMs`, `limit` or `cursor` is malformed.
3663
3984
  */
3664
3985
  400: ResponseError;
3665
3986
  /**
@@ -3685,6 +4006,82 @@ export type GetLiveRunSignalsResponses = {
3685
4006
  export type GetLiveRunSignalsResponse =
3686
4007
  GetLiveRunSignalsResponses[keyof GetLiveRunSignalsResponses];
3687
4008
 
4009
+ export type GetLiveRunPaperData = {
4010
+ body?: never;
4011
+ path: {
4012
+ runId: string;
4013
+ };
4014
+ query?: never;
4015
+ url: "/live/{runId}/paper";
4016
+ };
4017
+
4018
+ export type GetLiveRunPaperErrors = {
4019
+ /**
4020
+ * No such run, not one you may read, or a run without paper trading.
4021
+ */
4022
+ 404: ResponseError;
4023
+ };
4024
+
4025
+ export type GetLiveRunPaperError =
4026
+ GetLiveRunPaperErrors[keyof GetLiveRunPaperErrors];
4027
+
4028
+ export type GetLiveRunPaperResponses = {
4029
+ /**
4030
+ * The run's paper accounts
4031
+ */
4032
+ 200: LivePaper;
4033
+ };
4034
+
4035
+ export type GetLiveRunPaperResponse =
4036
+ GetLiveRunPaperResponses[keyof GetLiveRunPaperResponses];
4037
+
4038
+ export type GetLiveRunPaperEquityData = {
4039
+ body?: never;
4040
+ path: {
4041
+ runId: string;
4042
+ };
4043
+ query?: {
4044
+ /**
4045
+ * One account's quote currency, e.g. `USDT`.
4046
+ */
4047
+ currency?: string;
4048
+ /**
4049
+ * Start from this market time (epoch ms). Ignored when `cursor` is given.
4050
+ */
4051
+ sinceMs?: number;
4052
+ /**
4053
+ * Continue from a previous page's `_links.next`.
4054
+ */
4055
+ cursor?: string;
4056
+ limit?: number;
4057
+ };
4058
+ url: "/live/{runId}/paper/equity";
4059
+ };
4060
+
4061
+ export type GetLiveRunPaperEquityErrors = {
4062
+ /**
4063
+ * `sinceMs`, `limit` or `cursor` is malformed.
4064
+ */
4065
+ 400: ResponseError;
4066
+ /**
4067
+ * No such run, not one you may read, or a run without paper trading.
4068
+ */
4069
+ 404: ResponseError;
4070
+ };
4071
+
4072
+ export type GetLiveRunPaperEquityError =
4073
+ GetLiveRunPaperEquityErrors[keyof GetLiveRunPaperEquityErrors];
4074
+
4075
+ export type GetLiveRunPaperEquityResponses = {
4076
+ /**
4077
+ * One page of the curve
4078
+ */
4079
+ 200: LivePaperEquityPage;
4080
+ };
4081
+
4082
+ export type GetLiveRunPaperEquityResponse =
4083
+ GetLiveRunPaperEquityResponses[keyof GetLiveRunPaperEquityResponses];
4084
+
3688
4085
  export type MintLiveConnectionTokenData = {
3689
4086
  body?: never;
3690
4087
  path?: never;