@pear-protocol/core-sdk 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.d.ts +7 -9
- package/dist/core/index.d.ts +301 -117
- package/dist/core/index.js +58 -2
- package/package.json +3 -3
package/dist/core/index.d.ts
CHANGED
|
@@ -153,7 +153,7 @@ declare class Core {
|
|
|
153
153
|
orderType: "MARKET";
|
|
154
154
|
position: {
|
|
155
155
|
id: string;
|
|
156
|
-
exposure: Record<string, string
|
|
156
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
157
157
|
};
|
|
158
158
|
legs: [{
|
|
159
159
|
symbol: string;
|
|
@@ -196,7 +196,7 @@ declare class Core {
|
|
|
196
196
|
orderType: "MARKET";
|
|
197
197
|
position: {
|
|
198
198
|
id: string;
|
|
199
|
-
exposure: Record<string, string
|
|
199
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
200
200
|
};
|
|
201
201
|
error?: string | undefined;
|
|
202
202
|
orders?: {
|
|
@@ -223,18 +223,26 @@ declare class Core {
|
|
|
223
223
|
details: (positionId: string, headers?: ClientHeaders) => Promise<{
|
|
224
224
|
fills: {
|
|
225
225
|
id: string;
|
|
226
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
226
227
|
tradeAccountId: string;
|
|
227
228
|
symbol: string;
|
|
228
229
|
positionId: string;
|
|
229
230
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
230
231
|
side: "BUY" | "SELL";
|
|
231
232
|
reduceOnly: boolean;
|
|
233
|
+
isExternal: boolean;
|
|
232
234
|
quantity: string;
|
|
233
235
|
price: string;
|
|
234
236
|
usd: string;
|
|
235
237
|
timestamp: string;
|
|
236
238
|
cloid?: string | undefined;
|
|
237
|
-
|
|
239
|
+
exchangeFillId?: string | undefined;
|
|
240
|
+
tradeFee?: string | undefined;
|
|
241
|
+
pearFee?: string | undefined;
|
|
242
|
+
original?: {
|
|
243
|
+
exchangeFillId: string;
|
|
244
|
+
quantity: string;
|
|
245
|
+
} | undefined;
|
|
238
246
|
}[];
|
|
239
247
|
}>;
|
|
240
248
|
list: (query: HttpTypes.FillListParams, headers?: ClientHeaders) => Promise<{
|
|
@@ -242,18 +250,35 @@ declare class Core {
|
|
|
242
250
|
nextCursor: string | undefined;
|
|
243
251
|
fills: {
|
|
244
252
|
id: string;
|
|
253
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
245
254
|
tradeAccountId: string;
|
|
246
255
|
symbol: string;
|
|
247
256
|
positionId: string;
|
|
248
257
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
249
258
|
side: "BUY" | "SELL";
|
|
250
259
|
reduceOnly: boolean;
|
|
260
|
+
isExternal: boolean;
|
|
251
261
|
quantity: string;
|
|
252
262
|
price: string;
|
|
253
263
|
usd: string;
|
|
254
264
|
timestamp: string;
|
|
255
265
|
cloid?: string | undefined;
|
|
256
|
-
|
|
266
|
+
exchangeFillId?: string | undefined;
|
|
267
|
+
tradeFee?: string | undefined;
|
|
268
|
+
pearFee?: string | undefined;
|
|
269
|
+
original?: {
|
|
270
|
+
exchangeFillId: string;
|
|
271
|
+
quantity: string;
|
|
272
|
+
} | undefined;
|
|
273
|
+
}[];
|
|
274
|
+
}>;
|
|
275
|
+
provisionals: (headers?: ClientHeaders) => Promise<{
|
|
276
|
+
fills: {
|
|
277
|
+
id: string;
|
|
278
|
+
positionId: string;
|
|
279
|
+
symbol: string;
|
|
280
|
+
status: "PROVISIONAL";
|
|
281
|
+
cloid?: string | undefined;
|
|
257
282
|
}[];
|
|
258
283
|
}>;
|
|
259
284
|
};
|
|
@@ -292,6 +317,9 @@ declare class Core {
|
|
|
292
317
|
};
|
|
293
318
|
}[];
|
|
294
319
|
}>;
|
|
320
|
+
symbolToIdMap: (query: HttpTypes.InstrumentListParams, headers?: ClientHeaders) => Promise<{
|
|
321
|
+
data: Record<string, string>;
|
|
322
|
+
}>;
|
|
295
323
|
};
|
|
296
324
|
positions: {
|
|
297
325
|
list: (query: HttpTypes.PositionListParamsInput, headers?: ClientHeaders) => Promise<{
|
|
@@ -300,14 +328,23 @@ declare class Core {
|
|
|
300
328
|
tradeAccountId: string;
|
|
301
329
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
302
330
|
status: "OPEN" | "CLOSED";
|
|
303
|
-
exposure: Record<string, string
|
|
304
|
-
initialExposureUSD: Record<string, string
|
|
331
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
332
|
+
initialExposureUSD: Record<string, `-${string}` | `+${string}`>;
|
|
305
333
|
createdAt: string;
|
|
306
334
|
updatedAt: string;
|
|
307
335
|
closedReason?: "NETTED" | "USER" | "LIQUIDATED" | null | undefined;
|
|
308
336
|
closedAt?: string | null | undefined;
|
|
309
337
|
}[];
|
|
310
338
|
}>;
|
|
339
|
+
openLite: (headers?: ClientHeaders) => Promise<{
|
|
340
|
+
positions: {
|
|
341
|
+
id: string;
|
|
342
|
+
createdAt: string;
|
|
343
|
+
exposure: Record<string, string>;
|
|
344
|
+
status: "OPEN";
|
|
345
|
+
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
346
|
+
}[];
|
|
347
|
+
}>;
|
|
311
348
|
};
|
|
312
349
|
prices: {
|
|
313
350
|
list: (query: HttpTypes.PricesQueryParams, headers?: ClientHeaders) => Promise<{
|
|
@@ -331,7 +368,7 @@ declare class Core {
|
|
|
331
368
|
updatedAt: string;
|
|
332
369
|
strategy: "TWAP";
|
|
333
370
|
intent: "OPEN";
|
|
334
|
-
|
|
371
|
+
sliceIntervalSec: number;
|
|
335
372
|
sliceLegs: {
|
|
336
373
|
symbol: string;
|
|
337
374
|
side: "BUY" | "SELL";
|
|
@@ -342,21 +379,29 @@ declare class Core {
|
|
|
342
379
|
remainingNotional: string;
|
|
343
380
|
lastSliceAt?: string | undefined;
|
|
344
381
|
cancelledAt?: string | undefined;
|
|
345
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
382
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
346
383
|
fills?: {
|
|
347
384
|
id: string;
|
|
385
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
348
386
|
tradeAccountId: string;
|
|
349
387
|
symbol: string;
|
|
350
388
|
positionId: string;
|
|
351
389
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
352
390
|
side: "BUY" | "SELL";
|
|
353
391
|
reduceOnly: boolean;
|
|
392
|
+
isExternal: boolean;
|
|
354
393
|
quantity: string;
|
|
355
394
|
price: string;
|
|
356
395
|
usd: string;
|
|
357
396
|
timestamp: string;
|
|
358
397
|
cloid?: string | undefined;
|
|
359
|
-
|
|
398
|
+
exchangeFillId?: string | undefined;
|
|
399
|
+
tradeFee?: string | undefined;
|
|
400
|
+
pearFee?: string | undefined;
|
|
401
|
+
original?: {
|
|
402
|
+
exchangeFillId: string;
|
|
403
|
+
quantity: string;
|
|
404
|
+
} | undefined;
|
|
360
405
|
}[] | undefined;
|
|
361
406
|
} | {
|
|
362
407
|
id: string;
|
|
@@ -370,30 +415,38 @@ declare class Core {
|
|
|
370
415
|
updatedAt: string;
|
|
371
416
|
strategy: "TWAP";
|
|
372
417
|
intent: "CLOSE";
|
|
373
|
-
|
|
418
|
+
sliceIntervalSec: number;
|
|
374
419
|
positionId: string;
|
|
375
420
|
sliceLegs: {
|
|
376
421
|
symbol: string;
|
|
377
422
|
stepAmount: string;
|
|
378
423
|
}[];
|
|
379
|
-
initialExposure: Record<string, string
|
|
424
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
380
425
|
lastSliceAt?: string | undefined;
|
|
381
426
|
cancelledAt?: string | undefined;
|
|
382
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
427
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
383
428
|
fills?: {
|
|
384
429
|
id: string;
|
|
430
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
385
431
|
tradeAccountId: string;
|
|
386
432
|
symbol: string;
|
|
387
433
|
positionId: string;
|
|
388
434
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
389
435
|
side: "BUY" | "SELL";
|
|
390
436
|
reduceOnly: boolean;
|
|
437
|
+
isExternal: boolean;
|
|
391
438
|
quantity: string;
|
|
392
439
|
price: string;
|
|
393
440
|
usd: string;
|
|
394
441
|
timestamp: string;
|
|
395
442
|
cloid?: string | undefined;
|
|
396
|
-
|
|
443
|
+
exchangeFillId?: string | undefined;
|
|
444
|
+
tradeFee?: string | undefined;
|
|
445
|
+
pearFee?: string | undefined;
|
|
446
|
+
original?: {
|
|
447
|
+
exchangeFillId: string;
|
|
448
|
+
quantity: string;
|
|
449
|
+
} | undefined;
|
|
397
450
|
}[] | undefined;
|
|
398
451
|
})[];
|
|
399
452
|
}>;
|
|
@@ -410,7 +463,7 @@ declare class Core {
|
|
|
410
463
|
updatedAt: string;
|
|
411
464
|
strategy: "TWAP";
|
|
412
465
|
intent: "OPEN";
|
|
413
|
-
|
|
466
|
+
sliceIntervalSec: number;
|
|
414
467
|
sliceLegs: {
|
|
415
468
|
symbol: string;
|
|
416
469
|
side: "BUY" | "SELL";
|
|
@@ -421,21 +474,29 @@ declare class Core {
|
|
|
421
474
|
remainingNotional: string;
|
|
422
475
|
lastSliceAt?: string | undefined;
|
|
423
476
|
cancelledAt?: string | undefined;
|
|
424
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
477
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
425
478
|
fills?: {
|
|
426
479
|
id: string;
|
|
480
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
427
481
|
tradeAccountId: string;
|
|
428
482
|
symbol: string;
|
|
429
483
|
positionId: string;
|
|
430
484
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
431
485
|
side: "BUY" | "SELL";
|
|
432
486
|
reduceOnly: boolean;
|
|
487
|
+
isExternal: boolean;
|
|
433
488
|
quantity: string;
|
|
434
489
|
price: string;
|
|
435
490
|
usd: string;
|
|
436
491
|
timestamp: string;
|
|
437
492
|
cloid?: string | undefined;
|
|
438
|
-
|
|
493
|
+
exchangeFillId?: string | undefined;
|
|
494
|
+
tradeFee?: string | undefined;
|
|
495
|
+
pearFee?: string | undefined;
|
|
496
|
+
original?: {
|
|
497
|
+
exchangeFillId: string;
|
|
498
|
+
quantity: string;
|
|
499
|
+
} | undefined;
|
|
439
500
|
}[] | undefined;
|
|
440
501
|
} | {
|
|
441
502
|
id: string;
|
|
@@ -449,30 +510,38 @@ declare class Core {
|
|
|
449
510
|
updatedAt: string;
|
|
450
511
|
strategy: "TWAP";
|
|
451
512
|
intent: "CLOSE";
|
|
452
|
-
|
|
513
|
+
sliceIntervalSec: number;
|
|
453
514
|
positionId: string;
|
|
454
515
|
sliceLegs: {
|
|
455
516
|
symbol: string;
|
|
456
517
|
stepAmount: string;
|
|
457
518
|
}[];
|
|
458
|
-
initialExposure: Record<string, string
|
|
519
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
459
520
|
lastSliceAt?: string | undefined;
|
|
460
521
|
cancelledAt?: string | undefined;
|
|
461
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
522
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
462
523
|
fills?: {
|
|
463
524
|
id: string;
|
|
525
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
464
526
|
tradeAccountId: string;
|
|
465
527
|
symbol: string;
|
|
466
528
|
positionId: string;
|
|
467
529
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
468
530
|
side: "BUY" | "SELL";
|
|
469
531
|
reduceOnly: boolean;
|
|
532
|
+
isExternal: boolean;
|
|
470
533
|
quantity: string;
|
|
471
534
|
price: string;
|
|
472
535
|
usd: string;
|
|
473
536
|
timestamp: string;
|
|
474
537
|
cloid?: string | undefined;
|
|
475
|
-
|
|
538
|
+
exchangeFillId?: string | undefined;
|
|
539
|
+
tradeFee?: string | undefined;
|
|
540
|
+
pearFee?: string | undefined;
|
|
541
|
+
original?: {
|
|
542
|
+
exchangeFillId: string;
|
|
543
|
+
quantity: string;
|
|
544
|
+
} | undefined;
|
|
476
545
|
}[] | undefined;
|
|
477
546
|
};
|
|
478
547
|
}>;
|
|
@@ -483,6 +552,17 @@ declare class Core {
|
|
|
483
552
|
ids: string[];
|
|
484
553
|
}>;
|
|
485
554
|
};
|
|
555
|
+
sync: {
|
|
556
|
+
since: (body: HttpTypes.SyncSinceRequest, headers?: ClientHeaders) => Promise<{
|
|
557
|
+
since: string;
|
|
558
|
+
sinceMs: number;
|
|
559
|
+
safeTs?: number | undefined;
|
|
560
|
+
confirmedExchangeFillIds?: string[] | undefined;
|
|
561
|
+
}>;
|
|
562
|
+
confirm: (body: HttpTypes.ConfirmFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
563
|
+
reconcile: (body: HttpTypes.ReconcileFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
564
|
+
create: (body: HttpTypes.CreateFillsRequest, headers?: ClientHeaders) => Promise<Record<string, never>>;
|
|
565
|
+
};
|
|
486
566
|
trade: {
|
|
487
567
|
open: (body: HttpTypes.CreateTradeOpen, headers?: ClientHeaders) => Promise<{
|
|
488
568
|
execution: {
|
|
@@ -534,7 +614,7 @@ declare class Core {
|
|
|
534
614
|
orderType: "MARKET";
|
|
535
615
|
position: {
|
|
536
616
|
id: string;
|
|
537
|
-
exposure: Record<string, string
|
|
617
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
538
618
|
};
|
|
539
619
|
legs: [{
|
|
540
620
|
symbol: string;
|
|
@@ -577,7 +657,7 @@ declare class Core {
|
|
|
577
657
|
orderType: "MARKET";
|
|
578
658
|
position: {
|
|
579
659
|
id: string;
|
|
580
|
-
exposure: Record<string, string
|
|
660
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
581
661
|
};
|
|
582
662
|
error?: string | undefined;
|
|
583
663
|
orders?: {
|
|
@@ -649,7 +729,7 @@ declare class Core {
|
|
|
649
729
|
orderType: "MARKET";
|
|
650
730
|
position: {
|
|
651
731
|
id: string;
|
|
652
|
-
exposure: Record<string, string
|
|
732
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
653
733
|
};
|
|
654
734
|
legs: [{
|
|
655
735
|
symbol: string;
|
|
@@ -692,7 +772,7 @@ declare class Core {
|
|
|
692
772
|
orderType: "MARKET";
|
|
693
773
|
position: {
|
|
694
774
|
id: string;
|
|
695
|
-
exposure: Record<string, string
|
|
775
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
696
776
|
};
|
|
697
777
|
error?: string | undefined;
|
|
698
778
|
orders?: {
|
|
@@ -764,7 +844,7 @@ declare class Core {
|
|
|
764
844
|
orderType: "MARKET";
|
|
765
845
|
position: {
|
|
766
846
|
id: string;
|
|
767
|
-
exposure: Record<string, string
|
|
847
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
768
848
|
};
|
|
769
849
|
legs: [{
|
|
770
850
|
symbol: string;
|
|
@@ -807,7 +887,7 @@ declare class Core {
|
|
|
807
887
|
orderType: "MARKET";
|
|
808
888
|
position: {
|
|
809
889
|
id: string;
|
|
810
|
-
exposure: Record<string, string
|
|
890
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
811
891
|
};
|
|
812
892
|
error?: string | undefined;
|
|
813
893
|
orders?: {
|
|
@@ -879,7 +959,7 @@ declare class Core {
|
|
|
879
959
|
orderType: "MARKET";
|
|
880
960
|
position: {
|
|
881
961
|
id: string;
|
|
882
|
-
exposure: Record<string, string
|
|
962
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
883
963
|
};
|
|
884
964
|
legs: [{
|
|
885
965
|
symbol: string;
|
|
@@ -922,7 +1002,7 @@ declare class Core {
|
|
|
922
1002
|
orderType: "MARKET";
|
|
923
1003
|
position: {
|
|
924
1004
|
id: string;
|
|
925
|
-
exposure: Record<string, string
|
|
1005
|
+
exposure: Record<string, `-${string}` | `+${string}`>;
|
|
926
1006
|
};
|
|
927
1007
|
error?: string | undefined;
|
|
928
1008
|
orders?: {
|
|
@@ -955,6 +1035,7 @@ declare class Core {
|
|
|
955
1035
|
tradeAccountId: string;
|
|
956
1036
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
957
1037
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1038
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
958
1039
|
createdAt: string;
|
|
959
1040
|
updatedAt: string;
|
|
960
1041
|
intent: "OPEN";
|
|
@@ -962,7 +1043,7 @@ declare class Core {
|
|
|
962
1043
|
condition: {
|
|
963
1044
|
type: "ratio_v1";
|
|
964
1045
|
data: {
|
|
965
|
-
priceSource: "
|
|
1046
|
+
priceSource: "mark" | "mid";
|
|
966
1047
|
symbol_a: string;
|
|
967
1048
|
symbol_b: string;
|
|
968
1049
|
direction: "ABOVE" | "BELOW";
|
|
@@ -971,7 +1052,7 @@ declare class Core {
|
|
|
971
1052
|
} | {
|
|
972
1053
|
type: "price_v1";
|
|
973
1054
|
data: {
|
|
974
|
-
priceSource: "
|
|
1055
|
+
priceSource: "mark" | "mid";
|
|
975
1056
|
symbol: string;
|
|
976
1057
|
direction: "ABOVE" | "BELOW";
|
|
977
1058
|
threshold: number;
|
|
@@ -979,7 +1060,7 @@ declare class Core {
|
|
|
979
1060
|
} | {
|
|
980
1061
|
type: "index_v1";
|
|
981
1062
|
data: {
|
|
982
|
-
priceSource: "
|
|
1063
|
+
priceSource: "mark" | "mid";
|
|
983
1064
|
basket: {
|
|
984
1065
|
symbol: string;
|
|
985
1066
|
weight: number;
|
|
@@ -990,7 +1071,7 @@ declare class Core {
|
|
|
990
1071
|
} | {
|
|
991
1072
|
type: "weighted_ratio_v1";
|
|
992
1073
|
data: {
|
|
993
|
-
priceSource: "
|
|
1074
|
+
priceSource: "mark" | "mid";
|
|
994
1075
|
basket: {
|
|
995
1076
|
symbol: string;
|
|
996
1077
|
side: "BUY" | "SELL";
|
|
@@ -1016,28 +1097,36 @@ declare class Core {
|
|
|
1016
1097
|
};
|
|
1017
1098
|
triggeredAt?: string | undefined;
|
|
1018
1099
|
cancelledAt?: string | undefined;
|
|
1019
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1100
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1020
1101
|
fills?: {
|
|
1021
1102
|
id: string;
|
|
1103
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1022
1104
|
tradeAccountId: string;
|
|
1023
1105
|
symbol: string;
|
|
1024
1106
|
positionId: string;
|
|
1025
1107
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1026
1108
|
side: "BUY" | "SELL";
|
|
1027
1109
|
reduceOnly: boolean;
|
|
1110
|
+
isExternal: boolean;
|
|
1028
1111
|
quantity: string;
|
|
1029
1112
|
price: string;
|
|
1030
1113
|
usd: string;
|
|
1031
1114
|
timestamp: string;
|
|
1032
1115
|
cloid?: string | undefined;
|
|
1033
|
-
|
|
1116
|
+
exchangeFillId?: string | undefined;
|
|
1117
|
+
tradeFee?: string | undefined;
|
|
1118
|
+
pearFee?: string | undefined;
|
|
1119
|
+
original?: {
|
|
1120
|
+
exchangeFillId: string;
|
|
1121
|
+
quantity: string;
|
|
1122
|
+
} | undefined;
|
|
1034
1123
|
}[] | undefined;
|
|
1035
|
-
bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
|
|
1036
1124
|
} | {
|
|
1037
1125
|
id: string;
|
|
1038
1126
|
tradeAccountId: string;
|
|
1039
1127
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1040
1128
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1129
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1041
1130
|
createdAt: string;
|
|
1042
1131
|
updatedAt: string;
|
|
1043
1132
|
intent: "ADJUST";
|
|
@@ -1045,7 +1134,7 @@ declare class Core {
|
|
|
1045
1134
|
condition: {
|
|
1046
1135
|
type: "ratio_v1";
|
|
1047
1136
|
data: {
|
|
1048
|
-
priceSource: "
|
|
1137
|
+
priceSource: "mark" | "mid";
|
|
1049
1138
|
symbol_a: string;
|
|
1050
1139
|
symbol_b: string;
|
|
1051
1140
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1054,7 +1143,7 @@ declare class Core {
|
|
|
1054
1143
|
} | {
|
|
1055
1144
|
type: "price_v1";
|
|
1056
1145
|
data: {
|
|
1057
|
-
priceSource: "
|
|
1146
|
+
priceSource: "mark" | "mid";
|
|
1058
1147
|
symbol: string;
|
|
1059
1148
|
direction: "ABOVE" | "BELOW";
|
|
1060
1149
|
threshold: number;
|
|
@@ -1062,7 +1151,7 @@ declare class Core {
|
|
|
1062
1151
|
} | {
|
|
1063
1152
|
type: "index_v1";
|
|
1064
1153
|
data: {
|
|
1065
|
-
priceSource: "
|
|
1154
|
+
priceSource: "mark" | "mid";
|
|
1066
1155
|
basket: {
|
|
1067
1156
|
symbol: string;
|
|
1068
1157
|
weight: number;
|
|
@@ -1073,7 +1162,7 @@ declare class Core {
|
|
|
1073
1162
|
} | {
|
|
1074
1163
|
type: "weighted_ratio_v1";
|
|
1075
1164
|
data: {
|
|
1076
|
-
priceSource: "
|
|
1165
|
+
priceSource: "mark" | "mid";
|
|
1077
1166
|
basket: {
|
|
1078
1167
|
symbol: string;
|
|
1079
1168
|
side: "BUY" | "SELL";
|
|
@@ -1085,21 +1174,21 @@ declare class Core {
|
|
|
1085
1174
|
} | {
|
|
1086
1175
|
type: "position_value_v1";
|
|
1087
1176
|
data: {
|
|
1088
|
-
priceSource: "
|
|
1177
|
+
priceSource: "mark" | "mid";
|
|
1089
1178
|
direction: "ABOVE" | "BELOW";
|
|
1090
1179
|
threshold: number;
|
|
1091
1180
|
};
|
|
1092
1181
|
} | {
|
|
1093
1182
|
type: "position_upnl_value_v1";
|
|
1094
1183
|
data: {
|
|
1095
|
-
priceSource: "
|
|
1184
|
+
priceSource: "mark" | "mid";
|
|
1096
1185
|
direction: "ABOVE" | "BELOW";
|
|
1097
1186
|
threshold: number;
|
|
1098
1187
|
};
|
|
1099
1188
|
} | {
|
|
1100
1189
|
type: "position_upnl_percentage_v1";
|
|
1101
1190
|
data: {
|
|
1102
|
-
priceSource: "
|
|
1191
|
+
priceSource: "mark" | "mid";
|
|
1103
1192
|
direction: "ABOVE" | "BELOW";
|
|
1104
1193
|
threshold_bps: number;
|
|
1105
1194
|
};
|
|
@@ -1108,7 +1197,7 @@ declare class Core {
|
|
|
1108
1197
|
type: "MARKET";
|
|
1109
1198
|
position: {
|
|
1110
1199
|
id: string;
|
|
1111
|
-
initialExposure: Record<string, string
|
|
1200
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1112
1201
|
};
|
|
1113
1202
|
legs: [{
|
|
1114
1203
|
symbol: string;
|
|
@@ -1126,28 +1215,40 @@ declare class Core {
|
|
|
1126
1215
|
};
|
|
1127
1216
|
triggeredAt?: string | undefined;
|
|
1128
1217
|
cancelledAt?: string | undefined;
|
|
1129
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1218
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1130
1219
|
fills?: {
|
|
1131
1220
|
id: string;
|
|
1221
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1132
1222
|
tradeAccountId: string;
|
|
1133
1223
|
symbol: string;
|
|
1134
1224
|
positionId: string;
|
|
1135
1225
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1136
1226
|
side: "BUY" | "SELL";
|
|
1137
1227
|
reduceOnly: boolean;
|
|
1228
|
+
isExternal: boolean;
|
|
1138
1229
|
quantity: string;
|
|
1139
1230
|
price: string;
|
|
1140
1231
|
usd: string;
|
|
1141
1232
|
timestamp: string;
|
|
1142
1233
|
cloid?: string | undefined;
|
|
1143
|
-
|
|
1234
|
+
exchangeFillId?: string | undefined;
|
|
1235
|
+
tradeFee?: string | undefined;
|
|
1236
|
+
pearFee?: string | undefined;
|
|
1237
|
+
original?: {
|
|
1238
|
+
exchangeFillId: string;
|
|
1239
|
+
quantity: string;
|
|
1240
|
+
} | undefined;
|
|
1144
1241
|
}[] | undefined;
|
|
1145
|
-
|
|
1242
|
+
trailing?: {
|
|
1243
|
+
deltaValue: number;
|
|
1244
|
+
activationValue: number;
|
|
1245
|
+
} | undefined;
|
|
1146
1246
|
} | {
|
|
1147
1247
|
id: string;
|
|
1148
1248
|
tradeAccountId: string;
|
|
1149
1249
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1150
1250
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1251
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1151
1252
|
createdAt: string;
|
|
1152
1253
|
updatedAt: string;
|
|
1153
1254
|
intent: "CLOSE";
|
|
@@ -1155,7 +1256,7 @@ declare class Core {
|
|
|
1155
1256
|
condition: {
|
|
1156
1257
|
type: "ratio_v1";
|
|
1157
1258
|
data: {
|
|
1158
|
-
priceSource: "
|
|
1259
|
+
priceSource: "mark" | "mid";
|
|
1159
1260
|
symbol_a: string;
|
|
1160
1261
|
symbol_b: string;
|
|
1161
1262
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1164,7 +1265,7 @@ declare class Core {
|
|
|
1164
1265
|
} | {
|
|
1165
1266
|
type: "price_v1";
|
|
1166
1267
|
data: {
|
|
1167
|
-
priceSource: "
|
|
1268
|
+
priceSource: "mark" | "mid";
|
|
1168
1269
|
symbol: string;
|
|
1169
1270
|
direction: "ABOVE" | "BELOW";
|
|
1170
1271
|
threshold: number;
|
|
@@ -1172,7 +1273,7 @@ declare class Core {
|
|
|
1172
1273
|
} | {
|
|
1173
1274
|
type: "index_v1";
|
|
1174
1275
|
data: {
|
|
1175
|
-
priceSource: "
|
|
1276
|
+
priceSource: "mark" | "mid";
|
|
1176
1277
|
basket: {
|
|
1177
1278
|
symbol: string;
|
|
1178
1279
|
weight: number;
|
|
@@ -1183,7 +1284,7 @@ declare class Core {
|
|
|
1183
1284
|
} | {
|
|
1184
1285
|
type: "weighted_ratio_v1";
|
|
1185
1286
|
data: {
|
|
1186
|
-
priceSource: "
|
|
1287
|
+
priceSource: "mark" | "mid";
|
|
1187
1288
|
basket: {
|
|
1188
1289
|
symbol: string;
|
|
1189
1290
|
side: "BUY" | "SELL";
|
|
@@ -1195,21 +1296,21 @@ declare class Core {
|
|
|
1195
1296
|
} | {
|
|
1196
1297
|
type: "position_value_v1";
|
|
1197
1298
|
data: {
|
|
1198
|
-
priceSource: "
|
|
1299
|
+
priceSource: "mark" | "mid";
|
|
1199
1300
|
direction: "ABOVE" | "BELOW";
|
|
1200
1301
|
threshold: number;
|
|
1201
1302
|
};
|
|
1202
1303
|
} | {
|
|
1203
1304
|
type: "position_upnl_value_v1";
|
|
1204
1305
|
data: {
|
|
1205
|
-
priceSource: "
|
|
1306
|
+
priceSource: "mark" | "mid";
|
|
1206
1307
|
direction: "ABOVE" | "BELOW";
|
|
1207
1308
|
threshold: number;
|
|
1208
1309
|
};
|
|
1209
1310
|
} | {
|
|
1210
1311
|
type: "position_upnl_percentage_v1";
|
|
1211
1312
|
data: {
|
|
1212
|
-
priceSource: "
|
|
1313
|
+
priceSource: "mark" | "mid";
|
|
1213
1314
|
direction: "ABOVE" | "BELOW";
|
|
1214
1315
|
threshold_bps: number;
|
|
1215
1316
|
};
|
|
@@ -1218,28 +1319,39 @@ declare class Core {
|
|
|
1218
1319
|
type: "MARKET";
|
|
1219
1320
|
position: {
|
|
1220
1321
|
id: string;
|
|
1221
|
-
initialExposure: Record<string, string
|
|
1322
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1222
1323
|
};
|
|
1223
1324
|
};
|
|
1224
1325
|
triggeredAt?: string | undefined;
|
|
1225
1326
|
cancelledAt?: string | undefined;
|
|
1226
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1327
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1227
1328
|
fills?: {
|
|
1228
1329
|
id: string;
|
|
1330
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1229
1331
|
tradeAccountId: string;
|
|
1230
1332
|
symbol: string;
|
|
1231
1333
|
positionId: string;
|
|
1232
1334
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1233
1335
|
side: "BUY" | "SELL";
|
|
1234
1336
|
reduceOnly: boolean;
|
|
1337
|
+
isExternal: boolean;
|
|
1235
1338
|
quantity: string;
|
|
1236
1339
|
price: string;
|
|
1237
1340
|
usd: string;
|
|
1238
1341
|
timestamp: string;
|
|
1239
1342
|
cloid?: string | undefined;
|
|
1240
|
-
|
|
1343
|
+
exchangeFillId?: string | undefined;
|
|
1344
|
+
tradeFee?: string | undefined;
|
|
1345
|
+
pearFee?: string | undefined;
|
|
1346
|
+
original?: {
|
|
1347
|
+
exchangeFillId: string;
|
|
1348
|
+
quantity: string;
|
|
1349
|
+
} | undefined;
|
|
1241
1350
|
}[] | undefined;
|
|
1242
|
-
|
|
1351
|
+
trailing?: {
|
|
1352
|
+
deltaValue: number;
|
|
1353
|
+
activationValue: number;
|
|
1354
|
+
} | undefined;
|
|
1243
1355
|
})[];
|
|
1244
1356
|
}>;
|
|
1245
1357
|
open: (body: HttpTypes.CreateTriggerOpen, headers?: ClientHeaders) => Promise<{
|
|
@@ -1248,6 +1360,7 @@ declare class Core {
|
|
|
1248
1360
|
tradeAccountId: string;
|
|
1249
1361
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1250
1362
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1363
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1251
1364
|
createdAt: string;
|
|
1252
1365
|
updatedAt: string;
|
|
1253
1366
|
intent: "OPEN";
|
|
@@ -1255,7 +1368,7 @@ declare class Core {
|
|
|
1255
1368
|
condition: {
|
|
1256
1369
|
type: "ratio_v1";
|
|
1257
1370
|
data: {
|
|
1258
|
-
priceSource: "
|
|
1371
|
+
priceSource: "mark" | "mid";
|
|
1259
1372
|
symbol_a: string;
|
|
1260
1373
|
symbol_b: string;
|
|
1261
1374
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1264,7 +1377,7 @@ declare class Core {
|
|
|
1264
1377
|
} | {
|
|
1265
1378
|
type: "price_v1";
|
|
1266
1379
|
data: {
|
|
1267
|
-
priceSource: "
|
|
1380
|
+
priceSource: "mark" | "mid";
|
|
1268
1381
|
symbol: string;
|
|
1269
1382
|
direction: "ABOVE" | "BELOW";
|
|
1270
1383
|
threshold: number;
|
|
@@ -1272,7 +1385,7 @@ declare class Core {
|
|
|
1272
1385
|
} | {
|
|
1273
1386
|
type: "index_v1";
|
|
1274
1387
|
data: {
|
|
1275
|
-
priceSource: "
|
|
1388
|
+
priceSource: "mark" | "mid";
|
|
1276
1389
|
basket: {
|
|
1277
1390
|
symbol: string;
|
|
1278
1391
|
weight: number;
|
|
@@ -1283,7 +1396,7 @@ declare class Core {
|
|
|
1283
1396
|
} | {
|
|
1284
1397
|
type: "weighted_ratio_v1";
|
|
1285
1398
|
data: {
|
|
1286
|
-
priceSource: "
|
|
1399
|
+
priceSource: "mark" | "mid";
|
|
1287
1400
|
basket: {
|
|
1288
1401
|
symbol: string;
|
|
1289
1402
|
side: "BUY" | "SELL";
|
|
@@ -1309,28 +1422,36 @@ declare class Core {
|
|
|
1309
1422
|
};
|
|
1310
1423
|
triggeredAt?: string | undefined;
|
|
1311
1424
|
cancelledAt?: string | undefined;
|
|
1312
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1425
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1313
1426
|
fills?: {
|
|
1314
1427
|
id: string;
|
|
1428
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1315
1429
|
tradeAccountId: string;
|
|
1316
1430
|
symbol: string;
|
|
1317
1431
|
positionId: string;
|
|
1318
1432
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1319
1433
|
side: "BUY" | "SELL";
|
|
1320
1434
|
reduceOnly: boolean;
|
|
1435
|
+
isExternal: boolean;
|
|
1321
1436
|
quantity: string;
|
|
1322
1437
|
price: string;
|
|
1323
1438
|
usd: string;
|
|
1324
1439
|
timestamp: string;
|
|
1325
1440
|
cloid?: string | undefined;
|
|
1326
|
-
|
|
1441
|
+
exchangeFillId?: string | undefined;
|
|
1442
|
+
tradeFee?: string | undefined;
|
|
1443
|
+
pearFee?: string | undefined;
|
|
1444
|
+
original?: {
|
|
1445
|
+
exchangeFillId: string;
|
|
1446
|
+
quantity: string;
|
|
1447
|
+
} | undefined;
|
|
1327
1448
|
}[] | undefined;
|
|
1328
|
-
bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
|
|
1329
1449
|
} | {
|
|
1330
1450
|
id: string;
|
|
1331
1451
|
tradeAccountId: string;
|
|
1332
1452
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1333
1453
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1454
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1334
1455
|
createdAt: string;
|
|
1335
1456
|
updatedAt: string;
|
|
1336
1457
|
intent: "ADJUST";
|
|
@@ -1338,7 +1459,7 @@ declare class Core {
|
|
|
1338
1459
|
condition: {
|
|
1339
1460
|
type: "ratio_v1";
|
|
1340
1461
|
data: {
|
|
1341
|
-
priceSource: "
|
|
1462
|
+
priceSource: "mark" | "mid";
|
|
1342
1463
|
symbol_a: string;
|
|
1343
1464
|
symbol_b: string;
|
|
1344
1465
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1347,7 +1468,7 @@ declare class Core {
|
|
|
1347
1468
|
} | {
|
|
1348
1469
|
type: "price_v1";
|
|
1349
1470
|
data: {
|
|
1350
|
-
priceSource: "
|
|
1471
|
+
priceSource: "mark" | "mid";
|
|
1351
1472
|
symbol: string;
|
|
1352
1473
|
direction: "ABOVE" | "BELOW";
|
|
1353
1474
|
threshold: number;
|
|
@@ -1355,7 +1476,7 @@ declare class Core {
|
|
|
1355
1476
|
} | {
|
|
1356
1477
|
type: "index_v1";
|
|
1357
1478
|
data: {
|
|
1358
|
-
priceSource: "
|
|
1479
|
+
priceSource: "mark" | "mid";
|
|
1359
1480
|
basket: {
|
|
1360
1481
|
symbol: string;
|
|
1361
1482
|
weight: number;
|
|
@@ -1366,7 +1487,7 @@ declare class Core {
|
|
|
1366
1487
|
} | {
|
|
1367
1488
|
type: "weighted_ratio_v1";
|
|
1368
1489
|
data: {
|
|
1369
|
-
priceSource: "
|
|
1490
|
+
priceSource: "mark" | "mid";
|
|
1370
1491
|
basket: {
|
|
1371
1492
|
symbol: string;
|
|
1372
1493
|
side: "BUY" | "SELL";
|
|
@@ -1378,21 +1499,21 @@ declare class Core {
|
|
|
1378
1499
|
} | {
|
|
1379
1500
|
type: "position_value_v1";
|
|
1380
1501
|
data: {
|
|
1381
|
-
priceSource: "
|
|
1502
|
+
priceSource: "mark" | "mid";
|
|
1382
1503
|
direction: "ABOVE" | "BELOW";
|
|
1383
1504
|
threshold: number;
|
|
1384
1505
|
};
|
|
1385
1506
|
} | {
|
|
1386
1507
|
type: "position_upnl_value_v1";
|
|
1387
1508
|
data: {
|
|
1388
|
-
priceSource: "
|
|
1509
|
+
priceSource: "mark" | "mid";
|
|
1389
1510
|
direction: "ABOVE" | "BELOW";
|
|
1390
1511
|
threshold: number;
|
|
1391
1512
|
};
|
|
1392
1513
|
} | {
|
|
1393
1514
|
type: "position_upnl_percentage_v1";
|
|
1394
1515
|
data: {
|
|
1395
|
-
priceSource: "
|
|
1516
|
+
priceSource: "mark" | "mid";
|
|
1396
1517
|
direction: "ABOVE" | "BELOW";
|
|
1397
1518
|
threshold_bps: number;
|
|
1398
1519
|
};
|
|
@@ -1401,7 +1522,7 @@ declare class Core {
|
|
|
1401
1522
|
type: "MARKET";
|
|
1402
1523
|
position: {
|
|
1403
1524
|
id: string;
|
|
1404
|
-
initialExposure: Record<string, string
|
|
1525
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1405
1526
|
};
|
|
1406
1527
|
legs: [{
|
|
1407
1528
|
symbol: string;
|
|
@@ -1419,28 +1540,40 @@ declare class Core {
|
|
|
1419
1540
|
};
|
|
1420
1541
|
triggeredAt?: string | undefined;
|
|
1421
1542
|
cancelledAt?: string | undefined;
|
|
1422
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1543
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1423
1544
|
fills?: {
|
|
1424
1545
|
id: string;
|
|
1546
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1425
1547
|
tradeAccountId: string;
|
|
1426
1548
|
symbol: string;
|
|
1427
1549
|
positionId: string;
|
|
1428
1550
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1429
1551
|
side: "BUY" | "SELL";
|
|
1430
1552
|
reduceOnly: boolean;
|
|
1553
|
+
isExternal: boolean;
|
|
1431
1554
|
quantity: string;
|
|
1432
1555
|
price: string;
|
|
1433
1556
|
usd: string;
|
|
1434
1557
|
timestamp: string;
|
|
1435
1558
|
cloid?: string | undefined;
|
|
1436
|
-
|
|
1559
|
+
exchangeFillId?: string | undefined;
|
|
1560
|
+
tradeFee?: string | undefined;
|
|
1561
|
+
pearFee?: string | undefined;
|
|
1562
|
+
original?: {
|
|
1563
|
+
exchangeFillId: string;
|
|
1564
|
+
quantity: string;
|
|
1565
|
+
} | undefined;
|
|
1437
1566
|
}[] | undefined;
|
|
1438
|
-
|
|
1567
|
+
trailing?: {
|
|
1568
|
+
deltaValue: number;
|
|
1569
|
+
activationValue: number;
|
|
1570
|
+
} | undefined;
|
|
1439
1571
|
} | {
|
|
1440
1572
|
id: string;
|
|
1441
1573
|
tradeAccountId: string;
|
|
1442
1574
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1443
1575
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1576
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1444
1577
|
createdAt: string;
|
|
1445
1578
|
updatedAt: string;
|
|
1446
1579
|
intent: "CLOSE";
|
|
@@ -1448,7 +1581,7 @@ declare class Core {
|
|
|
1448
1581
|
condition: {
|
|
1449
1582
|
type: "ratio_v1";
|
|
1450
1583
|
data: {
|
|
1451
|
-
priceSource: "
|
|
1584
|
+
priceSource: "mark" | "mid";
|
|
1452
1585
|
symbol_a: string;
|
|
1453
1586
|
symbol_b: string;
|
|
1454
1587
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1457,7 +1590,7 @@ declare class Core {
|
|
|
1457
1590
|
} | {
|
|
1458
1591
|
type: "price_v1";
|
|
1459
1592
|
data: {
|
|
1460
|
-
priceSource: "
|
|
1593
|
+
priceSource: "mark" | "mid";
|
|
1461
1594
|
symbol: string;
|
|
1462
1595
|
direction: "ABOVE" | "BELOW";
|
|
1463
1596
|
threshold: number;
|
|
@@ -1465,7 +1598,7 @@ declare class Core {
|
|
|
1465
1598
|
} | {
|
|
1466
1599
|
type: "index_v1";
|
|
1467
1600
|
data: {
|
|
1468
|
-
priceSource: "
|
|
1601
|
+
priceSource: "mark" | "mid";
|
|
1469
1602
|
basket: {
|
|
1470
1603
|
symbol: string;
|
|
1471
1604
|
weight: number;
|
|
@@ -1476,7 +1609,7 @@ declare class Core {
|
|
|
1476
1609
|
} | {
|
|
1477
1610
|
type: "weighted_ratio_v1";
|
|
1478
1611
|
data: {
|
|
1479
|
-
priceSource: "
|
|
1612
|
+
priceSource: "mark" | "mid";
|
|
1480
1613
|
basket: {
|
|
1481
1614
|
symbol: string;
|
|
1482
1615
|
side: "BUY" | "SELL";
|
|
@@ -1488,21 +1621,21 @@ declare class Core {
|
|
|
1488
1621
|
} | {
|
|
1489
1622
|
type: "position_value_v1";
|
|
1490
1623
|
data: {
|
|
1491
|
-
priceSource: "
|
|
1624
|
+
priceSource: "mark" | "mid";
|
|
1492
1625
|
direction: "ABOVE" | "BELOW";
|
|
1493
1626
|
threshold: number;
|
|
1494
1627
|
};
|
|
1495
1628
|
} | {
|
|
1496
1629
|
type: "position_upnl_value_v1";
|
|
1497
1630
|
data: {
|
|
1498
|
-
priceSource: "
|
|
1631
|
+
priceSource: "mark" | "mid";
|
|
1499
1632
|
direction: "ABOVE" | "BELOW";
|
|
1500
1633
|
threshold: number;
|
|
1501
1634
|
};
|
|
1502
1635
|
} | {
|
|
1503
1636
|
type: "position_upnl_percentage_v1";
|
|
1504
1637
|
data: {
|
|
1505
|
-
priceSource: "
|
|
1638
|
+
priceSource: "mark" | "mid";
|
|
1506
1639
|
direction: "ABOVE" | "BELOW";
|
|
1507
1640
|
threshold_bps: number;
|
|
1508
1641
|
};
|
|
@@ -1511,28 +1644,39 @@ declare class Core {
|
|
|
1511
1644
|
type: "MARKET";
|
|
1512
1645
|
position: {
|
|
1513
1646
|
id: string;
|
|
1514
|
-
initialExposure: Record<string, string
|
|
1647
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1515
1648
|
};
|
|
1516
1649
|
};
|
|
1517
1650
|
triggeredAt?: string | undefined;
|
|
1518
1651
|
cancelledAt?: string | undefined;
|
|
1519
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1652
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1520
1653
|
fills?: {
|
|
1521
1654
|
id: string;
|
|
1655
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1522
1656
|
tradeAccountId: string;
|
|
1523
1657
|
symbol: string;
|
|
1524
1658
|
positionId: string;
|
|
1525
1659
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1526
1660
|
side: "BUY" | "SELL";
|
|
1527
1661
|
reduceOnly: boolean;
|
|
1662
|
+
isExternal: boolean;
|
|
1528
1663
|
quantity: string;
|
|
1529
1664
|
price: string;
|
|
1530
1665
|
usd: string;
|
|
1531
1666
|
timestamp: string;
|
|
1532
1667
|
cloid?: string | undefined;
|
|
1533
|
-
|
|
1668
|
+
exchangeFillId?: string | undefined;
|
|
1669
|
+
tradeFee?: string | undefined;
|
|
1670
|
+
pearFee?: string | undefined;
|
|
1671
|
+
original?: {
|
|
1672
|
+
exchangeFillId: string;
|
|
1673
|
+
quantity: string;
|
|
1674
|
+
} | undefined;
|
|
1534
1675
|
}[] | undefined;
|
|
1535
|
-
|
|
1676
|
+
trailing?: {
|
|
1677
|
+
deltaValue: number;
|
|
1678
|
+
activationValue: number;
|
|
1679
|
+
} | undefined;
|
|
1536
1680
|
};
|
|
1537
1681
|
}>;
|
|
1538
1682
|
close: (body: HttpTypes.CreateTriggerClose, headers?: ClientHeaders) => Promise<{
|
|
@@ -1541,6 +1685,7 @@ declare class Core {
|
|
|
1541
1685
|
tradeAccountId: string;
|
|
1542
1686
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1543
1687
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1688
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1544
1689
|
createdAt: string;
|
|
1545
1690
|
updatedAt: string;
|
|
1546
1691
|
intent: "OPEN";
|
|
@@ -1548,7 +1693,7 @@ declare class Core {
|
|
|
1548
1693
|
condition: {
|
|
1549
1694
|
type: "ratio_v1";
|
|
1550
1695
|
data: {
|
|
1551
|
-
priceSource: "
|
|
1696
|
+
priceSource: "mark" | "mid";
|
|
1552
1697
|
symbol_a: string;
|
|
1553
1698
|
symbol_b: string;
|
|
1554
1699
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1557,7 +1702,7 @@ declare class Core {
|
|
|
1557
1702
|
} | {
|
|
1558
1703
|
type: "price_v1";
|
|
1559
1704
|
data: {
|
|
1560
|
-
priceSource: "
|
|
1705
|
+
priceSource: "mark" | "mid";
|
|
1561
1706
|
symbol: string;
|
|
1562
1707
|
direction: "ABOVE" | "BELOW";
|
|
1563
1708
|
threshold: number;
|
|
@@ -1565,7 +1710,7 @@ declare class Core {
|
|
|
1565
1710
|
} | {
|
|
1566
1711
|
type: "index_v1";
|
|
1567
1712
|
data: {
|
|
1568
|
-
priceSource: "
|
|
1713
|
+
priceSource: "mark" | "mid";
|
|
1569
1714
|
basket: {
|
|
1570
1715
|
symbol: string;
|
|
1571
1716
|
weight: number;
|
|
@@ -1576,7 +1721,7 @@ declare class Core {
|
|
|
1576
1721
|
} | {
|
|
1577
1722
|
type: "weighted_ratio_v1";
|
|
1578
1723
|
data: {
|
|
1579
|
-
priceSource: "
|
|
1724
|
+
priceSource: "mark" | "mid";
|
|
1580
1725
|
basket: {
|
|
1581
1726
|
symbol: string;
|
|
1582
1727
|
side: "BUY" | "SELL";
|
|
@@ -1602,28 +1747,36 @@ declare class Core {
|
|
|
1602
1747
|
};
|
|
1603
1748
|
triggeredAt?: string | undefined;
|
|
1604
1749
|
cancelledAt?: string | undefined;
|
|
1605
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1750
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1606
1751
|
fills?: {
|
|
1607
1752
|
id: string;
|
|
1753
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1608
1754
|
tradeAccountId: string;
|
|
1609
1755
|
symbol: string;
|
|
1610
1756
|
positionId: string;
|
|
1611
1757
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1612
1758
|
side: "BUY" | "SELL";
|
|
1613
1759
|
reduceOnly: boolean;
|
|
1760
|
+
isExternal: boolean;
|
|
1614
1761
|
quantity: string;
|
|
1615
1762
|
price: string;
|
|
1616
1763
|
usd: string;
|
|
1617
1764
|
timestamp: string;
|
|
1618
1765
|
cloid?: string | undefined;
|
|
1619
|
-
|
|
1766
|
+
exchangeFillId?: string | undefined;
|
|
1767
|
+
tradeFee?: string | undefined;
|
|
1768
|
+
pearFee?: string | undefined;
|
|
1769
|
+
original?: {
|
|
1770
|
+
exchangeFillId: string;
|
|
1771
|
+
quantity: string;
|
|
1772
|
+
} | undefined;
|
|
1620
1773
|
}[] | undefined;
|
|
1621
|
-
bracketType?: "STOP_LOSS" | "TAKE_PROFIT" | undefined;
|
|
1622
1774
|
} | {
|
|
1623
1775
|
id: string;
|
|
1624
1776
|
tradeAccountId: string;
|
|
1625
1777
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1626
1778
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1779
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1627
1780
|
createdAt: string;
|
|
1628
1781
|
updatedAt: string;
|
|
1629
1782
|
intent: "ADJUST";
|
|
@@ -1631,7 +1784,7 @@ declare class Core {
|
|
|
1631
1784
|
condition: {
|
|
1632
1785
|
type: "ratio_v1";
|
|
1633
1786
|
data: {
|
|
1634
|
-
priceSource: "
|
|
1787
|
+
priceSource: "mark" | "mid";
|
|
1635
1788
|
symbol_a: string;
|
|
1636
1789
|
symbol_b: string;
|
|
1637
1790
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1640,7 +1793,7 @@ declare class Core {
|
|
|
1640
1793
|
} | {
|
|
1641
1794
|
type: "price_v1";
|
|
1642
1795
|
data: {
|
|
1643
|
-
priceSource: "
|
|
1796
|
+
priceSource: "mark" | "mid";
|
|
1644
1797
|
symbol: string;
|
|
1645
1798
|
direction: "ABOVE" | "BELOW";
|
|
1646
1799
|
threshold: number;
|
|
@@ -1648,7 +1801,7 @@ declare class Core {
|
|
|
1648
1801
|
} | {
|
|
1649
1802
|
type: "index_v1";
|
|
1650
1803
|
data: {
|
|
1651
|
-
priceSource: "
|
|
1804
|
+
priceSource: "mark" | "mid";
|
|
1652
1805
|
basket: {
|
|
1653
1806
|
symbol: string;
|
|
1654
1807
|
weight: number;
|
|
@@ -1659,7 +1812,7 @@ declare class Core {
|
|
|
1659
1812
|
} | {
|
|
1660
1813
|
type: "weighted_ratio_v1";
|
|
1661
1814
|
data: {
|
|
1662
|
-
priceSource: "
|
|
1815
|
+
priceSource: "mark" | "mid";
|
|
1663
1816
|
basket: {
|
|
1664
1817
|
symbol: string;
|
|
1665
1818
|
side: "BUY" | "SELL";
|
|
@@ -1671,21 +1824,21 @@ declare class Core {
|
|
|
1671
1824
|
} | {
|
|
1672
1825
|
type: "position_value_v1";
|
|
1673
1826
|
data: {
|
|
1674
|
-
priceSource: "
|
|
1827
|
+
priceSource: "mark" | "mid";
|
|
1675
1828
|
direction: "ABOVE" | "BELOW";
|
|
1676
1829
|
threshold: number;
|
|
1677
1830
|
};
|
|
1678
1831
|
} | {
|
|
1679
1832
|
type: "position_upnl_value_v1";
|
|
1680
1833
|
data: {
|
|
1681
|
-
priceSource: "
|
|
1834
|
+
priceSource: "mark" | "mid";
|
|
1682
1835
|
direction: "ABOVE" | "BELOW";
|
|
1683
1836
|
threshold: number;
|
|
1684
1837
|
};
|
|
1685
1838
|
} | {
|
|
1686
1839
|
type: "position_upnl_percentage_v1";
|
|
1687
1840
|
data: {
|
|
1688
|
-
priceSource: "
|
|
1841
|
+
priceSource: "mark" | "mid";
|
|
1689
1842
|
direction: "ABOVE" | "BELOW";
|
|
1690
1843
|
threshold_bps: number;
|
|
1691
1844
|
};
|
|
@@ -1694,7 +1847,7 @@ declare class Core {
|
|
|
1694
1847
|
type: "MARKET";
|
|
1695
1848
|
position: {
|
|
1696
1849
|
id: string;
|
|
1697
|
-
initialExposure: Record<string, string
|
|
1850
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1698
1851
|
};
|
|
1699
1852
|
legs: [{
|
|
1700
1853
|
symbol: string;
|
|
@@ -1712,28 +1865,40 @@ declare class Core {
|
|
|
1712
1865
|
};
|
|
1713
1866
|
triggeredAt?: string | undefined;
|
|
1714
1867
|
cancelledAt?: string | undefined;
|
|
1715
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1868
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1716
1869
|
fills?: {
|
|
1717
1870
|
id: string;
|
|
1871
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1718
1872
|
tradeAccountId: string;
|
|
1719
1873
|
symbol: string;
|
|
1720
1874
|
positionId: string;
|
|
1721
1875
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1722
1876
|
side: "BUY" | "SELL";
|
|
1723
1877
|
reduceOnly: boolean;
|
|
1878
|
+
isExternal: boolean;
|
|
1724
1879
|
quantity: string;
|
|
1725
1880
|
price: string;
|
|
1726
1881
|
usd: string;
|
|
1727
1882
|
timestamp: string;
|
|
1728
1883
|
cloid?: string | undefined;
|
|
1729
|
-
|
|
1884
|
+
exchangeFillId?: string | undefined;
|
|
1885
|
+
tradeFee?: string | undefined;
|
|
1886
|
+
pearFee?: string | undefined;
|
|
1887
|
+
original?: {
|
|
1888
|
+
exchangeFillId: string;
|
|
1889
|
+
quantity: string;
|
|
1890
|
+
} | undefined;
|
|
1730
1891
|
}[] | undefined;
|
|
1731
|
-
|
|
1892
|
+
trailing?: {
|
|
1893
|
+
deltaValue: number;
|
|
1894
|
+
activationValue: number;
|
|
1895
|
+
} | undefined;
|
|
1732
1896
|
} | {
|
|
1733
1897
|
id: string;
|
|
1734
1898
|
tradeAccountId: string;
|
|
1735
1899
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1736
1900
|
status: "CANCELLED" | "ACTIVE" | "TRIGGERED";
|
|
1901
|
+
bracketType: "STOP_LOSS" | "TAKE_PROFIT" | "NONE";
|
|
1737
1902
|
createdAt: string;
|
|
1738
1903
|
updatedAt: string;
|
|
1739
1904
|
intent: "CLOSE";
|
|
@@ -1741,7 +1906,7 @@ declare class Core {
|
|
|
1741
1906
|
condition: {
|
|
1742
1907
|
type: "ratio_v1";
|
|
1743
1908
|
data: {
|
|
1744
|
-
priceSource: "
|
|
1909
|
+
priceSource: "mark" | "mid";
|
|
1745
1910
|
symbol_a: string;
|
|
1746
1911
|
symbol_b: string;
|
|
1747
1912
|
direction: "ABOVE" | "BELOW";
|
|
@@ -1750,7 +1915,7 @@ declare class Core {
|
|
|
1750
1915
|
} | {
|
|
1751
1916
|
type: "price_v1";
|
|
1752
1917
|
data: {
|
|
1753
|
-
priceSource: "
|
|
1918
|
+
priceSource: "mark" | "mid";
|
|
1754
1919
|
symbol: string;
|
|
1755
1920
|
direction: "ABOVE" | "BELOW";
|
|
1756
1921
|
threshold: number;
|
|
@@ -1758,7 +1923,7 @@ declare class Core {
|
|
|
1758
1923
|
} | {
|
|
1759
1924
|
type: "index_v1";
|
|
1760
1925
|
data: {
|
|
1761
|
-
priceSource: "
|
|
1926
|
+
priceSource: "mark" | "mid";
|
|
1762
1927
|
basket: {
|
|
1763
1928
|
symbol: string;
|
|
1764
1929
|
weight: number;
|
|
@@ -1769,7 +1934,7 @@ declare class Core {
|
|
|
1769
1934
|
} | {
|
|
1770
1935
|
type: "weighted_ratio_v1";
|
|
1771
1936
|
data: {
|
|
1772
|
-
priceSource: "
|
|
1937
|
+
priceSource: "mark" | "mid";
|
|
1773
1938
|
basket: {
|
|
1774
1939
|
symbol: string;
|
|
1775
1940
|
side: "BUY" | "SELL";
|
|
@@ -1781,21 +1946,21 @@ declare class Core {
|
|
|
1781
1946
|
} | {
|
|
1782
1947
|
type: "position_value_v1";
|
|
1783
1948
|
data: {
|
|
1784
|
-
priceSource: "
|
|
1949
|
+
priceSource: "mark" | "mid";
|
|
1785
1950
|
direction: "ABOVE" | "BELOW";
|
|
1786
1951
|
threshold: number;
|
|
1787
1952
|
};
|
|
1788
1953
|
} | {
|
|
1789
1954
|
type: "position_upnl_value_v1";
|
|
1790
1955
|
data: {
|
|
1791
|
-
priceSource: "
|
|
1956
|
+
priceSource: "mark" | "mid";
|
|
1792
1957
|
direction: "ABOVE" | "BELOW";
|
|
1793
1958
|
threshold: number;
|
|
1794
1959
|
};
|
|
1795
1960
|
} | {
|
|
1796
1961
|
type: "position_upnl_percentage_v1";
|
|
1797
1962
|
data: {
|
|
1798
|
-
priceSource: "
|
|
1963
|
+
priceSource: "mark" | "mid";
|
|
1799
1964
|
direction: "ABOVE" | "BELOW";
|
|
1800
1965
|
threshold_bps: number;
|
|
1801
1966
|
};
|
|
@@ -1804,28 +1969,39 @@ declare class Core {
|
|
|
1804
1969
|
type: "MARKET";
|
|
1805
1970
|
position: {
|
|
1806
1971
|
id: string;
|
|
1807
|
-
initialExposure: Record<string, string
|
|
1972
|
+
initialExposure: Record<string, `-${string}` | `+${string}`>;
|
|
1808
1973
|
};
|
|
1809
1974
|
};
|
|
1810
1975
|
triggeredAt?: string | undefined;
|
|
1811
1976
|
cancelledAt?: string | undefined;
|
|
1812
|
-
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | undefined;
|
|
1977
|
+
cancelledReason?: "USER" | "POSITION_CLOSED" | "SYSTEM" | "POSITION_NETTED" | undefined;
|
|
1813
1978
|
fills?: {
|
|
1814
1979
|
id: string;
|
|
1980
|
+
status: "PROVISIONAL" | "CONFIRMED" | "RECONCILED";
|
|
1815
1981
|
tradeAccountId: string;
|
|
1816
1982
|
symbol: string;
|
|
1817
1983
|
positionId: string;
|
|
1818
1984
|
connector: "hyperliquid" | "binance" | "bybit" | "okx" | "lighter";
|
|
1819
1985
|
side: "BUY" | "SELL";
|
|
1820
1986
|
reduceOnly: boolean;
|
|
1987
|
+
isExternal: boolean;
|
|
1821
1988
|
quantity: string;
|
|
1822
1989
|
price: string;
|
|
1823
1990
|
usd: string;
|
|
1824
1991
|
timestamp: string;
|
|
1825
1992
|
cloid?: string | undefined;
|
|
1826
|
-
|
|
1993
|
+
exchangeFillId?: string | undefined;
|
|
1994
|
+
tradeFee?: string | undefined;
|
|
1995
|
+
pearFee?: string | undefined;
|
|
1996
|
+
original?: {
|
|
1997
|
+
exchangeFillId: string;
|
|
1998
|
+
quantity: string;
|
|
1999
|
+
} | undefined;
|
|
1827
2000
|
}[] | undefined;
|
|
1828
|
-
|
|
2001
|
+
trailing?: {
|
|
2002
|
+
deltaValue: number;
|
|
2003
|
+
activationValue: number;
|
|
2004
|
+
} | undefined;
|
|
1829
2005
|
};
|
|
1830
2006
|
}>;
|
|
1831
2007
|
cancel: (triggerId: string, headers?: ClientHeaders) => Promise<{
|
|
@@ -1883,15 +2059,23 @@ declare class Core {
|
|
|
1883
2059
|
};
|
|
1884
2060
|
};
|
|
1885
2061
|
statistics: {
|
|
1886
|
-
|
|
2062
|
+
volume: (query: HttpTypes.VolumeStatisticsQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
1887
2063
|
data: {
|
|
1888
|
-
|
|
2064
|
+
timestamp: number;
|
|
1889
2065
|
volume: number;
|
|
1890
2066
|
fees: number;
|
|
2067
|
+
trades: number;
|
|
1891
2068
|
users: number;
|
|
1892
2069
|
newUsers: number;
|
|
1893
2070
|
}[];
|
|
1894
2071
|
}>;
|
|
2072
|
+
oi: (query: HttpTypes.OiStatisticsQueryParamsInput, headers?: ClientHeaders) => Promise<{
|
|
2073
|
+
data: {
|
|
2074
|
+
timestamp: number;
|
|
2075
|
+
openInterest: number;
|
|
2076
|
+
openPositions: number;
|
|
2077
|
+
}[];
|
|
2078
|
+
}>;
|
|
1895
2079
|
};
|
|
1896
2080
|
}
|
|
1897
2081
|
|