@pear-protocol/core-sdk 1.19.3 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,626 @@ 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
+ referees: ({
3921
+ status: "BOUND";
3922
+ tradeCount: number;
3923
+ address?: `0x${string}` | undefined;
3924
+ referredAt?: number | undefined;
3925
+ } | {
3926
+ status: "PENDING";
3927
+ address: `0x${string}`;
3928
+ })[];
3929
+ nextCursor?: string | undefined;
3930
+ }>;
3931
+ };
3932
+ schedules: {
3933
+ list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
3934
+ limit: number;
3935
+ schedules: ({
3936
+ id: string;
3937
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3938
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3939
+ positionKey: string;
3940
+ executionType: "MARKET";
3941
+ startAt: string;
3942
+ endAt: string;
3943
+ createdAt: string;
3944
+ updatedAt: string;
3945
+ strategy: "TWAP";
3946
+ intent: "OPEN";
3947
+ sliceIntervalSec: number;
3948
+ sliceCount: number;
3949
+ randomization: {
3950
+ timingJitterBps: number;
3951
+ sizeJitterBps: number;
3952
+ };
3953
+ legs: {
3954
+ symbol: string;
3955
+ side: "BUY" | "SELL";
3956
+ weight: number;
3957
+ id?: string | undefined;
3958
+ }[];
3959
+ targetNotional: string;
3960
+ remainingNotional: string;
3961
+ lastSliceAt?: string | undefined;
3962
+ cancelledAt?: string | undefined;
3963
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
3964
+ fills?: {
3965
+ id: string;
3966
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3967
+ tradeAccountId: string;
3968
+ symbol: string;
3969
+ positionId: string;
3970
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3971
+ side: "BUY" | "SELL";
3972
+ reduceOnly: boolean;
3973
+ isExternal: boolean;
3974
+ synthetic: boolean;
3975
+ quantity: string;
3976
+ price: string;
3977
+ usd: string;
3978
+ timestamp: string;
3979
+ cloid?: string | undefined;
3980
+ exchangeFillId?: string | undefined;
3981
+ tradeFee?: string | undefined;
3982
+ pearFee?: string | undefined;
3983
+ original?: {
3984
+ exchangeFillId: string;
3985
+ quantity: string;
3986
+ } | undefined;
3987
+ }[] | undefined;
3988
+ } | {
3989
+ id: string;
3990
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3991
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3992
+ positionKey: string;
3993
+ executionType: "MARKET";
3994
+ startAt: string;
3995
+ endAt: string;
3996
+ createdAt: string;
3997
+ updatedAt: string;
3998
+ strategy: "TWAP";
3999
+ intent: "CLOSE";
4000
+ sliceIntervalSec: number;
4001
+ sliceCount: number;
4002
+ randomization: {
4003
+ timingJitterBps: number;
4004
+ sizeJitterBps: number;
4005
+ };
4006
+ positionId: string;
4007
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
4008
+ lastSliceAt?: string | undefined;
4009
+ cancelledAt?: string | undefined;
4010
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4011
+ fills?: {
2731
4012
  id: string;
4013
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4014
+ tradeAccountId: string;
4015
+ symbol: string;
2732
4016
  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
- } | {
4017
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4018
+ side: "BUY" | "SELL";
4019
+ reduceOnly: boolean;
4020
+ isExternal: boolean;
4021
+ synthetic: boolean;
4022
+ quantity: string;
4023
+ price: string;
4024
+ usd: string;
4025
+ timestamp: string;
4026
+ cloid?: string | undefined;
4027
+ exchangeFillId?: string | undefined;
4028
+ tradeFee?: string | undefined;
4029
+ pearFee?: string | undefined;
4030
+ original?: {
4031
+ exchangeFillId: string;
4032
+ quantity: string;
4033
+ } | undefined;
4034
+ }[] | undefined;
4035
+ })[];
4036
+ nextCursor?: string | undefined;
4037
+ }>;
4038
+ create: (body: HttpTypes.CreateSchedule, headers?: ClientHeaders) => Promise<{
4039
+ schedule: {
4040
+ id: string;
4041
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4042
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
4043
+ positionKey: string;
4044
+ executionType: "MARKET";
4045
+ startAt: string;
4046
+ endAt: string;
4047
+ createdAt: string;
4048
+ updatedAt: string;
4049
+ strategy: "TWAP";
4050
+ intent: "OPEN";
4051
+ sliceIntervalSec: number;
4052
+ sliceCount: number;
4053
+ randomization: {
4054
+ timingJitterBps: number;
4055
+ sizeJitterBps: number;
4056
+ };
4057
+ legs: {
4058
+ symbol: string;
4059
+ side: "BUY" | "SELL";
4060
+ weight: number;
4061
+ id?: string | undefined;
4062
+ }[];
4063
+ targetNotional: string;
4064
+ remainingNotional: string;
4065
+ lastSliceAt?: string | undefined;
4066
+ cancelledAt?: string | undefined;
4067
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4068
+ fills?: {
2740
4069
  id: string;
4070
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4071
+ tradeAccountId: string;
4072
+ symbol: string;
2741
4073
  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: {
4074
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4075
+ side: "BUY" | "SELL";
4076
+ reduceOnly: boolean;
4077
+ isExternal: boolean;
4078
+ synthetic: boolean;
4079
+ quantity: string;
4080
+ price: string;
4081
+ usd: string;
4082
+ timestamp: string;
4083
+ cloid?: string | undefined;
4084
+ exchangeFillId?: string | undefined;
4085
+ tradeFee?: string | undefined;
4086
+ pearFee?: string | undefined;
4087
+ original?: {
4088
+ exchangeFillId: string;
4089
+ quantity: string;
4090
+ } | undefined;
4091
+ }[] | undefined;
4092
+ } | {
2768
4093
  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";
4094
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4095
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
4096
+ positionKey: string;
4097
+ executionType: "MARKET";
4098
+ startAt: string;
4099
+ endAt: string;
2776
4100
  createdAt: string;
2777
- error?: string | undefined;
2778
- }[];
2779
- nextCursor?: string | undefined;
4101
+ updatedAt: string;
4102
+ strategy: "TWAP";
4103
+ intent: "CLOSE";
4104
+ sliceIntervalSec: number;
4105
+ sliceCount: number;
4106
+ randomization: {
4107
+ timingJitterBps: number;
4108
+ sizeJitterBps: number;
4109
+ };
4110
+ positionId: string;
4111
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
4112
+ lastSliceAt?: string | undefined;
4113
+ cancelledAt?: string | undefined;
4114
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
4115
+ fills?: {
4116
+ id: string;
4117
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
4118
+ tradeAccountId: string;
4119
+ symbol: string;
4120
+ positionId: string;
4121
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4122
+ side: "BUY" | "SELL";
4123
+ reduceOnly: boolean;
4124
+ isExternal: boolean;
4125
+ synthetic: boolean;
4126
+ quantity: string;
4127
+ price: string;
4128
+ usd: string;
4129
+ timestamp: string;
4130
+ cloid?: string | undefined;
4131
+ exchangeFillId?: string | undefined;
4132
+ tradeFee?: string | undefined;
4133
+ pearFee?: string | undefined;
4134
+ original?: {
4135
+ exchangeFillId: string;
4136
+ quantity: string;
4137
+ } | undefined;
4138
+ }[] | undefined;
4139
+ };
2780
4140
  }>;
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;
4141
+ cancel: (scheduleId: string, headers?: ClientHeaders) => Promise<{
4142
+ id: string;
2791
4143
  }>;
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;
4144
+ cancelAll: (headers?: ClientHeaders) => Promise<{
4145
+ ids: string[];
2807
4146
  }>;
2808
4147
  };
2809
- savedBaskets: {
2810
- list: (headers?: ClientHeaders) => Promise<{
2811
- baskets: {
4148
+ sync: {
4149
+ fills: {
4150
+ since: (body: HttpTypes.SyncFillsSinceRequest, headers?: ClientHeaders) => Promise<{
4151
+ sinceMs: number;
4152
+ neverSynced: boolean;
4153
+ firstSyncStartedAt?: number | undefined;
4154
+ confirmedExchangeFillIds?: string[] | undefined;
4155
+ }>;
4156
+ reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4157
+ reconcileBulk: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4158
+ confirm: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4159
+ confirmBulk: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4160
+ create: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4161
+ createBulk: (body: HttpTypes.CreateApplicablesRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4162
+ };
4163
+ funding: {
4164
+ since: (body: HttpTypes.SyncFundingSinceRequest, headers?: ClientHeaders) => Promise<{
4165
+ sinceMs: number;
4166
+ }>;
4167
+ create: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4168
+ createBulk: (body: HttpTypes.CreateFundingPaymentsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
4169
+ };
4170
+ };
4171
+ trade: {
4172
+ open: (body: HttpTypes.CreateTradeOpen, headers?: ClientHeaders) => Promise<{
4173
+ execution: {
2812
4174
  id: string;
2813
- name: string;
4175
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4176
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
4177
+ createdAt: string;
4178
+ updatedAt: string;
4179
+ intent: "OPEN";
4180
+ orderType: "MARKET";
2814
4181
  legs: [{
2815
4182
  symbol: string;
2816
4183
  side: "BUY" | "SELL";
2817
- weight: number;
4184
+ mode: "QUANTITY" | "USD";
4185
+ amount: string;
4186
+ reduceOnly: boolean;
4187
+ id?: string | undefined;
2818
4188
  }, ...{
2819
4189
  symbol: string;
2820
4190
  side: "BUY" | "SELL";
2821
- weight: number;
2822
- }[]];
4191
+ mode: "QUANTITY" | "USD";
4192
+ amount: string;
4193
+ reduceOnly: boolean;
4194
+ id?: string | undefined;
4195
+ }[]];
4196
+ error?: string | undefined;
4197
+ orders?: {
4198
+ id: string;
4199
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4200
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4201
+ createdAt: string;
4202
+ updatedAt: string;
4203
+ type: "MARKET";
4204
+ symbol: string;
4205
+ side: "BUY" | "SELL";
4206
+ reduceOnly: boolean;
4207
+ quantity: string;
4208
+ price: string;
4209
+ filledQuantity: string;
4210
+ error?: string | undefined;
4211
+ errorCode?: string | undefined;
4212
+ filledPrice?: string | undefined;
4213
+ }[] | undefined;
4214
+ } | {
4215
+ id: string;
4216
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4217
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2823
4218
  createdAt: string;
2824
4219
  updatedAt: string;
2825
- }[];
2826
- }>;
2827
- create: (body: HttpTypes.CreateSavedBasketPayload, headers?: ClientHeaders) => Promise<{
2828
- basket: {
2829
- id: string;
2830
- name: string;
4220
+ intent: "ADJUST";
4221
+ orderType: "MARKET";
4222
+ position: {
4223
+ id: string;
4224
+ exposure: Record<string, `-${string}` | `+${string}`>;
4225
+ };
2831
4226
  legs: [{
2832
4227
  symbol: string;
2833
4228
  side: "BUY" | "SELL";
2834
- weight: number;
4229
+ mode: "QUANTITY" | "USD";
4230
+ amount: string;
4231
+ reduceOnly: boolean;
4232
+ id?: string | undefined;
2835
4233
  }, ...{
2836
4234
  symbol: string;
2837
4235
  side: "BUY" | "SELL";
2838
- weight: number;
4236
+ mode: "QUANTITY" | "USD";
4237
+ amount: string;
4238
+ reduceOnly: boolean;
4239
+ id?: string | undefined;
2839
4240
  }[]];
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: [{
4241
+ error?: string | undefined;
4242
+ orders?: {
4243
+ id: string;
4244
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4245
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4246
+ createdAt: string;
4247
+ updatedAt: string;
4248
+ type: "MARKET";
2849
4249
  symbol: string;
2850
4250
  side: "BUY" | "SELL";
2851
- weight: number;
2852
- }, ...{
4251
+ reduceOnly: boolean;
4252
+ quantity: string;
4253
+ price: string;
4254
+ filledQuantity: string;
4255
+ error?: string | undefined;
4256
+ errorCode?: string | undefined;
4257
+ filledPrice?: string | undefined;
4258
+ }[] | undefined;
4259
+ } | {
4260
+ id: string;
4261
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4262
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
4263
+ createdAt: string;
4264
+ updatedAt: string;
4265
+ intent: "CLOSE";
4266
+ orderType: "MARKET";
4267
+ position: {
4268
+ id: string;
4269
+ exposure: Record<string, `-${string}` | `+${string}`>;
4270
+ };
4271
+ error?: string | undefined;
4272
+ orders?: {
4273
+ id: string;
4274
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4275
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4276
+ createdAt: string;
4277
+ updatedAt: string;
4278
+ type: "MARKET";
2853
4279
  symbol: string;
2854
4280
  side: "BUY" | "SELL";
2855
- weight: number;
2856
- }[]];
4281
+ reduceOnly: boolean;
4282
+ quantity: string;
4283
+ price: string;
4284
+ filledQuantity: string;
4285
+ error?: string | undefined;
4286
+ errorCode?: string | undefined;
4287
+ filledPrice?: string | undefined;
4288
+ }[] | undefined;
4289
+ } | {
4290
+ id: string;
4291
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4292
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2857
4293
  createdAt: string;
2858
4294
  updatedAt: string;
4295
+ intent: "REVERSE";
4296
+ orderType: "MARKET";
4297
+ position: {
4298
+ id: string;
4299
+ exposure: Record<string, `-${string}` | `+${string}`>;
4300
+ };
4301
+ error?: string | undefined;
4302
+ orders?: {
4303
+ id: string;
4304
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4305
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4306
+ createdAt: string;
4307
+ updatedAt: string;
4308
+ type: "MARKET";
4309
+ symbol: string;
4310
+ side: "BUY" | "SELL";
4311
+ reduceOnly: boolean;
4312
+ quantity: string;
4313
+ price: string;
4314
+ filledQuantity: string;
4315
+ error?: string | undefined;
4316
+ errorCode?: string | undefined;
4317
+ filledPrice?: string | undefined;
4318
+ }[] | undefined;
2859
4319
  };
2860
4320
  }>;
2861
- delete: (id: string, headers?: ClientHeaders) => Promise<void>;
2862
- };
2863
- schedules: {
2864
- list: (query: HttpTypes.ScheduleListParamsInput, headers?: ClientHeaders) => Promise<{
2865
- limit: number;
2866
- schedules: ({
4321
+ adjust: (positionId: string, body: HttpTypes.CreateTradeAdjust, headers?: ClientHeaders) => Promise<{
4322
+ execution: {
2867
4323
  id: string;
2868
4324
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2869
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2870
- positionKey: string;
2871
- executionType: "MARKET";
2872
- startAt: string;
2873
- endAt: string;
4325
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2874
4326
  createdAt: string;
2875
4327
  updatedAt: string;
2876
- strategy: "TWAP";
2877
4328
  intent: "OPEN";
2878
- sliceIntervalSec: number;
2879
- sliceCount: number;
2880
- randomization: {
2881
- timingJitterBps: number;
2882
- sizeJitterBps: number;
2883
- };
2884
- legs: {
4329
+ orderType: "MARKET";
4330
+ legs: [{
2885
4331
  symbol: string;
2886
4332
  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;
4333
+ mode: "QUANTITY" | "USD";
4334
+ amount: string;
4335
+ reduceOnly: boolean;
4336
+ id?: string | undefined;
4337
+ }, ...{
2898
4338
  symbol: string;
2899
- positionId: string;
4339
+ side: "BUY" | "SELL";
4340
+ mode: "QUANTITY" | "USD";
4341
+ amount: string;
4342
+ reduceOnly: boolean;
4343
+ id?: string | undefined;
4344
+ }[]];
4345
+ error?: string | undefined;
4346
+ orders?: {
4347
+ id: string;
2900
4348
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4349
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4350
+ createdAt: string;
4351
+ updatedAt: string;
4352
+ type: "MARKET";
4353
+ symbol: string;
2901
4354
  side: "BUY" | "SELL";
2902
4355
  reduceOnly: boolean;
2903
- isExternal: boolean;
2904
- synthetic: boolean;
2905
4356
  quantity: string;
2906
4357
  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;
4358
+ filledQuantity: string;
4359
+ error?: string | undefined;
4360
+ errorCode?: string | undefined;
4361
+ filledPrice?: string | undefined;
2917
4362
  }[] | undefined;
2918
4363
  } | {
2919
4364
  id: string;
2920
4365
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2921
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2922
- positionKey: string;
2923
- executionType: "MARKET";
2924
- startAt: string;
2925
- endAt: string;
4366
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2926
4367
  createdAt: string;
2927
4368
  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?: {
4369
+ intent: "ADJUST";
4370
+ orderType: "MARKET";
4371
+ position: {
2942
4372
  id: string;
2943
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
2944
- tradeAccountId: string;
4373
+ exposure: Record<string, `-${string}` | `+${string}`>;
4374
+ };
4375
+ legs: [{
2945
4376
  symbol: string;
2946
- positionId: string;
4377
+ side: "BUY" | "SELL";
4378
+ mode: "QUANTITY" | "USD";
4379
+ amount: string;
4380
+ reduceOnly: boolean;
4381
+ id?: string | undefined;
4382
+ }, ...{
4383
+ symbol: string;
4384
+ side: "BUY" | "SELL";
4385
+ mode: "QUANTITY" | "USD";
4386
+ amount: string;
4387
+ reduceOnly: boolean;
4388
+ id?: string | undefined;
4389
+ }[]];
4390
+ error?: string | undefined;
4391
+ orders?: {
4392
+ id: string;
2947
4393
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4394
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4395
+ createdAt: string;
4396
+ updatedAt: string;
4397
+ type: "MARKET";
4398
+ symbol: string;
2948
4399
  side: "BUY" | "SELL";
2949
4400
  reduceOnly: boolean;
2950
- isExternal: boolean;
2951
- synthetic: boolean;
2952
4401
  quantity: string;
2953
4402
  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: {
4403
+ filledQuantity: string;
4404
+ error?: string | undefined;
4405
+ errorCode?: string | undefined;
4406
+ filledPrice?: string | undefined;
4407
+ }[] | undefined;
4408
+ } | {
2970
4409
  id: string;
2971
4410
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
2972
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
2973
- positionKey: string;
2974
- executionType: "MARKET";
2975
- startAt: string;
2976
- endAt: string;
4411
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
2977
4412
  createdAt: string;
2978
4413
  updatedAt: string;
2979
- strategy: "TWAP";
2980
- intent: "OPEN";
2981
- sliceIntervalSec: number;
2982
- sliceCount: number;
2983
- randomization: {
2984
- timingJitterBps: number;
2985
- sizeJitterBps: number;
4414
+ intent: "CLOSE";
4415
+ orderType: "MARKET";
4416
+ position: {
4417
+ id: string;
4418
+ exposure: Record<string, `-${string}` | `+${string}`>;
2986
4419
  };
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?: {
4420
+ error?: string | undefined;
4421
+ orders?: {
2998
4422
  id: string;
2999
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3000
- tradeAccountId: string;
3001
- symbol: string;
3002
- positionId: string;
3003
4423
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4424
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4425
+ createdAt: string;
4426
+ updatedAt: string;
4427
+ type: "MARKET";
4428
+ symbol: string;
3004
4429
  side: "BUY" | "SELL";
3005
4430
  reduceOnly: boolean;
3006
- isExternal: boolean;
3007
- synthetic: boolean;
3008
4431
  quantity: string;
3009
4432
  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;
4433
+ filledQuantity: string;
4434
+ error?: string | undefined;
4435
+ errorCode?: string | undefined;
4436
+ filledPrice?: string | undefined;
3020
4437
  }[] | undefined;
3021
4438
  } | {
3022
4439
  id: string;
3023
4440
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3024
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "FAILED";
3025
- positionKey: string;
3026
- executionType: "MARKET";
3027
- startAt: string;
3028
- endAt: string;
4441
+ status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
3029
4442
  createdAt: string;
3030
4443
  updatedAt: string;
3031
- strategy: "TWAP";
3032
- intent: "CLOSE";
3033
- sliceIntervalSec: number;
3034
- sliceCount: number;
3035
- randomization: {
3036
- timingJitterBps: number;
3037
- sizeJitterBps: number;
4444
+ intent: "REVERSE";
4445
+ orderType: "MARKET";
4446
+ position: {
4447
+ id: string;
4448
+ exposure: Record<string, `-${string}` | `+${string}`>;
3038
4449
  };
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?: {
4450
+ error?: string | undefined;
4451
+ orders?: {
3045
4452
  id: string;
3046
- status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
3047
- tradeAccountId: string;
3048
- symbol: string;
3049
- positionId: string;
3050
4453
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4454
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4455
+ createdAt: string;
4456
+ updatedAt: string;
4457
+ type: "MARKET";
4458
+ symbol: string;
3051
4459
  side: "BUY" | "SELL";
3052
4460
  reduceOnly: boolean;
3053
- isExternal: boolean;
3054
- synthetic: boolean;
3055
4461
  quantity: string;
3056
4462
  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;
4463
+ filledQuantity: string;
4464
+ error?: string | undefined;
4465
+ errorCode?: string | undefined;
4466
+ filledPrice?: string | undefined;
3067
4467
  }[] | undefined;
3068
4468
  };
3069
4469
  }>;
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<{
4470
+ close: (positionId: string, body: HttpTypes.CreateTradeClose, headers?: ClientHeaders) => Promise<{
3102
4471
  execution: {
3103
4472
  id: string;
3104
4473
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3113,12 +4482,14 @@ declare class Core {
3113
4482
  mode: "QUANTITY" | "USD";
3114
4483
  amount: string;
3115
4484
  reduceOnly: boolean;
4485
+ id?: string | undefined;
3116
4486
  }, ...{
3117
4487
  symbol: string;
3118
4488
  side: "BUY" | "SELL";
3119
4489
  mode: "QUANTITY" | "USD";
3120
4490
  amount: string;
3121
4491
  reduceOnly: boolean;
4492
+ id?: string | undefined;
3122
4493
  }[]];
3123
4494
  error?: string | undefined;
3124
4495
  orders?: {
@@ -3156,12 +4527,14 @@ declare class Core {
3156
4527
  mode: "QUANTITY" | "USD";
3157
4528
  amount: string;
3158
4529
  reduceOnly: boolean;
4530
+ id?: string | undefined;
3159
4531
  }, ...{
3160
4532
  symbol: string;
3161
4533
  side: "BUY" | "SELL";
3162
4534
  mode: "QUANTITY" | "USD";
3163
4535
  amount: string;
3164
4536
  reduceOnly: boolean;
4537
+ id?: string | undefined;
3165
4538
  }[]];
3166
4539
  error?: string | undefined;
3167
4540
  orders?: {
@@ -3243,7 +4616,7 @@ declare class Core {
3243
4616
  }[] | undefined;
3244
4617
  };
3245
4618
  }>;
3246
- adjust: (positionId: string, body: HttpTypes.CreateTradeAdjust, headers?: ClientHeaders) => Promise<{
4619
+ reverse: (positionId: string, body: HttpTypes.CreateTradeReverse, headers?: ClientHeaders) => Promise<{
3247
4620
  execution: {
3248
4621
  id: string;
3249
4622
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3258,12 +4631,14 @@ declare class Core {
3258
4631
  mode: "QUANTITY" | "USD";
3259
4632
  amount: string;
3260
4633
  reduceOnly: boolean;
4634
+ id?: string | undefined;
3261
4635
  }, ...{
3262
4636
  symbol: string;
3263
4637
  side: "BUY" | "SELL";
3264
4638
  mode: "QUANTITY" | "USD";
3265
4639
  amount: string;
3266
4640
  reduceOnly: boolean;
4641
+ id?: string | undefined;
3267
4642
  }[]];
3268
4643
  error?: string | undefined;
3269
4644
  orders?: {
@@ -3301,12 +4676,14 @@ declare class Core {
3301
4676
  mode: "QUANTITY" | "USD";
3302
4677
  amount: string;
3303
4678
  reduceOnly: boolean;
4679
+ id?: string | undefined;
3304
4680
  }, ...{
3305
4681
  symbol: string;
3306
4682
  side: "BUY" | "SELL";
3307
4683
  mode: "QUANTITY" | "USD";
3308
4684
  amount: string;
3309
4685
  reduceOnly: boolean;
4686
+ id?: string | undefined;
3310
4687
  }[]];
3311
4688
  error?: string | undefined;
3312
4689
  orders?: {
@@ -3388,8 +4765,8 @@ declare class Core {
3388
4765
  }[] | undefined;
3389
4766
  };
3390
4767
  }>;
3391
- close: (positionId: string, body: HttpTypes.CreateTradeClose, headers?: ClientHeaders) => Promise<{
3392
- execution: {
4768
+ closeAll: (body: HttpTypes.CreateTradeCloseAll, headers?: ClientHeaders) => Promise<{
4769
+ executions: ({
3393
4770
  id: string;
3394
4771
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3395
4772
  status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
@@ -3403,12 +4780,14 @@ declare class Core {
3403
4780
  mode: "QUANTITY" | "USD";
3404
4781
  amount: string;
3405
4782
  reduceOnly: boolean;
4783
+ id?: string | undefined;
3406
4784
  }, ...{
3407
4785
  symbol: string;
3408
4786
  side: "BUY" | "SELL";
3409
4787
  mode: "QUANTITY" | "USD";
3410
4788
  amount: string;
3411
4789
  reduceOnly: boolean;
4790
+ id?: string | undefined;
3412
4791
  }[]];
3413
4792
  error?: string | undefined;
3414
4793
  orders?: {
@@ -3446,12 +4825,14 @@ declare class Core {
3446
4825
  mode: "QUANTITY" | "USD";
3447
4826
  amount: string;
3448
4827
  reduceOnly: boolean;
4828
+ id?: string | undefined;
3449
4829
  }, ...{
3450
4830
  symbol: string;
3451
4831
  side: "BUY" | "SELL";
3452
4832
  mode: "QUANTITY" | "USD";
3453
4833
  amount: string;
3454
4834
  reduceOnly: boolean;
4835
+ id?: string | undefined;
3455
4836
  }[]];
3456
4837
  error?: string | undefined;
3457
4838
  orders?: {
@@ -3516,319 +4897,1043 @@ declare class Core {
3516
4897
  error?: string | undefined;
3517
4898
  orders?: {
3518
4899
  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";
4900
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4901
+ status: "CANCELLED" | "PENDING" | "PARTIAL" | "FILLED" | "REJECTED";
4902
+ createdAt: string;
4903
+ updatedAt: string;
4904
+ type: "MARKET";
4905
+ symbol: string;
4906
+ side: "BUY" | "SELL";
4907
+ reduceOnly: boolean;
4908
+ quantity: string;
4909
+ price: string;
4910
+ filledQuantity: string;
4911
+ error?: string | undefined;
4912
+ errorCode?: string | undefined;
4913
+ filledPrice?: string | undefined;
4914
+ }[] | undefined;
4915
+ })[];
4916
+ }>;
4917
+ setLeverage: (body: HttpTypes.SetLeverage, headers?: ClientHeaders) => Promise<Record<string, never>>;
4918
+ };
4919
+ triggers: {
4920
+ list: (query: HttpTypes.TriggerListParamsInput, headers?: ClientHeaders) => Promise<{
4921
+ limit: number;
4922
+ triggers: ({
4923
+ id: string;
4924
+ tradeAccountId: string;
4925
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4926
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
4927
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
4928
+ createdAt: string;
4929
+ updatedAt: string;
4930
+ intent: "OPEN";
4931
+ type: "MARKET";
4932
+ condition: {
4933
+ type: "ratio";
4934
+ data: {
4935
+ priceSource: "mark" | "mid";
4936
+ symbol_a: string;
4937
+ symbol_b: string;
4938
+ track: "PEAK" | "TROUGH";
4939
+ threshold: number;
4940
+ };
4941
+ } | {
4942
+ type: "price";
4943
+ data: {
4944
+ priceSource: "mark" | "mid";
4945
+ symbol: string;
4946
+ track: "PEAK" | "TROUGH";
4947
+ threshold: number;
4948
+ };
4949
+ } | {
4950
+ type: "weighted_ratio";
4951
+ data: {
4952
+ priceSource: "mark" | "mid";
4953
+ basket: {
4954
+ symbol: string;
4955
+ side: "BUY" | "SELL";
4956
+ weight: number;
4957
+ }[];
4958
+ track: "PEAK" | "TROUGH";
4959
+ threshold: number;
4960
+ };
4961
+ } | {
4962
+ type: "funding_rate";
4963
+ data: {
4964
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
4965
+ symbol: string;
4966
+ track: "PEAK" | "TROUGH";
4967
+ threshold: number;
4968
+ };
4969
+ } | {
4970
+ type: "prediction_market";
4971
+ data: {
4972
+ source: "kalshi" | "polymarket";
4973
+ marketKey: string;
4974
+ track: "PEAK" | "TROUGH";
4975
+ threshold: number;
4976
+ };
4977
+ } | {
4978
+ type: "btc_dominance";
4979
+ data: {
4980
+ source: "coingecko";
4981
+ track: "PEAK" | "TROUGH";
4982
+ threshold: number;
4983
+ };
4984
+ };
4985
+ context: {
4986
+ type: "MARKET";
4987
+ legs: [{
4988
+ symbol: string;
4989
+ side: "BUY" | "SELL";
4990
+ mode: "QUANTITY" | "USD";
4991
+ amount: string;
4992
+ id?: string | undefined;
4993
+ }, ...{
4994
+ symbol: string;
4995
+ side: "BUY" | "SELL";
4996
+ mode: "QUANTITY" | "USD";
4997
+ amount: string;
4998
+ id?: string | undefined;
4999
+ }[]];
5000
+ attachedTriggers: {
5001
+ kind: "STATIC" | "TRAILING";
5002
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
5003
+ }[];
5004
+ };
5005
+ ladderId?: string | undefined;
5006
+ ladderIndex?: number | undefined;
5007
+ parentTriggerId?: string | undefined;
5008
+ triggeredAt?: string | undefined;
5009
+ cancelledAt?: string | undefined;
5010
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5011
+ fills?: {
5012
+ id: string;
5013
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5014
+ tradeAccountId: string;
3524
5015
  symbol: string;
5016
+ positionId: string;
5017
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3525
5018
  side: "BUY" | "SELL";
3526
5019
  reduceOnly: boolean;
5020
+ isExternal: boolean;
5021
+ synthetic: boolean;
3527
5022
  quantity: string;
3528
5023
  price: string;
3529
- filledQuantity: string;
3530
- error?: string | undefined;
3531
- errorCode?: string | undefined;
3532
- filledPrice?: string | undefined;
5024
+ usd: string;
5025
+ timestamp: string;
5026
+ cloid?: string | undefined;
5027
+ exchangeFillId?: string | undefined;
5028
+ tradeFee?: string | undefined;
5029
+ pearFee?: string | undefined;
5030
+ original?: {
5031
+ exchangeFillId: string;
5032
+ quantity: string;
5033
+ } | undefined;
3533
5034
  }[] | undefined;
3534
- };
3535
- }>;
3536
- reverse: (positionId: string, body: HttpTypes.CreateTradeReverse, headers?: ClientHeaders) => Promise<{
3537
- execution: {
5035
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5036
+ } | {
3538
5037
  id: string;
5038
+ tradeAccountId: string;
3539
5039
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3540
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5040
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5041
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3541
5042
  createdAt: string;
3542
5043
  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;
5044
+ intent: "ADJUST";
5045
+ type: "MARKET";
5046
+ condition: {
5047
+ type: "ratio";
5048
+ data: {
5049
+ priceSource: "mark" | "mid";
5050
+ symbol_a: string;
5051
+ symbol_b: string;
5052
+ track: "PEAK" | "TROUGH";
5053
+ threshold: number;
5054
+ };
5055
+ } | {
5056
+ type: "price";
5057
+ data: {
5058
+ priceSource: "mark" | "mid";
5059
+ symbol: string;
5060
+ track: "PEAK" | "TROUGH";
5061
+ threshold: number;
5062
+ };
5063
+ } | {
5064
+ type: "weighted_ratio";
5065
+ data: {
5066
+ priceSource: "mark" | "mid";
5067
+ basket: {
5068
+ symbol: string;
5069
+ side: "BUY" | "SELL";
5070
+ weight: number;
5071
+ }[];
5072
+ track: "PEAK" | "TROUGH";
5073
+ threshold: number;
5074
+ };
5075
+ } | {
5076
+ type: "notional";
5077
+ data: {
5078
+ priceSource: "mark" | "mid";
5079
+ track: "PEAK" | "TROUGH";
5080
+ threshold: number;
5081
+ };
5082
+ } | {
5083
+ type: "upnl";
5084
+ data: {
5085
+ priceSource: "mark" | "mid";
5086
+ track: "PEAK" | "TROUGH";
5087
+ threshold: number;
5088
+ };
5089
+ } | {
5090
+ type: "upnl_bps";
5091
+ data: {
5092
+ priceSource: "mark" | "mid";
5093
+ track: "PEAK" | "TROUGH";
5094
+ threshold: number;
5095
+ };
5096
+ } | {
5097
+ type: "funding_rate";
5098
+ data: {
5099
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5100
+ symbol: string;
5101
+ track: "PEAK" | "TROUGH";
5102
+ threshold: number;
5103
+ };
5104
+ } | {
5105
+ type: "prediction_market";
5106
+ data: {
5107
+ source: "kalshi" | "polymarket";
5108
+ marketKey: string;
5109
+ track: "PEAK" | "TROUGH";
5110
+ threshold: number;
5111
+ };
5112
+ } | {
5113
+ type: "btc_dominance";
5114
+ data: {
5115
+ source: "coingecko";
5116
+ track: "PEAK" | "TROUGH";
5117
+ threshold: number;
5118
+ };
5119
+ };
5120
+ context: {
3565
5121
  type: "MARKET";
5122
+ position: {
5123
+ id: string;
5124
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5125
+ };
5126
+ legs: [{
5127
+ symbol: string;
5128
+ side: "BUY" | "SELL";
5129
+ mode: "QUANTITY" | "USD";
5130
+ amount: string;
5131
+ reduceOnly: boolean;
5132
+ id?: string | undefined;
5133
+ }, ...{
5134
+ symbol: string;
5135
+ side: "BUY" | "SELL";
5136
+ mode: "QUANTITY" | "USD";
5137
+ amount: string;
5138
+ reduceOnly: boolean;
5139
+ id?: string | undefined;
5140
+ }[]];
5141
+ };
5142
+ ladderId?: string | undefined;
5143
+ ladderIndex?: number | undefined;
5144
+ parentTriggerId?: string | undefined;
5145
+ triggeredAt?: string | undefined;
5146
+ cancelledAt?: string | undefined;
5147
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5148
+ fills?: {
5149
+ id: string;
5150
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5151
+ tradeAccountId: string;
3566
5152
  symbol: string;
5153
+ positionId: string;
5154
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3567
5155
  side: "BUY" | "SELL";
3568
5156
  reduceOnly: boolean;
5157
+ isExternal: boolean;
5158
+ synthetic: boolean;
3569
5159
  quantity: string;
3570
5160
  price: string;
3571
- filledQuantity: string;
3572
- error?: string | undefined;
3573
- errorCode?: string | undefined;
3574
- filledPrice?: string | undefined;
5161
+ usd: string;
5162
+ timestamp: string;
5163
+ cloid?: string | undefined;
5164
+ exchangeFillId?: string | undefined;
5165
+ tradeFee?: string | undefined;
5166
+ pearFee?: string | undefined;
5167
+ original?: {
5168
+ exchangeFillId: string;
5169
+ quantity: string;
5170
+ } | undefined;
3575
5171
  }[] | undefined;
5172
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5173
+ trailing?: {
5174
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5175
+ deltaValue: number;
5176
+ activationValue?: number | undefined;
5177
+ bestMetricSeen?: number | undefined;
5178
+ currentStopValue?: number | undefined;
5179
+ stopBreachedAt?: number | undefined;
5180
+ } | undefined;
3576
5181
  } | {
3577
5182
  id: string;
5183
+ tradeAccountId: string;
3578
5184
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3579
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5185
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5186
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3580
5187
  createdAt: string;
3581
5188
  updatedAt: string;
3582
- intent: "ADJUST";
3583
- orderType: "MARKET";
3584
- position: {
3585
- id: string;
3586
- exposure: Record<string, `-${string}` | `+${string}`>;
5189
+ intent: "CLOSE";
5190
+ type: "MARKET";
5191
+ condition: {
5192
+ type: "ratio";
5193
+ data: {
5194
+ priceSource: "mark" | "mid";
5195
+ symbol_a: string;
5196
+ symbol_b: string;
5197
+ track: "PEAK" | "TROUGH";
5198
+ threshold: number;
5199
+ };
5200
+ } | {
5201
+ type: "price";
5202
+ data: {
5203
+ priceSource: "mark" | "mid";
5204
+ symbol: string;
5205
+ track: "PEAK" | "TROUGH";
5206
+ threshold: number;
5207
+ };
5208
+ } | {
5209
+ type: "weighted_ratio";
5210
+ data: {
5211
+ priceSource: "mark" | "mid";
5212
+ basket: {
5213
+ symbol: string;
5214
+ side: "BUY" | "SELL";
5215
+ weight: number;
5216
+ }[];
5217
+ track: "PEAK" | "TROUGH";
5218
+ threshold: number;
5219
+ };
5220
+ } | {
5221
+ type: "notional";
5222
+ data: {
5223
+ priceSource: "mark" | "mid";
5224
+ track: "PEAK" | "TROUGH";
5225
+ threshold: number;
5226
+ };
5227
+ } | {
5228
+ type: "upnl";
5229
+ data: {
5230
+ priceSource: "mark" | "mid";
5231
+ track: "PEAK" | "TROUGH";
5232
+ threshold: number;
5233
+ };
5234
+ } | {
5235
+ type: "upnl_bps";
5236
+ data: {
5237
+ priceSource: "mark" | "mid";
5238
+ track: "PEAK" | "TROUGH";
5239
+ threshold: number;
5240
+ };
5241
+ } | {
5242
+ type: "ratio_trailing";
5243
+ data: {
5244
+ priceSource: "mark" | "mid";
5245
+ symbol_a: string;
5246
+ symbol_b: string;
5247
+ };
5248
+ } | {
5249
+ type: "price_trailing";
5250
+ data: {
5251
+ priceSource: "mark" | "mid";
5252
+ symbol: string;
5253
+ };
5254
+ } | {
5255
+ type: "weighted_ratio_trailing";
5256
+ data: {
5257
+ priceSource: "mark" | "mid";
5258
+ basket: {
5259
+ symbol: string;
5260
+ side: "BUY" | "SELL";
5261
+ weight: number;
5262
+ }[];
5263
+ };
5264
+ } | {
5265
+ type: "notional_trailing";
5266
+ data: {
5267
+ priceSource: "mark" | "mid";
5268
+ };
5269
+ } | {
5270
+ type: "upnl_trailing";
5271
+ data: {
5272
+ priceSource: "mark" | "mid";
5273
+ };
5274
+ } | {
5275
+ type: "upnl_bps_trailing";
5276
+ data: {
5277
+ priceSource: "mark" | "mid";
5278
+ };
5279
+ } | {
5280
+ type: "funding_rate";
5281
+ data: {
5282
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5283
+ symbol: string;
5284
+ track: "PEAK" | "TROUGH";
5285
+ threshold: number;
5286
+ };
5287
+ } | {
5288
+ type: "prediction_market";
5289
+ data: {
5290
+ source: "kalshi" | "polymarket";
5291
+ marketKey: string;
5292
+ track: "PEAK" | "TROUGH";
5293
+ threshold: number;
5294
+ };
5295
+ } | {
5296
+ type: "btc_dominance";
5297
+ data: {
5298
+ source: "coingecko";
5299
+ track: "PEAK" | "TROUGH";
5300
+ threshold: number;
5301
+ };
3587
5302
  };
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;
5303
+ context: {
3608
5304
  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}`>;
5305
+ position: {
5306
+ id: string;
5307
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5308
+ };
3630
5309
  };
3631
- error?: string | undefined;
3632
- orders?: {
5310
+ ladderId?: string | undefined;
5311
+ ladderIndex?: number | undefined;
5312
+ parentTriggerId?: string | undefined;
5313
+ triggeredAt?: string | undefined;
5314
+ cancelledAt?: string | undefined;
5315
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5316
+ fills?: {
3633
5317
  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";
5318
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5319
+ tradeAccountId: string;
3639
5320
  symbol: string;
5321
+ positionId: string;
5322
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3640
5323
  side: "BUY" | "SELL";
3641
5324
  reduceOnly: boolean;
5325
+ isExternal: boolean;
5326
+ synthetic: boolean;
3642
5327
  quantity: string;
3643
5328
  price: string;
3644
- filledQuantity: string;
3645
- error?: string | undefined;
3646
- errorCode?: string | undefined;
3647
- filledPrice?: string | undefined;
5329
+ usd: string;
5330
+ timestamp: string;
5331
+ cloid?: string | undefined;
5332
+ exchangeFillId?: string | undefined;
5333
+ tradeFee?: string | undefined;
5334
+ pearFee?: string | undefined;
5335
+ original?: {
5336
+ exchangeFillId: string;
5337
+ quantity: string;
5338
+ } | undefined;
3648
5339
  }[] | undefined;
5340
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5341
+ trailing?: {
5342
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5343
+ deltaValue: number;
5344
+ activationValue?: number | undefined;
5345
+ bestMetricSeen?: number | undefined;
5346
+ currentStopValue?: number | undefined;
5347
+ stopBreachedAt?: number | undefined;
5348
+ } | undefined;
3649
5349
  } | {
3650
5350
  id: string;
5351
+ tradeAccountId: string;
3651
5352
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3652
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5353
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5354
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3653
5355
  createdAt: string;
3654
5356
  updatedAt: string;
3655
- intent: "REVERSE";
3656
- orderType: "MARKET";
3657
- position: {
3658
- id: string;
3659
- exposure: Record<string, `-${string}` | `+${string}`>;
5357
+ intent: "ADJUST";
5358
+ type: "TWAP";
5359
+ condition: {
5360
+ type: "ratio";
5361
+ data: {
5362
+ priceSource: "mark" | "mid";
5363
+ symbol_a: string;
5364
+ symbol_b: string;
5365
+ track: "PEAK" | "TROUGH";
5366
+ threshold: number;
5367
+ };
5368
+ } | {
5369
+ type: "price";
5370
+ data: {
5371
+ priceSource: "mark" | "mid";
5372
+ symbol: string;
5373
+ track: "PEAK" | "TROUGH";
5374
+ threshold: number;
5375
+ };
5376
+ } | {
5377
+ type: "weighted_ratio";
5378
+ data: {
5379
+ priceSource: "mark" | "mid";
5380
+ basket: {
5381
+ symbol: string;
5382
+ side: "BUY" | "SELL";
5383
+ weight: number;
5384
+ }[];
5385
+ track: "PEAK" | "TROUGH";
5386
+ threshold: number;
5387
+ };
5388
+ } | {
5389
+ type: "notional";
5390
+ data: {
5391
+ priceSource: "mark" | "mid";
5392
+ track: "PEAK" | "TROUGH";
5393
+ threshold: number;
5394
+ };
5395
+ } | {
5396
+ type: "upnl";
5397
+ data: {
5398
+ priceSource: "mark" | "mid";
5399
+ track: "PEAK" | "TROUGH";
5400
+ threshold: number;
5401
+ };
5402
+ } | {
5403
+ type: "upnl_bps";
5404
+ data: {
5405
+ priceSource: "mark" | "mid";
5406
+ track: "PEAK" | "TROUGH";
5407
+ threshold: number;
5408
+ };
5409
+ } | {
5410
+ type: "funding_rate";
5411
+ data: {
5412
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5413
+ symbol: string;
5414
+ track: "PEAK" | "TROUGH";
5415
+ threshold: number;
5416
+ };
5417
+ } | {
5418
+ type: "prediction_market";
5419
+ data: {
5420
+ source: "kalshi" | "polymarket";
5421
+ marketKey: string;
5422
+ track: "PEAK" | "TROUGH";
5423
+ threshold: number;
5424
+ };
5425
+ } | {
5426
+ type: "btc_dominance";
5427
+ data: {
5428
+ source: "coingecko";
5429
+ track: "PEAK" | "TROUGH";
5430
+ threshold: number;
5431
+ };
3660
5432
  };
3661
- error?: string | undefined;
3662
- orders?: {
5433
+ context: {
5434
+ type: "TWAP";
5435
+ durationSec: number;
5436
+ sliceIntervalSec: number;
5437
+ randomization: {
5438
+ timingJitterBps: number;
5439
+ sizeJitterBps: number;
5440
+ };
5441
+ position: {
5442
+ id: string;
5443
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5444
+ };
5445
+ legs: [{
5446
+ symbol: string;
5447
+ side: "BUY" | "SELL";
5448
+ weight: number;
5449
+ id?: string | undefined;
5450
+ }, ...{
5451
+ symbol: string;
5452
+ side: "BUY" | "SELL";
5453
+ weight: number;
5454
+ id?: string | undefined;
5455
+ }[]];
5456
+ targetNotional: string;
5457
+ };
5458
+ ladderId?: string | undefined;
5459
+ ladderIndex?: number | undefined;
5460
+ parentTriggerId?: string | undefined;
5461
+ triggeredAt?: string | undefined;
5462
+ cancelledAt?: string | undefined;
5463
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5464
+ fills?: {
3663
5465
  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
- }, ...{
5466
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5467
+ tradeAccountId: string;
3697
5468
  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;
5469
+ positionId: string;
3706
5470
  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
5471
  side: "BUY" | "SELL";
3713
5472
  reduceOnly: boolean;
5473
+ isExternal: boolean;
5474
+ synthetic: boolean;
3714
5475
  quantity: string;
3715
5476
  price: string;
3716
- filledQuantity: string;
3717
- error?: string | undefined;
3718
- errorCode?: string | undefined;
3719
- filledPrice?: string | undefined;
5477
+ usd: string;
5478
+ timestamp: string;
5479
+ cloid?: string | undefined;
5480
+ exchangeFillId?: string | undefined;
5481
+ tradeFee?: string | undefined;
5482
+ pearFee?: string | undefined;
5483
+ original?: {
5484
+ exchangeFillId: string;
5485
+ quantity: string;
5486
+ } | undefined;
3720
5487
  }[] | undefined;
5488
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5489
+ scheduleId?: string | undefined;
5490
+ trailing?: {
5491
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5492
+ deltaValue: number;
5493
+ activationValue?: number | undefined;
5494
+ bestMetricSeen?: number | undefined;
5495
+ currentStopValue?: number | undefined;
5496
+ stopBreachedAt?: number | undefined;
5497
+ } | undefined;
3721
5498
  } | {
3722
5499
  id: string;
5500
+ tradeAccountId: string;
3723
5501
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3724
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5502
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5503
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3725
5504
  createdAt: string;
3726
5505
  updatedAt: string;
3727
- intent: "ADJUST";
3728
- orderType: "MARKET";
3729
- position: {
3730
- id: string;
3731
- exposure: Record<string, `-${string}` | `+${string}`>;
5506
+ intent: "CLOSE";
5507
+ type: "TWAP";
5508
+ condition: {
5509
+ type: "ratio";
5510
+ data: {
5511
+ priceSource: "mark" | "mid";
5512
+ symbol_a: string;
5513
+ symbol_b: string;
5514
+ track: "PEAK" | "TROUGH";
5515
+ threshold: number;
5516
+ };
5517
+ } | {
5518
+ type: "price";
5519
+ data: {
5520
+ priceSource: "mark" | "mid";
5521
+ symbol: string;
5522
+ track: "PEAK" | "TROUGH";
5523
+ threshold: number;
5524
+ };
5525
+ } | {
5526
+ type: "weighted_ratio";
5527
+ data: {
5528
+ priceSource: "mark" | "mid";
5529
+ basket: {
5530
+ symbol: string;
5531
+ side: "BUY" | "SELL";
5532
+ weight: number;
5533
+ }[];
5534
+ track: "PEAK" | "TROUGH";
5535
+ threshold: number;
5536
+ };
5537
+ } | {
5538
+ type: "notional";
5539
+ data: {
5540
+ priceSource: "mark" | "mid";
5541
+ track: "PEAK" | "TROUGH";
5542
+ threshold: number;
5543
+ };
5544
+ } | {
5545
+ type: "upnl";
5546
+ data: {
5547
+ priceSource: "mark" | "mid";
5548
+ track: "PEAK" | "TROUGH";
5549
+ threshold: number;
5550
+ };
5551
+ } | {
5552
+ type: "upnl_bps";
5553
+ data: {
5554
+ priceSource: "mark" | "mid";
5555
+ track: "PEAK" | "TROUGH";
5556
+ threshold: number;
5557
+ };
5558
+ } | {
5559
+ type: "ratio_trailing";
5560
+ data: {
5561
+ priceSource: "mark" | "mid";
5562
+ symbol_a: string;
5563
+ symbol_b: string;
5564
+ };
5565
+ } | {
5566
+ type: "price_trailing";
5567
+ data: {
5568
+ priceSource: "mark" | "mid";
5569
+ symbol: string;
5570
+ };
5571
+ } | {
5572
+ type: "weighted_ratio_trailing";
5573
+ data: {
5574
+ priceSource: "mark" | "mid";
5575
+ basket: {
5576
+ symbol: string;
5577
+ side: "BUY" | "SELL";
5578
+ weight: number;
5579
+ }[];
5580
+ };
5581
+ } | {
5582
+ type: "notional_trailing";
5583
+ data: {
5584
+ priceSource: "mark" | "mid";
5585
+ };
5586
+ } | {
5587
+ type: "upnl_trailing";
5588
+ data: {
5589
+ priceSource: "mark" | "mid";
5590
+ };
5591
+ } | {
5592
+ type: "upnl_bps_trailing";
5593
+ data: {
5594
+ priceSource: "mark" | "mid";
5595
+ };
5596
+ } | {
5597
+ type: "funding_rate";
5598
+ data: {
5599
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5600
+ symbol: string;
5601
+ track: "PEAK" | "TROUGH";
5602
+ threshold: number;
5603
+ };
5604
+ } | {
5605
+ type: "prediction_market";
5606
+ data: {
5607
+ source: "kalshi" | "polymarket";
5608
+ marketKey: string;
5609
+ track: "PEAK" | "TROUGH";
5610
+ threshold: number;
5611
+ };
5612
+ } | {
5613
+ type: "btc_dominance";
5614
+ data: {
5615
+ source: "coingecko";
5616
+ track: "PEAK" | "TROUGH";
5617
+ threshold: number;
5618
+ };
3732
5619
  };
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?: {
5620
+ context: {
5621
+ type: "TWAP";
5622
+ durationSec: number;
5623
+ sliceIntervalSec: number;
5624
+ randomization: {
5625
+ timingJitterBps: number;
5626
+ sizeJitterBps: number;
5627
+ };
5628
+ position: {
5629
+ id: string;
5630
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5631
+ };
5632
+ };
5633
+ ladderId?: string | undefined;
5634
+ ladderIndex?: number | undefined;
5635
+ parentTriggerId?: string | undefined;
5636
+ triggeredAt?: string | undefined;
5637
+ cancelledAt?: string | undefined;
5638
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5639
+ fills?: {
3748
5640
  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";
5641
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5642
+ tradeAccountId: string;
3754
5643
  symbol: string;
5644
+ positionId: string;
5645
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3755
5646
  side: "BUY" | "SELL";
3756
5647
  reduceOnly: boolean;
5648
+ isExternal: boolean;
5649
+ synthetic: boolean;
3757
5650
  quantity: string;
3758
5651
  price: string;
3759
- filledQuantity: string;
3760
- error?: string | undefined;
3761
- errorCode?: string | undefined;
3762
- filledPrice?: string | undefined;
5652
+ usd: string;
5653
+ timestamp: string;
5654
+ cloid?: string | undefined;
5655
+ exchangeFillId?: string | undefined;
5656
+ tradeFee?: string | undefined;
5657
+ pearFee?: string | undefined;
5658
+ original?: {
5659
+ exchangeFillId: string;
5660
+ quantity: string;
5661
+ } | undefined;
3763
5662
  }[] | undefined;
3764
- } | {
5663
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5664
+ scheduleId?: string | undefined;
5665
+ trailing?: {
5666
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5667
+ deltaValue: number;
5668
+ activationValue?: number | undefined;
5669
+ bestMetricSeen?: number | undefined;
5670
+ currentStopValue?: number | undefined;
5671
+ stopBreachedAt?: number | undefined;
5672
+ } | undefined;
5673
+ })[];
5674
+ nextCursor?: string | undefined;
5675
+ }>;
5676
+ open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
5677
+ trigger: {
3765
5678
  id: string;
5679
+ tradeAccountId: string;
3766
5680
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3767
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5681
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5682
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3768
5683
  createdAt: string;
3769
5684
  updatedAt: string;
3770
- intent: "CLOSE";
3771
- orderType: "MARKET";
3772
- position: {
3773
- id: string;
3774
- exposure: Record<string, `-${string}` | `+${string}`>;
5685
+ intent: "OPEN";
5686
+ type: "MARKET";
5687
+ condition: {
5688
+ type: "ratio";
5689
+ data: {
5690
+ priceSource: "mark" | "mid";
5691
+ symbol_a: string;
5692
+ symbol_b: string;
5693
+ track: "PEAK" | "TROUGH";
5694
+ threshold: number;
5695
+ };
5696
+ } | {
5697
+ type: "price";
5698
+ data: {
5699
+ priceSource: "mark" | "mid";
5700
+ symbol: string;
5701
+ track: "PEAK" | "TROUGH";
5702
+ threshold: number;
5703
+ };
5704
+ } | {
5705
+ type: "weighted_ratio";
5706
+ data: {
5707
+ priceSource: "mark" | "mid";
5708
+ basket: {
5709
+ symbol: string;
5710
+ side: "BUY" | "SELL";
5711
+ weight: number;
5712
+ }[];
5713
+ track: "PEAK" | "TROUGH";
5714
+ threshold: number;
5715
+ };
5716
+ } | {
5717
+ type: "funding_rate";
5718
+ data: {
5719
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5720
+ symbol: string;
5721
+ track: "PEAK" | "TROUGH";
5722
+ threshold: number;
5723
+ };
5724
+ } | {
5725
+ type: "prediction_market";
5726
+ data: {
5727
+ source: "kalshi" | "polymarket";
5728
+ marketKey: string;
5729
+ track: "PEAK" | "TROUGH";
5730
+ threshold: number;
5731
+ };
5732
+ } | {
5733
+ type: "btc_dominance";
5734
+ data: {
5735
+ source: "coingecko";
5736
+ track: "PEAK" | "TROUGH";
5737
+ threshold: number;
5738
+ };
3775
5739
  };
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;
5740
+ context: {
3783
5741
  type: "MARKET";
5742
+ legs: [{
5743
+ symbol: string;
5744
+ side: "BUY" | "SELL";
5745
+ mode: "QUANTITY" | "USD";
5746
+ amount: string;
5747
+ id?: string | undefined;
5748
+ }, ...{
5749
+ symbol: string;
5750
+ side: "BUY" | "SELL";
5751
+ mode: "QUANTITY" | "USD";
5752
+ amount: string;
5753
+ id?: string | undefined;
5754
+ }[]];
5755
+ attachedTriggers: {
5756
+ kind: "STATIC" | "TRAILING";
5757
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT";
5758
+ }[];
5759
+ };
5760
+ ladderId?: string | undefined;
5761
+ ladderIndex?: number | undefined;
5762
+ parentTriggerId?: string | undefined;
5763
+ triggeredAt?: string | undefined;
5764
+ cancelledAt?: string | undefined;
5765
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5766
+ fills?: {
5767
+ id: string;
5768
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5769
+ tradeAccountId: string;
3784
5770
  symbol: string;
5771
+ positionId: string;
5772
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3785
5773
  side: "BUY" | "SELL";
3786
5774
  reduceOnly: boolean;
5775
+ isExternal: boolean;
5776
+ synthetic: boolean;
3787
5777
  quantity: string;
3788
5778
  price: string;
3789
- filledQuantity: string;
3790
- error?: string | undefined;
3791
- errorCode?: string | undefined;
3792
- filledPrice?: string | undefined;
5779
+ usd: string;
5780
+ timestamp: string;
5781
+ cloid?: string | undefined;
5782
+ exchangeFillId?: string | undefined;
5783
+ tradeFee?: string | undefined;
5784
+ pearFee?: string | undefined;
5785
+ original?: {
5786
+ exchangeFillId: string;
5787
+ quantity: string;
5788
+ } | undefined;
3793
5789
  }[] | undefined;
5790
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
3794
5791
  } | {
3795
5792
  id: string;
5793
+ tradeAccountId: string;
3796
5794
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3797
- status: "CANCELLED" | "ACTIVE" | "COMPLETED" | "IDLE" | "FAILED";
5795
+ status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
5796
+ bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3798
5797
  createdAt: string;
3799
5798
  updatedAt: string;
3800
- intent: "REVERSE";
3801
- orderType: "MARKET";
3802
- position: {
3803
- id: string;
3804
- exposure: Record<string, `-${string}` | `+${string}`>;
5799
+ intent: "ADJUST";
5800
+ type: "MARKET";
5801
+ condition: {
5802
+ type: "ratio";
5803
+ data: {
5804
+ priceSource: "mark" | "mid";
5805
+ symbol_a: string;
5806
+ symbol_b: string;
5807
+ track: "PEAK" | "TROUGH";
5808
+ threshold: number;
5809
+ };
5810
+ } | {
5811
+ type: "price";
5812
+ data: {
5813
+ priceSource: "mark" | "mid";
5814
+ symbol: string;
5815
+ track: "PEAK" | "TROUGH";
5816
+ threshold: number;
5817
+ };
5818
+ } | {
5819
+ type: "weighted_ratio";
5820
+ data: {
5821
+ priceSource: "mark" | "mid";
5822
+ basket: {
5823
+ symbol: string;
5824
+ side: "BUY" | "SELL";
5825
+ weight: number;
5826
+ }[];
5827
+ track: "PEAK" | "TROUGH";
5828
+ threshold: number;
5829
+ };
5830
+ } | {
5831
+ type: "notional";
5832
+ data: {
5833
+ priceSource: "mark" | "mid";
5834
+ track: "PEAK" | "TROUGH";
5835
+ threshold: number;
5836
+ };
5837
+ } | {
5838
+ type: "upnl";
5839
+ data: {
5840
+ priceSource: "mark" | "mid";
5841
+ track: "PEAK" | "TROUGH";
5842
+ threshold: number;
5843
+ };
5844
+ } | {
5845
+ type: "upnl_bps";
5846
+ data: {
5847
+ priceSource: "mark" | "mid";
5848
+ track: "PEAK" | "TROUGH";
5849
+ threshold: number;
5850
+ };
5851
+ } | {
5852
+ type: "funding_rate";
5853
+ data: {
5854
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
5855
+ symbol: string;
5856
+ track: "PEAK" | "TROUGH";
5857
+ threshold: number;
5858
+ };
5859
+ } | {
5860
+ type: "prediction_market";
5861
+ data: {
5862
+ source: "kalshi" | "polymarket";
5863
+ marketKey: string;
5864
+ track: "PEAK" | "TROUGH";
5865
+ threshold: number;
5866
+ };
5867
+ } | {
5868
+ type: "btc_dominance";
5869
+ data: {
5870
+ source: "coingecko";
5871
+ track: "PEAK" | "TROUGH";
5872
+ threshold: number;
5873
+ };
3805
5874
  };
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;
5875
+ context: {
3813
5876
  type: "MARKET";
5877
+ position: {
5878
+ id: string;
5879
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
5880
+ };
5881
+ legs: [{
5882
+ symbol: string;
5883
+ side: "BUY" | "SELL";
5884
+ mode: "QUANTITY" | "USD";
5885
+ amount: string;
5886
+ reduceOnly: boolean;
5887
+ id?: string | undefined;
5888
+ }, ...{
5889
+ symbol: string;
5890
+ side: "BUY" | "SELL";
5891
+ mode: "QUANTITY" | "USD";
5892
+ amount: string;
5893
+ reduceOnly: boolean;
5894
+ id?: string | undefined;
5895
+ }[]];
5896
+ };
5897
+ ladderId?: string | undefined;
5898
+ ladderIndex?: number | undefined;
5899
+ parentTriggerId?: string | undefined;
5900
+ triggeredAt?: string | undefined;
5901
+ cancelledAt?: string | undefined;
5902
+ cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | "POSITION_REVERSED" | undefined;
5903
+ fills?: {
5904
+ id: string;
5905
+ status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
5906
+ tradeAccountId: string;
3814
5907
  symbol: string;
5908
+ positionId: string;
5909
+ connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
3815
5910
  side: "BUY" | "SELL";
3816
5911
  reduceOnly: boolean;
5912
+ isExternal: boolean;
5913
+ synthetic: boolean;
3817
5914
  quantity: string;
3818
5915
  price: string;
3819
- filledQuantity: string;
3820
- error?: string | undefined;
3821
- errorCode?: string | undefined;
3822
- filledPrice?: string | undefined;
5916
+ usd: string;
5917
+ timestamp: string;
5918
+ cloid?: string | undefined;
5919
+ exchangeFillId?: string | undefined;
5920
+ tradeFee?: string | undefined;
5921
+ pearFee?: string | undefined;
5922
+ original?: {
5923
+ exchangeFillId: string;
5924
+ quantity: string;
5925
+ } | undefined;
3823
5926
  }[] | 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: ({
5927
+ semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
5928
+ trailing?: {
5929
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5930
+ deltaValue: number;
5931
+ activationValue?: number | undefined;
5932
+ bestMetricSeen?: number | undefined;
5933
+ currentStopValue?: number | undefined;
5934
+ stopBreachedAt?: number | undefined;
5935
+ } | undefined;
5936
+ } | {
3832
5937
  id: string;
3833
5938
  tradeAccountId: string;
3834
5939
  connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
@@ -3836,7 +5941,7 @@ declare class Core {
3836
5941
  bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
3837
5942
  createdAt: string;
3838
5943
  updatedAt: string;
3839
- intent: "OPEN";
5944
+ intent: "CLOSE";
3840
5945
  type: "MARKET";
3841
5946
  condition: {
3842
5947
  type: "ratio";
@@ -3867,6 +5972,65 @@ declare class Core {
3867
5972
  track: "PEAK" | "TROUGH";
3868
5973
  threshold: number;
3869
5974
  };
5975
+ } | {
5976
+ type: "notional";
5977
+ data: {
5978
+ priceSource: "mark" | "mid";
5979
+ track: "PEAK" | "TROUGH";
5980
+ threshold: number;
5981
+ };
5982
+ } | {
5983
+ type: "upnl";
5984
+ data: {
5985
+ priceSource: "mark" | "mid";
5986
+ track: "PEAK" | "TROUGH";
5987
+ threshold: number;
5988
+ };
5989
+ } | {
5990
+ type: "upnl_bps";
5991
+ data: {
5992
+ priceSource: "mark" | "mid";
5993
+ track: "PEAK" | "TROUGH";
5994
+ threshold: number;
5995
+ };
5996
+ } | {
5997
+ type: "ratio_trailing";
5998
+ data: {
5999
+ priceSource: "mark" | "mid";
6000
+ symbol_a: string;
6001
+ symbol_b: string;
6002
+ };
6003
+ } | {
6004
+ type: "price_trailing";
6005
+ data: {
6006
+ priceSource: "mark" | "mid";
6007
+ symbol: string;
6008
+ };
6009
+ } | {
6010
+ type: "weighted_ratio_trailing";
6011
+ data: {
6012
+ priceSource: "mark" | "mid";
6013
+ basket: {
6014
+ symbol: string;
6015
+ side: "BUY" | "SELL";
6016
+ weight: number;
6017
+ }[];
6018
+ };
6019
+ } | {
6020
+ type: "notional_trailing";
6021
+ data: {
6022
+ priceSource: "mark" | "mid";
6023
+ };
6024
+ } | {
6025
+ type: "upnl_trailing";
6026
+ data: {
6027
+ priceSource: "mark" | "mid";
6028
+ };
6029
+ } | {
6030
+ type: "upnl_bps_trailing";
6031
+ data: {
6032
+ priceSource: "mark" | "mid";
6033
+ };
3870
6034
  } | {
3871
6035
  type: "funding_rate";
3872
6036
  data: {
@@ -3893,21 +6057,10 @@ declare class Core {
3893
6057
  };
3894
6058
  context: {
3895
6059
  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
- }[];
6060
+ position: {
6061
+ id: string;
6062
+ initialExposure: Record<string, `-${string}` | `+${string}`>;
6063
+ };
3911
6064
  };
3912
6065
  ladderId?: string | undefined;
3913
6066
  ladderIndex?: number | undefined;
@@ -3940,6 +6093,14 @@ declare class Core {
3940
6093
  } | undefined;
3941
6094
  }[] | undefined;
3942
6095
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6096
+ trailing?: {
6097
+ mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
6098
+ deltaValue: number;
6099
+ activationValue?: number | undefined;
6100
+ bestMetricSeen?: number | undefined;
6101
+ currentStopValue?: number | undefined;
6102
+ stopBreachedAt?: number | undefined;
6103
+ } | undefined;
3943
6104
  } | {
3944
6105
  id: string;
3945
6106
  tradeAccountId: string;
@@ -3949,7 +6110,7 @@ declare class Core {
3949
6110
  createdAt: string;
3950
6111
  updatedAt: string;
3951
6112
  intent: "ADJUST";
3952
- type: "MARKET";
6113
+ type: "TWAP";
3953
6114
  condition: {
3954
6115
  type: "ratio";
3955
6116
  data: {
@@ -4025,7 +6186,13 @@ declare class Core {
4025
6186
  };
4026
6187
  };
4027
6188
  context: {
4028
- type: "MARKET";
6189
+ type: "TWAP";
6190
+ durationSec: number;
6191
+ sliceIntervalSec: number;
6192
+ randomization: {
6193
+ timingJitterBps: number;
6194
+ sizeJitterBps: number;
6195
+ };
4029
6196
  position: {
4030
6197
  id: string;
4031
6198
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4033,16 +6200,15 @@ declare class Core {
4033
6200
  legs: [{
4034
6201
  symbol: string;
4035
6202
  side: "BUY" | "SELL";
4036
- mode: "QUANTITY" | "USD";
4037
- amount: string;
4038
- reduceOnly: boolean;
6203
+ weight: number;
6204
+ id?: string | undefined;
4039
6205
  }, ...{
4040
6206
  symbol: string;
4041
6207
  side: "BUY" | "SELL";
4042
- mode: "QUANTITY" | "USD";
4043
- amount: string;
4044
- reduceOnly: boolean;
6208
+ weight: number;
6209
+ id?: string | undefined;
4045
6210
  }[]];
6211
+ targetNotional: string;
4046
6212
  };
4047
6213
  ladderId?: string | undefined;
4048
6214
  ladderIndex?: number | undefined;
@@ -4075,6 +6241,7 @@ declare class Core {
4075
6241
  } | undefined;
4076
6242
  }[] | undefined;
4077
6243
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6244
+ scheduleId?: string | undefined;
4078
6245
  trailing?: {
4079
6246
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4080
6247
  deltaValue: number;
@@ -4092,7 +6259,7 @@ declare class Core {
4092
6259
  createdAt: string;
4093
6260
  updatedAt: string;
4094
6261
  intent: "CLOSE";
4095
- type: "MARKET";
6262
+ type: "TWAP";
4096
6263
  condition: {
4097
6264
  type: "ratio";
4098
6265
  data: {
@@ -4206,7 +6373,13 @@ declare class Core {
4206
6373
  };
4207
6374
  };
4208
6375
  context: {
4209
- type: "MARKET";
6376
+ type: "TWAP";
6377
+ durationSec: number;
6378
+ sliceIntervalSec: number;
6379
+ randomization: {
6380
+ timingJitterBps: number;
6381
+ sizeJitterBps: number;
6382
+ };
4210
6383
  position: {
4211
6384
  id: string;
4212
6385
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4243,6 +6416,7 @@ declare class Core {
4243
6416
  } | undefined;
4244
6417
  }[] | undefined;
4245
6418
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6419
+ scheduleId?: string | undefined;
4246
6420
  trailing?: {
4247
6421
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4248
6422
  deltaValue: number;
@@ -4251,10 +6425,9 @@ declare class Core {
4251
6425
  currentStopValue?: number | undefined;
4252
6426
  stopBreachedAt?: number | undefined;
4253
6427
  } | undefined;
4254
- })[];
4255
- nextCursor?: string | undefined;
6428
+ };
4256
6429
  }>;
4257
- open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
6430
+ close: (body: HttpTypes.CreateTriggerClose, headers?: ClientHeaders) => Promise<{
4258
6431
  trigger: {
4259
6432
  id: string;
4260
6433
  tradeAccountId: string;
@@ -4325,11 +6498,13 @@ declare class Core {
4325
6498
  side: "BUY" | "SELL";
4326
6499
  mode: "QUANTITY" | "USD";
4327
6500
  amount: string;
6501
+ id?: string | undefined;
4328
6502
  }, ...{
4329
6503
  symbol: string;
4330
6504
  side: "BUY" | "SELL";
4331
6505
  mode: "QUANTITY" | "USD";
4332
6506
  amount: string;
6507
+ id?: string | undefined;
4333
6508
  }[]];
4334
6509
  attachedTriggers: {
4335
6510
  kind: "STATIC" | "TRAILING";
@@ -4463,12 +6638,14 @@ declare class Core {
4463
6638
  mode: "QUANTITY" | "USD";
4464
6639
  amount: string;
4465
6640
  reduceOnly: boolean;
6641
+ id?: string | undefined;
4466
6642
  }, ...{
4467
6643
  symbol: string;
4468
6644
  side: "BUY" | "SELL";
4469
6645
  mode: "QUANTITY" | "USD";
4470
6646
  amount: string;
4471
6647
  reduceOnly: boolean;
6648
+ id?: string | undefined;
4472
6649
  }[]];
4473
6650
  };
4474
6651
  ladderId?: string | undefined;
@@ -4678,121 +6855,6 @@ declare class Core {
4678
6855
  currentStopValue?: number | undefined;
4679
6856
  stopBreachedAt?: number | undefined;
4680
6857
  } | 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
6858
  } | {
4797
6859
  id: string;
4798
6860
  tradeAccountId: string;
@@ -4802,7 +6864,7 @@ declare class Core {
4802
6864
  createdAt: string;
4803
6865
  updatedAt: string;
4804
6866
  intent: "ADJUST";
4805
- type: "MARKET";
6867
+ type: "TWAP";
4806
6868
  condition: {
4807
6869
  type: "ratio";
4808
6870
  data: {
@@ -4878,7 +6940,13 @@ declare class Core {
4878
6940
  };
4879
6941
  };
4880
6942
  context: {
4881
- type: "MARKET";
6943
+ type: "TWAP";
6944
+ durationSec: number;
6945
+ sliceIntervalSec: number;
6946
+ randomization: {
6947
+ timingJitterBps: number;
6948
+ sizeJitterBps: number;
6949
+ };
4882
6950
  position: {
4883
6951
  id: string;
4884
6952
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -4886,16 +6954,15 @@ declare class Core {
4886
6954
  legs: [{
4887
6955
  symbol: string;
4888
6956
  side: "BUY" | "SELL";
4889
- mode: "QUANTITY" | "USD";
4890
- amount: string;
4891
- reduceOnly: boolean;
6957
+ weight: number;
6958
+ id?: string | undefined;
4892
6959
  }, ...{
4893
6960
  symbol: string;
4894
6961
  side: "BUY" | "SELL";
4895
- mode: "QUANTITY" | "USD";
4896
- amount: string;
4897
- reduceOnly: boolean;
6962
+ weight: number;
6963
+ id?: string | undefined;
4898
6964
  }[]];
6965
+ targetNotional: string;
4899
6966
  };
4900
6967
  ladderId?: string | undefined;
4901
6968
  ladderIndex?: number | undefined;
@@ -4928,6 +6995,7 @@ declare class Core {
4928
6995
  } | undefined;
4929
6996
  }[] | undefined;
4930
6997
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
6998
+ scheduleId?: string | undefined;
4931
6999
  trailing?: {
4932
7000
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
4933
7001
  deltaValue: number;
@@ -4945,7 +7013,7 @@ declare class Core {
4945
7013
  createdAt: string;
4946
7014
  updatedAt: string;
4947
7015
  intent: "CLOSE";
4948
- type: "MARKET";
7016
+ type: "TWAP";
4949
7017
  condition: {
4950
7018
  type: "ratio";
4951
7019
  data: {
@@ -5059,7 +7127,13 @@ declare class Core {
5059
7127
  };
5060
7128
  };
5061
7129
  context: {
5062
- type: "MARKET";
7130
+ type: "TWAP";
7131
+ durationSec: number;
7132
+ sliceIntervalSec: number;
7133
+ randomization: {
7134
+ timingJitterBps: number;
7135
+ sizeJitterBps: number;
7136
+ };
5063
7137
  position: {
5064
7138
  id: string;
5065
7139
  initialExposure: Record<string, `-${string}` | `+${string}`>;
@@ -5096,6 +7170,7 @@ declare class Core {
5096
7170
  } | undefined;
5097
7171
  }[] | undefined;
5098
7172
  semanticBracketType?: "STOP_LOSS" | "TAKE_PROFIT" | "NONE" | undefined;
7173
+ scheduleId?: string | undefined;
5099
7174
  trailing?: {
5100
7175
  mode: "RELATIVE_BPS" | "ABSOLUTE_POINTS";
5101
7176
  deltaValue: number;