@pear-protocol/core-sdk 1.19.3 → 1.20.1

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.
@@ -187,7 +187,7 @@ declare class Core {
187
187
  get: (query?: HttpTypes.QuoteFeeParamsInput, headers?: ClientHeaders) => Promise<{
188
188
  baseBps: string;
189
189
  discounts: {
190
- scope: "connector" | "all" | "user" | "client_id";
190
+ scope: "user" | "connector" | "all" | "client_id";
191
191
  rate: string;
192
192
  }[];
193
193
  finalBps: string;
@@ -218,6 +218,91 @@ declare class Core {
218
218
  }>;
219
219
  revoke: (id: string, headers?: ClientHeaders) => Promise<void>;
220
220
  };
221
+ baskets: {
222
+ saved: {
223
+ list: (headers?: ClientHeaders) => Promise<{
224
+ baskets: {
225
+ id: string;
226
+ name: string;
227
+ legs: [{
228
+ symbol: string;
229
+ side: "BUY" | "SELL";
230
+ weight: number;
231
+ id?: string | undefined;
232
+ }, ...{
233
+ symbol: string;
234
+ side: "BUY" | "SELL";
235
+ weight: number;
236
+ id?: string | undefined;
237
+ }[]];
238
+ createdAt: string;
239
+ updatedAt: string;
240
+ }[];
241
+ }>;
242
+ create: (body: HttpTypes.CreateSavedBasketPayload, headers?: ClientHeaders) => Promise<{
243
+ basket: {
244
+ id: string;
245
+ name: string;
246
+ legs: [{
247
+ symbol: string;
248
+ side: "BUY" | "SELL";
249
+ weight: number;
250
+ id?: string | undefined;
251
+ }, ...{
252
+ symbol: string;
253
+ side: "BUY" | "SELL";
254
+ weight: number;
255
+ id?: string | undefined;
256
+ }[]];
257
+ createdAt: string;
258
+ updatedAt: string;
259
+ };
260
+ }>;
261
+ update: (id: string, body: HttpTypes.UpdateSavedBasketPayload, headers?: ClientHeaders) => Promise<{
262
+ basket: {
263
+ id: string;
264
+ name: string;
265
+ legs: [{
266
+ symbol: string;
267
+ side: "BUY" | "SELL";
268
+ weight: number;
269
+ id?: string | undefined;
270
+ }, ...{
271
+ symbol: string;
272
+ side: "BUY" | "SELL";
273
+ weight: number;
274
+ id?: string | undefined;
275
+ }[]];
276
+ createdAt: string;
277
+ updatedAt: string;
278
+ };
279
+ }>;
280
+ delete: (id: string, headers?: ClientHeaders) => Promise<void>;
281
+ };
282
+ recommended: {
283
+ /** Publicly list every admin-curated recommended basket; no auth required. */
284
+ list: (headers?: ClientHeaders) => Promise<{
285
+ baskets: {
286
+ id: string;
287
+ name: string;
288
+ legs: [{
289
+ id: string;
290
+ symbol: string;
291
+ side: "BUY" | "SELL";
292
+ weight: number;
293
+ }, ...{
294
+ id: string;
295
+ symbol: string;
296
+ side: "BUY" | "SELL";
297
+ weight: number;
298
+ }[]];
299
+ createdAt: string;
300
+ updatedAt: string;
301
+ description?: string | undefined;
302
+ }[];
303
+ }>;
304
+ };
305
+ };
221
306
  executions: {
222
307
  list: (query: HttpTypes.ExecutionListParamsInput, headers?: ClientHeaders) => Promise<{
223
308
  limit: number;
@@ -235,12 +320,14 @@ declare class Core {
235
320
  mode: "QUANTITY" | "USD";
236
321
  amount: string;
237
322
  reduceOnly: boolean;
323
+ id?: string | undefined;
238
324
  }, ...{
239
325
  symbol: string;
240
326
  side: "BUY" | "SELL";
241
327
  mode: "QUANTITY" | "USD";
242
328
  amount: string;
243
329
  reduceOnly: boolean;
330
+ id?: string | undefined;
244
331
  }[]];
245
332
  error?: string | undefined;
246
333
  orders?: {
@@ -278,12 +365,14 @@ declare class Core {
278
365
  mode: "QUANTITY" | "USD";
279
366
  amount: string;
280
367
  reduceOnly: boolean;
368
+ id?: string | undefined;
281
369
  }, ...{
282
370
  symbol: string;
283
371
  side: "BUY" | "SELL";
284
372
  mode: "QUANTITY" | "USD";
285
373
  amount: string;
286
374
  reduceOnly: boolean;
375
+ id?: string | undefined;
287
376
  }[]];
288
377
  error?: string | undefined;
289
378
  orders?: {
@@ -381,12 +470,14 @@ declare class Core {
381
470
  mode: "QUANTITY" | "USD";
382
471
  amount: string;
383
472
  reduceOnly: boolean;
473
+ id?: string | undefined;
384
474
  }, ...{
385
475
  symbol: string;
386
476
  side: "BUY" | "SELL";
387
477
  mode: "QUANTITY" | "USD";
388
478
  amount: string;
389
479
  reduceOnly: boolean;
480
+ id?: string | undefined;
390
481
  }[]];
391
482
  error?: string | undefined;
392
483
  orders?: {
@@ -424,12 +515,14 @@ declare class Core {
424
515
  mode: "QUANTITY" | "USD";
425
516
  amount: string;
426
517
  reduceOnly: boolean;
518
+ id?: string | undefined;
427
519
  }, ...{
428
520
  symbol: string;
429
521
  side: "BUY" | "SELL";
430
522
  mode: "QUANTITY" | "USD";
431
523
  amount: string;
432
524
  reduceOnly: boolean;
525
+ id?: string | undefined;
433
526
  }[]];
434
527
  error?: string | undefined;
435
528
  orders?: {
@@ -669,11 +762,13 @@ declare class Core {
669
762
  side: "BUY" | "SELL";
670
763
  mode: "QUANTITY" | "USD";
671
764
  amount: string;
765
+ id?: string | undefined;
672
766
  }, ...{
673
767
  symbol: string;
674
768
  side: "BUY" | "SELL";
675
769
  mode: "QUANTITY" | "USD";
676
770
  amount: string;
771
+ id?: string | undefined;
677
772
  }[]];
678
773
  attachedTriggers: {
679
774
  kind: "STATIC" | "TRAILING";
@@ -807,12 +902,14 @@ declare class Core {
807
902
  mode: "QUANTITY" | "USD";
808
903
  amount: string;
809
904
  reduceOnly: boolean;
905
+ id?: string | undefined;
810
906
  }, ...{
811
907
  symbol: string;
812
908
  side: "BUY" | "SELL";
813
909
  mode: "QUANTITY" | "USD";
814
910
  amount: string;
815
911
  reduceOnly: boolean;
912
+ id?: string | undefined;
816
913
  }[]];
817
914
  };
818
915
  ladderId?: string | undefined;
@@ -1022,184 +1119,6 @@ declare class Core {
1022
1119
  currentStopValue?: number | undefined;
1023
1120
  stopBreachedAt?: number | undefined;
1024
1121
  } | undefined;
1025
- })[];
1026
- createdAt: string;
1027
- updatedAt: string;
1028
- attachTriggers?: ({
1029
- intent: "CLOSE";
1030
- type: "MARKET";
1031
- bracketType: "STOP_LOSS" | "TAKE_PROFIT";
1032
- condition: {
1033
- type: "notional";
1034
- data: {
1035
- priceSource: "mark" | "mid";
1036
- threshold: number;
1037
- };
1038
- } | {
1039
- type: "upnl";
1040
- data: {
1041
- priceSource: "mark" | "mid";
1042
- threshold: number;
1043
- };
1044
- } | {
1045
- type: "upnl_bps";
1046
- data: {
1047
- priceSource: "mark" | "mid";
1048
- threshold: number;
1049
- };
1050
- };
1051
- } | {
1052
- intent: "CLOSE";
1053
- type: "MARKET";
1054
- condition: {
1055
- type: "notional_trailing";
1056
- data: {
1057
- priceSource: "mark" | "mid";
1058
- };
1059
- } | {
1060
- type: "upnl_trailing";
1061
- data: {
1062
- priceSource: "mark" | "mid";
1063
- };
1064
- } | {
1065
- type: "upnl_bps_trailing";
1066
- data: {
1067
- priceSource: "mark" | "mid";
1068
- };
1069
- };
1070
- trailing: {
1071
- mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
1072
- deltaValue: number;
1073
- activationValue?: number | undefined;
1074
- };
1075
- })[] | undefined;
1076
- }[];
1077
- nextCursor?: string | undefined;
1078
- }>;
1079
- create: (body: HttpTypes.CreateLadder, headers?: ClientHeaders) => Promise<{
1080
- ladder: {
1081
- id: string;
1082
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1083
- positionKey: string;
1084
- config: {
1085
- thresholdStart: number;
1086
- thresholdEnd: number;
1087
- levels: number;
1088
- weighting: "EQUAL";
1089
- };
1090
- status: "CANCELLED" | "ACTIVE" | "COMPLETED";
1091
- triggers: ({
1092
- id: string;
1093
- tradeAccountId: string;
1094
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1095
- status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1096
- bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
1097
- createdAt: string;
1098
- updatedAt: string;
1099
- intent: "OPEN";
1100
- type: "MARKET";
1101
- condition: {
1102
- type: "ratio";
1103
- data: {
1104
- priceSource: "mark" | "mid";
1105
- symbol_a: string;
1106
- symbol_b: string;
1107
- track: "PEAK" | "TROUGH";
1108
- threshold: number;
1109
- };
1110
- } | {
1111
- type: "price";
1112
- data: {
1113
- priceSource: "mark" | "mid";
1114
- symbol: string;
1115
- track: "PEAK" | "TROUGH";
1116
- threshold: number;
1117
- };
1118
- } | {
1119
- type: "weighted_ratio";
1120
- data: {
1121
- priceSource: "mark" | "mid";
1122
- basket: {
1123
- symbol: string;
1124
- side: "BUY" | "SELL";
1125
- weight: number;
1126
- }[];
1127
- track: "PEAK" | "TROUGH";
1128
- threshold: number;
1129
- };
1130
- } | {
1131
- type: "funding_rate";
1132
- data: {
1133
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1134
- symbol: string;
1135
- track: "PEAK" | "TROUGH";
1136
- threshold: number;
1137
- };
1138
- } | {
1139
- type: "prediction_market";
1140
- data: {
1141
- source: "kalshi" | "polymarket";
1142
- marketKey: string;
1143
- track: "PEAK" | "TROUGH";
1144
- threshold: number;
1145
- };
1146
- } | {
1147
- type: "btc_dominance";
1148
- data: {
1149
- source: "coingecko";
1150
- track: "PEAK" | "TROUGH";
1151
- threshold: number;
1152
- };
1153
- };
1154
- context: {
1155
- type: "MARKET";
1156
- legs: [{
1157
- symbol: string;
1158
- side: "BUY" | "SELL";
1159
- mode: "QUANTITY" | "USD";
1160
- amount: string;
1161
- }, ...{
1162
- symbol: string;
1163
- side: "BUY" | "SELL";
1164
- mode: "QUANTITY" | "USD";
1165
- amount: string;
1166
- }[]];
1167
- attachedTriggers: {
1168
- kind: "STATIC" | "TRAILING";
1169
- bracketType: "STOP_LOSS" | "TAKE_PROFIT";
1170
- }[];
1171
- };
1172
- ladderId?: string | undefined;
1173
- ladderIndex?: number | undefined;
1174
- parentTriggerId?: string | undefined;
1175
- triggeredAt?: string | undefined;
1176
- cancelledAt?: string | undefined;
1177
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
1178
- fills?: {
1179
- id: string;
1180
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
1181
- tradeAccountId: string;
1182
- symbol: string;
1183
- positionId: string;
1184
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1185
- side: "BUY" | "SELL";
1186
- reduceOnly: boolean;
1187
- isExternal: boolean;
1188
- synthetic: boolean;
1189
- quantity: string;
1190
- price: string;
1191
- usd: string;
1192
- timestamp: string;
1193
- cloid?: string | undefined;
1194
- exchangeFillId?: string | undefined;
1195
- tradeFee?: string | undefined;
1196
- pearFee?: string | undefined;
1197
- original?: {
1198
- exchangeFillId: string;
1199
- quantity: string;
1200
- } | undefined;
1201
- }[] | undefined;
1202
- semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
1203
1122
  } | {
1204
1123
  id: string;
1205
1124
  tradeAccountId: string;
@@ -1209,7 +1128,7 @@ declare class Core {
1209
1128
  createdAt: string;
1210
1129
  updatedAt: string;
1211
1130
  intent: "ADJUST";
1212
- type: "MARKET";
1131
+ type: "TWAP";
1213
1132
  condition: {
1214
1133
  type: "ratio";
1215
1134
  data: {
@@ -1285,7 +1204,13 @@ declare class Core {
1285
1204
  };
1286
1205
  };
1287
1206
  context: {
1288
- type: "MARKET";
1207
+ type: "TWAP";
1208
+ durationSec: number;
1209
+ sliceIntervalSec: number;
1210
+ randomization: {
1211
+ timingJitterBps: number;
1212
+ sizeJitterBps: number;
1213
+ };
1289
1214
  position: {
1290
1215
  id: string;
1291
1216
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -1293,16 +1218,15 @@ declare class Core {
1293
1218
  legs: [{
1294
1219
  symbol: string;
1295
1220
  side: "BUY" | "SELL";
1296
- mode: "QUANTITY" | "USD";
1297
- amount: string;
1298
- reduceOnly: boolean;
1221
+ weight: number;
1222
+ id?: string | undefined;
1299
1223
  }, ...{
1300
1224
  symbol: string;
1301
1225
  side: "BUY" | "SELL";
1302
- mode: "QUANTITY" | "USD";
1303
- amount: string;
1304
- reduceOnly: boolean;
1226
+ weight: number;
1227
+ id?: string | undefined;
1305
1228
  }[]];
1229
+ targetNotional: string;
1306
1230
  };
1307
1231
  ladderId?: string | undefined;
1308
1232
  ladderIndex?: number | undefined;
@@ -1335,6 +1259,7 @@ declare class Core {
1335
1259
  } | undefined;
1336
1260
  }[] | undefined;
1337
1261
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
1262
+ scheduleId?: string | undefined;
1338
1263
  trailing?: {
1339
1264
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
1340
1265
  deltaValue: number;
@@ -1352,7 +1277,7 @@ declare class Core {
1352
1277
  createdAt: string;
1353
1278
  updatedAt: string;
1354
1279
  intent: "CLOSE";
1355
- type: "MARKET";
1280
+ type: "TWAP";
1356
1281
  condition: {
1357
1282
  type: "ratio";
1358
1283
  data: {
@@ -1466,7 +1391,13 @@ declare class Core {
1466
1391
  };
1467
1392
  };
1468
1393
  context: {
1469
- type: "MARKET";
1394
+ type: "TWAP";
1395
+ durationSec: number;
1396
+ sliceIntervalSec: number;
1397
+ randomization: {
1398
+ timingJitterBps: number;
1399
+ sizeJitterBps: number;
1400
+ };
1470
1401
  position: {
1471
1402
  id: string;
1472
1403
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -1503,6 +1434,7 @@ declare class Core {
1503
1434
  } | undefined;
1504
1435
  }[] | undefined;
1505
1436
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
1437
+ scheduleId?: string | undefined;
1506
1438
  trailing?: {
1507
1439
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
1508
1440
  deltaValue: number;
@@ -1562,9 +1494,10 @@ declare class Core {
1562
1494
  activationValue?: number | undefined;
1563
1495
  };
1564
1496
  })[] | undefined;
1565
- };
1497
+ }[];
1498
+ nextCursor?: string | undefined;
1566
1499
  }>;
1567
- get: (ladderId: string, headers?: ClientHeaders) => Promise<{
1500
+ create: (body: HttpTypes.CreateLadder, headers?: ClientHeaders) => Promise<{
1568
1501
  ladder: {
1569
1502
  id: string;
1570
1503
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -1646,11 +1579,13 @@ declare class Core {
1646
1579
  side: "BUY" | "SELL";
1647
1580
  mode: "QUANTITY" | "USD";
1648
1581
  amount: string;
1582
+ id?: string | undefined;
1649
1583
  }, ...{
1650
1584
  symbol: string;
1651
1585
  side: "BUY" | "SELL";
1652
1586
  mode: "QUANTITY" | "USD";
1653
1587
  amount: string;
1588
+ id?: string | undefined;
1654
1589
  }[]];
1655
1590
  attachedTriggers: {
1656
1591
  kind: "STATIC" | "TRAILING";
@@ -1784,12 +1719,14 @@ declare class Core {
1784
1719
  mode: "QUANTITY" | "USD";
1785
1720
  amount: string;
1786
1721
  reduceOnly: boolean;
1722
+ id?: string | undefined;
1787
1723
  }, ...{
1788
1724
  symbol: string;
1789
1725
  side: "BUY" | "SELL";
1790
1726
  mode: "QUANTITY" | "USD";
1791
1727
  amount: string;
1792
1728
  reduceOnly: boolean;
1729
+ id?: string | undefined;
1793
1730
  }[]];
1794
1731
  };
1795
1732
  ladderId?: string | undefined;
@@ -1999,36 +1936,239 @@ declare class Core {
1999
1936
  currentStopValue?: number | undefined;
2000
1937
  stopBreachedAt?: number | undefined;
2001
1938
  } | undefined;
2002
- })[];
2003
- createdAt: string;
2004
- updatedAt: string;
2005
- attachTriggers?: ({
2006
- intent: "CLOSE";
2007
- type: "MARKET";
2008
- bracketType: "STOP_LOSS" | "TAKE_PROFIT";
1939
+ } | {
1940
+ id: string;
1941
+ tradeAccountId: string;
1942
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
1943
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
1944
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
1945
+ createdAt: string;
1946
+ updatedAt: string;
1947
+ intent: "ADJUST";
1948
+ type: "TWAP";
2009
1949
  condition: {
1950
+ type: "ratio";
1951
+ data: {
1952
+ priceSource: "mark" | "mid";
1953
+ symbol_a: string;
1954
+ symbol_b: string;
1955
+ track: "PEAK" | "TROUGH";
1956
+ threshold: number;
1957
+ };
1958
+ } | {
1959
+ type: "price";
1960
+ data: {
1961
+ priceSource: "mark" | "mid";
1962
+ symbol: string;
1963
+ track: "PEAK" | "TROUGH";
1964
+ threshold: number;
1965
+ };
1966
+ } | {
1967
+ type: "weighted_ratio";
1968
+ data: {
1969
+ priceSource: "mark" | "mid";
1970
+ basket: {
1971
+ symbol: string;
1972
+ side: "BUY" | "SELL";
1973
+ weight: number;
1974
+ }[];
1975
+ track: "PEAK" | "TROUGH";
1976
+ threshold: number;
1977
+ };
1978
+ } | {
2010
1979
  type: "notional";
2011
1980
  data: {
2012
1981
  priceSource: "mark" | "mid";
1982
+ track: "PEAK" | "TROUGH";
2013
1983
  threshold: number;
2014
1984
  };
2015
1985
  } | {
2016
1986
  type: "upnl";
2017
1987
  data: {
2018
1988
  priceSource: "mark" | "mid";
1989
+ track: "PEAK" | "TROUGH";
2019
1990
  threshold: number;
2020
1991
  };
2021
1992
  } | {
2022
1993
  type: "upnl_bps";
2023
1994
  data: {
2024
1995
  priceSource: "mark" | "mid";
1996
+ track: "PEAK" | "TROUGH";
1997
+ threshold: number;
1998
+ };
1999
+ } | {
2000
+ type: "funding_rate";
2001
+ data: {
2002
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2003
+ symbol: string;
2004
+ track: "PEAK" | "TROUGH";
2005
+ threshold: number;
2006
+ };
2007
+ } | {
2008
+ type: "prediction_market";
2009
+ data: {
2010
+ source: "kalshi" | "polymarket";
2011
+ marketKey: string;
2012
+ track: "PEAK" | "TROUGH";
2013
+ threshold: number;
2014
+ };
2015
+ } | {
2016
+ type: "btc_dominance";
2017
+ data: {
2018
+ source: "coingecko";
2019
+ track: "PEAK" | "TROUGH";
2025
2020
  threshold: number;
2026
2021
  };
2027
2022
  };
2023
+ context: {
2024
+ type: "TWAP";
2025
+ durationSec: number;
2026
+ sliceIntervalSec: number;
2027
+ randomization: {
2028
+ timingJitterBps: number;
2029
+ sizeJitterBps: number;
2030
+ };
2031
+ position: {
2032
+ id: string;
2033
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
2034
+ };
2035
+ legs: [{
2036
+ symbol: string;
2037
+ side: "BUY" | "SELL";
2038
+ weight: number;
2039
+ id?: string | undefined;
2040
+ }, ...{
2041
+ symbol: string;
2042
+ side: "BUY" | "SELL";
2043
+ weight: number;
2044
+ id?: string | undefined;
2045
+ }[]];
2046
+ targetNotional: string;
2047
+ };
2048
+ ladderId?: string | undefined;
2049
+ ladderIndex?: number | undefined;
2050
+ parentTriggerId?: string | undefined;
2051
+ triggeredAt?: string | undefined;
2052
+ cancelledAt?: string | undefined;
2053
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2054
+ fills?: {
2055
+ id: string;
2056
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2057
+ tradeAccountId: string;
2058
+ symbol: string;
2059
+ positionId: string;
2060
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2061
+ side: "BUY" | "SELL";
2062
+ reduceOnly: boolean;
2063
+ isExternal: boolean;
2064
+ synthetic: boolean;
2065
+ quantity: string;
2066
+ price: string;
2067
+ usd: string;
2068
+ timestamp: string;
2069
+ cloid?: string | undefined;
2070
+ exchangeFillId?: string | undefined;
2071
+ tradeFee?: string | undefined;
2072
+ pearFee?: string | undefined;
2073
+ original?: {
2074
+ exchangeFillId: string;
2075
+ quantity: string;
2076
+ } | undefined;
2077
+ }[] | undefined;
2078
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2079
+ scheduleId?: string | undefined;
2080
+ trailing?: {
2081
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2082
+ deltaValue: number;
2083
+ activationValue?: number | undefined;
2084
+ bestMetricSeen?: number | undefined;
2085
+ currentStopValue?: number | undefined;
2086
+ stopBreachedAt?: number | undefined;
2087
+ } | undefined;
2028
2088
  } | {
2089
+ id: string;
2090
+ tradeAccountId: string;
2091
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2092
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2093
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2094
+ createdAt: string;
2095
+ updatedAt: string;
2029
2096
  intent: "CLOSE";
2030
- type: "MARKET";
2097
+ type: "TWAP";
2031
2098
  condition: {
2099
+ type: "ratio";
2100
+ data: {
2101
+ priceSource: "mark" | "mid";
2102
+ symbol_a: string;
2103
+ symbol_b: string;
2104
+ track: "PEAK" | "TROUGH";
2105
+ threshold: number;
2106
+ };
2107
+ } | {
2108
+ type: "price";
2109
+ data: {
2110
+ priceSource: "mark" | "mid";
2111
+ symbol: string;
2112
+ track: "PEAK" | "TROUGH";
2113
+ threshold: number;
2114
+ };
2115
+ } | {
2116
+ type: "weighted_ratio";
2117
+ data: {
2118
+ priceSource: "mark" | "mid";
2119
+ basket: {
2120
+ symbol: string;
2121
+ side: "BUY" | "SELL";
2122
+ weight: number;
2123
+ }[];
2124
+ track: "PEAK" | "TROUGH";
2125
+ threshold: number;
2126
+ };
2127
+ } | {
2128
+ type: "notional";
2129
+ data: {
2130
+ priceSource: "mark" | "mid";
2131
+ track: "PEAK" | "TROUGH";
2132
+ threshold: number;
2133
+ };
2134
+ } | {
2135
+ type: "upnl";
2136
+ data: {
2137
+ priceSource: "mark" | "mid";
2138
+ track: "PEAK" | "TROUGH";
2139
+ threshold: number;
2140
+ };
2141
+ } | {
2142
+ type: "upnl_bps";
2143
+ data: {
2144
+ priceSource: "mark" | "mid";
2145
+ track: "PEAK" | "TROUGH";
2146
+ threshold: number;
2147
+ };
2148
+ } | {
2149
+ type: "ratio_trailing";
2150
+ data: {
2151
+ priceSource: "mark" | "mid";
2152
+ symbol_a: string;
2153
+ symbol_b: string;
2154
+ };
2155
+ } | {
2156
+ type: "price_trailing";
2157
+ data: {
2158
+ priceSource: "mark" | "mid";
2159
+ symbol: string;
2160
+ };
2161
+ } | {
2162
+ type: "weighted_ratio_trailing";
2163
+ data: {
2164
+ priceSource: "mark" | "mid";
2165
+ basket: {
2166
+ symbol: string;
2167
+ side: "BUY" | "SELL";
2168
+ weight: number;
2169
+ }[];
2170
+ };
2171
+ } | {
2032
2172
  type: "notional_trailing";
2033
2173
  data: {
2034
2174
  priceSource: "mark" | "mid";
@@ -2043,31 +2183,968 @@ declare class Core {
2043
2183
  data: {
2044
2184
  priceSource: "mark" | "mid";
2045
2185
  };
2186
+ } | {
2187
+ type: "funding_rate";
2188
+ data: {
2189
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2190
+ symbol: string;
2191
+ track: "PEAK" | "TROUGH";
2192
+ threshold: number;
2193
+ };
2194
+ } | {
2195
+ type: "prediction_market";
2196
+ data: {
2197
+ source: "kalshi" | "polymarket";
2198
+ marketKey: string;
2199
+ track: "PEAK" | "TROUGH";
2200
+ threshold: number;
2201
+ };
2202
+ } | {
2203
+ type: "btc_dominance";
2204
+ data: {
2205
+ source: "coingecko";
2206
+ track: "PEAK" | "TROUGH";
2207
+ threshold: number;
2208
+ };
2046
2209
  };
2047
- trailing: {
2048
- mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2049
- deltaValue: number;
2050
- activationValue?: number | undefined;
2210
+ context: {
2211
+ type: "TWAP";
2212
+ durationSec: number;
2213
+ sliceIntervalSec: number;
2214
+ randomization: {
2215
+ timingJitterBps: number;
2216
+ sizeJitterBps: number;
2217
+ };
2218
+ position: {
2219
+ id: string;
2220
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
2221
+ };
2051
2222
  };
2052
- })[] | undefined;
2053
- };
2054
- }>;
2055
- cancel: (ladderId: string, headers?: ClientHeaders) => Promise<{
2056
- id: string;
2057
- }>;
2058
- };
2059
- instruments: {
2060
- list: (query: HttpTypes.InstrumentListParamsInput, headers?: ClientHeaders) => Promise<{
2061
- instruments: {
2062
- id: string;
2063
- base: string;
2064
- quote: string;
2065
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2066
- type: "spot" | "perp" | "hip3";
2067
- leverage: number;
2068
- marginMode: "any" | "isolated" | "cross";
2069
- precision: {
2070
- quantity: {
2223
+ ladderId?: string | undefined;
2224
+ ladderIndex?: number | undefined;
2225
+ parentTriggerId?: string | undefined;
2226
+ triggeredAt?: string | undefined;
2227
+ cancelledAt?: string | undefined;
2228
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2229
+ fills?: {
2230
+ id: string;
2231
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2232
+ tradeAccountId: string;
2233
+ symbol: string;
2234
+ positionId: string;
2235
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2236
+ side: "BUY" | "SELL";
2237
+ reduceOnly: boolean;
2238
+ isExternal: boolean;
2239
+ synthetic: boolean;
2240
+ quantity: string;
2241
+ price: string;
2242
+ usd: string;
2243
+ timestamp: string;
2244
+ cloid?: string | undefined;
2245
+ exchangeFillId?: string | undefined;
2246
+ tradeFee?: string | undefined;
2247
+ pearFee?: string | undefined;
2248
+ original?: {
2249
+ exchangeFillId: string;
2250
+ quantity: string;
2251
+ } | undefined;
2252
+ }[] | undefined;
2253
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2254
+ scheduleId?: string | undefined;
2255
+ trailing?: {
2256
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2257
+ deltaValue: number;
2258
+ activationValue?: number | undefined;
2259
+ bestMetricSeen?: number | undefined;
2260
+ currentStopValue?: number | undefined;
2261
+ stopBreachedAt?: number | undefined;
2262
+ } | undefined;
2263
+ })[];
2264
+ createdAt: string;
2265
+ updatedAt: string;
2266
+ attachTriggers?: ({
2267
+ intent: "CLOSE";
2268
+ type: "MARKET";
2269
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
2270
+ condition: {
2271
+ type: "notional";
2272
+ data: {
2273
+ priceSource: "mark" | "mid";
2274
+ threshold: number;
2275
+ };
2276
+ } | {
2277
+ type: "upnl";
2278
+ data: {
2279
+ priceSource: "mark" | "mid";
2280
+ threshold: number;
2281
+ };
2282
+ } | {
2283
+ type: "upnl_bps";
2284
+ data: {
2285
+ priceSource: "mark" | "mid";
2286
+ threshold: number;
2287
+ };
2288
+ };
2289
+ } | {
2290
+ intent: "CLOSE";
2291
+ type: "MARKET";
2292
+ condition: {
2293
+ type: "notional_trailing";
2294
+ data: {
2295
+ priceSource: "mark" | "mid";
2296
+ };
2297
+ } | {
2298
+ type: "upnl_trailing";
2299
+ data: {
2300
+ priceSource: "mark" | "mid";
2301
+ };
2302
+ } | {
2303
+ type: "upnl_bps_trailing";
2304
+ data: {
2305
+ priceSource: "mark" | "mid";
2306
+ };
2307
+ };
2308
+ trailing: {
2309
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2310
+ deltaValue: number;
2311
+ activationValue?: number | undefined;
2312
+ };
2313
+ })[] | undefined;
2314
+ };
2315
+ }>;
2316
+ get: (ladderId: string, headers?: ClientHeaders) => Promise<{
2317
+ ladder: {
2318
+ id: string;
2319
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2320
+ positionKey: string;
2321
+ config: {
2322
+ thresholdStart: number;
2323
+ thresholdEnd: number;
2324
+ levels: number;
2325
+ weighting: "EQUAL";
2326
+ };
2327
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED";
2328
+ triggers: ({
2329
+ id: string;
2330
+ tradeAccountId: string;
2331
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2332
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2333
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2334
+ createdAt: string;
2335
+ updatedAt: string;
2336
+ intent: "OPEN";
2337
+ type: "MARKET";
2338
+ condition: {
2339
+ type: "ratio";
2340
+ data: {
2341
+ priceSource: "mark" | "mid";
2342
+ symbol_a: string;
2343
+ symbol_b: string;
2344
+ track: "PEAK" | "TROUGH";
2345
+ threshold: number;
2346
+ };
2347
+ } | {
2348
+ type: "price";
2349
+ data: {
2350
+ priceSource: "mark" | "mid";
2351
+ symbol: string;
2352
+ track: "PEAK" | "TROUGH";
2353
+ threshold: number;
2354
+ };
2355
+ } | {
2356
+ type: "weighted_ratio";
2357
+ data: {
2358
+ priceSource: "mark" | "mid";
2359
+ basket: {
2360
+ symbol: string;
2361
+ side: "BUY" | "SELL";
2362
+ weight: number;
2363
+ }[];
2364
+ track: "PEAK" | "TROUGH";
2365
+ threshold: number;
2366
+ };
2367
+ } | {
2368
+ type: "funding_rate";
2369
+ data: {
2370
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2371
+ symbol: string;
2372
+ track: "PEAK" | "TROUGH";
2373
+ threshold: number;
2374
+ };
2375
+ } | {
2376
+ type: "prediction_market";
2377
+ data: {
2378
+ source: "kalshi" | "polymarket";
2379
+ marketKey: string;
2380
+ track: "PEAK" | "TROUGH";
2381
+ threshold: number;
2382
+ };
2383
+ } | {
2384
+ type: "btc_dominance";
2385
+ data: {
2386
+ source: "coingecko";
2387
+ track: "PEAK" | "TROUGH";
2388
+ threshold: number;
2389
+ };
2390
+ };
2391
+ context: {
2392
+ type: "MARKET";
2393
+ legs: [{
2394
+ symbol: string;
2395
+ side: "BUY" | "SELL";
2396
+ mode: "QUANTITY" | "USD";
2397
+ amount: string;
2398
+ id?: string | undefined;
2399
+ }, ...{
2400
+ symbol: string;
2401
+ side: "BUY" | "SELL";
2402
+ mode: "QUANTITY" | "USD";
2403
+ amount: string;
2404
+ id?: string | undefined;
2405
+ }[]];
2406
+ attachedTriggers: {
2407
+ kind: "STATIC" | "TRAILING";
2408
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
2409
+ }[];
2410
+ };
2411
+ ladderId?: string | undefined;
2412
+ ladderIndex?: number | undefined;
2413
+ parentTriggerId?: string | undefined;
2414
+ triggeredAt?: string | undefined;
2415
+ cancelledAt?: string | undefined;
2416
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2417
+ fills?: {
2418
+ id: string;
2419
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2420
+ tradeAccountId: string;
2421
+ symbol: string;
2422
+ positionId: string;
2423
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2424
+ side: "BUY" | "SELL";
2425
+ reduceOnly: boolean;
2426
+ isExternal: boolean;
2427
+ synthetic: boolean;
2428
+ quantity: string;
2429
+ price: string;
2430
+ usd: string;
2431
+ timestamp: string;
2432
+ cloid?: string | undefined;
2433
+ exchangeFillId?: string | undefined;
2434
+ tradeFee?: string | undefined;
2435
+ pearFee?: string | undefined;
2436
+ original?: {
2437
+ exchangeFillId: string;
2438
+ quantity: string;
2439
+ } | undefined;
2440
+ }[] | undefined;
2441
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2442
+ } | {
2443
+ id: string;
2444
+ tradeAccountId: string;
2445
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2446
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2447
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2448
+ createdAt: string;
2449
+ updatedAt: string;
2450
+ intent: "ADJUST";
2451
+ type: "MARKET";
2452
+ condition: {
2453
+ type: "ratio";
2454
+ data: {
2455
+ priceSource: "mark" | "mid";
2456
+ symbol_a: string;
2457
+ symbol_b: string;
2458
+ track: "PEAK" | "TROUGH";
2459
+ threshold: number;
2460
+ };
2461
+ } | {
2462
+ type: "price";
2463
+ data: {
2464
+ priceSource: "mark" | "mid";
2465
+ symbol: string;
2466
+ track: "PEAK" | "TROUGH";
2467
+ threshold: number;
2468
+ };
2469
+ } | {
2470
+ type: "weighted_ratio";
2471
+ data: {
2472
+ priceSource: "mark" | "mid";
2473
+ basket: {
2474
+ symbol: string;
2475
+ side: "BUY" | "SELL";
2476
+ weight: number;
2477
+ }[];
2478
+ track: "PEAK" | "TROUGH";
2479
+ threshold: number;
2480
+ };
2481
+ } | {
2482
+ type: "notional";
2483
+ data: {
2484
+ priceSource: "mark" | "mid";
2485
+ track: "PEAK" | "TROUGH";
2486
+ threshold: number;
2487
+ };
2488
+ } | {
2489
+ type: "upnl";
2490
+ data: {
2491
+ priceSource: "mark" | "mid";
2492
+ track: "PEAK" | "TROUGH";
2493
+ threshold: number;
2494
+ };
2495
+ } | {
2496
+ type: "upnl_bps";
2497
+ data: {
2498
+ priceSource: "mark" | "mid";
2499
+ track: "PEAK" | "TROUGH";
2500
+ threshold: number;
2501
+ };
2502
+ } | {
2503
+ type: "funding_rate";
2504
+ data: {
2505
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2506
+ symbol: string;
2507
+ track: "PEAK" | "TROUGH";
2508
+ threshold: number;
2509
+ };
2510
+ } | {
2511
+ type: "prediction_market";
2512
+ data: {
2513
+ source: "kalshi" | "polymarket";
2514
+ marketKey: string;
2515
+ track: "PEAK" | "TROUGH";
2516
+ threshold: number;
2517
+ };
2518
+ } | {
2519
+ type: "btc_dominance";
2520
+ data: {
2521
+ source: "coingecko";
2522
+ track: "PEAK" | "TROUGH";
2523
+ threshold: number;
2524
+ };
2525
+ };
2526
+ context: {
2527
+ type: "MARKET";
2528
+ position: {
2529
+ id: string;
2530
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
2531
+ };
2532
+ legs: [{
2533
+ symbol: string;
2534
+ side: "BUY" | "SELL";
2535
+ mode: "QUANTITY" | "USD";
2536
+ amount: string;
2537
+ reduceOnly: boolean;
2538
+ id?: string | undefined;
2539
+ }, ...{
2540
+ symbol: string;
2541
+ side: "BUY" | "SELL";
2542
+ mode: "QUANTITY" | "USD";
2543
+ amount: string;
2544
+ reduceOnly: boolean;
2545
+ id?: string | undefined;
2546
+ }[]];
2547
+ };
2548
+ ladderId?: string | undefined;
2549
+ ladderIndex?: number | undefined;
2550
+ parentTriggerId?: string | undefined;
2551
+ triggeredAt?: string | undefined;
2552
+ cancelledAt?: string | undefined;
2553
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2554
+ fills?: {
2555
+ id: string;
2556
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2557
+ tradeAccountId: string;
2558
+ symbol: string;
2559
+ positionId: string;
2560
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2561
+ side: "BUY" | "SELL";
2562
+ reduceOnly: boolean;
2563
+ isExternal: boolean;
2564
+ synthetic: boolean;
2565
+ quantity: string;
2566
+ price: string;
2567
+ usd: string;
2568
+ timestamp: string;
2569
+ cloid?: string | undefined;
2570
+ exchangeFillId?: string | undefined;
2571
+ tradeFee?: string | undefined;
2572
+ pearFee?: string | undefined;
2573
+ original?: {
2574
+ exchangeFillId: string;
2575
+ quantity: string;
2576
+ } | undefined;
2577
+ }[] | undefined;
2578
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2579
+ trailing?: {
2580
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2581
+ deltaValue: number;
2582
+ activationValue?: number | undefined;
2583
+ bestMetricSeen?: number | undefined;
2584
+ currentStopValue?: number | undefined;
2585
+ stopBreachedAt?: number | undefined;
2586
+ } | undefined;
2587
+ } | {
2588
+ id: string;
2589
+ tradeAccountId: string;
2590
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2591
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2592
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2593
+ createdAt: string;
2594
+ updatedAt: string;
2595
+ intent: "CLOSE";
2596
+ type: "MARKET";
2597
+ condition: {
2598
+ type: "ratio";
2599
+ data: {
2600
+ priceSource: "mark" | "mid";
2601
+ symbol_a: string;
2602
+ symbol_b: string;
2603
+ track: "PEAK" | "TROUGH";
2604
+ threshold: number;
2605
+ };
2606
+ } | {
2607
+ type: "price";
2608
+ data: {
2609
+ priceSource: "mark" | "mid";
2610
+ symbol: string;
2611
+ track: "PEAK" | "TROUGH";
2612
+ threshold: number;
2613
+ };
2614
+ } | {
2615
+ type: "weighted_ratio";
2616
+ data: {
2617
+ priceSource: "mark" | "mid";
2618
+ basket: {
2619
+ symbol: string;
2620
+ side: "BUY" | "SELL";
2621
+ weight: number;
2622
+ }[];
2623
+ track: "PEAK" | "TROUGH";
2624
+ threshold: number;
2625
+ };
2626
+ } | {
2627
+ type: "notional";
2628
+ data: {
2629
+ priceSource: "mark" | "mid";
2630
+ track: "PEAK" | "TROUGH";
2631
+ threshold: number;
2632
+ };
2633
+ } | {
2634
+ type: "upnl";
2635
+ data: {
2636
+ priceSource: "mark" | "mid";
2637
+ track: "PEAK" | "TROUGH";
2638
+ threshold: number;
2639
+ };
2640
+ } | {
2641
+ type: "upnl_bps";
2642
+ data: {
2643
+ priceSource: "mark" | "mid";
2644
+ track: "PEAK" | "TROUGH";
2645
+ threshold: number;
2646
+ };
2647
+ } | {
2648
+ type: "ratio_trailing";
2649
+ data: {
2650
+ priceSource: "mark" | "mid";
2651
+ symbol_a: string;
2652
+ symbol_b: string;
2653
+ };
2654
+ } | {
2655
+ type: "price_trailing";
2656
+ data: {
2657
+ priceSource: "mark" | "mid";
2658
+ symbol: string;
2659
+ };
2660
+ } | {
2661
+ type: "weighted_ratio_trailing";
2662
+ data: {
2663
+ priceSource: "mark" | "mid";
2664
+ basket: {
2665
+ symbol: string;
2666
+ side: "BUY" | "SELL";
2667
+ weight: number;
2668
+ }[];
2669
+ };
2670
+ } | {
2671
+ type: "notional_trailing";
2672
+ data: {
2673
+ priceSource: "mark" | "mid";
2674
+ };
2675
+ } | {
2676
+ type: "upnl_trailing";
2677
+ data: {
2678
+ priceSource: "mark" | "mid";
2679
+ };
2680
+ } | {
2681
+ type: "upnl_bps_trailing";
2682
+ data: {
2683
+ priceSource: "mark" | "mid";
2684
+ };
2685
+ } | {
2686
+ type: "funding_rate";
2687
+ data: {
2688
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2689
+ symbol: string;
2690
+ track: "PEAK" | "TROUGH";
2691
+ threshold: number;
2692
+ };
2693
+ } | {
2694
+ type: "prediction_market";
2695
+ data: {
2696
+ source: "kalshi" | "polymarket";
2697
+ marketKey: string;
2698
+ track: "PEAK" | "TROUGH";
2699
+ threshold: number;
2700
+ };
2701
+ } | {
2702
+ type: "btc_dominance";
2703
+ data: {
2704
+ source: "coingecko";
2705
+ track: "PEAK" | "TROUGH";
2706
+ threshold: number;
2707
+ };
2708
+ };
2709
+ context: {
2710
+ type: "MARKET";
2711
+ position: {
2712
+ id: string;
2713
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
2714
+ };
2715
+ };
2716
+ ladderId?: string | undefined;
2717
+ ladderIndex?: number | undefined;
2718
+ parentTriggerId?: string | undefined;
2719
+ triggeredAt?: string | undefined;
2720
+ cancelledAt?: string | undefined;
2721
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2722
+ fills?: {
2723
+ id: string;
2724
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2725
+ tradeAccountId: string;
2726
+ symbol: string;
2727
+ positionId: string;
2728
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2729
+ side: "BUY" | "SELL";
2730
+ reduceOnly: boolean;
2731
+ isExternal: boolean;
2732
+ synthetic: boolean;
2733
+ quantity: string;
2734
+ price: string;
2735
+ usd: string;
2736
+ timestamp: string;
2737
+ cloid?: string | undefined;
2738
+ exchangeFillId?: string | undefined;
2739
+ tradeFee?: string | undefined;
2740
+ pearFee?: string | undefined;
2741
+ original?: {
2742
+ exchangeFillId: string;
2743
+ quantity: string;
2744
+ } | undefined;
2745
+ }[] | undefined;
2746
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2747
+ trailing?: {
2748
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2749
+ deltaValue: number;
2750
+ activationValue?: number | undefined;
2751
+ bestMetricSeen?: number | undefined;
2752
+ currentStopValue?: number | undefined;
2753
+ stopBreachedAt?: number | undefined;
2754
+ } | undefined;
2755
+ } | {
2756
+ id: string;
2757
+ tradeAccountId: string;
2758
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2759
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2760
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2761
+ createdAt: string;
2762
+ updatedAt: string;
2763
+ intent: "ADJUST";
2764
+ type: "TWAP";
2765
+ condition: {
2766
+ type: "ratio";
2767
+ data: {
2768
+ priceSource: "mark" | "mid";
2769
+ symbol_a: string;
2770
+ symbol_b: string;
2771
+ track: "PEAK" | "TROUGH";
2772
+ threshold: number;
2773
+ };
2774
+ } | {
2775
+ type: "price";
2776
+ data: {
2777
+ priceSource: "mark" | "mid";
2778
+ symbol: string;
2779
+ track: "PEAK" | "TROUGH";
2780
+ threshold: number;
2781
+ };
2782
+ } | {
2783
+ type: "weighted_ratio";
2784
+ data: {
2785
+ priceSource: "mark" | "mid";
2786
+ basket: {
2787
+ symbol: string;
2788
+ side: "BUY" | "SELL";
2789
+ weight: number;
2790
+ }[];
2791
+ track: "PEAK" | "TROUGH";
2792
+ threshold: number;
2793
+ };
2794
+ } | {
2795
+ type: "notional";
2796
+ data: {
2797
+ priceSource: "mark" | "mid";
2798
+ track: "PEAK" | "TROUGH";
2799
+ threshold: number;
2800
+ };
2801
+ } | {
2802
+ type: "upnl";
2803
+ data: {
2804
+ priceSource: "mark" | "mid";
2805
+ track: "PEAK" | "TROUGH";
2806
+ threshold: number;
2807
+ };
2808
+ } | {
2809
+ type: "upnl_bps";
2810
+ data: {
2811
+ priceSource: "mark" | "mid";
2812
+ track: "PEAK" | "TROUGH";
2813
+ threshold: number;
2814
+ };
2815
+ } | {
2816
+ type: "funding_rate";
2817
+ data: {
2818
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2819
+ symbol: string;
2820
+ track: "PEAK" | "TROUGH";
2821
+ threshold: number;
2822
+ };
2823
+ } | {
2824
+ type: "prediction_market";
2825
+ data: {
2826
+ source: "kalshi" | "polymarket";
2827
+ marketKey: string;
2828
+ track: "PEAK" | "TROUGH";
2829
+ threshold: number;
2830
+ };
2831
+ } | {
2832
+ type: "btc_dominance";
2833
+ data: {
2834
+ source: "coingecko";
2835
+ track: "PEAK" | "TROUGH";
2836
+ threshold: number;
2837
+ };
2838
+ };
2839
+ context: {
2840
+ type: "TWAP";
2841
+ durationSec: number;
2842
+ sliceIntervalSec: number;
2843
+ randomization: {
2844
+ timingJitterBps: number;
2845
+ sizeJitterBps: number;
2846
+ };
2847
+ position: {
2848
+ id: string;
2849
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
2850
+ };
2851
+ legs: [{
2852
+ symbol: string;
2853
+ side: "BUY" | "SELL";
2854
+ weight: number;
2855
+ id?: string | undefined;
2856
+ }, ...{
2857
+ symbol: string;
2858
+ side: "BUY" | "SELL";
2859
+ weight: number;
2860
+ id?: string | undefined;
2861
+ }[]];
2862
+ targetNotional: string;
2863
+ };
2864
+ ladderId?: string | undefined;
2865
+ ladderIndex?: number | undefined;
2866
+ parentTriggerId?: string | undefined;
2867
+ triggeredAt?: string | undefined;
2868
+ cancelledAt?: string | undefined;
2869
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2870
+ fills?: {
2871
+ id: string;
2872
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2873
+ tradeAccountId: string;
2874
+ symbol: string;
2875
+ positionId: string;
2876
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2877
+ side: "BUY" | "SELL";
2878
+ reduceOnly: boolean;
2879
+ isExternal: boolean;
2880
+ synthetic: boolean;
2881
+ quantity: string;
2882
+ price: string;
2883
+ usd: string;
2884
+ timestamp: string;
2885
+ cloid?: string | undefined;
2886
+ exchangeFillId?: string | undefined;
2887
+ tradeFee?: string | undefined;
2888
+ pearFee?: string | undefined;
2889
+ original?: {
2890
+ exchangeFillId: string;
2891
+ quantity: string;
2892
+ } | undefined;
2893
+ }[] | undefined;
2894
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
2895
+ scheduleId?: string | undefined;
2896
+ trailing?: {
2897
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
2898
+ deltaValue: number;
2899
+ activationValue?: number | undefined;
2900
+ bestMetricSeen?: number | undefined;
2901
+ currentStopValue?: number | undefined;
2902
+ stopBreachedAt?: number | undefined;
2903
+ } | undefined;
2904
+ } | {
2905
+ id: string;
2906
+ tradeAccountId: string;
2907
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2908
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
2909
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
2910
+ createdAt: string;
2911
+ updatedAt: string;
2912
+ intent: "CLOSE";
2913
+ type: "TWAP";
2914
+ condition: {
2915
+ type: "ratio";
2916
+ data: {
2917
+ priceSource: "mark" | "mid";
2918
+ symbol_a: string;
2919
+ symbol_b: string;
2920
+ track: "PEAK" | "TROUGH";
2921
+ threshold: number;
2922
+ };
2923
+ } | {
2924
+ type: "price";
2925
+ data: {
2926
+ priceSource: "mark" | "mid";
2927
+ symbol: string;
2928
+ track: "PEAK" | "TROUGH";
2929
+ threshold: number;
2930
+ };
2931
+ } | {
2932
+ type: "weighted_ratio";
2933
+ data: {
2934
+ priceSource: "mark" | "mid";
2935
+ basket: {
2936
+ symbol: string;
2937
+ side: "BUY" | "SELL";
2938
+ weight: number;
2939
+ }[];
2940
+ track: "PEAK" | "TROUGH";
2941
+ threshold: number;
2942
+ };
2943
+ } | {
2944
+ type: "notional";
2945
+ data: {
2946
+ priceSource: "mark" | "mid";
2947
+ track: "PEAK" | "TROUGH";
2948
+ threshold: number;
2949
+ };
2950
+ } | {
2951
+ type: "upnl";
2952
+ data: {
2953
+ priceSource: "mark" | "mid";
2954
+ track: "PEAK" | "TROUGH";
2955
+ threshold: number;
2956
+ };
2957
+ } | {
2958
+ type: "upnl_bps";
2959
+ data: {
2960
+ priceSource: "mark" | "mid";
2961
+ track: "PEAK" | "TROUGH";
2962
+ threshold: number;
2963
+ };
2964
+ } | {
2965
+ type: "ratio_trailing";
2966
+ data: {
2967
+ priceSource: "mark" | "mid";
2968
+ symbol_a: string;
2969
+ symbol_b: string;
2970
+ };
2971
+ } | {
2972
+ type: "price_trailing";
2973
+ data: {
2974
+ priceSource: "mark" | "mid";
2975
+ symbol: string;
2976
+ };
2977
+ } | {
2978
+ type: "weighted_ratio_trailing";
2979
+ data: {
2980
+ priceSource: "mark" | "mid";
2981
+ basket: {
2982
+ symbol: string;
2983
+ side: "BUY" | "SELL";
2984
+ weight: number;
2985
+ }[];
2986
+ };
2987
+ } | {
2988
+ type: "notional_trailing";
2989
+ data: {
2990
+ priceSource: "mark" | "mid";
2991
+ };
2992
+ } | {
2993
+ type: "upnl_trailing";
2994
+ data: {
2995
+ priceSource: "mark" | "mid";
2996
+ };
2997
+ } | {
2998
+ type: "upnl_bps_trailing";
2999
+ data: {
3000
+ priceSource: "mark" | "mid";
3001
+ };
3002
+ } | {
3003
+ type: "funding_rate";
3004
+ data: {
3005
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3006
+ symbol: string;
3007
+ track: "PEAK" | "TROUGH";
3008
+ threshold: number;
3009
+ };
3010
+ } | {
3011
+ type: "prediction_market";
3012
+ data: {
3013
+ source: "kalshi" | "polymarket";
3014
+ marketKey: string;
3015
+ track: "PEAK" | "TROUGH";
3016
+ threshold: number;
3017
+ };
3018
+ } | {
3019
+ type: "btc_dominance";
3020
+ data: {
3021
+ source: "coingecko";
3022
+ track: "PEAK" | "TROUGH";
3023
+ threshold: number;
3024
+ };
3025
+ };
3026
+ context: {
3027
+ type: "TWAP";
3028
+ durationSec: number;
3029
+ sliceIntervalSec: number;
3030
+ randomization: {
3031
+ timingJitterBps: number;
3032
+ sizeJitterBps: number;
3033
+ };
3034
+ position: {
3035
+ id: string;
3036
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
3037
+ };
3038
+ };
3039
+ ladderId?: string | undefined;
3040
+ ladderIndex?: number | undefined;
3041
+ parentTriggerId?: string | undefined;
3042
+ triggeredAt?: string | undefined;
3043
+ cancelledAt?: string | undefined;
3044
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
3045
+ fills?: {
3046
+ id: string;
3047
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3048
+ tradeAccountId: string;
3049
+ symbol: string;
3050
+ positionId: string;
3051
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3052
+ side: "BUY" | "SELL";
3053
+ reduceOnly: boolean;
3054
+ isExternal: boolean;
3055
+ synthetic: boolean;
3056
+ quantity: string;
3057
+ price: string;
3058
+ usd: string;
3059
+ timestamp: string;
3060
+ cloid?: string | undefined;
3061
+ exchangeFillId?: string | undefined;
3062
+ tradeFee?: string | undefined;
3063
+ pearFee?: string | undefined;
3064
+ original?: {
3065
+ exchangeFillId: string;
3066
+ quantity: string;
3067
+ } | undefined;
3068
+ }[] | undefined;
3069
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
3070
+ scheduleId?: string | undefined;
3071
+ trailing?: {
3072
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
3073
+ deltaValue: number;
3074
+ activationValue?: number | undefined;
3075
+ bestMetricSeen?: number | undefined;
3076
+ currentStopValue?: number | undefined;
3077
+ stopBreachedAt?: number | undefined;
3078
+ } | undefined;
3079
+ })[];
3080
+ createdAt: string;
3081
+ updatedAt: string;
3082
+ attachTriggers?: ({
3083
+ intent: "CLOSE";
3084
+ type: "MARKET";
3085
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
3086
+ condition: {
3087
+ type: "notional";
3088
+ data: {
3089
+ priceSource: "mark" | "mid";
3090
+ threshold: number;
3091
+ };
3092
+ } | {
3093
+ type: "upnl";
3094
+ data: {
3095
+ priceSource: "mark" | "mid";
3096
+ threshold: number;
3097
+ };
3098
+ } | {
3099
+ type: "upnl_bps";
3100
+ data: {
3101
+ priceSource: "mark" | "mid";
3102
+ threshold: number;
3103
+ };
3104
+ };
3105
+ } | {
3106
+ intent: "CLOSE";
3107
+ type: "MARKET";
3108
+ condition: {
3109
+ type: "notional_trailing";
3110
+ data: {
3111
+ priceSource: "mark" | "mid";
3112
+ };
3113
+ } | {
3114
+ type: "upnl_trailing";
3115
+ data: {
3116
+ priceSource: "mark" | "mid";
3117
+ };
3118
+ } | {
3119
+ type: "upnl_bps_trailing";
3120
+ data: {
3121
+ priceSource: "mark" | "mid";
3122
+ };
3123
+ };
3124
+ trailing: {
3125
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
3126
+ deltaValue: number;
3127
+ activationValue?: number | undefined;
3128
+ };
3129
+ })[] | undefined;
3130
+ };
3131
+ }>;
3132
+ cancel: (ladderId: string, headers?: ClientHeaders) => Promise<{
3133
+ id: string;
3134
+ }>;
3135
+ };
3136
+ instruments: {
3137
+ list: (query: HttpTypes.InstrumentListParamsInput, headers?: ClientHeaders) => Promise<{
3138
+ instruments: {
3139
+ id: string;
3140
+ base: string;
3141
+ quote: string;
3142
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3143
+ type: "spot" | "perp" | "hip3";
3144
+ leverage: number;
3145
+ marginMode: "any" | "isolated" | "cross";
3146
+ precision: {
3147
+ quantity: {
2071
3148
  decimals: number;
2072
3149
  step: number;
2073
3150
  contractSize: number;
@@ -2169,7 +3246,7 @@ declare class Core {
2169
3246
  list: (query?: HttpTypes.NotificationListParamsInput, headers?: ClientHeaders) => Promise<{
2170
3247
  notifications: {
2171
3248
  id: string;
2172
- category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT" | "TAKE_PROFIT_FAILED" | "STOP_LOSS_FAILED" | "TRIGGER_ORDER_FAILED" | "ATTACHED_TRIGGER_DISCARDED" | "AUTO_REBALANCE_EXECUTED" | "AUTO_REBALANCE_FAILED" | "AUTO_REBALANCE_PAUSED" | "TRIGGER_CANCELLED_MIS_SCALED";
3249
+ category: "TAKE_PROFIT_HIT" | "STOP_LOSS_HIT" | "TRIGGER_ORDER_HIT" | "TAKE_PROFIT_FAILED" | "STOP_LOSS_FAILED" | "TRIGGER_ORDER_FAILED" | "ATTACHED_TRIGGER_DISCARDED" | "AUTO_REBALANCE_EXECUTED" | "AUTO_REBALANCE_FAILED" | "AUTO_REBALANCE_PAUSED" | "TRIGGER_TWAP_STARTED" | "TRIGGER_TWAP_SKIPPED" | "TRIGGER_TWAP_FAILED" | "TRIGGER_TWAP_POSITION_CHANGED" | "TRIGGER_CANCELLED_MIS_SCALED";
2173
3250
  parameters: {
2174
3251
  legs: {
2175
3252
  id: string;
@@ -2285,6 +3362,52 @@ declare class Core {
2285
3362
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2286
3363
  weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
2287
3364
  type: "auto_rebalance_paused";
3365
+ } | {
3366
+ legs: {
3367
+ id: string;
3368
+ symbol: string;
3369
+ side: "BUY" | "SELL";
3370
+ }[];
3371
+ triggerId: string;
3372
+ positionId: string;
3373
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3374
+ type: "trigger_twap_started";
3375
+ scheduleId: string;
3376
+ } | {
3377
+ legs: {
3378
+ id: string;
3379
+ symbol: string;
3380
+ side: "BUY" | "SELL";
3381
+ }[];
3382
+ triggerId: string;
3383
+ positionId: string;
3384
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3385
+ type: "trigger_twap_skipped";
3386
+ reason: string;
3387
+ } | {
3388
+ legs: {
3389
+ id: string;
3390
+ symbol: string;
3391
+ side: "BUY" | "SELL";
3392
+ }[];
3393
+ triggerId: string;
3394
+ positionId: string;
3395
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3396
+ type: "trigger_twap_failed";
3397
+ reason: string;
3398
+ scheduleId?: string | undefined;
3399
+ } | {
3400
+ legs: {
3401
+ id: string;
3402
+ symbol: string;
3403
+ side: "BUY" | "SELL";
3404
+ }[];
3405
+ triggerId: string;
3406
+ positionId: string;
3407
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3408
+ type: "trigger_twap_position_changed";
3409
+ scheduleId: string;
3410
+ reason: string;
2288
3411
  } | {
2289
3412
  type: "trigger_cancelled_mis_scaled";
2290
3413
  triggerId: string;
@@ -2725,380 +3848,628 @@ declare class Core {
2725
3848
  };
2726
3849
  pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
2727
3850
  };
2728
- }>;
2729
- replace: (id: string, body: HttpTypes.ReplaceAutoRebalanceConfig, headers?: ClientHeaders) => Promise<{
2730
- config: {
3851
+ }>;
3852
+ replace: (id: string, body: HttpTypes.ReplaceAutoRebalanceConfig, headers?: ClientHeaders) => Promise<{
3853
+ config: {
3854
+ id: string;
3855
+ positionId: string;
3856
+ status: "ACTIVE" | "PAUSED";
3857
+ minimumDriftPct: string;
3858
+ createdAt: string;
3859
+ updatedAt: string;
3860
+ weightSource: "INITIAL_WEIGHT";
3861
+ pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
3862
+ } | {
3863
+ id: string;
3864
+ positionId: string;
3865
+ status: "ACTIVE" | "PAUSED";
3866
+ minimumDriftPct: string;
3867
+ createdAt: string;
3868
+ updatedAt: string;
3869
+ weightSource: "LIVE_BETA";
3870
+ timeframe: "1d" | "1h" | "4h";
3871
+ beta: {
3872
+ state: "PENDING";
3873
+ } | {
3874
+ state: "BASELINED";
3875
+ impliedEntryBeta: string;
3876
+ } | {
3877
+ state: "TRACKING";
3878
+ impliedEntryBeta: string;
3879
+ lastDerivedBeta: string;
3880
+ lastProcessedBetaTime: string;
3881
+ driftPct?: string | undefined;
3882
+ };
3883
+ pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
3884
+ };
3885
+ }>;
3886
+ cancel: (id: string, headers?: ClientHeaders) => Promise<void>;
3887
+ };
3888
+ listEvents: (positionId: string, query?: HttpTypes.RebalanceEventListParamsInput, headers?: ClientHeaders) => Promise<{
3889
+ limit: number;
3890
+ items: {
3891
+ id: string;
3892
+ autoRebalanceConfigId: string;
3893
+ positionId: string;
3894
+ weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
3895
+ driftPct: string;
3896
+ currentWeights: Record<string, number>;
3897
+ targetWeights: Record<string, number>;
3898
+ status: "FAILED" | "SUCCESS";
3899
+ createdAt: string;
3900
+ error?: string | undefined;
3901
+ }[];
3902
+ nextCursor?: string | undefined;
3903
+ }>;
3904
+ };
3905
+ referrals: {
3906
+ /** Issue an immutable referral code to the authenticated user. */
3907
+ create: (body: HttpTypes.CreateReferralCode, headers?: ClientHeaders) => Promise<void>;
3908
+ /** Permanently bind the authenticated user to an existing referral code. */
3909
+ bind: (body: HttpTypes.BindReferralCode, headers?: ClientHeaders) => Promise<void>;
3910
+ /** Return referral codes owned by the authenticated user and their referrer. */
3911
+ status: (headers?: ClientHeaders) => Promise<{
3912
+ ownedCodes: string[];
3913
+ referrerCode?: string | undefined;
3914
+ }>;
3915
+ /** List users permanently bound to the authenticated referrer. */
3916
+ referees: (query?: HttpTypes.ReferralRefereeListParamsInput, headers?: ClientHeaders) => Promise<{
3917
+ limit: number;
3918
+ count: number;
3919
+ pendingCount: number;
3920
+ totalVolumeUsd: string;
3921
+ referees: ({
3922
+ status: "BOUND";
3923
+ tradeCount: number;
3924
+ volumeUsd: string;
3925
+ address?: `0x${string}` | undefined;
3926
+ referredAt?: number | undefined;
3927
+ } | {
3928
+ status: "PENDING";
3929
+ address: `0x${string}`;
3930
+ })[];
3931
+ nextCursor?: string | undefined;
3932
+ }>;
3933
+ };
3934
+ schedules: {
3935
+ list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
3936
+ limit: number;
3937
+ schedules: ({
3938
+ id: string;
3939
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3940
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3941
+ positionKey: string;
3942
+ executionType: "MARKET";
3943
+ startAt: string;
3944
+ endAt: string;
3945
+ createdAt: string;
3946
+ updatedAt: string;
3947
+ strategy: "TWAP";
3948
+ intent: "OPEN";
3949
+ sliceIntervalSec: number;
3950
+ sliceCount: number;
3951
+ randomization: {
3952
+ timingJitterBps: number;
3953
+ sizeJitterBps: number;
3954
+ };
3955
+ legs: {
3956
+ symbol: string;
3957
+ side: "BUY" | "SELL";
3958
+ weight: number;
3959
+ id?: string | undefined;
3960
+ }[];
3961
+ targetNotional: string;
3962
+ remainingNotional: string;
3963
+ lastSliceAt?: string | undefined;
3964
+ cancelledAt?: string | undefined;
3965
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
3966
+ fills?: {
3967
+ id: string;
3968
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3969
+ tradeAccountId: string;
3970
+ symbol: string;
3971
+ positionId: string;
3972
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3973
+ side: "BUY" | "SELL";
3974
+ reduceOnly: boolean;
3975
+ isExternal: boolean;
3976
+ synthetic: boolean;
3977
+ quantity: string;
3978
+ price: string;
3979
+ usd: string;
3980
+ timestamp: string;
3981
+ cloid?: string | undefined;
3982
+ exchangeFillId?: string | undefined;
3983
+ tradeFee?: string | undefined;
3984
+ pearFee?: string | undefined;
3985
+ original?: {
3986
+ exchangeFillId: string;
3987
+ quantity: string;
3988
+ } | undefined;
3989
+ }[] | undefined;
3990
+ } | {
3991
+ id: string;
3992
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3993
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3994
+ positionKey: string;
3995
+ executionType: "MARKET";
3996
+ startAt: string;
3997
+ endAt: string;
3998
+ createdAt: string;
3999
+ updatedAt: string;
4000
+ strategy: "TWAP";
4001
+ intent: "CLOSE";
4002
+ sliceIntervalSec: number;
4003
+ sliceCount: number;
4004
+ randomization: {
4005
+ timingJitterBps: number;
4006
+ sizeJitterBps: number;
4007
+ };
4008
+ positionId: string;
4009
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
4010
+ lastSliceAt?: string | undefined;
4011
+ cancelledAt?: string | undefined;
4012
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4013
+ fills?: {
2731
4014
  id: string;
4015
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4016
+ tradeAccountId: string;
4017
+ symbol: string;
2732
4018
  positionId: string;
2733
- status: "ACTIVE" | "PAUSED";
2734
- minimumDriftPct: string;
2735
- createdAt: string;
2736
- updatedAt: string;
2737
- weightSource: "INITIAL_WEIGHT";
2738
- pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
2739
- } | {
4019
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4020
+ side: "BUY" | "SELL";
4021
+ reduceOnly: boolean;
4022
+ isExternal: boolean;
4023
+ synthetic: boolean;
4024
+ quantity: string;
4025
+ price: string;
4026
+ usd: string;
4027
+ timestamp: string;
4028
+ cloid?: string | undefined;
4029
+ exchangeFillId?: string | undefined;
4030
+ tradeFee?: string | undefined;
4031
+ pearFee?: string | undefined;
4032
+ original?: {
4033
+ exchangeFillId: string;
4034
+ quantity: string;
4035
+ } | undefined;
4036
+ }[] | undefined;
4037
+ })[];
4038
+ nextCursor?: string | undefined;
4039
+ }>;
4040
+ create: (body: HttpTypes.CreateSchedule, headers?: ClientHeaders) => Promise<{
4041
+ schedule: {
4042
+ id: string;
4043
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4044
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
4045
+ positionKey: string;
4046
+ executionType: "MARKET";
4047
+ startAt: string;
4048
+ endAt: string;
4049
+ createdAt: string;
4050
+ updatedAt: string;
4051
+ strategy: "TWAP";
4052
+ intent: "OPEN";
4053
+ sliceIntervalSec: number;
4054
+ sliceCount: number;
4055
+ randomization: {
4056
+ timingJitterBps: number;
4057
+ sizeJitterBps: number;
4058
+ };
4059
+ legs: {
4060
+ symbol: string;
4061
+ side: "BUY" | "SELL";
4062
+ weight: number;
4063
+ id?: string | undefined;
4064
+ }[];
4065
+ targetNotional: string;
4066
+ remainingNotional: string;
4067
+ lastSliceAt?: string | undefined;
4068
+ cancelledAt?: string | undefined;
4069
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4070
+ fills?: {
2740
4071
  id: string;
4072
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4073
+ tradeAccountId: string;
4074
+ symbol: string;
2741
4075
  positionId: string;
2742
- status: "ACTIVE" | "PAUSED";
2743
- minimumDriftPct: string;
2744
- createdAt: string;
2745
- updatedAt: string;
2746
- weightSource: "LIVE_BETA";
2747
- timeframe: "1d" | "1h" | "4h";
2748
- beta: {
2749
- state: "PENDING";
2750
- } | {
2751
- state: "BASELINED";
2752
- impliedEntryBeta: string;
2753
- } | {
2754
- state: "TRACKING";
2755
- impliedEntryBeta: string;
2756
- lastDerivedBeta: string;
2757
- lastProcessedBetaTime: string;
2758
- driftPct?: string | undefined;
2759
- };
2760
- pausedReason?: "USER" | "POSITION_CHANGED" | "REPEATED_FAILURES" | "INVALID_LIVE_BETA_EXPOSURE" | undefined;
2761
- };
2762
- }>;
2763
- cancel: (id: string, headers?: ClientHeaders) => Promise<void>;
2764
- };
2765
- listEvents: (positionId: string, query?: HttpTypes.RebalanceEventListParamsInput, headers?: ClientHeaders) => Promise<{
2766
- limit: number;
2767
- items: {
4076
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4077
+ side: "BUY" | "SELL";
4078
+ reduceOnly: boolean;
4079
+ isExternal: boolean;
4080
+ synthetic: boolean;
4081
+ quantity: string;
4082
+ price: string;
4083
+ usd: string;
4084
+ timestamp: string;
4085
+ cloid?: string | undefined;
4086
+ exchangeFillId?: string | undefined;
4087
+ tradeFee?: string | undefined;
4088
+ pearFee?: string | undefined;
4089
+ original?: {
4090
+ exchangeFillId: string;
4091
+ quantity: string;
4092
+ } | undefined;
4093
+ }[] | undefined;
4094
+ } | {
2768
4095
  id: string;
2769
- autoRebalanceConfigId: string;
2770
- positionId: string;
2771
- weightSource: "INITIAL_WEIGHT" | "LIVE_BETA";
2772
- driftPct: string;
2773
- currentWeights: Record<string, number>;
2774
- targetWeights: Record<string, number>;
2775
- status: "FAILED" | "SUCCESS";
4096
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4097
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
4098
+ positionKey: string;
4099
+ executionType: "MARKET";
4100
+ startAt: string;
4101
+ endAt: string;
2776
4102
  createdAt: string;
2777
- error?: string | undefined;
2778
- }[];
2779
- nextCursor?: string | undefined;
4103
+ updatedAt: string;
4104
+ strategy: "TWAP";
4105
+ intent: "CLOSE";
4106
+ sliceIntervalSec: number;
4107
+ sliceCount: number;
4108
+ randomization: {
4109
+ timingJitterBps: number;
4110
+ sizeJitterBps: number;
4111
+ };
4112
+ positionId: string;
4113
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
4114
+ lastSliceAt?: string | undefined;
4115
+ cancelledAt?: string | undefined;
4116
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4117
+ fills?: {
4118
+ id: string;
4119
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4120
+ tradeAccountId: string;
4121
+ symbol: string;
4122
+ positionId: string;
4123
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4124
+ side: "BUY" | "SELL";
4125
+ reduceOnly: boolean;
4126
+ isExternal: boolean;
4127
+ synthetic: boolean;
4128
+ quantity: string;
4129
+ price: string;
4130
+ usd: string;
4131
+ timestamp: string;
4132
+ cloid?: string | undefined;
4133
+ exchangeFillId?: string | undefined;
4134
+ tradeFee?: string | undefined;
4135
+ pearFee?: string | undefined;
4136
+ original?: {
4137
+ exchangeFillId: string;
4138
+ quantity: string;
4139
+ } | undefined;
4140
+ }[] | undefined;
4141
+ };
2780
4142
  }>;
2781
- };
2782
- referrals: {
2783
- /** Issue an immutable referral code to the authenticated user. */
2784
- create: (body: HttpTypes.CreateReferralCode, headers?: ClientHeaders) => Promise<void>;
2785
- /** Permanently bind the authenticated user to an existing referral code. */
2786
- bind: (body: HttpTypes.BindReferralCode, headers?: ClientHeaders) => Promise<void>;
2787
- /** Return referral codes owned by the authenticated user and their referrer. */
2788
- status: (headers?: ClientHeaders) => Promise<{
2789
- ownedCodes: string[];
2790
- referrerCode?: string | undefined;
4143
+ cancel: (scheduleId: string, headers?: ClientHeaders) => Promise<{
4144
+ id: string;
2791
4145
  }>;
2792
- /** List users permanently bound to the authenticated referrer. */
2793
- referees: (query?: HttpTypes.ReferralRefereeListParamsInput, headers?: ClientHeaders) => Promise<{
2794
- limit: number;
2795
- count: number;
2796
- pendingCount: number;
2797
- referees: ({
2798
- status: "BOUND";
2799
- tradeCount: number;
2800
- address?: `0x${string}` | undefined;
2801
- referredAt?: number | undefined;
2802
- } | {
2803
- status: "PENDING";
2804
- address: `0x${string}`;
2805
- })[];
2806
- nextCursor?: string | undefined;
4146
+ cancelAll: (headers?: ClientHeaders) => Promise<{
4147
+ ids: string[];
2807
4148
  }>;
2808
4149
  };
2809
- savedBaskets: {
2810
- list: (headers?: ClientHeaders) => Promise<{
2811
- baskets: {
4150
+ sync: {
4151
+ fills: {
4152
+ since: (body: HttpTypes.SyncFillsSinceRequest, headers?: ClientHeaders) => Promise<{
4153
+ sinceMs: number;
4154
+ neverSynced: boolean;
4155
+ firstSyncStartedAt?: number | undefined;
4156
+ confirmedExchangeFillIds?: string[] | undefined;
4157
+ }>;
4158
+ reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4159
+ reconcileBulk: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4160
+ confirm: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4161
+ confirmBulk: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4162
+ create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4163
+ createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4164
+ };
4165
+ funding: {
4166
+ since: (body: HttpTypes.SyncFundingSinceRequest, headers?: ClientHeaders) => Promise<{
4167
+ sinceMs: number;
4168
+ }>;
4169
+ create: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4170
+ createBulk: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4171
+ };
4172
+ };
4173
+ trade: {
4174
+ open: (body: HttpTypes.CreateTradeOpen, headers?: ClientHeaders) => Promise<{
4175
+ execution: {
2812
4176
  id: string;
2813
- name: string;
4177
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4178
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
4179
+ createdAt: string;
4180
+ updatedAt: string;
4181
+ intent: "OPEN";
4182
+ orderType: "MARKET";
2814
4183
  legs: [{
2815
4184
  symbol: string;
2816
4185
  side: "BUY" | "SELL";
2817
- weight: number;
4186
+ mode: "QUANTITY" | "USD";
4187
+ amount: string;
4188
+ reduceOnly: boolean;
4189
+ id?: string | undefined;
2818
4190
  }, ...{
2819
4191
  symbol: string;
2820
4192
  side: "BUY" | "SELL";
2821
- weight: number;
2822
- }[]];
4193
+ mode: "QUANTITY" | "USD";
4194
+ amount: string;
4195
+ reduceOnly: boolean;
4196
+ id?: string | undefined;
4197
+ }[]];
4198
+ error?: string | undefined;
4199
+ orders?: {
4200
+ id: string;
4201
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4202
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4203
+ createdAt: string;
4204
+ updatedAt: string;
4205
+ type: "MARKET";
4206
+ symbol: string;
4207
+ side: "BUY" | "SELL";
4208
+ reduceOnly: boolean;
4209
+ quantity: string;
4210
+ price: string;
4211
+ filledQuantity: string;
4212
+ error?: string | undefined;
4213
+ errorCode?: string | undefined;
4214
+ filledPrice?: string | undefined;
4215
+ }[] | undefined;
4216
+ } | {
4217
+ id: string;
4218
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4219
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2823
4220
  createdAt: string;
2824
4221
  updatedAt: string;
2825
- }[];
2826
- }>;
2827
- create: (body: HttpTypes.CreateSavedBasketPayload, headers?: ClientHeaders) => Promise<{
2828
- basket: {
2829
- id: string;
2830
- name: string;
4222
+ intent: "ADJUST";
4223
+ orderType: "MARKET";
4224
+ position: {
4225
+ id: string;
4226
+ exposure: Record<string, `-${string}` | `+${string}`>;
4227
+ };
2831
4228
  legs: [{
2832
4229
  symbol: string;
2833
4230
  side: "BUY" | "SELL";
2834
- weight: number;
4231
+ mode: "QUANTITY" | "USD";
4232
+ amount: string;
4233
+ reduceOnly: boolean;
4234
+ id?: string | undefined;
2835
4235
  }, ...{
2836
4236
  symbol: string;
2837
4237
  side: "BUY" | "SELL";
2838
- weight: number;
4238
+ mode: "QUANTITY" | "USD";
4239
+ amount: string;
4240
+ reduceOnly: boolean;
4241
+ id?: string | undefined;
2839
4242
  }[]];
2840
- createdAt: string;
2841
- updatedAt: string;
2842
- };
2843
- }>;
2844
- update: (id: string, body: HttpTypes.UpdateSavedBasketPayload, headers?: ClientHeaders) => Promise<{
2845
- basket: {
2846
- id: string;
2847
- name: string;
2848
- legs: [{
4243
+ error?: string | undefined;
4244
+ orders?: {
4245
+ id: string;
4246
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4247
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4248
+ createdAt: string;
4249
+ updatedAt: string;
4250
+ type: "MARKET";
2849
4251
  symbol: string;
2850
4252
  side: "BUY" | "SELL";
2851
- weight: number;
2852
- }, ...{
4253
+ reduceOnly: boolean;
4254
+ quantity: string;
4255
+ price: string;
4256
+ filledQuantity: string;
4257
+ error?: string | undefined;
4258
+ errorCode?: string | undefined;
4259
+ filledPrice?: string | undefined;
4260
+ }[] | undefined;
4261
+ } | {
4262
+ id: string;
4263
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4264
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
4265
+ createdAt: string;
4266
+ updatedAt: string;
4267
+ intent: "CLOSE";
4268
+ orderType: "MARKET";
4269
+ position: {
4270
+ id: string;
4271
+ exposure: Record<string, `-${string}` | `+${string}`>;
4272
+ };
4273
+ error?: string | undefined;
4274
+ orders?: {
4275
+ id: string;
4276
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4277
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4278
+ createdAt: string;
4279
+ updatedAt: string;
4280
+ type: "MARKET";
2853
4281
  symbol: string;
2854
4282
  side: "BUY" | "SELL";
2855
- weight: number;
2856
- }[]];
4283
+ reduceOnly: boolean;
4284
+ quantity: string;
4285
+ price: string;
4286
+ filledQuantity: string;
4287
+ error?: string | undefined;
4288
+ errorCode?: string | undefined;
4289
+ filledPrice?: string | undefined;
4290
+ }[] | undefined;
4291
+ } | {
4292
+ id: string;
4293
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4294
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2857
4295
  createdAt: string;
2858
4296
  updatedAt: string;
4297
+ intent: "REVERSE";
4298
+ orderType: "MARKET";
4299
+ position: {
4300
+ id: string;
4301
+ exposure: Record<string, `-${string}` | `+${string}`>;
4302
+ };
4303
+ error?: string | undefined;
4304
+ orders?: {
4305
+ id: string;
4306
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4307
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4308
+ createdAt: string;
4309
+ updatedAt: string;
4310
+ type: "MARKET";
4311
+ symbol: string;
4312
+ side: "BUY" | "SELL";
4313
+ reduceOnly: boolean;
4314
+ quantity: string;
4315
+ price: string;
4316
+ filledQuantity: string;
4317
+ error?: string | undefined;
4318
+ errorCode?: string | undefined;
4319
+ filledPrice?: string | undefined;
4320
+ }[] | undefined;
2859
4321
  };
2860
4322
  }>;
2861
- delete: (id: string, headers?: ClientHeaders) => Promise<void>;
2862
- };
2863
- schedules: {
2864
- list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
2865
- limit: number;
2866
- schedules: ({
4323
+ adjust: (positionId: string, body: HttpTypes.CreateTradeAdjust, headers?: ClientHeaders) => Promise<{
4324
+ execution: {
2867
4325
  id: string;
2868
4326
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2869
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2870
- positionKey: string;
2871
- executionType: "MARKET";
2872
- startAt: string;
2873
- endAt: string;
4327
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2874
4328
  createdAt: string;
2875
4329
  updatedAt: string;
2876
- strategy: "TWAP";
2877
4330
  intent: "OPEN";
2878
- sliceIntervalSec: number;
2879
- sliceCount: number;
2880
- randomization: {
2881
- timingJitterBps: number;
2882
- sizeJitterBps: number;
2883
- };
2884
- legs: {
4331
+ orderType: "MARKET";
4332
+ legs: [{
2885
4333
  symbol: string;
2886
4334
  side: "BUY" | "SELL";
2887
- weight: number;
2888
- }[];
2889
- targetNotional: string;
2890
- remainingNotional: string;
2891
- lastSliceAt?: string | undefined;
2892
- cancelledAt?: string | undefined;
2893
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2894
- fills?: {
2895
- id: string;
2896
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2897
- tradeAccountId: string;
4335
+ mode: "QUANTITY" | "USD";
4336
+ amount: string;
4337
+ reduceOnly: boolean;
4338
+ id?: string | undefined;
4339
+ }, ...{
2898
4340
  symbol: string;
2899
- positionId: string;
4341
+ side: "BUY" | "SELL";
4342
+ mode: "QUANTITY" | "USD";
4343
+ amount: string;
4344
+ reduceOnly: boolean;
4345
+ id?: string | undefined;
4346
+ }[]];
4347
+ error?: string | undefined;
4348
+ orders?: {
4349
+ id: string;
2900
4350
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4351
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4352
+ createdAt: string;
4353
+ updatedAt: string;
4354
+ type: "MARKET";
4355
+ symbol: string;
2901
4356
  side: "BUY" | "SELL";
2902
4357
  reduceOnly: boolean;
2903
- isExternal: boolean;
2904
- synthetic: boolean;
2905
4358
  quantity: string;
2906
4359
  price: string;
2907
- usd: string;
2908
- timestamp: string;
2909
- cloid?: string | undefined;
2910
- exchangeFillId?: string | undefined;
2911
- tradeFee?: string | undefined;
2912
- pearFee?: string | undefined;
2913
- original?: {
2914
- exchangeFillId: string;
2915
- quantity: string;
2916
- } | undefined;
4360
+ filledQuantity: string;
4361
+ error?: string | undefined;
4362
+ errorCode?: string | undefined;
4363
+ filledPrice?: string | undefined;
2917
4364
  }[] | undefined;
2918
4365
  } | {
2919
4366
  id: string;
2920
4367
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2921
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2922
- positionKey: string;
2923
- executionType: "MARKET";
2924
- startAt: string;
2925
- endAt: string;
4368
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2926
4369
  createdAt: string;
2927
4370
  updatedAt: string;
2928
- strategy: "TWAP";
2929
- intent: "CLOSE";
2930
- sliceIntervalSec: number;
2931
- sliceCount: number;
2932
- randomization: {
2933
- timingJitterBps: number;
2934
- sizeJitterBps: number;
2935
- };
2936
- positionId: string;
2937
- initialExposure: Record<string, `-${string}` | `+${string}`>;
2938
- lastSliceAt?: string | undefined;
2939
- cancelledAt?: string | undefined;
2940
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2941
- fills?: {
4371
+ intent: "ADJUST";
4372
+ orderType: "MARKET";
4373
+ position: {
2942
4374
  id: string;
2943
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2944
- tradeAccountId: string;
4375
+ exposure: Record<string, `-${string}` | `+${string}`>;
4376
+ };
4377
+ legs: [{
2945
4378
  symbol: string;
2946
- positionId: string;
4379
+ side: "BUY" | "SELL";
4380
+ mode: "QUANTITY" | "USD";
4381
+ amount: string;
4382
+ reduceOnly: boolean;
4383
+ id?: string | undefined;
4384
+ }, ...{
4385
+ symbol: string;
4386
+ side: "BUY" | "SELL";
4387
+ mode: "QUANTITY" | "USD";
4388
+ amount: string;
4389
+ reduceOnly: boolean;
4390
+ id?: string | undefined;
4391
+ }[]];
4392
+ error?: string | undefined;
4393
+ orders?: {
4394
+ id: string;
2947
4395
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4396
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4397
+ createdAt: string;
4398
+ updatedAt: string;
4399
+ type: "MARKET";
4400
+ symbol: string;
2948
4401
  side: "BUY" | "SELL";
2949
4402
  reduceOnly: boolean;
2950
- isExternal: boolean;
2951
- synthetic: boolean;
2952
4403
  quantity: string;
2953
4404
  price: string;
2954
- usd: string;
2955
- timestamp: string;
2956
- cloid?: string | undefined;
2957
- exchangeFillId?: string | undefined;
2958
- tradeFee?: string | undefined;
2959
- pearFee?: string | undefined;
2960
- original?: {
2961
- exchangeFillId: string;
2962
- quantity: string;
2963
- } | undefined;
2964
- }[] | undefined;
2965
- })[];
2966
- nextCursor?: string | undefined;
2967
- }>;
2968
- create: (body: HttpTypes.CreateSchedule, headers?: ClientHeaders) => Promise<{
2969
- schedule: {
4405
+ filledQuantity: string;
4406
+ error?: string | undefined;
4407
+ errorCode?: string | undefined;
4408
+ filledPrice?: string | undefined;
4409
+ }[] | undefined;
4410
+ } | {
2970
4411
  id: string;
2971
4412
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2972
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2973
- positionKey: string;
2974
- executionType: "MARKET";
2975
- startAt: string;
2976
- endAt: string;
4413
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2977
4414
  createdAt: string;
2978
4415
  updatedAt: string;
2979
- strategy: "TWAP";
2980
- intent: "OPEN";
2981
- sliceIntervalSec: number;
2982
- sliceCount: number;
2983
- randomization: {
2984
- timingJitterBps: number;
2985
- sizeJitterBps: number;
4416
+ intent: "CLOSE";
4417
+ orderType: "MARKET";
4418
+ position: {
4419
+ id: string;
4420
+ exposure: Record<string, `-${string}` | `+${string}`>;
2986
4421
  };
2987
- legs: {
2988
- symbol: string;
2989
- side: "BUY" | "SELL";
2990
- weight: number;
2991
- }[];
2992
- targetNotional: string;
2993
- remainingNotional: string;
2994
- lastSliceAt?: string | undefined;
2995
- cancelledAt?: string | undefined;
2996
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
2997
- fills?: {
4422
+ error?: string | undefined;
4423
+ orders?: {
2998
4424
  id: string;
2999
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3000
- tradeAccountId: string;
3001
- symbol: string;
3002
- positionId: string;
3003
4425
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4426
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4427
+ createdAt: string;
4428
+ updatedAt: string;
4429
+ type: "MARKET";
4430
+ symbol: string;
3004
4431
  side: "BUY" | "SELL";
3005
4432
  reduceOnly: boolean;
3006
- isExternal: boolean;
3007
- synthetic: boolean;
3008
4433
  quantity: string;
3009
4434
  price: string;
3010
- usd: string;
3011
- timestamp: string;
3012
- cloid?: string | undefined;
3013
- exchangeFillId?: string | undefined;
3014
- tradeFee?: string | undefined;
3015
- pearFee?: string | undefined;
3016
- original?: {
3017
- exchangeFillId: string;
3018
- quantity: string;
3019
- } | undefined;
4435
+ filledQuantity: string;
4436
+ error?: string | undefined;
4437
+ errorCode?: string | undefined;
4438
+ filledPrice?: string | undefined;
3020
4439
  }[] | undefined;
3021
4440
  } | {
3022
4441
  id: string;
3023
4442
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3024
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3025
- positionKey: string;
3026
- executionType: "MARKET";
3027
- startAt: string;
3028
- endAt: string;
4443
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
3029
4444
  createdAt: string;
3030
4445
  updatedAt: string;
3031
- strategy: "TWAP";
3032
- intent: "CLOSE";
3033
- sliceIntervalSec: number;
3034
- sliceCount: number;
3035
- randomization: {
3036
- timingJitterBps: number;
3037
- sizeJitterBps: number;
4446
+ intent: "REVERSE";
4447
+ orderType: "MARKET";
4448
+ position: {
4449
+ id: string;
4450
+ exposure: Record<string, `-${string}` | `+${string}`>;
3038
4451
  };
3039
- positionId: string;
3040
- initialExposure: Record<string, `-${string}` | `+${string}`>;
3041
- lastSliceAt?: string | undefined;
3042
- cancelledAt?: string | undefined;
3043
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
3044
- fills?: {
4452
+ error?: string | undefined;
4453
+ orders?: {
3045
4454
  id: string;
3046
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3047
- tradeAccountId: string;
3048
- symbol: string;
3049
- positionId: string;
3050
4455
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4456
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4457
+ createdAt: string;
4458
+ updatedAt: string;
4459
+ type: "MARKET";
4460
+ symbol: string;
3051
4461
  side: "BUY" | "SELL";
3052
4462
  reduceOnly: boolean;
3053
- isExternal: boolean;
3054
- synthetic: boolean;
3055
4463
  quantity: string;
3056
4464
  price: string;
3057
- usd: string;
3058
- timestamp: string;
3059
- cloid?: string | undefined;
3060
- exchangeFillId?: string | undefined;
3061
- tradeFee?: string | undefined;
3062
- pearFee?: string | undefined;
3063
- original?: {
3064
- exchangeFillId: string;
3065
- quantity: string;
3066
- } | undefined;
4465
+ filledQuantity: string;
4466
+ error?: string | undefined;
4467
+ errorCode?: string | undefined;
4468
+ filledPrice?: string | undefined;
3067
4469
  }[] | undefined;
3068
4470
  };
3069
4471
  }>;
3070
- cancel: (scheduleId: string, headers?: ClientHeaders) => Promise<{
3071
- id: string;
3072
- }>;
3073
- cancelAll: (headers?: ClientHeaders) => Promise<{
3074
- ids: string[];
3075
- }>;
3076
- };
3077
- sync: {
3078
- fills: {
3079
- since: (body: HttpTypes.SyncFillsSinceRequest, headers?: ClientHeaders) => Promise<{
3080
- sinceMs: number;
3081
- neverSynced: boolean;
3082
- firstSyncStartedAt?: number | undefined;
3083
- confirmedExchangeFillIds?: string[] | undefined;
3084
- }>;
3085
- reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3086
- reconcileBulk: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3087
- confirm: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3088
- confirmBulk: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3089
- create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3090
- createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3091
- };
3092
- funding: {
3093
- since: (body: HttpTypes.SyncFundingSinceRequest, headers?: ClientHeaders) => Promise<{
3094
- sinceMs: number;
3095
- }>;
3096
- create: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3097
- createBulk: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
3098
- };
3099
- };
3100
- trade: {
3101
- open: (body: HttpTypes.CreateTradeOpen, headers?: ClientHeaders) => Promise<{
4472
+ close: (positionId: string, body: HttpTypes.CreateTradeClose, headers?: ClientHeaders) => Promise<{
3102
4473
  execution: {
3103
4474
  id: string;
3104
4475
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3113,12 +4484,14 @@ declare class Core {
3113
4484
  mode: "QUANTITY" | "USD";
3114
4485
  amount: string;
3115
4486
  reduceOnly: boolean;
4487
+ id?: string | undefined;
3116
4488
  }, ...{
3117
4489
  symbol: string;
3118
4490
  side: "BUY" | "SELL";
3119
4491
  mode: "QUANTITY" | "USD";
3120
4492
  amount: string;
3121
4493
  reduceOnly: boolean;
4494
+ id?: string | undefined;
3122
4495
  }[]];
3123
4496
  error?: string | undefined;
3124
4497
  orders?: {
@@ -3156,12 +4529,14 @@ declare class Core {
3156
4529
  mode: "QUANTITY" | "USD";
3157
4530
  amount: string;
3158
4531
  reduceOnly: boolean;
4532
+ id?: string | undefined;
3159
4533
  }, ...{
3160
4534
  symbol: string;
3161
4535
  side: "BUY" | "SELL";
3162
4536
  mode: "QUANTITY" | "USD";
3163
4537
  amount: string;
3164
4538
  reduceOnly: boolean;
4539
+ id?: string | undefined;
3165
4540
  }[]];
3166
4541
  error?: string | undefined;
3167
4542
  orders?: {
@@ -3243,7 +4618,7 @@ declare class Core {
3243
4618
  }[] | undefined;
3244
4619
  };
3245
4620
  }>;
3246
- adjust: (positionId: string, body: HttpTypes.CreateTradeAdjust, headers?: ClientHeaders) => Promise<{
4621
+ reverse: (positionId: string, body: HttpTypes.CreateTradeReverse, headers?: ClientHeaders) => Promise<{
3247
4622
  execution: {
3248
4623
  id: string;
3249
4624
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3258,12 +4633,14 @@ declare class Core {
3258
4633
  mode: "QUANTITY" | "USD";
3259
4634
  amount: string;
3260
4635
  reduceOnly: boolean;
4636
+ id?: string | undefined;
3261
4637
  }, ...{
3262
4638
  symbol: string;
3263
4639
  side: "BUY" | "SELL";
3264
4640
  mode: "QUANTITY" | "USD";
3265
4641
  amount: string;
3266
4642
  reduceOnly: boolean;
4643
+ id?: string | undefined;
3267
4644
  }[]];
3268
4645
  error?: string | undefined;
3269
4646
  orders?: {
@@ -3301,12 +4678,14 @@ declare class Core {
3301
4678
  mode: "QUANTITY" | "USD";
3302
4679
  amount: string;
3303
4680
  reduceOnly: boolean;
4681
+ id?: string | undefined;
3304
4682
  }, ...{
3305
4683
  symbol: string;
3306
4684
  side: "BUY" | "SELL";
3307
4685
  mode: "QUANTITY" | "USD";
3308
4686
  amount: string;
3309
4687
  reduceOnly: boolean;
4688
+ id?: string | undefined;
3310
4689
  }[]];
3311
4690
  error?: string | undefined;
3312
4691
  orders?: {
@@ -3388,8 +4767,8 @@ declare class Core {
3388
4767
  }[] | undefined;
3389
4768
  };
3390
4769
  }>;
3391
- close: (positionId: string, body: HttpTypes.CreateTradeClose, headers?: ClientHeaders) => Promise<{
3392
- execution: {
4770
+ closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<{
4771
+ executions: ({
3393
4772
  id: string;
3394
4773
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3395
4774
  status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
@@ -3403,12 +4782,14 @@ declare class Core {
3403
4782
  mode: "QUANTITY" | "USD";
3404
4783
  amount: string;
3405
4784
  reduceOnly: boolean;
4785
+ id?: string | undefined;
3406
4786
  }, ...{
3407
4787
  symbol: string;
3408
4788
  side: "BUY" | "SELL";
3409
4789
  mode: "QUANTITY" | "USD";
3410
4790
  amount: string;
3411
4791
  reduceOnly: boolean;
4792
+ id?: string | undefined;
3412
4793
  }[]];
3413
4794
  error?: string | undefined;
3414
4795
  orders?: {
@@ -3446,12 +4827,14 @@ declare class Core {
3446
4827
  mode: "QUANTITY" | "USD";
3447
4828
  amount: string;
3448
4829
  reduceOnly: boolean;
4830
+ id?: string | undefined;
3449
4831
  }, ...{
3450
4832
  symbol: string;
3451
4833
  side: "BUY" | "SELL";
3452
4834
  mode: "QUANTITY" | "USD";
3453
4835
  amount: string;
3454
4836
  reduceOnly: boolean;
4837
+ id?: string | undefined;
3455
4838
  }[]];
3456
4839
  error?: string | undefined;
3457
4840
  orders?: {
@@ -3516,319 +4899,1043 @@ declare class Core {
3516
4899
  error?: string | undefined;
3517
4900
  orders?: {
3518
4901
  id: string;
3519
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3520
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3521
- createdAt: string;
3522
- updatedAt: string;
3523
- type: "MARKET";
4902
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4903
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4904
+ createdAt: string;
4905
+ updatedAt: string;
4906
+ type: "MARKET";
4907
+ symbol: string;
4908
+ side: "BUY" | "SELL";
4909
+ reduceOnly: boolean;
4910
+ quantity: string;
4911
+ price: string;
4912
+ filledQuantity: string;
4913
+ error?: string | undefined;
4914
+ errorCode?: string | undefined;
4915
+ filledPrice?: string | undefined;
4916
+ }[] | undefined;
4917
+ })[];
4918
+ }>;
4919
+ setLeverage: (body: HttpTypes.SetLeverage, headers?: ClientHeaders) => Promise<Record<string, never>>;
4920
+ };
4921
+ triggers: {
4922
+ list: (query: HttpTypes.TriggerListParamsInput, headers?: ClientHeaders) => Promise<{
4923
+ limit: number;
4924
+ triggers: ({
4925
+ id: string;
4926
+ tradeAccountId: string;
4927
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4928
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
4929
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
4930
+ createdAt: string;
4931
+ updatedAt: string;
4932
+ intent: "OPEN";
4933
+ type: "MARKET";
4934
+ condition: {
4935
+ type: "ratio";
4936
+ data: {
4937
+ priceSource: "mark" | "mid";
4938
+ symbol_a: string;
4939
+ symbol_b: string;
4940
+ track: "PEAK" | "TROUGH";
4941
+ threshold: number;
4942
+ };
4943
+ } | {
4944
+ type: "price";
4945
+ data: {
4946
+ priceSource: "mark" | "mid";
4947
+ symbol: string;
4948
+ track: "PEAK" | "TROUGH";
4949
+ threshold: number;
4950
+ };
4951
+ } | {
4952
+ type: "weighted_ratio";
4953
+ data: {
4954
+ priceSource: "mark" | "mid";
4955
+ basket: {
4956
+ symbol: string;
4957
+ side: "BUY" | "SELL";
4958
+ weight: number;
4959
+ }[];
4960
+ track: "PEAK" | "TROUGH";
4961
+ threshold: number;
4962
+ };
4963
+ } | {
4964
+ type: "funding_rate";
4965
+ data: {
4966
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4967
+ symbol: string;
4968
+ track: "PEAK" | "TROUGH";
4969
+ threshold: number;
4970
+ };
4971
+ } | {
4972
+ type: "prediction_market";
4973
+ data: {
4974
+ source: "kalshi" | "polymarket";
4975
+ marketKey: string;
4976
+ track: "PEAK" | "TROUGH";
4977
+ threshold: number;
4978
+ };
4979
+ } | {
4980
+ type: "btc_dominance";
4981
+ data: {
4982
+ source: "coingecko";
4983
+ track: "PEAK" | "TROUGH";
4984
+ threshold: number;
4985
+ };
4986
+ };
4987
+ context: {
4988
+ type: "MARKET";
4989
+ legs: [{
4990
+ symbol: string;
4991
+ side: "BUY" | "SELL";
4992
+ mode: "QUANTITY" | "USD";
4993
+ amount: string;
4994
+ id?: string | undefined;
4995
+ }, ...{
4996
+ symbol: string;
4997
+ side: "BUY" | "SELL";
4998
+ mode: "QUANTITY" | "USD";
4999
+ amount: string;
5000
+ id?: string | undefined;
5001
+ }[]];
5002
+ attachedTriggers: {
5003
+ kind: "STATIC" | "TRAILING";
5004
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
5005
+ }[];
5006
+ };
5007
+ ladderId?: string | undefined;
5008
+ ladderIndex?: number | undefined;
5009
+ parentTriggerId?: string | undefined;
5010
+ triggeredAt?: string | undefined;
5011
+ cancelledAt?: string | undefined;
5012
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5013
+ fills?: {
5014
+ id: string;
5015
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5016
+ tradeAccountId: string;
3524
5017
  symbol: string;
5018
+ positionId: string;
5019
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3525
5020
  side: "BUY" | "SELL";
3526
5021
  reduceOnly: boolean;
5022
+ isExternal: boolean;
5023
+ synthetic: boolean;
3527
5024
  quantity: string;
3528
5025
  price: string;
3529
- filledQuantity: string;
3530
- error?: string | undefined;
3531
- errorCode?: string | undefined;
3532
- filledPrice?: string | undefined;
5026
+ usd: string;
5027
+ timestamp: string;
5028
+ cloid?: string | undefined;
5029
+ exchangeFillId?: string | undefined;
5030
+ tradeFee?: string | undefined;
5031
+ pearFee?: string | undefined;
5032
+ original?: {
5033
+ exchangeFillId: string;
5034
+ quantity: string;
5035
+ } | undefined;
3533
5036
  }[] | undefined;
3534
- };
3535
- }>;
3536
- reverse: (positionId: string, body: HttpTypes.CreateTradeReverse, headers?: ClientHeaders) => Promise<{
3537
- execution: {
5037
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5038
+ } | {
3538
5039
  id: string;
5040
+ tradeAccountId: string;
3539
5041
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3540
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5042
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5043
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3541
5044
  createdAt: string;
3542
5045
  updatedAt: string;
3543
- intent: "OPEN";
3544
- orderType: "MARKET";
3545
- legs: [{
3546
- symbol: string;
3547
- side: "BUY" | "SELL";
3548
- mode: "QUANTITY" | "USD";
3549
- amount: string;
3550
- reduceOnly: boolean;
3551
- }, ...{
3552
- symbol: string;
3553
- side: "BUY" | "SELL";
3554
- mode: "QUANTITY" | "USD";
3555
- amount: string;
3556
- reduceOnly: boolean;
3557
- }[]];
3558
- error?: string | undefined;
3559
- orders?: {
3560
- id: string;
3561
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3562
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3563
- createdAt: string;
3564
- updatedAt: string;
5046
+ intent: "ADJUST";
5047
+ type: "MARKET";
5048
+ condition: {
5049
+ type: "ratio";
5050
+ data: {
5051
+ priceSource: "mark" | "mid";
5052
+ symbol_a: string;
5053
+ symbol_b: string;
5054
+ track: "PEAK" | "TROUGH";
5055
+ threshold: number;
5056
+ };
5057
+ } | {
5058
+ type: "price";
5059
+ data: {
5060
+ priceSource: "mark" | "mid";
5061
+ symbol: string;
5062
+ track: "PEAK" | "TROUGH";
5063
+ threshold: number;
5064
+ };
5065
+ } | {
5066
+ type: "weighted_ratio";
5067
+ data: {
5068
+ priceSource: "mark" | "mid";
5069
+ basket: {
5070
+ symbol: string;
5071
+ side: "BUY" | "SELL";
5072
+ weight: number;
5073
+ }[];
5074
+ track: "PEAK" | "TROUGH";
5075
+ threshold: number;
5076
+ };
5077
+ } | {
5078
+ type: "notional";
5079
+ data: {
5080
+ priceSource: "mark" | "mid";
5081
+ track: "PEAK" | "TROUGH";
5082
+ threshold: number;
5083
+ };
5084
+ } | {
5085
+ type: "upnl";
5086
+ data: {
5087
+ priceSource: "mark" | "mid";
5088
+ track: "PEAK" | "TROUGH";
5089
+ threshold: number;
5090
+ };
5091
+ } | {
5092
+ type: "upnl_bps";
5093
+ data: {
5094
+ priceSource: "mark" | "mid";
5095
+ track: "PEAK" | "TROUGH";
5096
+ threshold: number;
5097
+ };
5098
+ } | {
5099
+ type: "funding_rate";
5100
+ data: {
5101
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5102
+ symbol: string;
5103
+ track: "PEAK" | "TROUGH";
5104
+ threshold: number;
5105
+ };
5106
+ } | {
5107
+ type: "prediction_market";
5108
+ data: {
5109
+ source: "kalshi" | "polymarket";
5110
+ marketKey: string;
5111
+ track: "PEAK" | "TROUGH";
5112
+ threshold: number;
5113
+ };
5114
+ } | {
5115
+ type: "btc_dominance";
5116
+ data: {
5117
+ source: "coingecko";
5118
+ track: "PEAK" | "TROUGH";
5119
+ threshold: number;
5120
+ };
5121
+ };
5122
+ context: {
3565
5123
  type: "MARKET";
5124
+ position: {
5125
+ id: string;
5126
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5127
+ };
5128
+ legs: [{
5129
+ symbol: string;
5130
+ side: "BUY" | "SELL";
5131
+ mode: "QUANTITY" | "USD";
5132
+ amount: string;
5133
+ reduceOnly: boolean;
5134
+ id?: string | undefined;
5135
+ }, ...{
5136
+ symbol: string;
5137
+ side: "BUY" | "SELL";
5138
+ mode: "QUANTITY" | "USD";
5139
+ amount: string;
5140
+ reduceOnly: boolean;
5141
+ id?: string | undefined;
5142
+ }[]];
5143
+ };
5144
+ ladderId?: string | undefined;
5145
+ ladderIndex?: number | undefined;
5146
+ parentTriggerId?: string | undefined;
5147
+ triggeredAt?: string | undefined;
5148
+ cancelledAt?: string | undefined;
5149
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5150
+ fills?: {
5151
+ id: string;
5152
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5153
+ tradeAccountId: string;
3566
5154
  symbol: string;
5155
+ positionId: string;
5156
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3567
5157
  side: "BUY" | "SELL";
3568
5158
  reduceOnly: boolean;
5159
+ isExternal: boolean;
5160
+ synthetic: boolean;
3569
5161
  quantity: string;
3570
5162
  price: string;
3571
- filledQuantity: string;
3572
- error?: string | undefined;
3573
- errorCode?: string | undefined;
3574
- filledPrice?: string | undefined;
5163
+ usd: string;
5164
+ timestamp: string;
5165
+ cloid?: string | undefined;
5166
+ exchangeFillId?: string | undefined;
5167
+ tradeFee?: string | undefined;
5168
+ pearFee?: string | undefined;
5169
+ original?: {
5170
+ exchangeFillId: string;
5171
+ quantity: string;
5172
+ } | undefined;
3575
5173
  }[] | undefined;
5174
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5175
+ trailing?: {
5176
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5177
+ deltaValue: number;
5178
+ activationValue?: number | undefined;
5179
+ bestMetricSeen?: number | undefined;
5180
+ currentStopValue?: number | undefined;
5181
+ stopBreachedAt?: number | undefined;
5182
+ } | undefined;
3576
5183
  } | {
3577
5184
  id: string;
5185
+ tradeAccountId: string;
3578
5186
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3579
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5187
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5188
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3580
5189
  createdAt: string;
3581
5190
  updatedAt: string;
3582
- intent: "ADJUST";
3583
- orderType: "MARKET";
3584
- position: {
3585
- id: string;
3586
- exposure: Record<string, `-${string}` | `+${string}`>;
5191
+ intent: "CLOSE";
5192
+ type: "MARKET";
5193
+ condition: {
5194
+ type: "ratio";
5195
+ data: {
5196
+ priceSource: "mark" | "mid";
5197
+ symbol_a: string;
5198
+ symbol_b: string;
5199
+ track: "PEAK" | "TROUGH";
5200
+ threshold: number;
5201
+ };
5202
+ } | {
5203
+ type: "price";
5204
+ data: {
5205
+ priceSource: "mark" | "mid";
5206
+ symbol: string;
5207
+ track: "PEAK" | "TROUGH";
5208
+ threshold: number;
5209
+ };
5210
+ } | {
5211
+ type: "weighted_ratio";
5212
+ data: {
5213
+ priceSource: "mark" | "mid";
5214
+ basket: {
5215
+ symbol: string;
5216
+ side: "BUY" | "SELL";
5217
+ weight: number;
5218
+ }[];
5219
+ track: "PEAK" | "TROUGH";
5220
+ threshold: number;
5221
+ };
5222
+ } | {
5223
+ type: "notional";
5224
+ data: {
5225
+ priceSource: "mark" | "mid";
5226
+ track: "PEAK" | "TROUGH";
5227
+ threshold: number;
5228
+ };
5229
+ } | {
5230
+ type: "upnl";
5231
+ data: {
5232
+ priceSource: "mark" | "mid";
5233
+ track: "PEAK" | "TROUGH";
5234
+ threshold: number;
5235
+ };
5236
+ } | {
5237
+ type: "upnl_bps";
5238
+ data: {
5239
+ priceSource: "mark" | "mid";
5240
+ track: "PEAK" | "TROUGH";
5241
+ threshold: number;
5242
+ };
5243
+ } | {
5244
+ type: "ratio_trailing";
5245
+ data: {
5246
+ priceSource: "mark" | "mid";
5247
+ symbol_a: string;
5248
+ symbol_b: string;
5249
+ };
5250
+ } | {
5251
+ type: "price_trailing";
5252
+ data: {
5253
+ priceSource: "mark" | "mid";
5254
+ symbol: string;
5255
+ };
5256
+ } | {
5257
+ type: "weighted_ratio_trailing";
5258
+ data: {
5259
+ priceSource: "mark" | "mid";
5260
+ basket: {
5261
+ symbol: string;
5262
+ side: "BUY" | "SELL";
5263
+ weight: number;
5264
+ }[];
5265
+ };
5266
+ } | {
5267
+ type: "notional_trailing";
5268
+ data: {
5269
+ priceSource: "mark" | "mid";
5270
+ };
5271
+ } | {
5272
+ type: "upnl_trailing";
5273
+ data: {
5274
+ priceSource: "mark" | "mid";
5275
+ };
5276
+ } | {
5277
+ type: "upnl_bps_trailing";
5278
+ data: {
5279
+ priceSource: "mark" | "mid";
5280
+ };
5281
+ } | {
5282
+ type: "funding_rate";
5283
+ data: {
5284
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5285
+ symbol: string;
5286
+ track: "PEAK" | "TROUGH";
5287
+ threshold: number;
5288
+ };
5289
+ } | {
5290
+ type: "prediction_market";
5291
+ data: {
5292
+ source: "kalshi" | "polymarket";
5293
+ marketKey: string;
5294
+ track: "PEAK" | "TROUGH";
5295
+ threshold: number;
5296
+ };
5297
+ } | {
5298
+ type: "btc_dominance";
5299
+ data: {
5300
+ source: "coingecko";
5301
+ track: "PEAK" | "TROUGH";
5302
+ threshold: number;
5303
+ };
3587
5304
  };
3588
- legs: [{
3589
- symbol: string;
3590
- side: "BUY" | "SELL";
3591
- mode: "QUANTITY" | "USD";
3592
- amount: string;
3593
- reduceOnly: boolean;
3594
- }, ...{
3595
- symbol: string;
3596
- side: "BUY" | "SELL";
3597
- mode: "QUANTITY" | "USD";
3598
- amount: string;
3599
- reduceOnly: boolean;
3600
- }[]];
3601
- error?: string | undefined;
3602
- orders?: {
3603
- id: string;
3604
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3605
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3606
- createdAt: string;
3607
- updatedAt: string;
5305
+ context: {
3608
5306
  type: "MARKET";
3609
- symbol: string;
3610
- side: "BUY" | "SELL";
3611
- reduceOnly: boolean;
3612
- quantity: string;
3613
- price: string;
3614
- filledQuantity: string;
3615
- error?: string | undefined;
3616
- errorCode?: string | undefined;
3617
- filledPrice?: string | undefined;
3618
- }[] | undefined;
3619
- } | {
3620
- id: string;
3621
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3622
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
3623
- createdAt: string;
3624
- updatedAt: string;
3625
- intent: "CLOSE";
3626
- orderType: "MARKET";
3627
- position: {
3628
- id: string;
3629
- exposure: Record<string, `-${string}` | `+${string}`>;
5307
+ position: {
5308
+ id: string;
5309
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5310
+ };
3630
5311
  };
3631
- error?: string | undefined;
3632
- orders?: {
5312
+ ladderId?: string | undefined;
5313
+ ladderIndex?: number | undefined;
5314
+ parentTriggerId?: string | undefined;
5315
+ triggeredAt?: string | undefined;
5316
+ cancelledAt?: string | undefined;
5317
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5318
+ fills?: {
3633
5319
  id: string;
3634
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3635
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3636
- createdAt: string;
3637
- updatedAt: string;
3638
- type: "MARKET";
5320
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5321
+ tradeAccountId: string;
3639
5322
  symbol: string;
5323
+ positionId: string;
5324
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3640
5325
  side: "BUY" | "SELL";
3641
5326
  reduceOnly: boolean;
5327
+ isExternal: boolean;
5328
+ synthetic: boolean;
3642
5329
  quantity: string;
3643
5330
  price: string;
3644
- filledQuantity: string;
3645
- error?: string | undefined;
3646
- errorCode?: string | undefined;
3647
- filledPrice?: string | undefined;
5331
+ usd: string;
5332
+ timestamp: string;
5333
+ cloid?: string | undefined;
5334
+ exchangeFillId?: string | undefined;
5335
+ tradeFee?: string | undefined;
5336
+ pearFee?: string | undefined;
5337
+ original?: {
5338
+ exchangeFillId: string;
5339
+ quantity: string;
5340
+ } | undefined;
3648
5341
  }[] | undefined;
5342
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5343
+ trailing?: {
5344
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5345
+ deltaValue: number;
5346
+ activationValue?: number | undefined;
5347
+ bestMetricSeen?: number | undefined;
5348
+ currentStopValue?: number | undefined;
5349
+ stopBreachedAt?: number | undefined;
5350
+ } | undefined;
3649
5351
  } | {
3650
5352
  id: string;
5353
+ tradeAccountId: string;
3651
5354
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3652
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5355
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5356
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3653
5357
  createdAt: string;
3654
5358
  updatedAt: string;
3655
- intent: "REVERSE";
3656
- orderType: "MARKET";
3657
- position: {
3658
- id: string;
3659
- exposure: Record<string, `-${string}` | `+${string}`>;
5359
+ intent: "ADJUST";
5360
+ type: "TWAP";
5361
+ condition: {
5362
+ type: "ratio";
5363
+ data: {
5364
+ priceSource: "mark" | "mid";
5365
+ symbol_a: string;
5366
+ symbol_b: string;
5367
+ track: "PEAK" | "TROUGH";
5368
+ threshold: number;
5369
+ };
5370
+ } | {
5371
+ type: "price";
5372
+ data: {
5373
+ priceSource: "mark" | "mid";
5374
+ symbol: string;
5375
+ track: "PEAK" | "TROUGH";
5376
+ threshold: number;
5377
+ };
5378
+ } | {
5379
+ type: "weighted_ratio";
5380
+ data: {
5381
+ priceSource: "mark" | "mid";
5382
+ basket: {
5383
+ symbol: string;
5384
+ side: "BUY" | "SELL";
5385
+ weight: number;
5386
+ }[];
5387
+ track: "PEAK" | "TROUGH";
5388
+ threshold: number;
5389
+ };
5390
+ } | {
5391
+ type: "notional";
5392
+ data: {
5393
+ priceSource: "mark" | "mid";
5394
+ track: "PEAK" | "TROUGH";
5395
+ threshold: number;
5396
+ };
5397
+ } | {
5398
+ type: "upnl";
5399
+ data: {
5400
+ priceSource: "mark" | "mid";
5401
+ track: "PEAK" | "TROUGH";
5402
+ threshold: number;
5403
+ };
5404
+ } | {
5405
+ type: "upnl_bps";
5406
+ data: {
5407
+ priceSource: "mark" | "mid";
5408
+ track: "PEAK" | "TROUGH";
5409
+ threshold: number;
5410
+ };
5411
+ } | {
5412
+ type: "funding_rate";
5413
+ data: {
5414
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5415
+ symbol: string;
5416
+ track: "PEAK" | "TROUGH";
5417
+ threshold: number;
5418
+ };
5419
+ } | {
5420
+ type: "prediction_market";
5421
+ data: {
5422
+ source: "kalshi" | "polymarket";
5423
+ marketKey: string;
5424
+ track: "PEAK" | "TROUGH";
5425
+ threshold: number;
5426
+ };
5427
+ } | {
5428
+ type: "btc_dominance";
5429
+ data: {
5430
+ source: "coingecko";
5431
+ track: "PEAK" | "TROUGH";
5432
+ threshold: number;
5433
+ };
3660
5434
  };
3661
- error?: string | undefined;
3662
- orders?: {
5435
+ context: {
5436
+ type: "TWAP";
5437
+ durationSec: number;
5438
+ sliceIntervalSec: number;
5439
+ randomization: {
5440
+ timingJitterBps: number;
5441
+ sizeJitterBps: number;
5442
+ };
5443
+ position: {
5444
+ id: string;
5445
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5446
+ };
5447
+ legs: [{
5448
+ symbol: string;
5449
+ side: "BUY" | "SELL";
5450
+ weight: number;
5451
+ id?: string | undefined;
5452
+ }, ...{
5453
+ symbol: string;
5454
+ side: "BUY" | "SELL";
5455
+ weight: number;
5456
+ id?: string | undefined;
5457
+ }[]];
5458
+ targetNotional: string;
5459
+ };
5460
+ ladderId?: string | undefined;
5461
+ ladderIndex?: number | undefined;
5462
+ parentTriggerId?: string | undefined;
5463
+ triggeredAt?: string | undefined;
5464
+ cancelledAt?: string | undefined;
5465
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5466
+ fills?: {
3663
5467
  id: string;
3664
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3665
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3666
- createdAt: string;
3667
- updatedAt: string;
3668
- type: "MARKET";
3669
- symbol: string;
3670
- side: "BUY" | "SELL";
3671
- reduceOnly: boolean;
3672
- quantity: string;
3673
- price: string;
3674
- filledQuantity: string;
3675
- error?: string | undefined;
3676
- errorCode?: string | undefined;
3677
- filledPrice?: string | undefined;
3678
- }[] | undefined;
3679
- };
3680
- }>;
3681
- closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<{
3682
- executions: ({
3683
- id: string;
3684
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3685
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
3686
- createdAt: string;
3687
- updatedAt: string;
3688
- intent: "OPEN";
3689
- orderType: "MARKET";
3690
- legs: [{
3691
- symbol: string;
3692
- side: "BUY" | "SELL";
3693
- mode: "QUANTITY" | "USD";
3694
- amount: string;
3695
- reduceOnly: boolean;
3696
- }, ...{
5468
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5469
+ tradeAccountId: string;
3697
5470
  symbol: string;
3698
- side: "BUY" | "SELL";
3699
- mode: "QUANTITY" | "USD";
3700
- amount: string;
3701
- reduceOnly: boolean;
3702
- }[]];
3703
- error?: string | undefined;
3704
- orders?: {
3705
- id: string;
5471
+ positionId: string;
3706
5472
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3707
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3708
- createdAt: string;
3709
- updatedAt: string;
3710
- type: "MARKET";
3711
- symbol: string;
3712
5473
  side: "BUY" | "SELL";
3713
5474
  reduceOnly: boolean;
5475
+ isExternal: boolean;
5476
+ synthetic: boolean;
3714
5477
  quantity: string;
3715
5478
  price: string;
3716
- filledQuantity: string;
3717
- error?: string | undefined;
3718
- errorCode?: string | undefined;
3719
- filledPrice?: string | undefined;
5479
+ usd: string;
5480
+ timestamp: string;
5481
+ cloid?: string | undefined;
5482
+ exchangeFillId?: string | undefined;
5483
+ tradeFee?: string | undefined;
5484
+ pearFee?: string | undefined;
5485
+ original?: {
5486
+ exchangeFillId: string;
5487
+ quantity: string;
5488
+ } | undefined;
3720
5489
  }[] | undefined;
5490
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5491
+ scheduleId?: string | undefined;
5492
+ trailing?: {
5493
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5494
+ deltaValue: number;
5495
+ activationValue?: number | undefined;
5496
+ bestMetricSeen?: number | undefined;
5497
+ currentStopValue?: number | undefined;
5498
+ stopBreachedAt?: number | undefined;
5499
+ } | undefined;
3721
5500
  } | {
3722
5501
  id: string;
5502
+ tradeAccountId: string;
3723
5503
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3724
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5504
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5505
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3725
5506
  createdAt: string;
3726
5507
  updatedAt: string;
3727
- intent: "ADJUST";
3728
- orderType: "MARKET";
3729
- position: {
3730
- id: string;
3731
- exposure: Record<string, `-${string}` | `+${string}`>;
5508
+ intent: "CLOSE";
5509
+ type: "TWAP";
5510
+ condition: {
5511
+ type: "ratio";
5512
+ data: {
5513
+ priceSource: "mark" | "mid";
5514
+ symbol_a: string;
5515
+ symbol_b: string;
5516
+ track: "PEAK" | "TROUGH";
5517
+ threshold: number;
5518
+ };
5519
+ } | {
5520
+ type: "price";
5521
+ data: {
5522
+ priceSource: "mark" | "mid";
5523
+ symbol: string;
5524
+ track: "PEAK" | "TROUGH";
5525
+ threshold: number;
5526
+ };
5527
+ } | {
5528
+ type: "weighted_ratio";
5529
+ data: {
5530
+ priceSource: "mark" | "mid";
5531
+ basket: {
5532
+ symbol: string;
5533
+ side: "BUY" | "SELL";
5534
+ weight: number;
5535
+ }[];
5536
+ track: "PEAK" | "TROUGH";
5537
+ threshold: number;
5538
+ };
5539
+ } | {
5540
+ type: "notional";
5541
+ data: {
5542
+ priceSource: "mark" | "mid";
5543
+ track: "PEAK" | "TROUGH";
5544
+ threshold: number;
5545
+ };
5546
+ } | {
5547
+ type: "upnl";
5548
+ data: {
5549
+ priceSource: "mark" | "mid";
5550
+ track: "PEAK" | "TROUGH";
5551
+ threshold: number;
5552
+ };
5553
+ } | {
5554
+ type: "upnl_bps";
5555
+ data: {
5556
+ priceSource: "mark" | "mid";
5557
+ track: "PEAK" | "TROUGH";
5558
+ threshold: number;
5559
+ };
5560
+ } | {
5561
+ type: "ratio_trailing";
5562
+ data: {
5563
+ priceSource: "mark" | "mid";
5564
+ symbol_a: string;
5565
+ symbol_b: string;
5566
+ };
5567
+ } | {
5568
+ type: "price_trailing";
5569
+ data: {
5570
+ priceSource: "mark" | "mid";
5571
+ symbol: string;
5572
+ };
5573
+ } | {
5574
+ type: "weighted_ratio_trailing";
5575
+ data: {
5576
+ priceSource: "mark" | "mid";
5577
+ basket: {
5578
+ symbol: string;
5579
+ side: "BUY" | "SELL";
5580
+ weight: number;
5581
+ }[];
5582
+ };
5583
+ } | {
5584
+ type: "notional_trailing";
5585
+ data: {
5586
+ priceSource: "mark" | "mid";
5587
+ };
5588
+ } | {
5589
+ type: "upnl_trailing";
5590
+ data: {
5591
+ priceSource: "mark" | "mid";
5592
+ };
5593
+ } | {
5594
+ type: "upnl_bps_trailing";
5595
+ data: {
5596
+ priceSource: "mark" | "mid";
5597
+ };
5598
+ } | {
5599
+ type: "funding_rate";
5600
+ data: {
5601
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5602
+ symbol: string;
5603
+ track: "PEAK" | "TROUGH";
5604
+ threshold: number;
5605
+ };
5606
+ } | {
5607
+ type: "prediction_market";
5608
+ data: {
5609
+ source: "kalshi" | "polymarket";
5610
+ marketKey: string;
5611
+ track: "PEAK" | "TROUGH";
5612
+ threshold: number;
5613
+ };
5614
+ } | {
5615
+ type: "btc_dominance";
5616
+ data: {
5617
+ source: "coingecko";
5618
+ track: "PEAK" | "TROUGH";
5619
+ threshold: number;
5620
+ };
3732
5621
  };
3733
- legs: [{
3734
- symbol: string;
3735
- side: "BUY" | "SELL";
3736
- mode: "QUANTITY" | "USD";
3737
- amount: string;
3738
- reduceOnly: boolean;
3739
- }, ...{
3740
- symbol: string;
3741
- side: "BUY" | "SELL";
3742
- mode: "QUANTITY" | "USD";
3743
- amount: string;
3744
- reduceOnly: boolean;
3745
- }[]];
3746
- error?: string | undefined;
3747
- orders?: {
5622
+ context: {
5623
+ type: "TWAP";
5624
+ durationSec: number;
5625
+ sliceIntervalSec: number;
5626
+ randomization: {
5627
+ timingJitterBps: number;
5628
+ sizeJitterBps: number;
5629
+ };
5630
+ position: {
5631
+ id: string;
5632
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5633
+ };
5634
+ };
5635
+ ladderId?: string | undefined;
5636
+ ladderIndex?: number | undefined;
5637
+ parentTriggerId?: string | undefined;
5638
+ triggeredAt?: string | undefined;
5639
+ cancelledAt?: string | undefined;
5640
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5641
+ fills?: {
3748
5642
  id: string;
3749
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3750
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3751
- createdAt: string;
3752
- updatedAt: string;
3753
- type: "MARKET";
5643
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5644
+ tradeAccountId: string;
3754
5645
  symbol: string;
5646
+ positionId: string;
5647
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3755
5648
  side: "BUY" | "SELL";
3756
5649
  reduceOnly: boolean;
5650
+ isExternal: boolean;
5651
+ synthetic: boolean;
3757
5652
  quantity: string;
3758
5653
  price: string;
3759
- filledQuantity: string;
3760
- error?: string | undefined;
3761
- errorCode?: string | undefined;
3762
- filledPrice?: string | undefined;
5654
+ usd: string;
5655
+ timestamp: string;
5656
+ cloid?: string | undefined;
5657
+ exchangeFillId?: string | undefined;
5658
+ tradeFee?: string | undefined;
5659
+ pearFee?: string | undefined;
5660
+ original?: {
5661
+ exchangeFillId: string;
5662
+ quantity: string;
5663
+ } | undefined;
3763
5664
  }[] | undefined;
3764
- } | {
5665
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5666
+ scheduleId?: string | undefined;
5667
+ trailing?: {
5668
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5669
+ deltaValue: number;
5670
+ activationValue?: number | undefined;
5671
+ bestMetricSeen?: number | undefined;
5672
+ currentStopValue?: number | undefined;
5673
+ stopBreachedAt?: number | undefined;
5674
+ } | undefined;
5675
+ })[];
5676
+ nextCursor?: string | undefined;
5677
+ }>;
5678
+ open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
5679
+ trigger: {
3765
5680
  id: string;
5681
+ tradeAccountId: string;
3766
5682
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3767
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5683
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5684
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3768
5685
  createdAt: string;
3769
5686
  updatedAt: string;
3770
- intent: "CLOSE";
3771
- orderType: "MARKET";
3772
- position: {
3773
- id: string;
3774
- exposure: Record<string, `-${string}` | `+${string}`>;
5687
+ intent: "OPEN";
5688
+ type: "MARKET";
5689
+ condition: {
5690
+ type: "ratio";
5691
+ data: {
5692
+ priceSource: "mark" | "mid";
5693
+ symbol_a: string;
5694
+ symbol_b: string;
5695
+ track: "PEAK" | "TROUGH";
5696
+ threshold: number;
5697
+ };
5698
+ } | {
5699
+ type: "price";
5700
+ data: {
5701
+ priceSource: "mark" | "mid";
5702
+ symbol: string;
5703
+ track: "PEAK" | "TROUGH";
5704
+ threshold: number;
5705
+ };
5706
+ } | {
5707
+ type: "weighted_ratio";
5708
+ data: {
5709
+ priceSource: "mark" | "mid";
5710
+ basket: {
5711
+ symbol: string;
5712
+ side: "BUY" | "SELL";
5713
+ weight: number;
5714
+ }[];
5715
+ track: "PEAK" | "TROUGH";
5716
+ threshold: number;
5717
+ };
5718
+ } | {
5719
+ type: "funding_rate";
5720
+ data: {
5721
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5722
+ symbol: string;
5723
+ track: "PEAK" | "TROUGH";
5724
+ threshold: number;
5725
+ };
5726
+ } | {
5727
+ type: "prediction_market";
5728
+ data: {
5729
+ source: "kalshi" | "polymarket";
5730
+ marketKey: string;
5731
+ track: "PEAK" | "TROUGH";
5732
+ threshold: number;
5733
+ };
5734
+ } | {
5735
+ type: "btc_dominance";
5736
+ data: {
5737
+ source: "coingecko";
5738
+ track: "PEAK" | "TROUGH";
5739
+ threshold: number;
5740
+ };
3775
5741
  };
3776
- error?: string | undefined;
3777
- orders?: {
3778
- id: string;
3779
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3780
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3781
- createdAt: string;
3782
- updatedAt: string;
5742
+ context: {
3783
5743
  type: "MARKET";
5744
+ legs: [{
5745
+ symbol: string;
5746
+ side: "BUY" | "SELL";
5747
+ mode: "QUANTITY" | "USD";
5748
+ amount: string;
5749
+ id?: string | undefined;
5750
+ }, ...{
5751
+ symbol: string;
5752
+ side: "BUY" | "SELL";
5753
+ mode: "QUANTITY" | "USD";
5754
+ amount: string;
5755
+ id?: string | undefined;
5756
+ }[]];
5757
+ attachedTriggers: {
5758
+ kind: "STATIC" | "TRAILING";
5759
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
5760
+ }[];
5761
+ };
5762
+ ladderId?: string | undefined;
5763
+ ladderIndex?: number | undefined;
5764
+ parentTriggerId?: string | undefined;
5765
+ triggeredAt?: string | undefined;
5766
+ cancelledAt?: string | undefined;
5767
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5768
+ fills?: {
5769
+ id: string;
5770
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5771
+ tradeAccountId: string;
3784
5772
  symbol: string;
5773
+ positionId: string;
5774
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3785
5775
  side: "BUY" | "SELL";
3786
5776
  reduceOnly: boolean;
5777
+ isExternal: boolean;
5778
+ synthetic: boolean;
3787
5779
  quantity: string;
3788
5780
  price: string;
3789
- filledQuantity: string;
3790
- error?: string | undefined;
3791
- errorCode?: string | undefined;
3792
- filledPrice?: string | undefined;
5781
+ usd: string;
5782
+ timestamp: string;
5783
+ cloid?: string | undefined;
5784
+ exchangeFillId?: string | undefined;
5785
+ tradeFee?: string | undefined;
5786
+ pearFee?: string | undefined;
5787
+ original?: {
5788
+ exchangeFillId: string;
5789
+ quantity: string;
5790
+ } | undefined;
3793
5791
  }[] | undefined;
5792
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
3794
5793
  } | {
3795
5794
  id: string;
5795
+ tradeAccountId: string;
3796
5796
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3797
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5797
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5798
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3798
5799
  createdAt: string;
3799
5800
  updatedAt: string;
3800
- intent: "REVERSE";
3801
- orderType: "MARKET";
3802
- position: {
3803
- id: string;
3804
- exposure: Record<string, `-${string}` | `+${string}`>;
5801
+ intent: "ADJUST";
5802
+ type: "MARKET";
5803
+ condition: {
5804
+ type: "ratio";
5805
+ data: {
5806
+ priceSource: "mark" | "mid";
5807
+ symbol_a: string;
5808
+ symbol_b: string;
5809
+ track: "PEAK" | "TROUGH";
5810
+ threshold: number;
5811
+ };
5812
+ } | {
5813
+ type: "price";
5814
+ data: {
5815
+ priceSource: "mark" | "mid";
5816
+ symbol: string;
5817
+ track: "PEAK" | "TROUGH";
5818
+ threshold: number;
5819
+ };
5820
+ } | {
5821
+ type: "weighted_ratio";
5822
+ data: {
5823
+ priceSource: "mark" | "mid";
5824
+ basket: {
5825
+ symbol: string;
5826
+ side: "BUY" | "SELL";
5827
+ weight: number;
5828
+ }[];
5829
+ track: "PEAK" | "TROUGH";
5830
+ threshold: number;
5831
+ };
5832
+ } | {
5833
+ type: "notional";
5834
+ data: {
5835
+ priceSource: "mark" | "mid";
5836
+ track: "PEAK" | "TROUGH";
5837
+ threshold: number;
5838
+ };
5839
+ } | {
5840
+ type: "upnl";
5841
+ data: {
5842
+ priceSource: "mark" | "mid";
5843
+ track: "PEAK" | "TROUGH";
5844
+ threshold: number;
5845
+ };
5846
+ } | {
5847
+ type: "upnl_bps";
5848
+ data: {
5849
+ priceSource: "mark" | "mid";
5850
+ track: "PEAK" | "TROUGH";
5851
+ threshold: number;
5852
+ };
5853
+ } | {
5854
+ type: "funding_rate";
5855
+ data: {
5856
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5857
+ symbol: string;
5858
+ track: "PEAK" | "TROUGH";
5859
+ threshold: number;
5860
+ };
5861
+ } | {
5862
+ type: "prediction_market";
5863
+ data: {
5864
+ source: "kalshi" | "polymarket";
5865
+ marketKey: string;
5866
+ track: "PEAK" | "TROUGH";
5867
+ threshold: number;
5868
+ };
5869
+ } | {
5870
+ type: "btc_dominance";
5871
+ data: {
5872
+ source: "coingecko";
5873
+ track: "PEAK" | "TROUGH";
5874
+ threshold: number;
5875
+ };
3805
5876
  };
3806
- error?: string | undefined;
3807
- orders?: {
3808
- id: string;
3809
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3810
- status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
3811
- createdAt: string;
3812
- updatedAt: string;
5877
+ context: {
3813
5878
  type: "MARKET";
5879
+ position: {
5880
+ id: string;
5881
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5882
+ };
5883
+ legs: [{
5884
+ symbol: string;
5885
+ side: "BUY" | "SELL";
5886
+ mode: "QUANTITY" | "USD";
5887
+ amount: string;
5888
+ reduceOnly: boolean;
5889
+ id?: string | undefined;
5890
+ }, ...{
5891
+ symbol: string;
5892
+ side: "BUY" | "SELL";
5893
+ mode: "QUANTITY" | "USD";
5894
+ amount: string;
5895
+ reduceOnly: boolean;
5896
+ id?: string | undefined;
5897
+ }[]];
5898
+ };
5899
+ ladderId?: string | undefined;
5900
+ ladderIndex?: number | undefined;
5901
+ parentTriggerId?: string | undefined;
5902
+ triggeredAt?: string | undefined;
5903
+ cancelledAt?: string | undefined;
5904
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5905
+ fills?: {
5906
+ id: string;
5907
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5908
+ tradeAccountId: string;
3814
5909
  symbol: string;
5910
+ positionId: string;
5911
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3815
5912
  side: "BUY" | "SELL";
3816
5913
  reduceOnly: boolean;
5914
+ isExternal: boolean;
5915
+ synthetic: boolean;
3817
5916
  quantity: string;
3818
5917
  price: string;
3819
- filledQuantity: string;
3820
- error?: string | undefined;
3821
- errorCode?: string | undefined;
3822
- filledPrice?: string | undefined;
5918
+ usd: string;
5919
+ timestamp: string;
5920
+ cloid?: string | undefined;
5921
+ exchangeFillId?: string | undefined;
5922
+ tradeFee?: string | undefined;
5923
+ pearFee?: string | undefined;
5924
+ original?: {
5925
+ exchangeFillId: string;
5926
+ quantity: string;
5927
+ } | undefined;
3823
5928
  }[] | undefined;
3824
- })[];
3825
- }>;
3826
- setLeverage: (body: HttpTypes.SetLeverage, headers?: ClientHeaders) => Promise<Record<string, never>>;
3827
- };
3828
- triggers: {
3829
- list: (query: HttpTypes.TriggerListParamsInput, headers?: ClientHeaders) => Promise<{
3830
- limit: number;
3831
- triggers: ({
5929
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5930
+ trailing?: {
5931
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5932
+ deltaValue: number;
5933
+ activationValue?: number | undefined;
5934
+ bestMetricSeen?: number | undefined;
5935
+ currentStopValue?: number | undefined;
5936
+ stopBreachedAt?: number | undefined;
5937
+ } | undefined;
5938
+ } | {
3832
5939
  id: string;
3833
5940
  tradeAccountId: string;
3834
5941
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3836,7 +5943,7 @@ declare class Core {
3836
5943
  bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3837
5944
  createdAt: string;
3838
5945
  updatedAt: string;
3839
- intent: "OPEN";
5946
+ intent: "CLOSE";
3840
5947
  type: "MARKET";
3841
5948
  condition: {
3842
5949
  type: "ratio";
@@ -3867,6 +5974,65 @@ declare class Core {
3867
5974
  track: "PEAK" | "TROUGH";
3868
5975
  threshold: number;
3869
5976
  };
5977
+ } | {
5978
+ type: "notional";
5979
+ data: {
5980
+ priceSource: "mark" | "mid";
5981
+ track: "PEAK" | "TROUGH";
5982
+ threshold: number;
5983
+ };
5984
+ } | {
5985
+ type: "upnl";
5986
+ data: {
5987
+ priceSource: "mark" | "mid";
5988
+ track: "PEAK" | "TROUGH";
5989
+ threshold: number;
5990
+ };
5991
+ } | {
5992
+ type: "upnl_bps";
5993
+ data: {
5994
+ priceSource: "mark" | "mid";
5995
+ track: "PEAK" | "TROUGH";
5996
+ threshold: number;
5997
+ };
5998
+ } | {
5999
+ type: "ratio_trailing";
6000
+ data: {
6001
+ priceSource: "mark" | "mid";
6002
+ symbol_a: string;
6003
+ symbol_b: string;
6004
+ };
6005
+ } | {
6006
+ type: "price_trailing";
6007
+ data: {
6008
+ priceSource: "mark" | "mid";
6009
+ symbol: string;
6010
+ };
6011
+ } | {
6012
+ type: "weighted_ratio_trailing";
6013
+ data: {
6014
+ priceSource: "mark" | "mid";
6015
+ basket: {
6016
+ symbol: string;
6017
+ side: "BUY" | "SELL";
6018
+ weight: number;
6019
+ }[];
6020
+ };
6021
+ } | {
6022
+ type: "notional_trailing";
6023
+ data: {
6024
+ priceSource: "mark" | "mid";
6025
+ };
6026
+ } | {
6027
+ type: "upnl_trailing";
6028
+ data: {
6029
+ priceSource: "mark" | "mid";
6030
+ };
6031
+ } | {
6032
+ type: "upnl_bps_trailing";
6033
+ data: {
6034
+ priceSource: "mark" | "mid";
6035
+ };
3870
6036
  } | {
3871
6037
  type: "funding_rate";
3872
6038
  data: {
@@ -3893,21 +6059,10 @@ declare class Core {
3893
6059
  };
3894
6060
  context: {
3895
6061
  type: "MARKET";
3896
- legs: [{
3897
- symbol: string;
3898
- side: "BUY" | "SELL";
3899
- mode: "QUANTITY" | "USD";
3900
- amount: string;
3901
- }, ...{
3902
- symbol: string;
3903
- side: "BUY" | "SELL";
3904
- mode: "QUANTITY" | "USD";
3905
- amount: string;
3906
- }[]];
3907
- attachedTriggers: {
3908
- kind: "STATIC" | "TRAILING";
3909
- bracketType: "STOP_LOSS" | "TAKE_PROFIT";
3910
- }[];
6062
+ position: {
6063
+ id: string;
6064
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
6065
+ };
3911
6066
  };
3912
6067
  ladderId?: string | undefined;
3913
6068
  ladderIndex?: number | undefined;
@@ -3940,6 +6095,14 @@ declare class Core {
3940
6095
  } | undefined;
3941
6096
  }[] | undefined;
3942
6097
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6098
+ trailing?: {
6099
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
6100
+ deltaValue: number;
6101
+ activationValue?: number | undefined;
6102
+ bestMetricSeen?: number | undefined;
6103
+ currentStopValue?: number | undefined;
6104
+ stopBreachedAt?: number | undefined;
6105
+ } | undefined;
3943
6106
  } | {
3944
6107
  id: string;
3945
6108
  tradeAccountId: string;
@@ -3949,7 +6112,7 @@ declare class Core {
3949
6112
  createdAt: string;
3950
6113
  updatedAt: string;
3951
6114
  intent: "ADJUST";
3952
- type: "MARKET";
6115
+ type: "TWAP";
3953
6116
  condition: {
3954
6117
  type: "ratio";
3955
6118
  data: {
@@ -4025,7 +6188,13 @@ declare class Core {
4025
6188
  };
4026
6189
  };
4027
6190
  context: {
4028
- type: "MARKET";
6191
+ type: "TWAP";
6192
+ durationSec: number;
6193
+ sliceIntervalSec: number;
6194
+ randomization: {
6195
+ timingJitterBps: number;
6196
+ sizeJitterBps: number;
6197
+ };
4029
6198
  position: {
4030
6199
  id: string;
4031
6200
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4033,16 +6202,15 @@ declare class Core {
4033
6202
  legs: [{
4034
6203
  symbol: string;
4035
6204
  side: "BUY" | "SELL";
4036
- mode: "QUANTITY" | "USD";
4037
- amount: string;
4038
- reduceOnly: boolean;
6205
+ weight: number;
6206
+ id?: string | undefined;
4039
6207
  }, ...{
4040
6208
  symbol: string;
4041
6209
  side: "BUY" | "SELL";
4042
- mode: "QUANTITY" | "USD";
4043
- amount: string;
4044
- reduceOnly: boolean;
6210
+ weight: number;
6211
+ id?: string | undefined;
4045
6212
  }[]];
6213
+ targetNotional: string;
4046
6214
  };
4047
6215
  ladderId?: string | undefined;
4048
6216
  ladderIndex?: number | undefined;
@@ -4075,6 +6243,7 @@ declare class Core {
4075
6243
  } | undefined;
4076
6244
  }[] | undefined;
4077
6245
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6246
+ scheduleId?: string | undefined;
4078
6247
  trailing?: {
4079
6248
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4080
6249
  deltaValue: number;
@@ -4092,7 +6261,7 @@ declare class Core {
4092
6261
  createdAt: string;
4093
6262
  updatedAt: string;
4094
6263
  intent: "CLOSE";
4095
- type: "MARKET";
6264
+ type: "TWAP";
4096
6265
  condition: {
4097
6266
  type: "ratio";
4098
6267
  data: {
@@ -4206,7 +6375,13 @@ declare class Core {
4206
6375
  };
4207
6376
  };
4208
6377
  context: {
4209
- type: "MARKET";
6378
+ type: "TWAP";
6379
+ durationSec: number;
6380
+ sliceIntervalSec: number;
6381
+ randomization: {
6382
+ timingJitterBps: number;
6383
+ sizeJitterBps: number;
6384
+ };
4210
6385
  position: {
4211
6386
  id: string;
4212
6387
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4243,6 +6418,7 @@ declare class Core {
4243
6418
  } | undefined;
4244
6419
  }[] | undefined;
4245
6420
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6421
+ scheduleId?: string | undefined;
4246
6422
  trailing?: {
4247
6423
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4248
6424
  deltaValue: number;
@@ -4251,10 +6427,9 @@ declare class Core {
4251
6427
  currentStopValue?: number | undefined;
4252
6428
  stopBreachedAt?: number | undefined;
4253
6429
  } | undefined;
4254
- })[];
4255
- nextCursor?: string | undefined;
6430
+ };
4256
6431
  }>;
4257
- open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
6432
+ close: (body: HttpTypes.CreateTriggerClose, headers?: ClientHeaders) => Promise<{
4258
6433
  trigger: {
4259
6434
  id: string;
4260
6435
  tradeAccountId: string;
@@ -4325,11 +6500,13 @@ declare class Core {
4325
6500
  side: "BUY" | "SELL";
4326
6501
  mode: "QUANTITY" | "USD";
4327
6502
  amount: string;
6503
+ id?: string | undefined;
4328
6504
  }, ...{
4329
6505
  symbol: string;
4330
6506
  side: "BUY" | "SELL";
4331
6507
  mode: "QUANTITY" | "USD";
4332
6508
  amount: string;
6509
+ id?: string | undefined;
4333
6510
  }[]];
4334
6511
  attachedTriggers: {
4335
6512
  kind: "STATIC" | "TRAILING";
@@ -4463,12 +6640,14 @@ declare class Core {
4463
6640
  mode: "QUANTITY" | "USD";
4464
6641
  amount: string;
4465
6642
  reduceOnly: boolean;
6643
+ id?: string | undefined;
4466
6644
  }, ...{
4467
6645
  symbol: string;
4468
6646
  side: "BUY" | "SELL";
4469
6647
  mode: "QUANTITY" | "USD";
4470
6648
  amount: string;
4471
6649
  reduceOnly: boolean;
6650
+ id?: string | undefined;
4472
6651
  }[]];
4473
6652
  };
4474
6653
  ladderId?: string | undefined;
@@ -4678,121 +6857,6 @@ declare class Core {
4678
6857
  currentStopValue?: number | undefined;
4679
6858
  stopBreachedAt?: number | undefined;
4680
6859
  } | undefined;
4681
- };
4682
- }>;
4683
- close: (body: HttpTypes.CreateTriggerClose, headers?: ClientHeaders) => Promise<{
4684
- trigger: {
4685
- id: string;
4686
- tradeAccountId: string;
4687
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4688
- status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
4689
- bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
4690
- createdAt: string;
4691
- updatedAt: string;
4692
- intent: "OPEN";
4693
- type: "MARKET";
4694
- condition: {
4695
- type: "ratio";
4696
- data: {
4697
- priceSource: "mark" | "mid";
4698
- symbol_a: string;
4699
- symbol_b: string;
4700
- track: "PEAK" | "TROUGH";
4701
- threshold: number;
4702
- };
4703
- } | {
4704
- type: "price";
4705
- data: {
4706
- priceSource: "mark" | "mid";
4707
- symbol: string;
4708
- track: "PEAK" | "TROUGH";
4709
- threshold: number;
4710
- };
4711
- } | {
4712
- type: "weighted_ratio";
4713
- data: {
4714
- priceSource: "mark" | "mid";
4715
- basket: {
4716
- symbol: string;
4717
- side: "BUY" | "SELL";
4718
- weight: number;
4719
- }[];
4720
- track: "PEAK" | "TROUGH";
4721
- threshold: number;
4722
- };
4723
- } | {
4724
- type: "funding_rate";
4725
- data: {
4726
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4727
- symbol: string;
4728
- track: "PEAK" | "TROUGH";
4729
- threshold: number;
4730
- };
4731
- } | {
4732
- type: "prediction_market";
4733
- data: {
4734
- source: "kalshi" | "polymarket";
4735
- marketKey: string;
4736
- track: "PEAK" | "TROUGH";
4737
- threshold: number;
4738
- };
4739
- } | {
4740
- type: "btc_dominance";
4741
- data: {
4742
- source: "coingecko";
4743
- track: "PEAK" | "TROUGH";
4744
- threshold: number;
4745
- };
4746
- };
4747
- context: {
4748
- type: "MARKET";
4749
- legs: [{
4750
- symbol: string;
4751
- side: "BUY" | "SELL";
4752
- mode: "QUANTITY" | "USD";
4753
- amount: string;
4754
- }, ...{
4755
- symbol: string;
4756
- side: "BUY" | "SELL";
4757
- mode: "QUANTITY" | "USD";
4758
- amount: string;
4759
- }[]];
4760
- attachedTriggers: {
4761
- kind: "STATIC" | "TRAILING";
4762
- bracketType: "STOP_LOSS" | "TAKE_PROFIT";
4763
- }[];
4764
- };
4765
- ladderId?: string | undefined;
4766
- ladderIndex?: number | undefined;
4767
- parentTriggerId?: string | undefined;
4768
- triggeredAt?: string | undefined;
4769
- cancelledAt?: string | undefined;
4770
- cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4771
- fills?: {
4772
- id: string;
4773
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4774
- tradeAccountId: string;
4775
- symbol: string;
4776
- positionId: string;
4777
- connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4778
- side: "BUY" | "SELL";
4779
- reduceOnly: boolean;
4780
- isExternal: boolean;
4781
- synthetic: boolean;
4782
- quantity: string;
4783
- price: string;
4784
- usd: string;
4785
- timestamp: string;
4786
- cloid?: string | undefined;
4787
- exchangeFillId?: string | undefined;
4788
- tradeFee?: string | undefined;
4789
- pearFee?: string | undefined;
4790
- original?: {
4791
- exchangeFillId: string;
4792
- quantity: string;
4793
- } | undefined;
4794
- }[] | undefined;
4795
- semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
4796
6860
  } | {
4797
6861
  id: string;
4798
6862
  tradeAccountId: string;
@@ -4802,7 +6866,7 @@ declare class Core {
4802
6866
  createdAt: string;
4803
6867
  updatedAt: string;
4804
6868
  intent: "ADJUST";
4805
- type: "MARKET";
6869
+ type: "TWAP";
4806
6870
  condition: {
4807
6871
  type: "ratio";
4808
6872
  data: {
@@ -4878,7 +6942,13 @@ declare class Core {
4878
6942
  };
4879
6943
  };
4880
6944
  context: {
4881
- type: "MARKET";
6945
+ type: "TWAP";
6946
+ durationSec: number;
6947
+ sliceIntervalSec: number;
6948
+ randomization: {
6949
+ timingJitterBps: number;
6950
+ sizeJitterBps: number;
6951
+ };
4882
6952
  position: {
4883
6953
  id: string;
4884
6954
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4886,16 +6956,15 @@ declare class Core {
4886
6956
  legs: [{
4887
6957
  symbol: string;
4888
6958
  side: "BUY" | "SELL";
4889
- mode: "QUANTITY" | "USD";
4890
- amount: string;
4891
- reduceOnly: boolean;
6959
+ weight: number;
6960
+ id?: string | undefined;
4892
6961
  }, ...{
4893
6962
  symbol: string;
4894
6963
  side: "BUY" | "SELL";
4895
- mode: "QUANTITY" | "USD";
4896
- amount: string;
4897
- reduceOnly: boolean;
6964
+ weight: number;
6965
+ id?: string | undefined;
4898
6966
  }[]];
6967
+ targetNotional: string;
4899
6968
  };
4900
6969
  ladderId?: string | undefined;
4901
6970
  ladderIndex?: number | undefined;
@@ -4928,6 +6997,7 @@ declare class Core {
4928
6997
  } | undefined;
4929
6998
  }[] | undefined;
4930
6999
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
7000
+ scheduleId?: string | undefined;
4931
7001
  trailing?: {
4932
7002
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4933
7003
  deltaValue: number;
@@ -4945,7 +7015,7 @@ declare class Core {
4945
7015
  createdAt: string;
4946
7016
  updatedAt: string;
4947
7017
  intent: "CLOSE";
4948
- type: "MARKET";
7018
+ type: "TWAP";
4949
7019
  condition: {
4950
7020
  type: "ratio";
4951
7021
  data: {
@@ -5059,7 +7129,13 @@ declare class Core {
5059
7129
  };
5060
7130
  };
5061
7131
  context: {
5062
- type: "MARKET";
7132
+ type: "TWAP";
7133
+ durationSec: number;
7134
+ sliceIntervalSec: number;
7135
+ randomization: {
7136
+ timingJitterBps: number;
7137
+ sizeJitterBps: number;
7138
+ };
5063
7139
  position: {
5064
7140
  id: string;
5065
7141
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -5096,6 +7172,7 @@ declare class Core {
5096
7172
  } | undefined;
5097
7173
  }[] | undefined;
5098
7174
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
7175
+ scheduleId?: string | undefined;
5099
7176
  trailing?: {
5100
7177
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5101
7178
  deltaValue: number;