@pear-protocol/types 2.23.0 → 2.25.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.
Files changed (46) hide show
  1. package/dist/copy/entities.d.ts +162 -10
  2. package/dist/copy/responses.d.ts +96 -11
  3. package/dist/execution/entities.d.ts +260 -43
  4. package/dist/execution/queries.d.ts +3 -2
  5. package/dist/execution/responses.d.ts +144 -24
  6. package/dist/fill/entities.d.ts +60 -1
  7. package/dist/fill/queries.d.ts +1 -0
  8. package/dist/fill/responses.d.ts +34 -4
  9. package/dist/index.js +743 -411
  10. package/dist/ladder/entities.d.ts +141 -24
  11. package/dist/ladder/payloads.d.ts +60 -24
  12. package/dist/ladder/queries.d.ts +2 -2
  13. package/dist/ladder/responses.d.ts +420 -69
  14. package/dist/leverage/payloads.d.ts +6 -1
  15. package/dist/notification/entities.d.ts +209 -7
  16. package/dist/notification/responses.d.ts +99 -2
  17. package/dist/order/entities.d.ts +3 -3
  18. package/dist/position/entities.d.ts +5 -5
  19. package/dist/position/responses.d.ts +4 -4
  20. package/dist/realtime/frames.d.ts +38 -6
  21. package/dist/realtime/public-events.d.ts +19 -3
  22. package/dist/rewards/entities.d.ts +18 -0
  23. package/dist/rewards/index.d.ts +1 -0
  24. package/dist/rewards/queries.d.ts +7 -0
  25. package/dist/rewards/responses.d.ts +52 -0
  26. package/dist/schedule/entities.d.ts +155 -19
  27. package/dist/schedule/index.d.ts +1 -0
  28. package/dist/schedule/queries.d.ts +3 -2
  29. package/dist/schedule/responses.d.ts +142 -19
  30. package/dist/sync/payloads.d.ts +56 -88
  31. package/dist/tca/responses.d.ts +12 -12
  32. package/dist/trade/payloads.d.ts +60 -24
  33. package/dist/trade/responses.d.ts +360 -60
  34. package/dist/traders/performance.d.ts +4 -0
  35. package/dist/traders/public.d.ts +537 -285
  36. package/dist/trigger/common/index.d.ts +8 -2
  37. package/dist/trigger/entities/conditions.d.ts +40 -0
  38. package/dist/trigger/entities/index.d.ts +339 -32
  39. package/dist/trigger/payloads/conditions.d.ts +70 -38
  40. package/dist/trigger/payloads/index.d.ts +408 -216
  41. package/dist/trigger/queries.d.ts +2 -2
  42. package/dist/trigger/responses.d.ts +218 -20
  43. package/dist/users/entities.d.ts +1 -0
  44. package/dist/users/payloads.d.ts +1 -0
  45. package/dist/users/response.d.ts +2 -0
  46. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -22,6 +22,7 @@ __export(bundle_exports, {
22
22
  ApiKeyScope: () => ApiKeyScope,
23
23
  ApiKeySummary: () => ApiKeySummary,
24
24
  ApplicableFill: () => ApplicableFill,
25
+ ApplicableFillAssignment: () => ApplicableFillAssignment,
25
26
  ApplicableMetadata: () => ApplicableMetadata,
26
27
  ApplicablePosition: () => ApplicablePosition,
27
28
  AppliedFeeDiscount: () => AppliedFeeDiscount,
@@ -69,7 +70,11 @@ __export(bundle_exports, {
69
70
  CopyActivityListResponse: () => CopyActivityListResponse,
70
71
  CopyActivityOutcome: () => CopyActivityOutcome,
71
72
  CopyActivityState: () => CopyActivityState,
73
+ CopyActivityTWAP: () => CopyActivityTWAP,
74
+ CopyActivityTWAPReduction: () => CopyActivityTWAPReduction,
72
75
  CopyCaptureTiming: () => CopyCaptureTiming,
76
+ CopyControlTransferReason: () => CopyControlTransferReason,
77
+ CopyCoverage: () => CopyCoverage,
73
78
  CopyEndCapture: () => CopyEndCapture,
74
79
  CopyEndCaptureStatus: () => CopyEndCaptureStatus,
75
80
  CopyEndedSubscriptionWithVolume: () => CopyEndedSubscriptionWithVolume,
@@ -80,6 +85,7 @@ __export(bundle_exports, {
80
85
  CopyHealthResponse: () => CopyHealthResponse,
81
86
  CopyJoinResult: () => CopyJoinResult,
82
87
  CopyLeaderAction: () => CopyLeaderAction,
88
+ CopyManagedPosition: () => CopyManagedPosition,
83
89
  CopyPerformance: () => CopyPerformance,
84
90
  CopyPnlBreakdown: () => CopyPnlBreakdown,
85
91
  CopySizing: () => CopySizing,
@@ -97,6 +103,8 @@ __export(bundle_exports, {
97
103
  CopySubscriptionResponse: () => CopySubscriptionResponse,
98
104
  CopySubscriptionStatus: () => CopySubscriptionStatus,
99
105
  CopySubscriptionWithMetrics: () => CopySubscriptionWithMetrics,
106
+ CopyUnmanagedFollowerPositionReason: () => CopyUnmanagedFollowerPositionReason,
107
+ CopyUnmanagedPosition: () => CopyUnmanagedPosition,
100
108
  CreateApiKeyInput: () => CreateApiKeyInput,
101
109
  CreateApiKeyOutput: () => CreateApiKeyOutput,
102
110
  CreateApiKeyWithMessageResult: () => CreateApiKeyWithMessageResult,
@@ -174,16 +182,20 @@ __export(bundle_exports, {
174
182
  ExchangeCredentialsResponse: () => ExchangeCredentialsResponse,
175
183
  ExchangeXLoginRequest: () => ExchangeXLoginRequest,
176
184
  Execution: () => Execution,
185
+ ExecutionErrorCode: () => ExecutionErrorCode,
177
186
  ExecutionFulfillment: () => ExecutionFulfillment,
178
187
  ExecutionIntent: () => ExecutionIntent,
179
188
  ExecutionLegMode: () => ExecutionLegMode,
180
189
  ExecutionListParams: () => ExecutionListParams,
181
190
  ExecutionListResponse: () => ExecutionListResponse,
182
191
  ExecutionOrderType: () => ExecutionOrderType,
192
+ ExecutionRefusedLeg: () => ExecutionRefusedLeg,
193
+ ExecutionRefusedLegErrorCode: () => ExecutionRefusedLegErrorCode,
183
194
  ExecutionStatus: () => ExecutionStatus,
184
195
  ExternalPosition: () => ExternalPosition,
185
196
  ExternalTrigger: () => ExternalTrigger,
186
197
  ExternalTriggerSource: () => ExternalTriggerSource,
198
+ FINAL_TWAP_SLICE_START_HEADROOM_SEC: () => FINAL_TWAP_SLICE_START_HEADROOM_SEC,
187
199
  FeeBps: () => FeeBps,
188
200
  FeeConnector: () => FeeConnector,
189
201
  FeeDiscountScope: () => FeeDiscountScope,
@@ -192,6 +204,7 @@ __export(bundle_exports, {
192
204
  FeeResponse: () => FeeResponse,
193
205
  FeeRole: () => FeeRole,
194
206
  Fill: () => Fill,
207
+ FillAssignment: () => FillAssignment,
195
208
  FillListParams: () => FillListParams,
196
209
  FillListResponse: () => FillListResponse,
197
210
  FillOrderBy: () => FillOrderBy,
@@ -252,6 +265,7 @@ __export(bundle_exports, {
252
265
  ListApiKeysOutput: () => ListApiKeysOutput,
253
266
  ListLighterUdaDepositsParams: () => ListLighterUdaDepositsParams,
254
267
  ListLighterUdaDepositsResult: () => ListLighterUdaDepositsResult,
268
+ ListRewardClaimsQuery: () => ListRewardClaimsQuery,
255
269
  LoginMethod: () => LoginMethod,
256
270
  LoginRequest: () => LoginRequest,
257
271
  LoginResponse: () => LoginResponse,
@@ -259,7 +273,9 @@ __export(bundle_exports, {
259
273
  LogoutResponse: () => LogoutResponse,
260
274
  MARKET_BASKET_POSITION_COUNTS_MAX_BASKETS: () => MARKET_BASKET_POSITION_COUNTS_MAX_BASKETS,
261
275
  MAX_FEE_BPS: () => MAX_FEE_BPS,
276
+ MAX_TWAP_DURATION_SEC: () => MAX_TWAP_DURATION_SEC,
262
277
  MAX_VAULTS_PER_CONNECTION: () => MAX_VAULTS_PER_CONNECTION,
278
+ MIN_TWAP_SLICE_INTERVAL_SEC: () => MIN_TWAP_SLICE_INTERVAL_SEC,
263
279
  ManagementVaultDataset: () => ManagementVaultDataset,
264
280
  ManagementVaultInvalidatedData: () => ManagementVaultInvalidatedData,
265
281
  MarginMode: () => MarginMode,
@@ -343,6 +359,7 @@ __export(bundle_exports, {
343
359
  PositionClosedReason: () => PositionClosedReason,
344
360
  PositionEntryPrices: () => PositionEntryPrices,
345
361
  PositionExposure: () => PositionExposure,
362
+ PositionFill: () => PositionFill,
346
363
  PositionFillListResponse: () => PositionFillListResponse,
347
364
  PositionInitialExposureUSD: () => PositionInitialExposureUSD,
348
365
  PositionListParams: () => PositionListParams,
@@ -407,13 +424,16 @@ __export(bundle_exports, {
407
424
  ResendVerificationResponse: () => ResendVerificationResponse,
408
425
  ResetPasswordRequest: () => ResetPasswordRequest,
409
426
  ResetPasswordResponse: () => ResetPasswordResponse,
427
+ ResizeBehavior: () => ResizeBehavior,
410
428
  RewardAccrual: () => RewardAccrual,
411
429
  RewardAccrualResponse: () => RewardAccrualResponse,
412
430
  RewardClaimId: () => RewardClaimId,
431
+ RewardClaimListResponse: () => RewardClaimListResponse,
413
432
  RewardClaimResponse: () => RewardClaimResponse,
414
433
  RewardClaimStatus: () => RewardClaimStatus,
415
434
  RewardClaimStatusResponse: () => RewardClaimStatusResponse,
416
435
  RewardPayoutAvailability: () => RewardPayoutAvailability,
436
+ RewardSourceAccrual: () => RewardSourceAccrual,
417
437
  RewardSummaryResponse: () => RewardSummaryResponse,
418
438
  SavedBasket: () => SavedBasket,
419
439
  SavedBasketLeg: () => SavedBasketLeg,
@@ -423,6 +443,8 @@ __export(bundle_exports, {
423
443
  ScheduleDetailParams: () => ScheduleDetailParams,
424
444
  ScheduleDetailResponse: () => ScheduleDetailResponse,
425
445
  ScheduleExecutionType: () => ScheduleExecutionType,
446
+ ScheduleFailedReason: () => ScheduleFailedReason,
447
+ ScheduleFailure: () => ScheduleFailure,
426
448
  ScheduleIntent: () => ScheduleIntent,
427
449
  ScheduleListParams: () => ScheduleListParams,
428
450
  ScheduleListResponse: () => ScheduleListResponse,
@@ -1187,6 +1209,400 @@ var TradeLegPostOnlyWithMaxImpactPrice = TradeLegShape.omit({
1187
1209
  reduceOnly: true
1188
1210
  }).extend(TradeLegMaxImpactPrice).strict().superRefine(RefineLegIdMatchesSymbol);
1189
1211
  var EthereumTransactionHash = z.string().regex(/^0x[a-fA-F0-9]{64}$/).transform((val) => val);
1212
+ var FillStatus = z.enum([
1213
+ "PROVISIONAL",
1214
+ "CONFIRMED",
1215
+ "RECONCILED"
1216
+ ]);
1217
+ var FillAssignment = z.object({
1218
+ /** Position UUID receiving this allocation. */
1219
+ positionId: z.uuid(),
1220
+ quantity: z.string(),
1221
+ usd: z.string(),
1222
+ tradeFee: z.string().optional(),
1223
+ pearFee: z.string().optional()
1224
+ });
1225
+ var FillFields = z.object({
1226
+ /**
1227
+ * Fill UUID
1228
+ */
1229
+ id: z.uuid(),
1230
+ /** Client order ID (abbreviated as cloid) */
1231
+ cloid: z.string().optional(),
1232
+ /** Exchange-native fill ID (tradeId / tid / etc) */
1233
+ exchangeFillId: z.string().optional(),
1234
+ /**
1235
+ * Fill lifecycle status
1236
+ */
1237
+ status: FillStatus,
1238
+ /**
1239
+ * Trade account UUID
1240
+ */
1241
+ tradeAccountId: z.uuid(),
1242
+ /**
1243
+ * Instrument ID
1244
+ */
1245
+ symbol: InstrumentId,
1246
+ /**
1247
+ * Parent execution UUID when the fill came from an execution
1248
+ */
1249
+ executionId: z.uuid().optional(),
1250
+ /**
1251
+ * Parent schedule UUID for schedule-spawned fills
1252
+ */
1253
+ scheduleId: z.uuid().optional(),
1254
+ /**
1255
+ * Parent trigger UUID for trigger-fired fills
1256
+ */
1257
+ triggerId: z.uuid().optional(),
1258
+ /**
1259
+ * Connector
1260
+ */
1261
+ connector: Connector,
1262
+ /**
1263
+ * Side
1264
+ */
1265
+ side: Side,
1266
+ /**
1267
+ * Reduce only flag
1268
+ */
1269
+ reduceOnly: z.boolean(),
1270
+ /** True when the fill was created from external sync. */
1271
+ isExternal: z.boolean(),
1272
+ /**
1273
+ * True when the fill is a synthetic bridge fill (gap/gone reconstruction).
1274
+ * Unpriceable gone-close synthetics carry "0" price/usd and should be displayed distinctly.
1275
+ */
1276
+ synthetic: z.boolean(),
1277
+ quantity: z.string(),
1278
+ /** Filled price — "0" on an unpriceable gone-close synthetic (no price guessing). */
1279
+ price: z.string(),
1280
+ /** USD value — "0" on an unpriceable gone-close synthetic (cannot compute without price). */
1281
+ usd: z.string(),
1282
+ /**
1283
+ * Trade fee paid
1284
+ */
1285
+ tradeFee: z.string().optional(),
1286
+ /**
1287
+ * Pear fee paid
1288
+ */
1289
+ pearFee: z.string().optional(),
1290
+ /**
1291
+ * Timestamp
1292
+ */
1293
+ timestamp: z.string(),
1294
+ /**
1295
+ * A fill spanning multiple positions gets a synthetic exchange fill id.
1296
+ * This `original` field contains the root exchange fill id and quantity.
1297
+ */
1298
+ original: z.object({
1299
+ exchangeFillId: z.string(),
1300
+ quantity: z.string()
1301
+ }).optional()
1302
+ });
1303
+ var Fill = FillFields.extend({
1304
+ /** Allocated quantities and fees for each affected position. */
1305
+ assignments: z.array(FillAssignment)
1306
+ });
1307
+ var PositionFill = FillFields.extend({
1308
+ /** Position UUID receiving the quantity, USD value and fees in this view. */
1309
+ positionId: z.uuid()
1310
+ });
1311
+ var MAX_JITTER_BPS = 5e3;
1312
+ var DEFAULT_TWAP_RANDOMIZATION = {
1313
+ timingJitterBps: 0,
1314
+ sizeJitterBps: 0
1315
+ };
1316
+ var TWAPRandomization = z.object({
1317
+ /** Maximum symmetric timing variation in basis points, capped at ±50%. */
1318
+ timingJitterBps: z.int().min(0).max(MAX_JITTER_BPS),
1319
+ /** Maximum symmetric basket-size variation in basis points, capped at ±50%. */
1320
+ sizeJitterBps: z.int().min(0).max(MAX_JITTER_BPS)
1321
+ });
1322
+
1323
+ // src/schedule/entities.ts
1324
+ var ScheduleStrategy = z.enum([
1325
+ "TWAP",
1326
+ "VWAP"
1327
+ ]);
1328
+ var ScheduleStatus = z.enum([
1329
+ "ACTIVE",
1330
+ "COMPLETED",
1331
+ "FAILED",
1332
+ "CANCELLED"
1333
+ ]);
1334
+ var ScheduleIntent = z.enum([
1335
+ "OPEN",
1336
+ "CLOSE"
1337
+ ]);
1338
+ var ScheduleExecutionType = z.enum([
1339
+ "MARKET"
1340
+ ]);
1341
+ var ScheduleCancelledReason = z.enum([
1342
+ "POSITION_CLOSED",
1343
+ "USER",
1344
+ "SYSTEM",
1345
+ "POSITION_NETTED",
1346
+ "POSITION_LIQUIDATED",
1347
+ "POSITION_REVERSED"
1348
+ ]);
1349
+ var ScheduleFailedReason = z.enum([
1350
+ "EXPIRED",
1351
+ "INVALID_SCHEDULE",
1352
+ "POSITION_UNAVAILABLE",
1353
+ "MARKET_DATA_UNAVAILABLE",
1354
+ "NO_PLACEABLE_LEG",
1355
+ "LEG_BELOW_VENUE_MINIMUM",
1356
+ "SLICE_ERRORED",
1357
+ "LEG_FAILED",
1358
+ "REMAINDER_UNFILLED",
1359
+ "REPEATED_SLICE_FAILURES"
1360
+ ]);
1361
+ var ScheduleFailureBeforeSlice = z.object({
1362
+ /**
1363
+ * Why the schedule stopped
1364
+ */
1365
+ reason: ScheduleFailedReason.extract([
1366
+ "EXPIRED",
1367
+ "INVALID_SCHEDULE",
1368
+ "POSITION_UNAVAILABLE",
1369
+ "MARKET_DATA_UNAVAILABLE",
1370
+ "NO_PLACEABLE_LEG",
1371
+ "LEG_BELOW_VENUE_MINIMUM"
1372
+ ])
1373
+ });
1374
+ var ScheduleFailureAfterSlice = z.object({
1375
+ /**
1376
+ * Why the schedule stopped
1377
+ */
1378
+ reason: ScheduleFailedReason.extract([
1379
+ "SLICE_ERRORED",
1380
+ "LEG_FAILED",
1381
+ "REMAINDER_UNFILLED",
1382
+ "REPEATED_SLICE_FAILURES"
1383
+ ]),
1384
+ /**
1385
+ * The stopping slice's execution, for `GET /executions/:id`; absent only when that execution was deleted
1386
+ */
1387
+ executionId: z.uuid().optional()
1388
+ });
1389
+ var ScheduleFailure = z.discriminatedUnion("reason", [
1390
+ ScheduleFailureBeforeSlice,
1391
+ ScheduleFailureAfterSlice
1392
+ ]);
1393
+ var TWAPOpenLeg = z.object({
1394
+ /** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
1395
+ id: InstrumentId.optional(),
1396
+ /**
1397
+ * Instrument ID
1398
+ */
1399
+ symbol: InstrumentId,
1400
+ /**
1401
+ * Side
1402
+ */
1403
+ side: Side,
1404
+ /**
1405
+ * Share of the parent target notional allocated to this leg
1406
+ */
1407
+ weight: AssetWeight
1408
+ });
1409
+ var BaseSchedule = z.object({
1410
+ /**
1411
+ * Schedule UUID
1412
+ */
1413
+ id: z.uuid(),
1414
+ /**
1415
+ * Connector
1416
+ */
1417
+ connector: Connector,
1418
+ /**
1419
+ * Schedule strategy
1420
+ */
1421
+ strategy: ScheduleStrategy,
1422
+ /**
1423
+ * Schedule status
1424
+ */
1425
+ status: ScheduleStatus,
1426
+ /**
1427
+ * Intent
1428
+ */
1429
+ intent: ScheduleIntent,
1430
+ /**
1431
+ * Position key
1432
+ */
1433
+ positionKey: z.string(),
1434
+ /**
1435
+ * Execution type
1436
+ */
1437
+ executionType: ScheduleExecutionType,
1438
+ /**
1439
+ * Last slice at timestamp
1440
+ */
1441
+ lastSliceAt: z.string().optional(),
1442
+ /**
1443
+ * Start at timestamp
1444
+ */
1445
+ startAt: z.string(),
1446
+ /**
1447
+ * End at timestamp
1448
+ */
1449
+ endAt: z.string(),
1450
+ /**
1451
+ * When the schedule was cancelled
1452
+ */
1453
+ cancelledAt: z.string().optional(),
1454
+ /**
1455
+ * Reason for the schedule being cancelled
1456
+ */
1457
+ cancelledReason: ScheduleCancelledReason.optional(),
1458
+ /**
1459
+ * Why a slice stopped the schedule; present on a FAILED schedule whose stop was recorded
1460
+ */
1461
+ failure: ScheduleFailure.optional(),
1462
+ /**
1463
+ * When a slice stopped the schedule as FAILED; present on every FAILED schedule, including those stopped before `failure` existed
1464
+ */
1465
+ failedAt: z.string().optional(),
1466
+ /**
1467
+ * Created at timestamp
1468
+ */
1469
+ createdAt: z.string(),
1470
+ /**
1471
+ * Updated at timestamp
1472
+ */
1473
+ updatedAt: z.string(),
1474
+ /**
1475
+ * Slices that produced live fills
1476
+ */
1477
+ executedSliceCount: z.number().int().nonnegative(),
1478
+ /**
1479
+ * Absolute USD filled across every slice
1480
+ */
1481
+ filledUsd: UnsignedDecimalString,
1482
+ /**
1483
+ * Absolute base quantity filled, per instrument
1484
+ */
1485
+ filledQuantities: z.record(InstrumentId, UnsignedDecimalString),
1486
+ /**
1487
+ * Overall progress from 0 to 1: notional filled for OPEN, the slowest leg for CLOSE
1488
+ */
1489
+ progress: z.number().min(0).max(1),
1490
+ /**
1491
+ * Progress of each leg from 0 to 1, capped at 1 when a leg overfills
1492
+ */
1493
+ legProgress: z.record(InstrumentId, z.number().min(0).max(1))
1494
+ });
1495
+ var TWAPOpen = BaseSchedule.extend({
1496
+ /**
1497
+ * Strategy
1498
+ */
1499
+ strategy: z.literal("TWAP"),
1500
+ /**
1501
+ * Intent
1502
+ */
1503
+ intent: z.literal("OPEN"),
1504
+ /**
1505
+ * Slice interval in seconds
1506
+ */
1507
+ sliceIntervalSec: z.number(),
1508
+ /**
1509
+ * Number of slices planned inside the execution window
1510
+ */
1511
+ sliceCount: z.number().int().positive(),
1512
+ /**
1513
+ * Bounded timing and basket-size randomization
1514
+ */
1515
+ randomization: TWAPRandomization,
1516
+ /**
1517
+ * Parent-order leg allocation
1518
+ */
1519
+ legs: z.array(TWAPOpenLeg),
1520
+ /**
1521
+ * Target notional
1522
+ */
1523
+ targetNotional: UnsignedDecimalString,
1524
+ /**
1525
+ * Remaining notional
1526
+ */
1527
+ remainingNotional: UnsignedDecimalString
1528
+ });
1529
+ var TWAPClose = BaseSchedule.extend({
1530
+ /**
1531
+ * Strategy
1532
+ */
1533
+ strategy: z.literal("TWAP"),
1534
+ /**
1535
+ * Intent
1536
+ */
1537
+ intent: z.literal("CLOSE"),
1538
+ /**
1539
+ * Slice interval in seconds
1540
+ */
1541
+ sliceIntervalSec: z.number(),
1542
+ /**
1543
+ * Number of slices planned inside the execution window
1544
+ */
1545
+ sliceCount: z.number().int().positive(),
1546
+ /**
1547
+ * Bounded timing and basket-size randomization
1548
+ */
1549
+ randomization: TWAPRandomization,
1550
+ /**
1551
+ * Position UUID
1552
+ */
1553
+ positionId: z.uuid(),
1554
+ /**
1555
+ * Initial exposure
1556
+ */
1557
+ initialExposure: z.record(InstrumentId, SignedDecimalString)
1558
+ });
1559
+ var Schedule = z.discriminatedUnion("intent", [
1560
+ TWAPOpen,
1561
+ TWAPClose
1562
+ ]);
1563
+ var ScheduleSlicePosition = z.object({
1564
+ /**
1565
+ * Grid index of the slice inside the execution window
1566
+ */
1567
+ index: z.number().int().nonnegative(),
1568
+ /**
1569
+ * Grid time the slice is planned around, before timing jitter
1570
+ */
1571
+ scheduledAt: z.string()
1572
+ });
1573
+ var ScheduleSlice = z.discriminatedUnion("status", [
1574
+ ScheduleSlicePosition.extend({
1575
+ status: z.literal("EXECUTED"),
1576
+ /**
1577
+ * Absolute USD filled by the slice
1578
+ */
1579
+ usd: UnsignedDecimalString,
1580
+ /**
1581
+ * Absolute base quantity filled by the slice, per instrument
1582
+ */
1583
+ quantities: z.record(InstrumentId, UnsignedDecimalString),
1584
+ /**
1585
+ * Timestamp of the slice's latest fill
1586
+ */
1587
+ lastFilledAt: z.string(),
1588
+ /**
1589
+ * The slice's live fills in time order, present when requested with include=fills
1590
+ */
1591
+ fills: z.array(Fill).optional()
1592
+ }),
1593
+ ScheduleSlicePosition.extend({
1594
+ /**
1595
+ * Not yet reached on an active schedule
1596
+ */
1597
+ status: z.literal("PENDING")
1598
+ }),
1599
+ ScheduleSlicePosition.extend({
1600
+ /**
1601
+ * Passed without fills: skipped by catch-up, or before a finished schedule's last executed slice
1602
+ */
1603
+ status: z.literal("MISSED")
1604
+ })
1605
+ ]);
1190
1606
  var Decimal = z.string().regex(/^[+-]?\d+(?:\.\d+)?$/);
1191
1607
  var CopyPnlBreakdown = z.object({
1192
1608
  grossRealizedPnl: SignedDecimalString,
@@ -1337,13 +1753,20 @@ var CopySkipReason = z.enum([
1337
1753
  "LEADER_EQUITY_UNREADABLE",
1338
1754
  "FOLLOWER_EQUITY_UNREADABLE",
1339
1755
  "PRICE_UNAVAILABLE",
1340
- "LEVERAGE_NOT_APPLIED"
1756
+ "LEVERAGE_NOT_APPLIED",
1757
+ "FOLLOWER_TWAP_NOT_ACTIVE",
1758
+ "FOLLOWER_TWAP_ALREADY_ACTIVE",
1759
+ "TRUE_UP_STALE",
1760
+ "ASSET_CONFLICT"
1341
1761
  ]);
1342
1762
  var CopyLeaderAction = z.enum([
1343
1763
  "OPEN",
1344
1764
  "ADJUST",
1345
1765
  "CLOSE",
1346
- "REVERSE"
1766
+ "REVERSE",
1767
+ "TWAP",
1768
+ "TWAP_END",
1769
+ "LEVERAGE_CHANGED"
1347
1770
  ]);
1348
1771
  var CopyExecutionSource = z.discriminatedUnion("origin", [
1349
1772
  z.object({
@@ -1369,6 +1792,34 @@ var CopyExecutionSource = z.discriminatedUnion("origin", [
1369
1792
  configId: z.string()
1370
1793
  })
1371
1794
  ]);
1795
+ var CopyActivityTWAPReduction = z.discriminatedUnion("kind", [
1796
+ z.object({
1797
+ kind: z.literal("NONE")
1798
+ }),
1799
+ z.object({
1800
+ kind: z.literal("MINIMUM"),
1801
+ limitingLegs: z.array(z.object({
1802
+ symbol: InstrumentId,
1803
+ minimumNotional: UnsignedDecimalString
1804
+ })).describe("Legs whose venue minimum (USD) forced fewer, larger slices")
1805
+ })
1806
+ ]);
1807
+ var CopyActivityTWAP = z.object({
1808
+ intent: ScheduleIntent,
1809
+ totalNotional: UnsignedDecimalString.describe("Follower USD notional: the parent order for an open, the starting exposure for a close"),
1810
+ startAt: z.string().describe("ISO 8601"),
1811
+ endAt: z.string().describe("ISO 8601"),
1812
+ sliceCount: z.number().int().positive(),
1813
+ sliceIntervalSec: z.number().int().positive(),
1814
+ leaderSliceCount: z.number().int().positive(),
1815
+ reduction: CopyActivityTWAPReduction,
1816
+ progress: z.object({
1817
+ status: ScheduleStatus,
1818
+ filledNotional: UnsignedDecimalString.describe("Follower USD filled so far across all slices"),
1819
+ executedSliceCount: z.number().int().nonnegative(),
1820
+ partiallyFilled: z.boolean().describe("The TWAP ended early (cancelled or failed) short of its size; an ended TWAP with no fills also reports true, and an ended close always does")
1821
+ }).optional().describe("Live follower TWAP progress; absent until the follower TWAP exists")
1822
+ });
1372
1823
  var CopyActivity = z.object({
1373
1824
  id: z.uuid(),
1374
1825
  leaderAction: CopyLeaderAction.describe("What the leader did"),
@@ -1379,8 +1830,47 @@ var CopyActivity = z.object({
1379
1830
  failureReason: z.string().optional().describe("Why execution stopped; set when the outcome is FAILED or PARTIAL"),
1380
1831
  followerLegs: z.array(CopyActivityLeg).describe("Actual fills received by the follower"),
1381
1832
  leaderEquityFraction: z.string().optional().describe("The leader position notional over their equity at that moment; absent when unvaluable"),
1833
+ twap: CopyActivityTWAP.optional().describe("Set on a copied leader TWAP row once its follower TWAP is planned"),
1382
1834
  createdAt: z.string().describe("ISO 8601")
1383
1835
  });
1836
+ var CopyCoverage = z.enum([
1837
+ "FULLY_COPY",
1838
+ "PARTIALLY_COPY"
1839
+ ]);
1840
+ var CopyControlTransferReason = z.enum([
1841
+ "FOLLOWER_INTERVENTION",
1842
+ "EXTERNAL_SYNC",
1843
+ "LIQUIDATED",
1844
+ "ASSET_CONFLICT",
1845
+ "LEADER_EXTERNAL_ACTIVITY"
1846
+ ]);
1847
+ var CopyUnmanagedFollowerPositionReason = z.enum([
1848
+ ...CopyControlTransferReason.options,
1849
+ "EXISTING_AT_ADMISSION",
1850
+ "MANUAL_POSITION"
1851
+ ]);
1852
+ var CopyUnmanagedPosition = z.discriminatedUnion("kind", [
1853
+ z.object({
1854
+ /** The follower's own position; the follower manages it, and leader closes do not close it. */
1855
+ kind: z.literal("FOLLOWER_POSITION"),
1856
+ positionId: z.uuid(),
1857
+ reason: CopyUnmanagedFollowerPositionReason,
1858
+ detectedAt: z.string().datetime().describe("ISO 8601; when the position left or started outside copy management"),
1859
+ instrumentIds: z.array(InstrumentId).describe("Instruments the position still holds")
1860
+ }),
1861
+ z.object({
1862
+ /** A still-open leader position whose later actions this subscription no longer copies. */
1863
+ kind: z.literal("LEADER_POSITION"),
1864
+ positionId: z.uuid(),
1865
+ reason: CopyControlTransferReason,
1866
+ detectedAt: z.string().datetime().describe("ISO 8601; when copying of this leader position stopped"),
1867
+ instrumentIds: z.array(InstrumentId).describe("Instruments the leader position still holds")
1868
+ })
1869
+ ]);
1870
+ var CopyManagedPosition = z.object({
1871
+ positionId: z.uuid(),
1872
+ instrumentIds: z.array(InstrumentId).describe("Instruments the position still holds")
1873
+ });
1384
1874
  var CopyFollower = z.object({
1385
1875
  tradeAccountId: z.uuid(),
1386
1876
  status: z.literal("ACTIVE"),
@@ -1415,7 +1905,10 @@ var CopyStateResponse = z.discriminatedUnion("state", [
1415
1905
  }),
1416
1906
  z.object({
1417
1907
  state: z.literal("ACTIVE"),
1418
- subscription: CopySubscriptionWithMetrics
1908
+ subscription: CopySubscriptionWithMetrics,
1909
+ coverage: CopyCoverage.describe("PARTIALLY_COPY while any listed unmanaged position remains open; full coverage does not guarantee identical performance"),
1910
+ unmanagedPositions: z.array(CopyUnmanagedPosition).describe("Open positions outside copy management that explain divergence and who manages their closes"),
1911
+ managedPositions: z.array(CopyManagedPosition).describe("Open follower positions copy manages")
1419
1912
  })
1420
1913
  ]);
1421
1914
  var CopyFollowersResponse = z.object({
@@ -1483,13 +1976,15 @@ var CopyFollowerStats = CopyFollower.pick({
1483
1976
  }).extend({
1484
1977
  status: CopySubscriptionStatus,
1485
1978
  copiedTrades: z.number().int().nonnegative(),
1486
- copiedVolumeUsd: UnsignedDecimalString
1979
+ copiedVolumeUsd: UnsignedDecimalString,
1980
+ rewardsEarnedUsd: UnsignedDecimalString
1487
1981
  });
1488
1982
  var CopyStatsResponse = z.object({
1489
1983
  currentFollowerCount: z.number().int().nonnegative(),
1490
1984
  lifetimeFollowerCount: z.number().int().nonnegative(),
1491
1985
  copiedTrades: z.number().int().nonnegative(),
1492
1986
  copiedVolumeUsd: UnsignedDecimalString,
1987
+ rewardsEarnedUsd: UnsignedDecimalString,
1493
1988
  followers: z.array(CopyFollowerStats)
1494
1989
  });
1495
1990
  var OrderStatus = z.enum([
@@ -1616,6 +2111,8 @@ var Position = z.object({
1616
2111
  exposure: PositionExposure,
1617
2112
  /**
1618
2113
  * Whether a backfilled fill invalidated historical metrics derived from this position.
2114
+ *
2115
+ * @deprecated Always `false`: fill-position assignments never replay history. Will be removed in a future major.
1619
2116
  */
1620
2117
  unstableHistoricalData: z.boolean(),
1621
2118
  totalFundingPayment: PositionTotalFundingPayment,
@@ -1793,7 +2290,11 @@ var ClosedPosition = z.object({
1793
2290
  hasSyntheticFills: z.boolean(),
1794
2291
  /** Whether any fill is still PROVISIONAL, so fees and net PnL may still settle. */
1795
2292
  hasProvisionalFills: z.boolean(),
1796
- /** Whether a backfilled fill made this position's historical metrics unreliable. */
2293
+ /**
2294
+ * Whether a backfilled fill made this position's historical metrics unreliable.
2295
+ *
2296
+ * @deprecated Always `false`: fill-position assignments never replay history. Will be removed in a future major.
2297
+ */
1797
2298
  unstableHistoricalData: z.boolean(),
1798
2299
  longAssets: z.array(InstrumentId),
1799
2300
  shortAssets: z.array(InstrumentId),
@@ -1933,7 +2434,11 @@ var OpenPosition = z.object({
1933
2434
  * Independent of hasSyntheticFills: a row can have either, both or neither.
1934
2435
  */
1935
2436
  hasProvisionalFills: z.boolean(),
1936
- /** Whether a backfilled fill made this position's historical metrics unreliable. */
2437
+ /**
2438
+ * Whether a backfilled fill made this position's historical metrics unreliable.
2439
+ *
2440
+ * @deprecated Always `false`: fill-position assignments never replay history. Will be removed in a future major.
2441
+ */
1937
2442
  unstableHistoricalData: z.boolean(),
1938
2443
  /**
1939
2444
  * Every asset the ledger recorded, each carrying its own side.
@@ -2216,6 +2721,16 @@ var ExecutionLegMode = z.enum([
2216
2721
  "QUANTITY",
2217
2722
  "USD"
2218
2723
  ]);
2724
+ var ExecutionErrorCode = z.enum([
2725
+ "INSUFFICIENT_SIZE",
2726
+ "INSUFFICIENT_SIZE_SHARED",
2727
+ "LEGS_FAILED",
2728
+ "EXECUTION_CREATION_COMPENSATED"
2729
+ ]);
2730
+ var ExecutionRefusedLegErrorCode = ExecutionErrorCode.extract([
2731
+ "INSUFFICIENT_SIZE",
2732
+ "INSUFFICIENT_SIZE_SHARED"
2733
+ ]);
2219
2734
  var ExecutionLeg = z.object({
2220
2735
  /** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
2221
2736
  id: InstrumentId.optional(),
@@ -2244,6 +2759,24 @@ var ExecutionLeg = z.object({
2244
2759
  */
2245
2760
  reduceOnly: z.boolean()
2246
2761
  });
2762
+ var ExecutionRefusedLeg = z.object({
2763
+ /**
2764
+ * Instrument id of the refused leg, as the venue keys it
2765
+ */
2766
+ id: InstrumentId,
2767
+ /**
2768
+ * Base asset of the instrument, the name a reader understands
2769
+ */
2770
+ ticker: z.string(),
2771
+ /**
2772
+ * Why the engine refused the leg: below the venue minimum, or below it because another open position holds the asset
2773
+ */
2774
+ errorCode: ExecutionRefusedLegErrorCode,
2775
+ /**
2776
+ * Readable message for the refusal; it names the ticker
2777
+ */
2778
+ error: z.string()
2779
+ });
2247
2780
  var BaseExecution = z.object({
2248
2781
  /**
2249
2782
  * Execution UUID
@@ -2270,6 +2803,14 @@ var BaseExecution = z.object({
2270
2803
  */
2271
2804
  error: z.string().optional(),
2272
2805
  /**
2806
+ * Machine-readable code for the failure, for example `INSUFFICIENT_SIZE`; absent when none was recorded
2807
+ */
2808
+ errorCode: ExecutionErrorCode.optional(),
2809
+ /**
2810
+ * Legs the engine refused before reaching the venue, when the failure names them
2811
+ */
2812
+ refusedLegs: z.array(ExecutionRefusedLeg).optional(),
2813
+ /**
2273
2814
  * Created at timestamp
2274
2815
  */
2275
2816
  createdAt: z.string(),
@@ -2377,10 +2918,8 @@ var MarketExecution = z.discriminatedUnion("intent", [
2377
2918
  var Execution = z.discriminatedUnion("orderType", [
2378
2919
  MarketExecution
2379
2920
  ]);
2380
- var StatusEnum2 = z.enum([
2381
- "ACTIVE",
2382
- "COMPLETED",
2383
- "CANCELLED"
2921
+ var StatusEnum2 = ExecutionStatus.exclude([
2922
+ "IDLE"
2384
2923
  ]);
2385
2924
  var StatusArray2 = z.preprocess((arg) => normalizeArray(arg), z.array(StatusEnum2));
2386
2925
  var ExecutionListParams = CursorFindParams.extend({
@@ -2474,81 +3013,6 @@ var FeeRecipientResponse = z.object({
2474
3013
  // Connector-native recipient identifier (Hyperliquid builder address, Lighter integrator account index)
2475
3014
  recipient: z.string().optional()
2476
3015
  }).describe("Connector-native fee recipient to approve for the caller's role");
2477
- var FillStatus = z.enum([
2478
- "PROVISIONAL",
2479
- "CONFIRMED",
2480
- "RECONCILED"
2481
- ]);
2482
- var Fill = z.object({
2483
- /**
2484
- * Fill UUID
2485
- */
2486
- id: z.uuid(),
2487
- /** Client order ID (abbreviated as cloid) */
2488
- cloid: z.string().optional(),
2489
- /** Exchange-native fill ID (tradeId / tid / etc) */
2490
- exchangeFillId: z.string().optional(),
2491
- /**
2492
- * Fill lifecycle status
2493
- */
2494
- status: FillStatus,
2495
- /**
2496
- * Trade account UUID
2497
- */
2498
- tradeAccountId: z.uuid(),
2499
- /**
2500
- * Instrument ID
2501
- */
2502
- symbol: InstrumentId,
2503
- /**
2504
- * Position UUID
2505
- */
2506
- positionId: z.uuid(),
2507
- /**
2508
- * Connector
2509
- */
2510
- connector: Connector,
2511
- /**
2512
- * Side
2513
- */
2514
- side: Side,
2515
- /**
2516
- * Reduce only flag
2517
- */
2518
- reduceOnly: z.boolean(),
2519
- /** True when the fill was created from external sync. */
2520
- isExternal: z.boolean(),
2521
- /**
2522
- * True when the fill is a synthetic bridge fill (gap/gone reconstruction).
2523
- * Unpriceable gone-close synthetics carry "0" price/usd and should be displayed distinctly.
2524
- */
2525
- synthetic: z.boolean(),
2526
- quantity: z.string(),
2527
- /** Filled price — "0" on an unpriceable gone-close synthetic (no price guessing). */
2528
- price: z.string(),
2529
- /** USD value — "0" on an unpriceable gone-close synthetic (cannot compute without price). */
2530
- usd: z.string(),
2531
- /**
2532
- * Trade fee paid
2533
- */
2534
- tradeFee: z.string().optional(),
2535
- /**
2536
- * Pear fee paid
2537
- */
2538
- pearFee: z.string().optional(),
2539
- /**
2540
- * Timestamp
2541
- */
2542
- timestamp: z.string(),
2543
- /**
2544
- * A fill spanning multiple positions gets a synthetic exchange fill id.
2545
- * This `original` field contains the root exchange fill id and quantity.
2546
- */
2547
- original: z.object({
2548
- exchangeFillId: z.string(),
2549
- quantity: z.string()
2550
- }).optional()
2551
- });
2552
3016
  var FillOrderBy = z.union([
2553
3017
  z.literal("timestamp"),
2554
3018
  z.literal("-timestamp")
@@ -2561,11 +3025,13 @@ var FillListResponse = CursorResponse.extend({
2561
3025
  fills: z.array(Fill)
2562
3026
  });
2563
3027
  var PositionFillListResponse = z.object({
2564
- fills: z.array(Fill)
3028
+ fills: z.array(PositionFill)
2565
3029
  });
2566
3030
  var ProvisionalFill = z.object({
2567
3031
  id: z.uuid(),
2568
- positionId: z.uuid(),
3032
+ tradeAccountId: z.uuid(),
3033
+ connector: Connector,
3034
+ executionId: z.uuid().optional(),
2569
3035
  symbol: InstrumentId,
2570
3036
  cloid: z.string().optional(),
2571
3037
  status: z.literal("PROVISIONAL")
@@ -2609,7 +3075,12 @@ var TriggerCancelledReason = z.enum([
2609
3075
  "SYSTEM",
2610
3076
  "POSITION_NETTED",
2611
3077
  "POSITION_LIQUIDATED",
2612
- "POSITION_REVERSED"
3078
+ "POSITION_REVERSED",
3079
+ "POSITION_RESIZED"
3080
+ ]);
3081
+ var ResizeBehavior = z.enum([
3082
+ "cancel",
3083
+ "keep"
2613
3084
  ]);
2614
3085
  var BracketType = z.enum([
2615
3086
  "STOP_LOSS",
@@ -2628,17 +3099,6 @@ var TrailingMode = z.enum([
2628
3099
  "RELATIVE_BPS",
2629
3100
  "ABSOLUTE_POINTS"
2630
3101
  ]);
2631
- var MAX_JITTER_BPS = 5e3;
2632
- var DEFAULT_TWAP_RANDOMIZATION = {
2633
- timingJitterBps: 0,
2634
- sizeJitterBps: 0
2635
- };
2636
- var TWAPRandomization = z.object({
2637
- /** Maximum symmetric timing variation in basis points, capped at ±50%. */
2638
- timingJitterBps: z.int().min(0).max(MAX_JITTER_BPS),
2639
- /** Maximum symmetric basket-size variation in basis points, capped at ±50%. */
2640
- sizeJitterBps: z.int().min(0).max(MAX_JITTER_BPS)
2641
- });
2642
3102
  var MAX_TWAP_DURATION_SEC = 60 * 60 * 24 * 31;
2643
3103
  var MIN_TWAP_SLICE_INTERVAL_SEC = 15;
2644
3104
  var FINAL_TWAP_SLICE_START_HEADROOM_SEC = 15;
@@ -2646,7 +3106,7 @@ var TWAPSliceIntervalSec = z.int().min(MIN_TWAP_SLICE_INTERVAL_SEC).max(MAX_TWAP
2646
3106
  var TWAPTargetNotional = UnsignedDecimalString.refine((value) => /[1-9]/.test(value), {
2647
3107
  message: "Target notional must be greater than zero"
2648
3108
  });
2649
- var TWAPOpenLeg = z.object({
3109
+ var TWAPOpenLeg2 = z.object({
2650
3110
  /** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
2651
3111
  id: InstrumentId.optional(),
2652
3112
  /** Instrument ID. */
@@ -2656,8 +3116,8 @@ var TWAPOpenLeg = z.object({
2656
3116
  /** Share of the parent target notional allocated to this leg. */
2657
3117
  weight: AssetWeight
2658
3118
  }).superRefine(RefineLegIdMatchesSymbol);
2659
- var TWAPOpenLegs = z.array(TWAPOpenLeg).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).superRefine(RefineWeightingSum);
2660
- var TriggerTWAPOpenLeg = TWAPOpenLeg.strict();
3119
+ var TWAPOpenLegs = z.array(TWAPOpenLeg2).superRefine(RefineMinimumOneSymbol).superRefine(RefineUniqueSymbols).superRefine(RefineWeightingSum);
3120
+ var TriggerTWAPOpenLeg = TWAPOpenLeg2.strict();
2661
3121
  var TriggerTWAPOpenLegs = z.tuple([
2662
3122
  TriggerTWAPOpenLeg
2663
3123
  ]).rest(TriggerTWAPOpenLeg).superRefine(RefineUniqueSymbols).superRefine(RefineWeightingSum);
@@ -2718,7 +3178,8 @@ var Notional = z.object({
2718
3178
  data: z.object({
2719
3179
  priceSource: PriceSource,
2720
3180
  track: MetricTrack,
2721
- threshold: z.number()
3181
+ threshold: z.number(),
3182
+ onPositionResize: ResizeBehavior
2722
3183
  })
2723
3184
  });
2724
3185
  var Upnl = z.object({
@@ -2726,7 +3187,8 @@ var Upnl = z.object({
2726
3187
  data: z.object({
2727
3188
  priceSource: PriceSource,
2728
3189
  track: MetricTrack,
2729
- threshold: z.number()
3190
+ threshold: z.number(),
3191
+ onPositionResize: ResizeBehavior
2730
3192
  })
2731
3193
  });
2732
3194
  var UpnlBps = z.object({
@@ -2795,13 +3257,15 @@ var WeightedRatioTrailing = z.object({
2795
3257
  var NotionalTrailing = z.object({
2796
3258
  type: z.literal("notional_trailing"),
2797
3259
  data: z.object({
2798
- priceSource: PriceSource
3260
+ priceSource: PriceSource,
3261
+ onPositionResize: ResizeBehavior
2799
3262
  })
2800
3263
  });
2801
3264
  var UpnlTrailing = z.object({
2802
3265
  type: z.literal("upnl_trailing"),
2803
3266
  data: z.object({
2804
- priceSource: PriceSource
3267
+ priceSource: PriceSource,
3268
+ onPositionResize: ResizeBehavior
2805
3269
  })
2806
3270
  });
2807
3271
  var UpnlBpsTrailing = z.object({
@@ -3019,6 +3483,10 @@ var TriggerMarketClose = BaseTrigger.extend({
3019
3483
  */
3020
3484
  condition: TriggerConditionClose,
3021
3485
  /**
3486
+ * Fraction of the position to close when the trigger fires; absent means a full close.
3487
+ */
3488
+ closePercent: z.number().optional(),
3489
+ /**
3022
3490
  * Context
3023
3491
  */
3024
3492
  context: z.object({
@@ -3318,45 +3786,47 @@ var RatioCloseStatic = z.object({
3318
3786
  symbol_a: InstrumentId,
3319
3787
  symbol_b: InstrumentId,
3320
3788
  threshold: TriggerThreshold
3321
- }).superRefine(RefineTwoUniqueSymbols)
3322
- });
3789
+ }).strict().superRefine(RefineTwoUniqueSymbols)
3790
+ }).strict();
3323
3791
  var PriceCloseStatic = z.object({
3324
3792
  type: z.literal("price"),
3325
3793
  data: z.object({
3326
3794
  priceSource: PriceSource2,
3327
3795
  symbol: InstrumentId,
3328
3796
  threshold: TriggerThreshold
3329
- })
3330
- });
3797
+ }).strict()
3798
+ }).strict();
3331
3799
  var WeightedRatioCloseStatic = z.object({
3332
3800
  type: z.literal("weighted_ratio"),
3333
3801
  data: z.object({
3334
3802
  priceSource: PriceSource2,
3335
3803
  basket: WeightedRatioBasket,
3336
3804
  threshold: TriggerThreshold
3337
- })
3338
- });
3805
+ }).strict()
3806
+ }).strict();
3339
3807
  var NotionalCloseStatic = z.object({
3340
3808
  type: z.literal("notional"),
3341
3809
  data: z.object({
3342
3810
  priceSource: PriceSource2,
3343
- threshold: TriggerThreshold
3344
- })
3345
- });
3811
+ threshold: TriggerThreshold,
3812
+ onPositionResize: ResizeBehavior.default("cancel")
3813
+ }).strict()
3814
+ }).strict();
3346
3815
  var UpnlCloseStatic = z.object({
3347
3816
  type: z.literal("upnl"),
3348
3817
  data: z.object({
3349
3818
  priceSource: PriceSource2,
3350
- threshold: z.number()
3351
- })
3352
- });
3819
+ threshold: z.number(),
3820
+ onPositionResize: ResizeBehavior.default("cancel")
3821
+ }).strict()
3822
+ }).strict();
3353
3823
  var UpnlBpsCloseStatic = z.object({
3354
3824
  type: z.literal("upnl_bps"),
3355
3825
  data: z.object({
3356
3826
  priceSource: PriceSource2,
3357
3827
  threshold: z.number()
3358
- })
3359
- });
3828
+ }).strict()
3829
+ }).strict();
3360
3830
  var PredictionMarketCloseStatic = z.object({
3361
3831
  type: z.literal("prediction_market"),
3362
3832
  data: z.object({
@@ -3366,48 +3836,50 @@ var PredictionMarketCloseStatic = z.object({
3366
3836
  ]),
3367
3837
  marketKey: z.string().min(1),
3368
3838
  threshold: TriggerThreshold
3369
- })
3370
- });
3839
+ }).strict()
3840
+ }).strict();
3371
3841
  var RatioCloseTrailing = z.object({
3372
3842
  type: z.literal("ratio_trailing"),
3373
3843
  data: z.object({
3374
3844
  priceSource: PriceSource2,
3375
3845
  symbol_a: InstrumentId,
3376
3846
  symbol_b: InstrumentId
3377
- }).superRefine(RefineTwoUniqueSymbols)
3378
- });
3847
+ }).strict().superRefine(RefineTwoUniqueSymbols)
3848
+ }).strict();
3379
3849
  var PriceCloseTrailing = z.object({
3380
3850
  type: z.literal("price_trailing"),
3381
3851
  data: z.object({
3382
3852
  priceSource: PriceSource2,
3383
3853
  symbol: InstrumentId
3384
- })
3385
- });
3854
+ }).strict()
3855
+ }).strict();
3386
3856
  var WeightedRatioCloseTrailing = z.object({
3387
3857
  type: z.literal("weighted_ratio_trailing"),
3388
3858
  data: z.object({
3389
3859
  priceSource: PriceSource2,
3390
3860
  basket: WeightedRatioBasket
3391
- })
3392
- });
3861
+ }).strict()
3862
+ }).strict();
3393
3863
  var NotionalCloseTrailing = z.object({
3394
3864
  type: z.literal("notional_trailing"),
3395
3865
  data: z.object({
3396
- priceSource: PriceSource2
3397
- })
3398
- });
3866
+ priceSource: PriceSource2,
3867
+ onPositionResize: ResizeBehavior.default("cancel")
3868
+ }).strict()
3869
+ }).strict();
3399
3870
  var UpnlCloseTrailing = z.object({
3400
3871
  type: z.literal("upnl_trailing"),
3401
3872
  data: z.object({
3402
- priceSource: PriceSource2
3403
- })
3404
- });
3873
+ priceSource: PriceSource2,
3874
+ onPositionResize: ResizeBehavior.default("cancel")
3875
+ }).strict()
3876
+ }).strict();
3405
3877
  var UpnlBpsCloseTrailing = z.object({
3406
3878
  type: z.literal("upnl_bps_trailing"),
3407
3879
  data: z.object({
3408
3880
  priceSource: PriceSource2
3409
- })
3410
- });
3881
+ }).strict()
3882
+ }).strict();
3411
3883
  var CreateTriggerConditionOpen = z.discriminatedUnion("type", [
3412
3884
  RatioOpen,
3413
3885
  PriceOpen,
@@ -3448,6 +3920,13 @@ var CreateTriggerConditionAttachTrailing = z.discriminatedUnion("type", [
3448
3920
  var MAX_ATTACH_TRIGGERS = 5;
3449
3921
 
3450
3922
  // src/trigger/payloads/index.ts
3923
+ var ClosePercent = z.number().min(1, {
3924
+ message: "closePercent must be at least 1"
3925
+ }).max(100, {
3926
+ message: "closePercent must be at most 100"
3927
+ }).refine((value) => Math.round(value * 100) / 100 === value, {
3928
+ message: "closePercent allows at most 2 decimals"
3929
+ });
3451
3930
  var CreateTriggerMarketPayload = z.object({
3452
3931
  type: z.literal("MARKET"),
3453
3932
  legs: z.tuple([
@@ -3478,11 +3957,13 @@ var AttachTriggerMarketCloseStatic = z.object({
3478
3957
  intent: z.literal("CLOSE"),
3479
3958
  type: z.literal("MARKET"),
3480
3959
  bracketType: TpSlBracketType,
3960
+ closePercent: ClosePercent.optional(),
3481
3961
  condition: CreateTriggerConditionAttachStatic
3482
3962
  }).superRefine(RefineStaticLogicalRules);
3483
3963
  var AttachTriggerMarketCloseTrailing = z.object({
3484
3964
  intent: z.literal("CLOSE"),
3485
3965
  type: z.literal("MARKET"),
3966
+ closePercent: ClosePercent.optional(),
3486
3967
  condition: CreateTriggerConditionAttachTrailing,
3487
3968
  trailing: TrailingConfig
3488
3969
  }).superRefine(RefineTrailingLogicalRules);
@@ -3540,6 +4021,7 @@ var CreateTriggerMarketCloseStatic = z.object({
3540
4021
  // User intent when bracketType is a side-dependent price-crossing encoding.
3541
4022
  // Optional so older clients remain wire-compatible during rollout.
3542
4023
  semanticBracketType: TpSlBracketType.optional(),
4024
+ closePercent: ClosePercent.optional(),
3543
4025
  condition: CreateTriggerConditionCloseStatic,
3544
4026
  /**
3545
4027
  * Attribution route code (client_ids.code)
@@ -3550,6 +4032,7 @@ var CreateTriggerMarketCloseTrailing = z.object({
3550
4032
  intent: z.literal("CLOSE"),
3551
4033
  type: z.literal("MARKET"),
3552
4034
  positionId: z.uuid(),
4035
+ closePercent: ClosePercent.optional(),
3553
4036
  condition: CreateTriggerConditionCloseTrailing,
3554
4037
  trailing: TrailingConfig,
3555
4038
  /**
@@ -3752,6 +4235,10 @@ var MarginMode = z.enum([
3752
4235
  "isolated"
3753
4236
  ]);
3754
4237
  var SetLeverage = z.object({
4238
+ source: z.enum([
4239
+ "TRADE_PREPARATION",
4240
+ "MANUAL"
4241
+ ]).default("MANUAL"),
3755
4242
  symbol: InstrumentId,
3756
4243
  leverage: z.int().positive(),
3757
4244
  marginMode: MarginMode.optional()
@@ -3856,29 +4343,29 @@ var MarketBasketPositionCountsResponse = z.object({
3856
4343
  counts: z.array(MarketBasketPositionCounts)
3857
4344
  });
3858
4345
  var CreateLighterApiKeyParams = z.object({
3859
- accountIndex: z.number(),
3860
- apiKeyIndex: z.number()
4346
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4347
+ apiKeyIndex: z.number().int().nonnegative().max(254)
3861
4348
  });
3862
4349
  var SubmitChangePubKeyParams = z.object({
3863
4350
  l1Signature: z.string(),
3864
4351
  txInfo: z.string(),
3865
- accountIndex: z.number(),
3866
- apiKeyIndex: z.number()
4352
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4353
+ apiKeyIndex: z.number().int().nonnegative().max(254)
3867
4354
  });
3868
4355
  var PrepareApproveIntegratorParams = z.object({
3869
- accountIndex: z.number(),
3870
- apiKeyIndex: z.number(),
4356
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4357
+ apiKeyIndex: z.number().int().nonnegative().max(254),
3871
4358
  apiPrivateKey: z.string()
3872
4359
  });
3873
4360
  var SubmitApproveIntegratorParams = z.object({
3874
4361
  l1Signature: z.string(),
3875
4362
  txInfo: z.string(),
3876
- accountIndex: z.number(),
3877
- apiKeyIndex: z.number()
4363
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4364
+ apiKeyIndex: z.number().int().nonnegative().max(254)
3878
4365
  });
3879
4366
  var CreateAuthTokenParams = z.object({
3880
- accountIndex: z.number(),
3881
- apiKeyIndex: z.number(),
4367
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
4368
+ apiKeyIndex: z.number().int().nonnegative().max(254),
3882
4369
  apiPrivateKey: z.string(),
3883
4370
  ttlSeconds: z.number().optional()
3884
4371
  });
@@ -4049,7 +4536,14 @@ var NotificationCategory = z.enum([
4049
4536
  "COPY_FAILED",
4050
4537
  "COPY_SUBSCRIPTION_STOPPED",
4051
4538
  "COPY_LEVERAGE_NOT_APPLIED",
4052
- "POSITION_LIQUIDATION"
4539
+ "POSITION_LIQUIDATION",
4540
+ "TRIGGER_CANCELLED_POSITION_RESIZED",
4541
+ "TAKE_PROFIT_PARTIAL",
4542
+ "STOP_LOSS_PARTIAL",
4543
+ "TRIGGER_ORDER_PARTIAL",
4544
+ "TRIGGER_CANCELLED_BY_OPERATOR",
4545
+ "LADDER_CANCELLED_BY_OPERATOR",
4546
+ "AUTO_REBALANCE_STOPPED_BY_OPERATOR"
4053
4547
  ]);
4054
4548
  var NotificationMetric = z.enum([
4055
4549
  "ratio",
@@ -4071,7 +4565,12 @@ var NotificationMetric = z.enum([
4071
4565
  var TriggerNotificationEnrichment = {
4072
4566
  metric: NotificationMetric.optional(),
4073
4567
  level: z.number().optional(),
4074
- reason: z.string().max(255).optional()
4568
+ reason: z.string().max(255).optional(),
4569
+ /**
4570
+ * On a `*_PARTIAL` notification: whether the trigger stays armed on the part of the
4571
+ * position its close left open. Absent on every other category.
4572
+ */
4573
+ triggerActive: z.boolean().optional()
4075
4574
  };
4076
4575
  var TriggerNotificationLeg = z.object({
4077
4576
  id: z.string().min(1),
@@ -4181,6 +4680,40 @@ var TriggerCancelledMisScaledNotificationParameters = z.object({
4181
4680
  storedBps: z.number(),
4182
4681
  readingMarginPct: z.number()
4183
4682
  });
4683
+ var TriggerCancelledPositionResizedNotificationParameters = z.object({
4684
+ type: z.literal("trigger_cancelled_position_resized"),
4685
+ triggerId: z.uuid(),
4686
+ positionId: z.uuid(),
4687
+ connector: Connector,
4688
+ metric: z.enum([
4689
+ "notional",
4690
+ "upnl",
4691
+ "notional_trailing",
4692
+ "upnl_trailing"
4693
+ ])
4694
+ });
4695
+ var TriggerCancelledByOperatorNotificationParameters = PositionLegParameters.safeExtend({
4696
+ type: z.literal("trigger_cancelled_by_operator"),
4697
+ triggerId: z.uuid(),
4698
+ connector: Connector,
4699
+ // The position the trigger watched; absent when the trigger would have opened a new position.
4700
+ positionId: z.uuid().optional(),
4701
+ // User-facing bracket semantics, so the copy can say stop loss, take profit or trigger order.
4702
+ semanticBracketType: BracketType
4703
+ });
4704
+ var LadderCancelledByOperatorNotificationParameters = PositionLegParameters.safeExtend({
4705
+ type: z.literal("ladder_cancelled_by_operator"),
4706
+ ladderId: z.uuid(),
4707
+ connector: Connector,
4708
+ // The position the ladder's rungs watched; absent when the rungs would have opened a new position.
4709
+ positionId: z.uuid().optional()
4710
+ });
4711
+ var AutoRebalanceStoppedByOperatorNotificationParameters = PositionLegParameters.safeExtend({
4712
+ type: z.literal("auto_rebalance_stopped_by_operator"),
4713
+ configId: z.uuid(),
4714
+ positionId: z.uuid(),
4715
+ connector: Connector
4716
+ });
4184
4717
  var TriggerTWAPNotificationAnchor = PositionLegParameters.safeExtend({
4185
4718
  triggerId: z.uuid(),
4186
4719
  positionId: z.uuid(),
@@ -4208,10 +4741,16 @@ var CopyPlacedNotificationParameters = z.object({
4208
4741
  type: z.literal("copy_placed"),
4209
4742
  subscriptionId: z.uuid(),
4210
4743
  activityId: z.uuid(),
4211
- resource: z.object({
4212
- kind: z.literal("POSITION"),
4213
- id: z.uuid()
4214
- }),
4744
+ resource: z.discriminatedUnion("kind", [
4745
+ z.object({
4746
+ kind: z.literal("POSITION"),
4747
+ id: z.uuid()
4748
+ }),
4749
+ z.object({
4750
+ kind: z.literal("SCHEDULE"),
4751
+ id: z.uuid()
4752
+ })
4753
+ ]),
4215
4754
  leaderTradeAccountId: z.uuid()
4216
4755
  });
4217
4756
  var CopyFailedNotificationParameters = z.object({
@@ -4268,7 +4807,11 @@ var NotificationParameters = z.discriminatedUnion("type", [
4268
4807
  CopyPlacedNotificationParameters,
4269
4808
  CopyFailedNotificationParameters,
4270
4809
  CopySubscriptionStoppedNotificationParameters,
4271
- CopyLeverageNotAppliedNotificationParameters
4810
+ CopyLeverageNotAppliedNotificationParameters,
4811
+ TriggerCancelledPositionResizedNotificationParameters,
4812
+ TriggerCancelledByOperatorNotificationParameters,
4813
+ LadderCancelledByOperatorNotificationParameters,
4814
+ AutoRebalanceStoppedByOperatorNotificationParameters
4272
4815
  ]);
4273
4816
  var Notification = z.object({
4274
4817
  /**
@@ -5049,12 +5592,21 @@ var CreateAutoRebalanceResponse = z.object({
5049
5592
  var RebalanceEventListResponse = CursorResponse.extend({
5050
5593
  items: z.array(RebalanceEvent)
5051
5594
  });
5595
+ var RewardSourceAccrual = z.object({
5596
+ earned: UnsignedDecimalString,
5597
+ pendingMaturity: UnsignedDecimalString,
5598
+ pendingFunding: UnsignedDecimalString
5599
+ });
5052
5600
  var RewardAccrual = z.object({
5053
5601
  earned: UnsignedDecimalString,
5054
5602
  pendingMaturity: UnsignedDecimalString,
5055
5603
  pendingFunding: UnsignedDecimalString,
5056
5604
  claimable: UnsignedDecimalString,
5057
- paid: UnsignedDecimalString
5605
+ paid: UnsignedDecimalString,
5606
+ sources: z.object({
5607
+ referral: RewardSourceAccrual,
5608
+ copy: RewardSourceAccrual
5609
+ })
5058
5610
  });
5059
5611
  var RewardClaimStatus = z.enum([
5060
5612
  "TRANSFER_INTENT_READY",
@@ -5080,6 +5632,10 @@ var RewardClaimId = z.uuid();
5080
5632
  var CreateRewardClaim = z.object({
5081
5633
  destination: z.string().trim().regex(/^0x[0-9a-fA-F]{40}$/)
5082
5634
  });
5635
+ var ListRewardClaimsQuery = z.object({
5636
+ cursor: z.string().optional(),
5637
+ limit: z.coerce.number().int().min(1).max(100).default(20)
5638
+ });
5083
5639
  var RewardAccrualResponse = z.discriminatedUnion("status", [
5084
5640
  z.object({
5085
5641
  status: z.literal("DISABLED")
@@ -5107,6 +5663,9 @@ var RewardClaimStatusResponse = z.object({
5107
5663
  // PAID means the USDC arrived: a sent transfer can still revert, which ends the claim RELEASED.
5108
5664
  transactionHash: EthereumTransactionHash.optional()
5109
5665
  });
5666
+ var RewardClaimListResponse = CursorResponse.extend({
5667
+ items: z.array(RewardClaimStatusResponse)
5668
+ });
5110
5669
  var RewardClaimResponse = z.object({
5111
5670
  claimId: z.uuid().optional(),
5112
5671
  status: RewardClaimStatus,
@@ -5114,236 +5673,6 @@ var RewardClaimResponse = z.object({
5114
5673
  // PAID means the USDC arrived: a sent transfer can still revert, which ends the claim RELEASED.
5115
5674
  transactionHash: EthereumTransactionHash.optional()
5116
5675
  });
5117
- var ScheduleStrategy = z.enum([
5118
- "TWAP",
5119
- "VWAP"
5120
- ]);
5121
- var ScheduleStatus = z.enum([
5122
- "ACTIVE",
5123
- "COMPLETED",
5124
- "FAILED",
5125
- "CANCELLED"
5126
- ]);
5127
- var ScheduleIntent = z.enum([
5128
- "OPEN",
5129
- "CLOSE"
5130
- ]);
5131
- var ScheduleExecutionType = z.enum([
5132
- "MARKET"
5133
- ]);
5134
- var ScheduleCancelledReason = z.enum([
5135
- "POSITION_CLOSED",
5136
- "USER",
5137
- "SYSTEM",
5138
- "POSITION_NETTED",
5139
- "POSITION_LIQUIDATED",
5140
- "POSITION_REVERSED"
5141
- ]);
5142
- var TWAPOpenLeg2 = z.object({
5143
- /** SYMBOL-MIGRATION switch-to-id: mirrors `symbol` today; becomes required once requests always carry `id`. */
5144
- id: InstrumentId.optional(),
5145
- /**
5146
- * Instrument ID
5147
- */
5148
- symbol: InstrumentId,
5149
- /**
5150
- * Side
5151
- */
5152
- side: Side,
5153
- /**
5154
- * Share of the parent target notional allocated to this leg
5155
- */
5156
- weight: AssetWeight
5157
- });
5158
- var BaseSchedule = z.object({
5159
- /**
5160
- * Schedule UUID
5161
- */
5162
- id: z.uuid(),
5163
- /**
5164
- * Connector
5165
- */
5166
- connector: Connector,
5167
- /**
5168
- * Schedule strategy
5169
- */
5170
- strategy: ScheduleStrategy,
5171
- /**
5172
- * Schedule status
5173
- */
5174
- status: ScheduleStatus,
5175
- /**
5176
- * Intent
5177
- */
5178
- intent: ScheduleIntent,
5179
- /**
5180
- * Position key
5181
- */
5182
- positionKey: z.string(),
5183
- /**
5184
- * Execution type
5185
- */
5186
- executionType: ScheduleExecutionType,
5187
- /**
5188
- * Last slice at timestamp
5189
- */
5190
- lastSliceAt: z.string().optional(),
5191
- /**
5192
- * Start at timestamp
5193
- */
5194
- startAt: z.string(),
5195
- /**
5196
- * End at timestamp
5197
- */
5198
- endAt: z.string(),
5199
- /**
5200
- * When the schedule was cancelled
5201
- */
5202
- cancelledAt: z.string().optional(),
5203
- /**
5204
- * Reason for the schedule being cancelled
5205
- */
5206
- cancelledReason: ScheduleCancelledReason.optional(),
5207
- /**
5208
- * Created at timestamp
5209
- */
5210
- createdAt: z.string(),
5211
- /**
5212
- * Updated at timestamp
5213
- */
5214
- updatedAt: z.string(),
5215
- /**
5216
- * Slices that produced live fills
5217
- */
5218
- executedSliceCount: z.number().int().nonnegative(),
5219
- /**
5220
- * Absolute USD filled across every slice
5221
- */
5222
- filledUsd: UnsignedDecimalString,
5223
- /**
5224
- * Absolute base quantity filled, per instrument
5225
- */
5226
- filledQuantities: z.record(InstrumentId, UnsignedDecimalString),
5227
- /**
5228
- * Overall progress from 0 to 1: notional filled for OPEN, the slowest leg for CLOSE
5229
- */
5230
- progress: z.number().min(0).max(1),
5231
- /**
5232
- * Progress of each leg from 0 to 1, capped at 1 when a leg overfills
5233
- */
5234
- legProgress: z.record(InstrumentId, z.number().min(0).max(1))
5235
- });
5236
- var TWAPOpen = BaseSchedule.extend({
5237
- /**
5238
- * Strategy
5239
- */
5240
- strategy: z.literal("TWAP"),
5241
- /**
5242
- * Intent
5243
- */
5244
- intent: z.literal("OPEN"),
5245
- /**
5246
- * Slice interval in seconds
5247
- */
5248
- sliceIntervalSec: z.number(),
5249
- /**
5250
- * Number of slices planned inside the execution window
5251
- */
5252
- sliceCount: z.number().int().positive(),
5253
- /**
5254
- * Bounded timing and basket-size randomization
5255
- */
5256
- randomization: TWAPRandomization,
5257
- /**
5258
- * Parent-order leg allocation
5259
- */
5260
- legs: z.array(TWAPOpenLeg2),
5261
- /**
5262
- * Target notional
5263
- */
5264
- targetNotional: UnsignedDecimalString,
5265
- /**
5266
- * Remaining notional
5267
- */
5268
- remainingNotional: UnsignedDecimalString
5269
- });
5270
- var TWAPClose = BaseSchedule.extend({
5271
- /**
5272
- * Strategy
5273
- */
5274
- strategy: z.literal("TWAP"),
5275
- /**
5276
- * Intent
5277
- */
5278
- intent: z.literal("CLOSE"),
5279
- /**
5280
- * Slice interval in seconds
5281
- */
5282
- sliceIntervalSec: z.number(),
5283
- /**
5284
- * Number of slices planned inside the execution window
5285
- */
5286
- sliceCount: z.number().int().positive(),
5287
- /**
5288
- * Bounded timing and basket-size randomization
5289
- */
5290
- randomization: TWAPRandomization,
5291
- /**
5292
- * Position UUID
5293
- */
5294
- positionId: z.uuid(),
5295
- /**
5296
- * Initial exposure
5297
- */
5298
- initialExposure: z.record(InstrumentId, SignedDecimalString)
5299
- });
5300
- var Schedule = z.discriminatedUnion("intent", [
5301
- TWAPOpen,
5302
- TWAPClose
5303
- ]);
5304
- var ScheduleSlicePosition = z.object({
5305
- /**
5306
- * Grid index of the slice inside the execution window
5307
- */
5308
- index: z.number().int().nonnegative(),
5309
- /**
5310
- * Grid time the slice is planned around, before timing jitter
5311
- */
5312
- scheduledAt: z.string()
5313
- });
5314
- var ScheduleSlice = z.discriminatedUnion("status", [
5315
- ScheduleSlicePosition.extend({
5316
- status: z.literal("EXECUTED"),
5317
- /**
5318
- * Absolute USD filled by the slice
5319
- */
5320
- usd: UnsignedDecimalString,
5321
- /**
5322
- * Absolute base quantity filled by the slice, per instrument
5323
- */
5324
- quantities: z.record(InstrumentId, UnsignedDecimalString),
5325
- /**
5326
- * Timestamp of the slice's latest fill
5327
- */
5328
- lastFilledAt: z.string(),
5329
- /**
5330
- * The slice's live fills in time order, present when requested with include=fills
5331
- */
5332
- fills: z.array(Fill).optional()
5333
- }),
5334
- ScheduleSlicePosition.extend({
5335
- /**
5336
- * Not yet reached on an active schedule
5337
- */
5338
- status: z.literal("PENDING")
5339
- }),
5340
- ScheduleSlicePosition.extend({
5341
- /**
5342
- * Passed without fills: skipped by catch-up, or before a finished schedule's last executed slice
5343
- */
5344
- status: z.literal("MISSED")
5345
- })
5346
- ]);
5347
5676
  var BaseSchedule2 = z.object({
5348
5677
  /**
5349
5678
  * Start at date
@@ -5422,12 +5751,7 @@ var CreateSchedule = z.discriminatedUnion("intent", [
5422
5751
  CreateTWAPOpen,
5423
5752
  CreateTWAPClose
5424
5753
  ]);
5425
- var StatusEnum4 = z.enum([
5426
- "ACTIVE",
5427
- "COMPLETED",
5428
- "CANCELLED"
5429
- ]);
5430
- var StatusArray6 = z.preprocess((arg) => normalizeArray(arg), z.array(StatusEnum4));
5754
+ var StatusArray6 = z.preprocess((arg) => normalizeArray(arg), z.array(ScheduleStatus));
5431
5755
  var ScheduleListParams = CursorFindParams.extend({
5432
5756
  connector: Connector.optional(),
5433
5757
  status: StatusArray6.optional()
@@ -5733,10 +6057,6 @@ var LiquidationMark = z.object({
5733
6057
  mark: UnsignedDecimalString
5734
6058
  }).nullable();
5735
6059
  var TradeFee = DecimalString;
5736
- var OriginalFillRef = z.object({
5737
- exchangeFillId: ExchangeFillId,
5738
- quantity: UnsignedDecimalString
5739
- });
5740
6060
  var UnknownExternalFill = z.object({
5741
6061
  exchangeFillId: ExchangeFillId,
5742
6062
  cloid: z.string().nullable(),
@@ -5765,8 +6085,9 @@ var ExternalPosition = z.object({
5765
6085
  markPrice: UnsignedDecimalString
5766
6086
  });
5767
6087
  var ApplicableFill = z.object({
5768
- // Deterministic synthetic id (`synthetic-{positionKey}-{symbol}-{side}`) for synthetic fills,
5769
- // exchange-native id for real fills.
6088
+ // Deterministic synthetic id (`synthetic-{positionKey}-{lifecycleStartMs}-{symbol}-{side}`, or
6089
+ // `synthetic-{positionKey}-{symbol}-{side}` when no stable lifecycle start exists) for synthetic
6090
+ // fills, exchange-native id for real fills.
5770
6091
  exchangeFillId: ExchangeFillId,
5771
6092
  cloid: z.string().nullable(),
5772
6093
  connector: Connector,
@@ -5781,14 +6102,16 @@ var ApplicableFill = z.object({
5781
6102
  isExternal: z.boolean(),
5782
6103
  tradeFee: TradeFee,
5783
6104
  builderFee: UnsignedDecimalString,
5784
- closedReason: PositionClosedReason.optional().describe("e.g. NETTED for a synthetic close fill"),
5785
- liquidation: LiquidationMark.unwrap().extend({
5786
- outcome: z.enum([
5787
- "CLOSED",
5788
- "REDUCED"
5789
- ]).optional().describe("Position outcome after this reducing slice")
5790
- }).nullable().optional(),
5791
- original: OriginalFillRef.optional()
6105
+ closedReason: PositionClosedReason.optional().describe("e.g. USER for a synthetic close fill"),
6106
+ liquidation: LiquidationMark.optional()
6107
+ });
6108
+ var ApplicableFillAssignment = z.object({
6109
+ exchangeFillId: ExchangeFillId,
6110
+ quantity: UnsignedDecimalString.refine((quantity) => /[1-9]/.test(quantity), "Assignment quantity must be positive"),
6111
+ liquidationOutcome: z.enum([
6112
+ "CLOSED",
6113
+ "REDUCED"
6114
+ ]).optional()
5792
6115
  });
5793
6116
  var ApplicableMetadata = z.object({
5794
6117
  initialExposureUSD: z.record(InstrumentId, SignedDecimalString).describe("opening cost basis from this position\u2019s own real fills; partial map allowed")
@@ -5798,8 +6121,8 @@ var ApplicablePosition = z.object({
5798
6121
  exposure: z.record(InstrumentId, SignedDecimalString).describe("final position exposure (signed, BASE units)"),
5799
6122
  origin: PositionOrigin,
5800
6123
  status: PositionStatus,
5801
- closedReason: PositionClosedReason.optional().describe("set when status is CLOSED, e.g. NETTED"),
5802
- fills: z.array(ApplicableFill).min(1, "Applicable must carry at least one fill"),
6124
+ closedReason: PositionClosedReason.optional().describe("set when status is CLOSED, e.g. USER"),
6125
+ assignments: z.array(ApplicableFillAssignment).min(1, "Applicable must carry at least one assignment"),
5803
6126
  metadata: ApplicableMetadata
5804
6127
  });
5805
6128
  var WATERMARK_FUTURE_SKEW_MS = 3e5;
@@ -5815,6 +6138,7 @@ var CreateApplicablesBulkFields = z.object({
5815
6138
  executionsUpdatedAtEpochMs: z.string().regex(/^\d+$/, "Must be a non-negative integer millisecond value").transform(Number).describe("mirror of meta.executionsUpdatedAtEpochMs, readable without decompressing the payload")
5816
6139
  });
5817
6140
  var CreateApplicablesRequest = z.object({
6141
+ fills: z.array(ApplicableFill),
5818
6142
  applicables: z.array(ApplicablePosition),
5819
6143
  exchangePositions: z.array(ExternalPosition),
5820
6144
  meta: CreateApplicablesMeta
@@ -6468,14 +6792,19 @@ var TraderPerformanceQuery = z.object({
6468
6792
  range: z.enum([
6469
6793
  "24h",
6470
6794
  "7d",
6471
- "30d"
6795
+ "30d",
6796
+ "1y",
6797
+ "all"
6472
6798
  ]).default("24h")
6473
6799
  }).strict();
6474
6800
  var TraderPerformancePoint = z.object({
6475
6801
  at: z.string().datetime(),
6476
6802
  equityUsd: SignedDecimalString.optional(),
6477
6803
  pnlUsd: SignedDecimalString.optional(),
6478
- roiPercent: SignedDecimalString.optional()
6804
+ // Return on starting equity: profit since the first point with positive equity, over that equity. Deposits never move the denominator, and that anchor can be later than pnlUsd's baseline.
6805
+ roiPercent: SignedDecimalString.optional(),
6806
+ // True once any earlier or current capture excluded a value it could not measure; it never clears within a series.
6807
+ hasGap: z.boolean()
6479
6808
  });
6480
6809
  var TraderPerformanceResponse = z.object({
6481
6810
  points: z.array(TraderPerformancePoint)
@@ -6617,6 +6946,7 @@ var scheduleFields = {
6617
6946
  randomization: true,
6618
6947
  cancelledAt: true,
6619
6948
  cancelledReason: true,
6949
+ failedAt: true,
6620
6950
  createdAt: true,
6621
6951
  updatedAt: true
6622
6952
  };
@@ -6694,7 +7024,8 @@ var SearchTriggersResponse = z.object({
6694
7024
  nextCursor: z.string().nullable()
6695
7025
  });
6696
7026
  var UserPreferences = z.object({
6697
- slippageToleranceBps: z.int().describe("User slippage preference in basis points")
7027
+ slippageToleranceBps: z.int().describe("User slippage preference in basis points"),
7028
+ copySlippageToleranceBps: z.int().describe("Slippage preference in basis points for copy-trading orders, independent of slippageToleranceBps")
6698
7029
  }).describe("User preferences");
6699
7030
  var UserProfile = z.object({
6700
7031
  id: z.uuid().describe("User UUID"),
@@ -6735,7 +7066,8 @@ var ReferralReferee = z.discriminatedUnion("status", [
6735
7066
  PendingReferralReferee
6736
7067
  ]).describe("One referral-history entry, shaped by whether the referee is bound to a V3 user yet");
6737
7068
  var UpdateUserPreferences = z.object({
6738
- slippageToleranceBps: z.int().min(1).max(1e4).optional().describe("User slippage preference in basis points")
7069
+ slippageToleranceBps: z.int().min(1).max(1e4).optional().describe("User slippage preference in basis points"),
7070
+ copySlippageToleranceBps: z.int().min(1).max(1e4).optional().describe("Slippage preference in basis points for copy-trading orders, independent of slippageToleranceBps")
6739
7071
  }).describe("Payload to update user preferences");
6740
7072
  var DISPLAY_NAME_REGEX = /^[\p{L}\p{N} .'-]+$/u;
6741
7073
  var DisplayNameSchema = z.preprocess((value) => {
@@ -7360,4 +7692,4 @@ var VaultServiceError = z.discriminatedUnion("error", [
7360
7692
  })
7361
7693
  ]);
7362
7694
 
7363
- export { Activity, ActivityItemResponse, ActivityResponse, AdjustIsolatedMargin, AdjustIsolatedMarginResponse, AgentApprove, AgentApproveResponse, AgentApproveResult, ApiKeyMeResponse, ApiKeyScope, ApiKeySummary, ApplicableFill, ApplicableMetadata, ApplicablePosition, AppliedFeeDiscount, AttachTriggerMarketClose, AttachTriggerMarketCloseList, AttachTriggerMarketCloseStatic, AttachTriggerMarketCloseTrailing, AuthenticatedUser, AutoRebalanceBetaState, AutoRebalanceConfig, AutoRebalanceListParams, AutoRebalanceListResponse, AutoRebalancePausedReason, AutoRebalanceStatus, AutoRebalanceTimeframe, AutoRebalanceWeightSource, BaseExecution, BasketMarket, BindReferralCode, BoundReferralReferee, BracketType, BuilderFeeApproval, BulkSnapshotPoint, BulkSnapshotsResponse, CancelAllSchedulesResponse, CancelAllTriggersResponse, CancelLadderResponse, CancelScheduleResponse, CancelTriggerResponse, ChangeLighterAccountTierParams, ChangeLighterAccountTierResult, ChangePasswordRequest, ChangePasswordResponse, ClosedPosition, ClosedPositionLeg, ClosedPositionLegSide, ClosedPositionListParams, ClosedPositionListResponse, ConnectedIdentity, Connector, CopyAccountPerformance, CopyActivity, CopyActivityLeg, CopyActivityListParams, CopyActivityListResponse, CopyActivityOutcome, CopyActivityState, CopyCaptureTiming, CopyEndCapture, CopyEndCaptureStatus, CopyEndedSubscriptionWithVolume, CopyExecutionSource, CopyFollower, CopyFollowerStats, CopyFollowersResponse, CopyHealthResponse, CopyJoinResult, CopyLeaderAction, CopyPerformance, CopyPnlBreakdown, CopySizing, CopySkipReason, CopyStartSnapshot, CopyStartingAccount, CopyStateResponse, CopyStatsParams, CopyStatsResponse, CopySubscription, CopySubscriptionListQuery, CopySubscriptionListResponse, CopySubscriptionMetrics, CopySubscriptionRead, CopySubscriptionResponse, CopySubscriptionStatus, CopySubscriptionWithMetrics, CreateApiKeyInput, CreateApiKeyOutput, CreateApiKeyWithMessageResult, CreateApplicablesBulkFields, CreateApplicablesMeta, CreateApplicablesRequest, CreateAuthTokenParams, CreateAuthTokenResult, CreateAutoRebalanceConfig, CreateAutoRebalanceResponse, CreateCopySubscription, CreateCopySubscriptionResponse, CreateFundingPaymentsRequest, CreateLadder, CreateLadderMarketOpen, CreateLadderResponse, CreateLighterApiKeyParams, CreateLighterSubAccountParams, CreateLighterSubAccountResult, CreateLighterUdaParams, CreateLighterUdaResult, CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateMarketReverse, CreateReferralCode, CreateRewardClaim, CreateSavedBasketPayload, CreateSavedBasketResponse, CreateSchedule, CreateScheduleResponse, CreateTWAPClose, CreateTWAPOpen, CreateTradeAccount, CreateTradeAdjust, CreateTradeAdjustResponse, CreateTradeClose, CreateTradeCloseAll, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpen, CreateTradeOpenResponse, CreateTradeReverse, CreateTradeReverseResponse, CreateTriggerClose, CreateTriggerConditionAttachStatic, CreateTriggerConditionAttachTrailing, CreateTriggerConditionCloseStatic, CreateTriggerConditionCloseTrailing, CreateTriggerConditionOpen, CreateTriggerMarketAdjust, CreateTriggerMarketClose, CreateTriggerMarketCloseStatic, CreateTriggerMarketCloseTrailing, CreateTriggerMarketOpen, CreateTriggerOpen, CreateTriggerResponse, CreateTriggerTWAPAdjust, CreateTriggerTWAPClose, CreateTriggerTWAPCloseStatic, CreateTriggerTWAPCloseTrailing, CreateVault, CreateVaultTradeAccount, CreatedVaultResponse, CreatedVaultResult, DEFAULT_TWAP_RANDOMIZATION, DisconnectXResponse, DiscountRate, EmailLoginRequest, EmailRegisterRequest, EndCopySubscriptionResponse, EthereumAddress2 as EthereumAddress, EthereumTransactionHash, ExchangeCredentialsResponse, ExchangeXLoginRequest, Execution, ExecutionFulfillment, ExecutionIntent, ExecutionLegMode, ExecutionListParams, ExecutionListResponse, ExecutionOrderType, ExecutionStatus, ExternalPosition, ExternalTrigger, ExternalTriggerSource, FeeBps, FeeConnector, FeeDiscountScope, FeeOverrideScope, FeeRecipientResponse, FeeResponse, FeeRole, Fill, FillListParams, FillListResponse, FillOrderBy, FillStatus, ForgotPasswordRequest, ForgotPasswordResponse, FundingInfo, FundingPaymentEntry, FundingQueryParams, FundingResponse, FundingUpdatedData, GetExecutionResponse, GetFeeRecipientParams, bundle_exports as HttpTypes, Instrument, InstrumentFundingMap, InstrumentId, InstrumentListLiteResponse, InstrumentListParams, InstrumentListResponse, InstrumentLite, InstrumentMarginMode, InstrumentPrecision, InstrumentPriceMap, InstrumentScope, InstrumentSymbolToIdMapResponse, InstrumentTradeability, InstrumentTradeabilityReason, InstrumentTradeabilityStatus, InstrumentType, LEADERBOARD_MAX_LIMIT, Ladder, LadderConditionOpen, LadderConfig, LadderListParams, LadderListResponse, LadderResponse, LadderStatus, LeaderSignedAction, LeaderboardArchiveListResponse, LeaderboardArchiveParams, LeaderboardArchivePeriodParams, LeaderboardArchiveResponse, LeaderboardQueryParams, LeaderboardResponse, LeaderboardRow, LeaderboardSnapshotParams, LeaderboardSnapshotQueryParams, LeaderboardSnapshotResponse, LeaderboardSortBy, LeaderboardStatus, LighterAccountTier, LighterUdaResolution, LighterUdaTransaction, LinkEmailRequest, LinkEmailResponse, LinkWalletRequest, LinkWalletResponse, ListApiKeysOutput, ListLighterUdaDepositsParams, ListLighterUdaDepositsResult, LoginMethod, LoginRequest, LoginResponse, LogoutRequest, LogoutResponse, MARKET_BASKET_POSITION_COUNTS_MAX_BASKETS, MAX_FEE_BPS, MAX_VAULTS_PER_CONNECTION, ManagementVaultDataset, ManagementVaultInvalidatedData, MarginMode, MarkNotificationUnreadPayload, MarkNotificationUnreadResponse, MarkNotificationsReadPayload, MarkNotificationsReadResponse, Market, MarketAdjustExecution, MarketBasketPositionCounts, MarketBasketPositionCountsPayload, MarketBasketPositionCountsResponse, MarketBasketsQueryParams, MarketBasketsResponse, MarketCloseExecution, MarketExecution, MarketOpenExecution, MarketOrder, MarketReverseExecution, MarketTotals, MarketsQueryParams, MarketsResponse, MeResponse, MetricTrack, NavBucket, NavBucketPoint, NavRangeQueryParams, NavRangeResponse, NavResolution, NavSnapshot, NavSnapshotResponse, NavStatsQueryParams, NavStatsResponse, NavStatsWindow, Notification, NotificationCategory, NotificationListParams, NotificationListResponse, NotificationMetric, NotificationParameters, NullableNumber, ORDERED_VALIDITY_WINDOW_MESSAGE, OauthGrant, OauthGrantsResponse, OauthInteractionClient, OauthInteractionConfirmRequest, OauthInteractionDetailsResponse, OauthInteractionRedirectResponse, OiStatistics, OiStatisticsQueryParams, OiStatisticsResponse, OpenPosition, OpenPositionLeg, OpenPositionListParams, OpenPositionListResponse, OpenPositionLite, OpenPositionLiteListResponse, OracleTrigger, OracleUnit, OracleValue, Order, OrderStatus, PendingReferralReferee, PortfolioAnalyticsConfig, PortfolioAnalyticsInterval, PortfolioAnalyticsQuery, PortfolioAnalyticsResponse, PortfolioCashflowAmounts, PortfolioCashflowIntervals, PortfolioCashflowSeriesPoint, PortfolioClosedPositionStats, PortfolioOpenSnapshot, PortfolioPairBreakdown, PortfolioQuery, PortfolioResponse, PortfolioSource, PortfolioVolumeAmounts, PortfolioVolumeIntervals, PortfolioVolumeSeriesPoint, Position, PositionClosedReason, PositionEntryPrices, PositionExposure, PositionFillListResponse, PositionInitialExposureUSD, PositionListParams, PositionListResponse, PositionOrigin, PositionStatus, PositionStep, PositionStepLeg, PositionTotalFundingPayment, PositiveAmount, PrepareApproveIntegratorParams, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawParams, PrepareLighterFastWithdrawResult, PriceSource, PriceUpdatedData, PricesQueryParams, PricesResponse, ProfileResponse, ProvisionalFill, ProvisionalFillListResponse, PublicClosedPosition, PublicLadder, PublicOpenPosition, PublicSchedule, PublicTradeLeg, PublicTraderClosedPositionsParams, PublicTraderClosedPositionsResponse, PublicTraderParams, PublicTraderQuery, PublicTraderResponse, PublicTrigger, PublicVaultDataset, PublicVaultInvalidatedData, QuoteFeeParams, RealtimeFunding, RealtimePrice, RebalanceEvent, RebalanceEventListParams, RebalanceEventListResponse, RebalanceEventStatus, RebalanceManual, RebalanceManualResponse, RecommendedBasket, RecommendedBasketLeg, RecommendedBasketListResponse, ReferralReferee, ReferralRefereeListParams, ReferralRefereeListResponse, ReferralStatusResponse, RefineStaticLogicalRules, RefineTrailingConfig, RefineTrailingLogicalRules, RefreshSessionResponse, RefreshTokenRequest, RefreshTokenResponse, RegisterEmailResponse, ReplaceAutoRebalanceConfig, RequestNonceRequest, RequestNonceResponse, ResendVerificationForRegisterRequest, ResendVerificationResponse, ResetPasswordRequest, ResetPasswordResponse, RewardAccrual, RewardAccrualResponse, RewardClaimId, RewardClaimResponse, RewardClaimStatus, RewardClaimStatusResponse, RewardPayoutAvailability, RewardSummaryResponse, SavedBasket, SavedBasketLeg, SavedBasketListResponse, Schedule, ScheduleCancelledReason, ScheduleDetailParams, ScheduleDetailResponse, ScheduleExecutionType, ScheduleIntent, ScheduleListParams, ScheduleListResponse, ScheduleSlice, ScheduleStatus, ScheduleStrategy, SearchTriggersParams, SearchTriggersResponse, SetLeverage, SetLeverageResponse, SetLighterSubAccountMetadataParams, SetTrader, SetTraderResponse, SetTraderResult, SetUnifiedAccount, SetXVisibilityRequest, SetXVisibilityResponse, SnapshotsBulk, SparklinePoint, SparklineRange, StartXLinkRequest, StartXLinkResponse, StartXLoginRequest, StartXLoginResponse, StatisticsTotals, StatisticsTotalsQueryParams, StatisticsTotalsResponse, StpearFeePricing, SubmitApproveIntegratorParams, SubmitApproveIntegratorResult, SubmitChangePubKeyParams, SubmitChangePubKeyResult, SubmitLighterFastWithdrawParams, SubmitLighterFastWithdrawResult, SyncFillsResponse, SyncFillsSinceRequest, SyncFillsSinceResponse, SyncFundingSinceRequest, SyncFundingSinceResponse, SyncMeta, TWAPClose, TWAPOpen, TWAPRandomization, TcaBenchmarkResponse, TcaExecutionResponse, TcaExecutionSummaryContextResponse, TcaExecutionSummaryLegResponse, TcaExecutionSummaryResponse, TcaFillMetricResponse, TcaMetricStatus, TcaPositionQueryParams, TcaPositionResponse, TcaSummaryQueryParams, TcaSummaryResponse, TcaSummaryTotalsResponse, TcaTimingGranularity, TpSlBracketType, TradeAccount, TradeAccountListParams, TradeAccountListResponse, TradeAccountResponse, TradeExecutedData, TradeFill, TradeGroup, TradeLeg, TradeLegPostOnly, TradeLegPostOnlyWithMaxImpactPrice, TradeLegWithMaxImpactPrice, TradeListParams, TradeListResponse, TradePositionEffect, TradePositionState, TradeRealization, TraderPerformancePoint, TraderPerformanceQuery, TraderPerformanceResponse, Trailing, TrailingConfig, TrailingMode, TransferLighterSubAccountParams, TransferLighterSubAccountResult, Trigger, TriggerCancelledReason, TriggerConditionAdjust, TriggerConditionClose, TriggerConditionOpen, TriggerIntent, TriggerListParams, TriggerListResponse, TriggerMarket, TriggerMarketAdjust, TriggerMarketClose, TriggerMarketOpen, TriggerMarketOpenAttachedTrigger, TriggerOutcome, TriggerStatus, TriggerTWAP, TriggerTWAPAdjust, TriggerTWAPClose, TriggerTriggeredPublicData, TypedDataPayload, UnifiedAccountResponse, UnknownExternalFill, UpdateAutoRebalanceConfig, UpdateSavedBasketPayload, UpdateSavedBasketResponse, UpdateTradeAccount, UpdateUserDisplayName, UpdateUserDisplayNameResponse, UpdateUserPreferences, UpdateUserPreferencesResponse, UpdateVaultMetadata, UpdateVaultMetadataResponse, UpdateVaultMetadataResult, UserEventData, UserEventTopic, UserPreferences, UserProfile, Vault, VaultClosedPosition, VaultClosedPositionLeg, VaultClosedPositionListParams, VaultClosedPositionListResponse, VaultDataset, VaultEvent, VaultEventListParams, VaultEventListResponse, VaultInvalidatedData, VaultInvestmentsQueryParams, VaultInvestmentsResponse, VaultListParams, VaultListResponse, VaultOpenPosition, VaultOpenPositionLeg, VaultOpenPositionListParams, VaultOpenPositionListResponse, VaultOverviewResponse, VaultRequestIssue, VaultResponse, VaultServiceError, VaultStatsQueryParams, VaultStatsResponse, VaultStatus, VaultTradeAccountStatus, VaultTradeAccountStatusResponse, VaultsOverviewQueryParams, VerifyEmailRequest, VerifyEmailResponse, ViewerCopyStatus, VolumeStatistics, VolumeStatisticsQueryParams, VolumeStatisticsResponse, WATERMARK_FUTURE_SKEW_MS, WalletLoginRequest, WebsocketAckFrame, WebsocketChannel, WebsocketControlMessage, WebsocketErrorCode, WebsocketErrorFrame, WebsocketEventFrame, WebsocketFrame, WebsocketPongFrame, WebsocketPublicChannel, WebsocketPublicParams, WebsocketRequestErrorCode, WebsocketRequestId, WebsocketTriggerEventsParams, WebsocketUserEventsParams, WebsocketVaultErrorCode, WebsocketVaultEventsParams, WebsocketWelcomeFrame, WeightMap, WithdrawToEvm, WithdrawToEvmResponse, WithdrawToEvmResult, getStaticLogicalIssues, getTrailingDeltaIssues, getTrailingLogicalIssues, hasOrderedValidityWindow, isAttachTriggerMarketCloseTrailing, isPublicVaultDataset };
7695
+ export { Activity, ActivityItemResponse, ActivityResponse, AdjustIsolatedMargin, AdjustIsolatedMarginResponse, AgentApprove, AgentApproveResponse, AgentApproveResult, ApiKeyMeResponse, ApiKeyScope, ApiKeySummary, ApplicableFill, ApplicableFillAssignment, ApplicableMetadata, ApplicablePosition, AppliedFeeDiscount, AttachTriggerMarketClose, AttachTriggerMarketCloseList, AttachTriggerMarketCloseStatic, AttachTriggerMarketCloseTrailing, AuthenticatedUser, AutoRebalanceBetaState, AutoRebalanceConfig, AutoRebalanceListParams, AutoRebalanceListResponse, AutoRebalancePausedReason, AutoRebalanceStatus, AutoRebalanceTimeframe, AutoRebalanceWeightSource, BaseExecution, BasketMarket, BindReferralCode, BoundReferralReferee, BracketType, BuilderFeeApproval, BulkSnapshotPoint, BulkSnapshotsResponse, CancelAllSchedulesResponse, CancelAllTriggersResponse, CancelLadderResponse, CancelScheduleResponse, CancelTriggerResponse, ChangeLighterAccountTierParams, ChangeLighterAccountTierResult, ChangePasswordRequest, ChangePasswordResponse, ClosedPosition, ClosedPositionLeg, ClosedPositionLegSide, ClosedPositionListParams, ClosedPositionListResponse, ConnectedIdentity, Connector, CopyAccountPerformance, CopyActivity, CopyActivityLeg, CopyActivityListParams, CopyActivityListResponse, CopyActivityOutcome, CopyActivityState, CopyActivityTWAP, CopyActivityTWAPReduction, CopyCaptureTiming, CopyControlTransferReason, CopyCoverage, CopyEndCapture, CopyEndCaptureStatus, CopyEndedSubscriptionWithVolume, CopyExecutionSource, CopyFollower, CopyFollowerStats, CopyFollowersResponse, CopyHealthResponse, CopyJoinResult, CopyLeaderAction, CopyManagedPosition, CopyPerformance, CopyPnlBreakdown, CopySizing, CopySkipReason, CopyStartSnapshot, CopyStartingAccount, CopyStateResponse, CopyStatsParams, CopyStatsResponse, CopySubscription, CopySubscriptionListQuery, CopySubscriptionListResponse, CopySubscriptionMetrics, CopySubscriptionRead, CopySubscriptionResponse, CopySubscriptionStatus, CopySubscriptionWithMetrics, CopyUnmanagedFollowerPositionReason, CopyUnmanagedPosition, CreateApiKeyInput, CreateApiKeyOutput, CreateApiKeyWithMessageResult, CreateApplicablesBulkFields, CreateApplicablesMeta, CreateApplicablesRequest, CreateAuthTokenParams, CreateAuthTokenResult, CreateAutoRebalanceConfig, CreateAutoRebalanceResponse, CreateCopySubscription, CreateCopySubscriptionResponse, CreateFundingPaymentsRequest, CreateLadder, CreateLadderMarketOpen, CreateLadderResponse, CreateLighterApiKeyParams, CreateLighterSubAccountParams, CreateLighterSubAccountResult, CreateLighterUdaParams, CreateLighterUdaResult, CreateMarketAdjust, CreateMarketClose, CreateMarketCloseAll, CreateMarketOpen, CreateMarketReverse, CreateReferralCode, CreateRewardClaim, CreateSavedBasketPayload, CreateSavedBasketResponse, CreateSchedule, CreateScheduleResponse, CreateTWAPClose, CreateTWAPOpen, CreateTradeAccount, CreateTradeAdjust, CreateTradeAdjustResponse, CreateTradeClose, CreateTradeCloseAll, CreateTradeCloseAllResponse, CreateTradeCloseResponse, CreateTradeOpen, CreateTradeOpenResponse, CreateTradeReverse, CreateTradeReverseResponse, CreateTriggerClose, CreateTriggerConditionAttachStatic, CreateTriggerConditionAttachTrailing, CreateTriggerConditionCloseStatic, CreateTriggerConditionCloseTrailing, CreateTriggerConditionOpen, CreateTriggerMarketAdjust, CreateTriggerMarketClose, CreateTriggerMarketCloseStatic, CreateTriggerMarketCloseTrailing, CreateTriggerMarketOpen, CreateTriggerOpen, CreateTriggerResponse, CreateTriggerTWAPAdjust, CreateTriggerTWAPClose, CreateTriggerTWAPCloseStatic, CreateTriggerTWAPCloseTrailing, CreateVault, CreateVaultTradeAccount, CreatedVaultResponse, CreatedVaultResult, DEFAULT_TWAP_RANDOMIZATION, DisconnectXResponse, DiscountRate, EmailLoginRequest, EmailRegisterRequest, EndCopySubscriptionResponse, EthereumAddress2 as EthereumAddress, EthereumTransactionHash, ExchangeCredentialsResponse, ExchangeXLoginRequest, Execution, ExecutionErrorCode, ExecutionFulfillment, ExecutionIntent, ExecutionLegMode, ExecutionListParams, ExecutionListResponse, ExecutionOrderType, ExecutionRefusedLeg, ExecutionRefusedLegErrorCode, ExecutionStatus, ExternalPosition, ExternalTrigger, ExternalTriggerSource, FINAL_TWAP_SLICE_START_HEADROOM_SEC, FeeBps, FeeConnector, FeeDiscountScope, FeeOverrideScope, FeeRecipientResponse, FeeResponse, FeeRole, Fill, FillAssignment, FillListParams, FillListResponse, FillOrderBy, FillStatus, ForgotPasswordRequest, ForgotPasswordResponse, FundingInfo, FundingPaymentEntry, FundingQueryParams, FundingResponse, FundingUpdatedData, GetExecutionResponse, GetFeeRecipientParams, bundle_exports as HttpTypes, Instrument, InstrumentFundingMap, InstrumentId, InstrumentListLiteResponse, InstrumentListParams, InstrumentListResponse, InstrumentLite, InstrumentMarginMode, InstrumentPrecision, InstrumentPriceMap, InstrumentScope, InstrumentSymbolToIdMapResponse, InstrumentTradeability, InstrumentTradeabilityReason, InstrumentTradeabilityStatus, InstrumentType, LEADERBOARD_MAX_LIMIT, Ladder, LadderConditionOpen, LadderConfig, LadderListParams, LadderListResponse, LadderResponse, LadderStatus, LeaderSignedAction, LeaderboardArchiveListResponse, LeaderboardArchiveParams, LeaderboardArchivePeriodParams, LeaderboardArchiveResponse, LeaderboardQueryParams, LeaderboardResponse, LeaderboardRow, LeaderboardSnapshotParams, LeaderboardSnapshotQueryParams, LeaderboardSnapshotResponse, LeaderboardSortBy, LeaderboardStatus, LighterAccountTier, LighterUdaResolution, LighterUdaTransaction, LinkEmailRequest, LinkEmailResponse, LinkWalletRequest, LinkWalletResponse, ListApiKeysOutput, ListLighterUdaDepositsParams, ListLighterUdaDepositsResult, ListRewardClaimsQuery, LoginMethod, LoginRequest, LoginResponse, LogoutRequest, LogoutResponse, MARKET_BASKET_POSITION_COUNTS_MAX_BASKETS, MAX_FEE_BPS, MAX_TWAP_DURATION_SEC, MAX_VAULTS_PER_CONNECTION, MIN_TWAP_SLICE_INTERVAL_SEC, ManagementVaultDataset, ManagementVaultInvalidatedData, MarginMode, MarkNotificationUnreadPayload, MarkNotificationUnreadResponse, MarkNotificationsReadPayload, MarkNotificationsReadResponse, Market, MarketAdjustExecution, MarketBasketPositionCounts, MarketBasketPositionCountsPayload, MarketBasketPositionCountsResponse, MarketBasketsQueryParams, MarketBasketsResponse, MarketCloseExecution, MarketExecution, MarketOpenExecution, MarketOrder, MarketReverseExecution, MarketTotals, MarketsQueryParams, MarketsResponse, MeResponse, MetricTrack, NavBucket, NavBucketPoint, NavRangeQueryParams, NavRangeResponse, NavResolution, NavSnapshot, NavSnapshotResponse, NavStatsQueryParams, NavStatsResponse, NavStatsWindow, Notification, NotificationCategory, NotificationListParams, NotificationListResponse, NotificationMetric, NotificationParameters, NullableNumber, ORDERED_VALIDITY_WINDOW_MESSAGE, OauthGrant, OauthGrantsResponse, OauthInteractionClient, OauthInteractionConfirmRequest, OauthInteractionDetailsResponse, OauthInteractionRedirectResponse, OiStatistics, OiStatisticsQueryParams, OiStatisticsResponse, OpenPosition, OpenPositionLeg, OpenPositionListParams, OpenPositionListResponse, OpenPositionLite, OpenPositionLiteListResponse, OracleTrigger, OracleUnit, OracleValue, Order, OrderStatus, PendingReferralReferee, PortfolioAnalyticsConfig, PortfolioAnalyticsInterval, PortfolioAnalyticsQuery, PortfolioAnalyticsResponse, PortfolioCashflowAmounts, PortfolioCashflowIntervals, PortfolioCashflowSeriesPoint, PortfolioClosedPositionStats, PortfolioOpenSnapshot, PortfolioPairBreakdown, PortfolioQuery, PortfolioResponse, PortfolioSource, PortfolioVolumeAmounts, PortfolioVolumeIntervals, PortfolioVolumeSeriesPoint, Position, PositionClosedReason, PositionEntryPrices, PositionExposure, PositionFill, PositionFillListResponse, PositionInitialExposureUSD, PositionListParams, PositionListResponse, PositionOrigin, PositionStatus, PositionStep, PositionStepLeg, PositionTotalFundingPayment, PositiveAmount, PrepareApproveIntegratorParams, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawParams, PrepareLighterFastWithdrawResult, PriceSource, PriceUpdatedData, PricesQueryParams, PricesResponse, ProfileResponse, ProvisionalFill, ProvisionalFillListResponse, PublicClosedPosition, PublicLadder, PublicOpenPosition, PublicSchedule, PublicTradeLeg, PublicTraderClosedPositionsParams, PublicTraderClosedPositionsResponse, PublicTraderParams, PublicTraderQuery, PublicTraderResponse, PublicTrigger, PublicVaultDataset, PublicVaultInvalidatedData, QuoteFeeParams, RealtimeFunding, RealtimePrice, RebalanceEvent, RebalanceEventListParams, RebalanceEventListResponse, RebalanceEventStatus, RebalanceManual, RebalanceManualResponse, RecommendedBasket, RecommendedBasketLeg, RecommendedBasketListResponse, ReferralReferee, ReferralRefereeListParams, ReferralRefereeListResponse, ReferralStatusResponse, RefineStaticLogicalRules, RefineTrailingConfig, RefineTrailingLogicalRules, RefreshSessionResponse, RefreshTokenRequest, RefreshTokenResponse, RegisterEmailResponse, ReplaceAutoRebalanceConfig, RequestNonceRequest, RequestNonceResponse, ResendVerificationForRegisterRequest, ResendVerificationResponse, ResetPasswordRequest, ResetPasswordResponse, ResizeBehavior, RewardAccrual, RewardAccrualResponse, RewardClaimId, RewardClaimListResponse, RewardClaimResponse, RewardClaimStatus, RewardClaimStatusResponse, RewardPayoutAvailability, RewardSourceAccrual, RewardSummaryResponse, SavedBasket, SavedBasketLeg, SavedBasketListResponse, Schedule, ScheduleCancelledReason, ScheduleDetailParams, ScheduleDetailResponse, ScheduleExecutionType, ScheduleFailedReason, ScheduleFailure, ScheduleIntent, ScheduleListParams, ScheduleListResponse, ScheduleSlice, ScheduleStatus, ScheduleStrategy, SearchTriggersParams, SearchTriggersResponse, SetLeverage, SetLeverageResponse, SetLighterSubAccountMetadataParams, SetTrader, SetTraderResponse, SetTraderResult, SetUnifiedAccount, SetXVisibilityRequest, SetXVisibilityResponse, SnapshotsBulk, SparklinePoint, SparklineRange, StartXLinkRequest, StartXLinkResponse, StartXLoginRequest, StartXLoginResponse, StatisticsTotals, StatisticsTotalsQueryParams, StatisticsTotalsResponse, StpearFeePricing, SubmitApproveIntegratorParams, SubmitApproveIntegratorResult, SubmitChangePubKeyParams, SubmitChangePubKeyResult, SubmitLighterFastWithdrawParams, SubmitLighterFastWithdrawResult, SyncFillsResponse, SyncFillsSinceRequest, SyncFillsSinceResponse, SyncFundingSinceRequest, SyncFundingSinceResponse, SyncMeta, TWAPClose, TWAPOpen, TWAPRandomization, TcaBenchmarkResponse, TcaExecutionResponse, TcaExecutionSummaryContextResponse, TcaExecutionSummaryLegResponse, TcaExecutionSummaryResponse, TcaFillMetricResponse, TcaMetricStatus, TcaPositionQueryParams, TcaPositionResponse, TcaSummaryQueryParams, TcaSummaryResponse, TcaSummaryTotalsResponse, TcaTimingGranularity, TpSlBracketType, TradeAccount, TradeAccountListParams, TradeAccountListResponse, TradeAccountResponse, TradeExecutedData, TradeFill, TradeGroup, TradeLeg, TradeLegPostOnly, TradeLegPostOnlyWithMaxImpactPrice, TradeLegWithMaxImpactPrice, TradeListParams, TradeListResponse, TradePositionEffect, TradePositionState, TradeRealization, TraderPerformancePoint, TraderPerformanceQuery, TraderPerformanceResponse, Trailing, TrailingConfig, TrailingMode, TransferLighterSubAccountParams, TransferLighterSubAccountResult, Trigger, TriggerCancelledReason, TriggerConditionAdjust, TriggerConditionClose, TriggerConditionOpen, TriggerIntent, TriggerListParams, TriggerListResponse, TriggerMarket, TriggerMarketAdjust, TriggerMarketClose, TriggerMarketOpen, TriggerMarketOpenAttachedTrigger, TriggerOutcome, TriggerStatus, TriggerTWAP, TriggerTWAPAdjust, TriggerTWAPClose, TriggerTriggeredPublicData, TypedDataPayload, UnifiedAccountResponse, UnknownExternalFill, UpdateAutoRebalanceConfig, UpdateSavedBasketPayload, UpdateSavedBasketResponse, UpdateTradeAccount, UpdateUserDisplayName, UpdateUserDisplayNameResponse, UpdateUserPreferences, UpdateUserPreferencesResponse, UpdateVaultMetadata, UpdateVaultMetadataResponse, UpdateVaultMetadataResult, UserEventData, UserEventTopic, UserPreferences, UserProfile, Vault, VaultClosedPosition, VaultClosedPositionLeg, VaultClosedPositionListParams, VaultClosedPositionListResponse, VaultDataset, VaultEvent, VaultEventListParams, VaultEventListResponse, VaultInvalidatedData, VaultInvestmentsQueryParams, VaultInvestmentsResponse, VaultListParams, VaultListResponse, VaultOpenPosition, VaultOpenPositionLeg, VaultOpenPositionListParams, VaultOpenPositionListResponse, VaultOverviewResponse, VaultRequestIssue, VaultResponse, VaultServiceError, VaultStatsQueryParams, VaultStatsResponse, VaultStatus, VaultTradeAccountStatus, VaultTradeAccountStatusResponse, VaultsOverviewQueryParams, VerifyEmailRequest, VerifyEmailResponse, ViewerCopyStatus, VolumeStatistics, VolumeStatisticsQueryParams, VolumeStatisticsResponse, WATERMARK_FUTURE_SKEW_MS, WalletLoginRequest, WebsocketAckFrame, WebsocketChannel, WebsocketControlMessage, WebsocketErrorCode, WebsocketErrorFrame, WebsocketEventFrame, WebsocketFrame, WebsocketPongFrame, WebsocketPublicChannel, WebsocketPublicParams, WebsocketRequestErrorCode, WebsocketRequestId, WebsocketTriggerEventsParams, WebsocketUserEventsParams, WebsocketVaultErrorCode, WebsocketVaultEventsParams, WebsocketWelcomeFrame, WeightMap, WithdrawToEvm, WithdrawToEvmResponse, WithdrawToEvmResult, getStaticLogicalIssues, getTrailingDeltaIssues, getTrailingLogicalIssues, hasOrderedValidityWindow, isAttachTriggerMarketCloseTrailing, isPublicVaultDataset };