@pear-protocol/types 1.1.0 → 1.3.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.
- package/dist/execution/entities.d.ts +175 -0
- package/dist/execution/entities.js +18 -3
- package/dist/execution/responses.d.ts +57 -0
- package/dist/schedule/entities.d.ts +6 -0
- package/dist/schedule/entities.js +7 -1
- package/dist/schedule/responses.d.ts +4 -0
- package/dist/tca/responses.d.ts +128 -0
- package/dist/tca/responses.js +19 -1
- package/dist/trade/payloads.d.ts +10 -2
- package/dist/trade/payloads.js +9 -1
- package/dist/trade/responses.d.ts +506 -0
- package/dist/trade/responses.js +2 -1
- package/dist/trigger/common/index.d.ts +1 -0
- package/dist/trigger/common/index.js +7 -1
- package/dist/trigger/entities/index.d.ts +51 -0
- package/dist/trigger/entities/index.js +11 -3
- package/dist/trigger/payloads/config.d.ts +1 -0
- package/dist/trigger/payloads/config.js +3 -0
- package/dist/trigger/payloads/index.d.ts +290 -147
- package/dist/trigger/payloads/index.js +29 -16
- package/dist/trigger/responses.d.ts +26 -0
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ export declare const ExecutionIntent: z.ZodEnum<{
|
|
|
3
3
|
OPEN: "OPEN";
|
|
4
4
|
CLOSE: "CLOSE";
|
|
5
5
|
ADJUST: "ADJUST";
|
|
6
|
+
REVERSE: "REVERSE";
|
|
6
7
|
}>;
|
|
7
8
|
export type ExecutionIntent = z.infer<typeof ExecutionIntent>;
|
|
8
9
|
export declare const ExecutionOrderType: z.ZodEnum<{
|
|
@@ -48,6 +49,7 @@ export declare const BaseExecution: z.ZodObject<{
|
|
|
48
49
|
OPEN: "OPEN";
|
|
49
50
|
CLOSE: "CLOSE";
|
|
50
51
|
ADJUST: "ADJUST";
|
|
52
|
+
REVERSE: "REVERSE";
|
|
51
53
|
}>;
|
|
52
54
|
orderType: z.ZodEnum<{
|
|
53
55
|
MARKET: "MARKET";
|
|
@@ -315,6 +317,64 @@ export declare const MarketCloseExecution: z.ZodObject<{
|
|
|
315
317
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
316
318
|
}, z.core.$strip>;
|
|
317
319
|
}, z.core.$strip>;
|
|
320
|
+
export declare const MarketReverseExecution: z.ZodObject<{
|
|
321
|
+
id: z.ZodUUID;
|
|
322
|
+
connector: z.ZodEnum<{
|
|
323
|
+
hyperliquid: "hyperliquid";
|
|
324
|
+
binance: "binance";
|
|
325
|
+
bybit: "bybit";
|
|
326
|
+
okx: "okx";
|
|
327
|
+
lighter: "lighter";
|
|
328
|
+
}>;
|
|
329
|
+
status: z.ZodEnum<{
|
|
330
|
+
CANCELLED: "CANCELLED";
|
|
331
|
+
IDLE: "IDLE";
|
|
332
|
+
ACTIVE: "ACTIVE";
|
|
333
|
+
COMPLETED: "COMPLETED";
|
|
334
|
+
FAILED: "FAILED";
|
|
335
|
+
}>;
|
|
336
|
+
error: z.ZodOptional<z.ZodString>;
|
|
337
|
+
createdAt: z.ZodString;
|
|
338
|
+
updatedAt: z.ZodString;
|
|
339
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
340
|
+
id: z.ZodUUID;
|
|
341
|
+
connector: z.ZodEnum<{
|
|
342
|
+
hyperliquid: "hyperliquid";
|
|
343
|
+
binance: "binance";
|
|
344
|
+
bybit: "bybit";
|
|
345
|
+
okx: "okx";
|
|
346
|
+
lighter: "lighter";
|
|
347
|
+
}>;
|
|
348
|
+
status: z.ZodEnum<{
|
|
349
|
+
PENDING: "PENDING";
|
|
350
|
+
PARTIAL: "PARTIAL";
|
|
351
|
+
FILLED: "FILLED";
|
|
352
|
+
CANCELLED: "CANCELLED";
|
|
353
|
+
REJECTED: "REJECTED";
|
|
354
|
+
}>;
|
|
355
|
+
error: z.ZodOptional<z.ZodString>;
|
|
356
|
+
createdAt: z.ZodString;
|
|
357
|
+
updatedAt: z.ZodString;
|
|
358
|
+
type: z.ZodLiteral<"MARKET">;
|
|
359
|
+
symbol: z.ZodString;
|
|
360
|
+
side: z.ZodEnum<{
|
|
361
|
+
BUY: "BUY";
|
|
362
|
+
SELL: "SELL";
|
|
363
|
+
}>;
|
|
364
|
+
reduceOnly: z.ZodBoolean;
|
|
365
|
+
leverage: z.ZodInt;
|
|
366
|
+
quantity: z.ZodString;
|
|
367
|
+
price: z.ZodString;
|
|
368
|
+
filledQuantity: z.ZodString;
|
|
369
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
370
|
+
}, z.core.$strip>], "type">>>;
|
|
371
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
372
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
373
|
+
position: z.ZodObject<{
|
|
374
|
+
id: z.ZodUUID;
|
|
375
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
376
|
+
}, z.core.$strip>;
|
|
377
|
+
}, z.core.$strip>;
|
|
318
378
|
export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
319
379
|
id: z.ZodUUID;
|
|
320
380
|
connector: z.ZodEnum<{
|
|
@@ -532,6 +592,63 @@ export declare const MarketExecution: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
532
592
|
id: z.ZodUUID;
|
|
533
593
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
534
594
|
}, z.core.$strip>;
|
|
595
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
+
id: z.ZodUUID;
|
|
597
|
+
connector: z.ZodEnum<{
|
|
598
|
+
hyperliquid: "hyperliquid";
|
|
599
|
+
binance: "binance";
|
|
600
|
+
bybit: "bybit";
|
|
601
|
+
okx: "okx";
|
|
602
|
+
lighter: "lighter";
|
|
603
|
+
}>;
|
|
604
|
+
status: z.ZodEnum<{
|
|
605
|
+
CANCELLED: "CANCELLED";
|
|
606
|
+
IDLE: "IDLE";
|
|
607
|
+
ACTIVE: "ACTIVE";
|
|
608
|
+
COMPLETED: "COMPLETED";
|
|
609
|
+
FAILED: "FAILED";
|
|
610
|
+
}>;
|
|
611
|
+
error: z.ZodOptional<z.ZodString>;
|
|
612
|
+
createdAt: z.ZodString;
|
|
613
|
+
updatedAt: z.ZodString;
|
|
614
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
615
|
+
id: z.ZodUUID;
|
|
616
|
+
connector: z.ZodEnum<{
|
|
617
|
+
hyperliquid: "hyperliquid";
|
|
618
|
+
binance: "binance";
|
|
619
|
+
bybit: "bybit";
|
|
620
|
+
okx: "okx";
|
|
621
|
+
lighter: "lighter";
|
|
622
|
+
}>;
|
|
623
|
+
status: z.ZodEnum<{
|
|
624
|
+
PENDING: "PENDING";
|
|
625
|
+
PARTIAL: "PARTIAL";
|
|
626
|
+
FILLED: "FILLED";
|
|
627
|
+
CANCELLED: "CANCELLED";
|
|
628
|
+
REJECTED: "REJECTED";
|
|
629
|
+
}>;
|
|
630
|
+
error: z.ZodOptional<z.ZodString>;
|
|
631
|
+
createdAt: z.ZodString;
|
|
632
|
+
updatedAt: z.ZodString;
|
|
633
|
+
type: z.ZodLiteral<"MARKET">;
|
|
634
|
+
symbol: z.ZodString;
|
|
635
|
+
side: z.ZodEnum<{
|
|
636
|
+
BUY: "BUY";
|
|
637
|
+
SELL: "SELL";
|
|
638
|
+
}>;
|
|
639
|
+
reduceOnly: z.ZodBoolean;
|
|
640
|
+
leverage: z.ZodInt;
|
|
641
|
+
quantity: z.ZodString;
|
|
642
|
+
price: z.ZodString;
|
|
643
|
+
filledQuantity: z.ZodString;
|
|
644
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
645
|
+
}, z.core.$strip>], "type">>>;
|
|
646
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
647
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
648
|
+
position: z.ZodObject<{
|
|
649
|
+
id: z.ZodUUID;
|
|
650
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
651
|
+
}, z.core.$strip>;
|
|
535
652
|
}, z.core.$strip>], "intent">;
|
|
536
653
|
export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
537
654
|
id: z.ZodUUID;
|
|
@@ -750,12 +867,70 @@ export declare const Execution: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion
|
|
|
750
867
|
id: z.ZodUUID;
|
|
751
868
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
752
869
|
}, z.core.$strip>;
|
|
870
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
871
|
+
id: z.ZodUUID;
|
|
872
|
+
connector: z.ZodEnum<{
|
|
873
|
+
hyperliquid: "hyperliquid";
|
|
874
|
+
binance: "binance";
|
|
875
|
+
bybit: "bybit";
|
|
876
|
+
okx: "okx";
|
|
877
|
+
lighter: "lighter";
|
|
878
|
+
}>;
|
|
879
|
+
status: z.ZodEnum<{
|
|
880
|
+
CANCELLED: "CANCELLED";
|
|
881
|
+
IDLE: "IDLE";
|
|
882
|
+
ACTIVE: "ACTIVE";
|
|
883
|
+
COMPLETED: "COMPLETED";
|
|
884
|
+
FAILED: "FAILED";
|
|
885
|
+
}>;
|
|
886
|
+
error: z.ZodOptional<z.ZodString>;
|
|
887
|
+
createdAt: z.ZodString;
|
|
888
|
+
updatedAt: z.ZodString;
|
|
889
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
890
|
+
id: z.ZodUUID;
|
|
891
|
+
connector: z.ZodEnum<{
|
|
892
|
+
hyperliquid: "hyperliquid";
|
|
893
|
+
binance: "binance";
|
|
894
|
+
bybit: "bybit";
|
|
895
|
+
okx: "okx";
|
|
896
|
+
lighter: "lighter";
|
|
897
|
+
}>;
|
|
898
|
+
status: z.ZodEnum<{
|
|
899
|
+
PENDING: "PENDING";
|
|
900
|
+
PARTIAL: "PARTIAL";
|
|
901
|
+
FILLED: "FILLED";
|
|
902
|
+
CANCELLED: "CANCELLED";
|
|
903
|
+
REJECTED: "REJECTED";
|
|
904
|
+
}>;
|
|
905
|
+
error: z.ZodOptional<z.ZodString>;
|
|
906
|
+
createdAt: z.ZodString;
|
|
907
|
+
updatedAt: z.ZodString;
|
|
908
|
+
type: z.ZodLiteral<"MARKET">;
|
|
909
|
+
symbol: z.ZodString;
|
|
910
|
+
side: z.ZodEnum<{
|
|
911
|
+
BUY: "BUY";
|
|
912
|
+
SELL: "SELL";
|
|
913
|
+
}>;
|
|
914
|
+
reduceOnly: z.ZodBoolean;
|
|
915
|
+
leverage: z.ZodInt;
|
|
916
|
+
quantity: z.ZodString;
|
|
917
|
+
price: z.ZodString;
|
|
918
|
+
filledQuantity: z.ZodString;
|
|
919
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
920
|
+
}, z.core.$strip>], "type">>>;
|
|
921
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
922
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
923
|
+
position: z.ZodObject<{
|
|
924
|
+
id: z.ZodUUID;
|
|
925
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
926
|
+
}, z.core.$strip>;
|
|
753
927
|
}, z.core.$strip>], "intent">], "orderType">;
|
|
754
928
|
export type ExecutionLeg = z.infer<typeof ExecutionLeg>;
|
|
755
929
|
export type BaseExecution = z.output<typeof BaseExecution>;
|
|
756
930
|
export type MarketOpenExecution = z.output<typeof MarketOpenExecution>;
|
|
757
931
|
export type MarketAdjustExecution = z.output<typeof MarketAdjustExecution>;
|
|
758
932
|
export type MarketCloseExecution = z.output<typeof MarketCloseExecution>;
|
|
933
|
+
export type MarketReverseExecution = z.output<typeof MarketReverseExecution>;
|
|
759
934
|
export type MarketExecution = z.output<typeof MarketExecution>;
|
|
760
935
|
export type Execution = z.output<typeof Execution>;
|
|
761
936
|
export {};
|
|
@@ -5,7 +5,7 @@ import { InstrumentId } from '../instrument';
|
|
|
5
5
|
import { Order } from '../order';
|
|
6
6
|
import { Position } from '../position';
|
|
7
7
|
|
|
8
|
-
const ExecutionIntent = z.enum(["OPEN", "CLOSE", "ADJUST"]);
|
|
8
|
+
const ExecutionIntent = z.enum(["OPEN", "CLOSE", "ADJUST", "REVERSE"]);
|
|
9
9
|
const ExecutionOrderType = z.enum(["MARKET"]);
|
|
10
10
|
const ExecutionStatus = z.enum(["IDLE", "ACTIVE", "COMPLETED", "FAILED", "CANCELLED"]);
|
|
11
11
|
const ExecutionLegMode = z.enum(["QUANTITY", "USD"]);
|
|
@@ -115,11 +115,26 @@ const MarketCloseExecution = BaseExecution.extend({
|
|
|
115
115
|
*/
|
|
116
116
|
position: Position.pick({ id: true, exposure: true })
|
|
117
117
|
});
|
|
118
|
+
const MarketReverseExecution = BaseExecution.extend({
|
|
119
|
+
/**
|
|
120
|
+
* Intent
|
|
121
|
+
*/
|
|
122
|
+
intent: z.literal("REVERSE"),
|
|
123
|
+
/**
|
|
124
|
+
* Order type
|
|
125
|
+
*/
|
|
126
|
+
orderType: z.literal("MARKET"),
|
|
127
|
+
/**
|
|
128
|
+
* Position
|
|
129
|
+
*/
|
|
130
|
+
position: Position.pick({ id: true, exposure: true })
|
|
131
|
+
});
|
|
118
132
|
const MarketExecution = z.discriminatedUnion("intent", [
|
|
119
133
|
MarketOpenExecution,
|
|
120
134
|
MarketAdjustExecution,
|
|
121
|
-
MarketCloseExecution
|
|
135
|
+
MarketCloseExecution,
|
|
136
|
+
MarketReverseExecution
|
|
122
137
|
]);
|
|
123
138
|
const Execution = z.discriminatedUnion("orderType", [MarketExecution]);
|
|
124
139
|
|
|
125
|
-
export { BaseExecution, Execution, ExecutionIntent, ExecutionLegMode, ExecutionOrderType, ExecutionStatus, MarketAdjustExecution, MarketCloseExecution, MarketExecution, MarketOpenExecution };
|
|
140
|
+
export { BaseExecution, Execution, ExecutionIntent, ExecutionLegMode, ExecutionOrderType, ExecutionStatus, MarketAdjustExecution, MarketCloseExecution, MarketExecution, MarketOpenExecution, MarketReverseExecution };
|
|
@@ -219,6 +219,63 @@ export declare const ExecutionListResponse: z.ZodObject<{
|
|
|
219
219
|
id: z.ZodUUID;
|
|
220
220
|
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
221
221
|
}, z.core.$strip>;
|
|
222
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
223
|
+
id: z.ZodUUID;
|
|
224
|
+
connector: z.ZodEnum<{
|
|
225
|
+
hyperliquid: "hyperliquid";
|
|
226
|
+
binance: "binance";
|
|
227
|
+
bybit: "bybit";
|
|
228
|
+
okx: "okx";
|
|
229
|
+
lighter: "lighter";
|
|
230
|
+
}>;
|
|
231
|
+
status: z.ZodEnum<{
|
|
232
|
+
CANCELLED: "CANCELLED";
|
|
233
|
+
IDLE: "IDLE";
|
|
234
|
+
ACTIVE: "ACTIVE";
|
|
235
|
+
COMPLETED: "COMPLETED";
|
|
236
|
+
FAILED: "FAILED";
|
|
237
|
+
}>;
|
|
238
|
+
error: z.ZodOptional<z.ZodString>;
|
|
239
|
+
createdAt: z.ZodString;
|
|
240
|
+
updatedAt: z.ZodString;
|
|
241
|
+
orders: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
242
|
+
id: z.ZodUUID;
|
|
243
|
+
connector: z.ZodEnum<{
|
|
244
|
+
hyperliquid: "hyperliquid";
|
|
245
|
+
binance: "binance";
|
|
246
|
+
bybit: "bybit";
|
|
247
|
+
okx: "okx";
|
|
248
|
+
lighter: "lighter";
|
|
249
|
+
}>;
|
|
250
|
+
status: z.ZodEnum<{
|
|
251
|
+
PENDING: "PENDING";
|
|
252
|
+
PARTIAL: "PARTIAL";
|
|
253
|
+
FILLED: "FILLED";
|
|
254
|
+
CANCELLED: "CANCELLED";
|
|
255
|
+
REJECTED: "REJECTED";
|
|
256
|
+
}>;
|
|
257
|
+
error: z.ZodOptional<z.ZodString>;
|
|
258
|
+
createdAt: z.ZodString;
|
|
259
|
+
updatedAt: z.ZodString;
|
|
260
|
+
type: z.ZodLiteral<"MARKET">;
|
|
261
|
+
symbol: z.ZodString;
|
|
262
|
+
side: z.ZodEnum<{
|
|
263
|
+
BUY: "BUY";
|
|
264
|
+
SELL: "SELL";
|
|
265
|
+
}>;
|
|
266
|
+
reduceOnly: z.ZodBoolean;
|
|
267
|
+
leverage: z.ZodInt;
|
|
268
|
+
quantity: z.ZodString;
|
|
269
|
+
price: z.ZodString;
|
|
270
|
+
filledQuantity: z.ZodString;
|
|
271
|
+
filledPrice: z.ZodOptional<z.ZodString>;
|
|
272
|
+
}, z.core.$strip>], "type">>>;
|
|
273
|
+
intent: z.ZodLiteral<"REVERSE">;
|
|
274
|
+
orderType: z.ZodLiteral<"MARKET">;
|
|
275
|
+
position: z.ZodObject<{
|
|
276
|
+
id: z.ZodUUID;
|
|
277
|
+
exposure: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodString, z.ZodTransform<`-${string}` | `+${string}`, string>>>;
|
|
278
|
+
}, z.core.$strip>;
|
|
222
279
|
}, z.core.$strip>], "intent">], "orderType">>;
|
|
223
280
|
}, z.core.$strip>;
|
|
224
281
|
export type ExecutionListResponse = z.output<typeof ExecutionListResponse>;
|
|
@@ -30,6 +30,7 @@ export declare const ScheduleCancelledReason: z.ZodEnum<{
|
|
|
30
30
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
31
31
|
SYSTEM: "SYSTEM";
|
|
32
32
|
POSITION_NETTED: "POSITION_NETTED";
|
|
33
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
33
34
|
}>;
|
|
34
35
|
export type ScheduleCancelledReason = z.infer<typeof ScheduleCancelledReason>;
|
|
35
36
|
declare const TWAPSliceOpenLeg: z.ZodObject<{
|
|
@@ -84,6 +85,7 @@ declare const BaseSchedule: z.ZodObject<{
|
|
|
84
85
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
85
86
|
SYSTEM: "SYSTEM";
|
|
86
87
|
POSITION_NETTED: "POSITION_NETTED";
|
|
88
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
87
89
|
}>>;
|
|
88
90
|
createdAt: z.ZodString;
|
|
89
91
|
updatedAt: z.ZodString;
|
|
@@ -152,6 +154,7 @@ export declare const TWAPOpen: z.ZodObject<{
|
|
|
152
154
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
153
155
|
SYSTEM: "SYSTEM";
|
|
154
156
|
POSITION_NETTED: "POSITION_NETTED";
|
|
157
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
155
158
|
}>>;
|
|
156
159
|
createdAt: z.ZodString;
|
|
157
160
|
updatedAt: z.ZodString;
|
|
@@ -237,6 +240,7 @@ export declare const TWAPClose: z.ZodObject<{
|
|
|
237
240
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
238
241
|
SYSTEM: "SYSTEM";
|
|
239
242
|
POSITION_NETTED: "POSITION_NETTED";
|
|
243
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
240
244
|
}>>;
|
|
241
245
|
createdAt: z.ZodString;
|
|
242
246
|
updatedAt: z.ZodString;
|
|
@@ -314,6 +318,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
314
318
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
315
319
|
SYSTEM: "SYSTEM";
|
|
316
320
|
POSITION_NETTED: "POSITION_NETTED";
|
|
321
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
317
322
|
}>>;
|
|
318
323
|
createdAt: z.ZodString;
|
|
319
324
|
updatedAt: z.ZodString;
|
|
@@ -398,6 +403,7 @@ export declare const Schedule: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
398
403
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
399
404
|
SYSTEM: "SYSTEM";
|
|
400
405
|
POSITION_NETTED: "POSITION_NETTED";
|
|
406
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
401
407
|
}>>;
|
|
402
408
|
createdAt: z.ZodString;
|
|
403
409
|
updatedAt: z.ZodString;
|
|
@@ -9,7 +9,13 @@ const ScheduleStatus = z.enum(["ACTIVE", "COMPLETED", "FAILED", "CANCELLED"]);
|
|
|
9
9
|
const ScheduleIntent = z.enum(["OPEN", "CLOSE"]);
|
|
10
10
|
const ScheduleExecutionType = z.enum(["MARKET"]);
|
|
11
11
|
const ScheduleSliceMode = z.enum(["QUANTITY", "USD"]);
|
|
12
|
-
const ScheduleCancelledReason = z.enum([
|
|
12
|
+
const ScheduleCancelledReason = z.enum([
|
|
13
|
+
"POSITION_CLOSED",
|
|
14
|
+
"USER",
|
|
15
|
+
"SYSTEM",
|
|
16
|
+
"POSITION_NETTED",
|
|
17
|
+
"POSITION_REVERSED"
|
|
18
|
+
]);
|
|
13
19
|
const TWAPSliceOpenLeg = z.object({
|
|
14
20
|
/**
|
|
15
21
|
* Instrument ID
|
|
@@ -30,6 +30,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
30
30
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
31
31
|
SYSTEM: "SYSTEM";
|
|
32
32
|
POSITION_NETTED: "POSITION_NETTED";
|
|
33
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
33
34
|
}>>;
|
|
34
35
|
createdAt: z.ZodString;
|
|
35
36
|
updatedAt: z.ZodString;
|
|
@@ -114,6 +115,7 @@ export declare const ScheduleListResponse: z.ZodObject<{
|
|
|
114
115
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
115
116
|
SYSTEM: "SYSTEM";
|
|
116
117
|
POSITION_NETTED: "POSITION_NETTED";
|
|
118
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
117
119
|
}>>;
|
|
118
120
|
createdAt: z.ZodString;
|
|
119
121
|
updatedAt: z.ZodString;
|
|
@@ -194,6 +196,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
194
196
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
195
197
|
SYSTEM: "SYSTEM";
|
|
196
198
|
POSITION_NETTED: "POSITION_NETTED";
|
|
199
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
197
200
|
}>>;
|
|
198
201
|
createdAt: z.ZodString;
|
|
199
202
|
updatedAt: z.ZodString;
|
|
@@ -278,6 +281,7 @@ export declare const CreateScheduleResponse: z.ZodObject<{
|
|
|
278
281
|
POSITION_CLOSED: "POSITION_CLOSED";
|
|
279
282
|
SYSTEM: "SYSTEM";
|
|
280
283
|
POSITION_NETTED: "POSITION_NETTED";
|
|
284
|
+
POSITION_REVERSED: "POSITION_REVERSED";
|
|
281
285
|
}>>;
|
|
282
286
|
createdAt: z.ZodString;
|
|
283
287
|
updatedAt: z.ZodString;
|
package/dist/tca/responses.d.ts
CHANGED
|
@@ -103,6 +103,45 @@ export declare const TcaFillMetricResponse: z.ZodObject<{
|
|
|
103
103
|
}, z.core.$strip>>;
|
|
104
104
|
}, z.core.$strip>;
|
|
105
105
|
export type TcaFillMetricResponse = z.output<typeof TcaFillMetricResponse>;
|
|
106
|
+
export declare const TcaExecutionSummaryLegResponse: z.ZodObject<{
|
|
107
|
+
symbol: z.ZodString;
|
|
108
|
+
side: z.ZodEnum<{
|
|
109
|
+
BUY: "BUY";
|
|
110
|
+
SELL: "SELL";
|
|
111
|
+
}>;
|
|
112
|
+
reduceOnly: z.ZodBoolean;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
export type TcaExecutionSummaryLegResponse = z.output<typeof TcaExecutionSummaryLegResponse>;
|
|
115
|
+
export declare const TcaExecutionSummaryContextResponse: z.ZodObject<{
|
|
116
|
+
intent: z.ZodEnum<{
|
|
117
|
+
OPEN: "OPEN";
|
|
118
|
+
CLOSE: "CLOSE";
|
|
119
|
+
ADJUST: "ADJUST";
|
|
120
|
+
REVERSE: "REVERSE";
|
|
121
|
+
}>;
|
|
122
|
+
orderType: z.ZodEnum<{
|
|
123
|
+
MARKET: "MARKET";
|
|
124
|
+
}>;
|
|
125
|
+
executionStatus: z.ZodEnum<{
|
|
126
|
+
CANCELLED: "CANCELLED";
|
|
127
|
+
IDLE: "IDLE";
|
|
128
|
+
ACTIVE: "ACTIVE";
|
|
129
|
+
COMPLETED: "COMPLETED";
|
|
130
|
+
FAILED: "FAILED";
|
|
131
|
+
}>;
|
|
132
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
133
|
+
scheduleId: z.ZodOptional<z.ZodUUID>;
|
|
134
|
+
triggerId: z.ZodOptional<z.ZodUUID>;
|
|
135
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
136
|
+
symbol: z.ZodString;
|
|
137
|
+
side: z.ZodEnum<{
|
|
138
|
+
BUY: "BUY";
|
|
139
|
+
SELL: "SELL";
|
|
140
|
+
}>;
|
|
141
|
+
reduceOnly: z.ZodBoolean;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
export type TcaExecutionSummaryContextResponse = z.output<typeof TcaExecutionSummaryContextResponse>;
|
|
106
145
|
export declare const TcaExecutionSummaryResponse: z.ZodObject<{
|
|
107
146
|
id: z.ZodUUID;
|
|
108
147
|
executionId: z.ZodUUID;
|
|
@@ -114,6 +153,35 @@ export declare const TcaExecutionSummaryResponse: z.ZodObject<{
|
|
|
114
153
|
okx: "okx";
|
|
115
154
|
lighter: "lighter";
|
|
116
155
|
}>;
|
|
156
|
+
executionContext: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
intent: z.ZodEnum<{
|
|
158
|
+
OPEN: "OPEN";
|
|
159
|
+
CLOSE: "CLOSE";
|
|
160
|
+
ADJUST: "ADJUST";
|
|
161
|
+
REVERSE: "REVERSE";
|
|
162
|
+
}>;
|
|
163
|
+
orderType: z.ZodEnum<{
|
|
164
|
+
MARKET: "MARKET";
|
|
165
|
+
}>;
|
|
166
|
+
executionStatus: z.ZodEnum<{
|
|
167
|
+
CANCELLED: "CANCELLED";
|
|
168
|
+
IDLE: "IDLE";
|
|
169
|
+
ACTIVE: "ACTIVE";
|
|
170
|
+
COMPLETED: "COMPLETED";
|
|
171
|
+
FAILED: "FAILED";
|
|
172
|
+
}>;
|
|
173
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
174
|
+
scheduleId: z.ZodOptional<z.ZodUUID>;
|
|
175
|
+
triggerId: z.ZodOptional<z.ZodUUID>;
|
|
176
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
177
|
+
symbol: z.ZodString;
|
|
178
|
+
side: z.ZodEnum<{
|
|
179
|
+
BUY: "BUY";
|
|
180
|
+
SELL: "SELL";
|
|
181
|
+
}>;
|
|
182
|
+
reduceOnly: z.ZodBoolean;
|
|
183
|
+
}, z.core.$strip>>;
|
|
184
|
+
}, z.core.$strip>>;
|
|
117
185
|
notionalQuote: z.ZodOptional<z.ZodString>;
|
|
118
186
|
notionalUsd: z.ZodOptional<z.ZodString>;
|
|
119
187
|
weightedSlippageBps: z.ZodOptional<z.ZodString>;
|
|
@@ -139,6 +207,35 @@ export declare const TcaExecutionResponse: z.ZodObject<{
|
|
|
139
207
|
okx: "okx";
|
|
140
208
|
lighter: "lighter";
|
|
141
209
|
}>;
|
|
210
|
+
executionContext: z.ZodOptional<z.ZodObject<{
|
|
211
|
+
intent: z.ZodEnum<{
|
|
212
|
+
OPEN: "OPEN";
|
|
213
|
+
CLOSE: "CLOSE";
|
|
214
|
+
ADJUST: "ADJUST";
|
|
215
|
+
REVERSE: "REVERSE";
|
|
216
|
+
}>;
|
|
217
|
+
orderType: z.ZodEnum<{
|
|
218
|
+
MARKET: "MARKET";
|
|
219
|
+
}>;
|
|
220
|
+
executionStatus: z.ZodEnum<{
|
|
221
|
+
CANCELLED: "CANCELLED";
|
|
222
|
+
IDLE: "IDLE";
|
|
223
|
+
ACTIVE: "ACTIVE";
|
|
224
|
+
COMPLETED: "COMPLETED";
|
|
225
|
+
FAILED: "FAILED";
|
|
226
|
+
}>;
|
|
227
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
228
|
+
scheduleId: z.ZodOptional<z.ZodUUID>;
|
|
229
|
+
triggerId: z.ZodOptional<z.ZodUUID>;
|
|
230
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
231
|
+
symbol: z.ZodString;
|
|
232
|
+
side: z.ZodEnum<{
|
|
233
|
+
BUY: "BUY";
|
|
234
|
+
SELL: "SELL";
|
|
235
|
+
}>;
|
|
236
|
+
reduceOnly: z.ZodBoolean;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
}, z.core.$strip>>;
|
|
142
239
|
notionalQuote: z.ZodOptional<z.ZodString>;
|
|
143
240
|
notionalUsd: z.ZodOptional<z.ZodString>;
|
|
144
241
|
weightedSlippageBps: z.ZodOptional<z.ZodString>;
|
|
@@ -307,6 +404,7 @@ export declare const TcaSummaryTotalsResponse: z.ZodObject<{
|
|
|
307
404
|
fillCount: z.ZodNumber;
|
|
308
405
|
notionalQuote: z.ZodOptional<z.ZodString>;
|
|
309
406
|
notionalUsd: z.ZodOptional<z.ZodString>;
|
|
407
|
+
weightedSlippageBps: z.ZodOptional<z.ZodString>;
|
|
310
408
|
totalSlippageUsd: z.ZodOptional<z.ZodString>;
|
|
311
409
|
totalTradeFee: z.ZodOptional<z.ZodString>;
|
|
312
410
|
totalPearFee: z.ZodOptional<z.ZodString>;
|
|
@@ -327,6 +425,35 @@ export declare const TcaSummaryResponse: z.ZodObject<{
|
|
|
327
425
|
okx: "okx";
|
|
328
426
|
lighter: "lighter";
|
|
329
427
|
}>;
|
|
428
|
+
executionContext: z.ZodOptional<z.ZodObject<{
|
|
429
|
+
intent: z.ZodEnum<{
|
|
430
|
+
OPEN: "OPEN";
|
|
431
|
+
CLOSE: "CLOSE";
|
|
432
|
+
ADJUST: "ADJUST";
|
|
433
|
+
REVERSE: "REVERSE";
|
|
434
|
+
}>;
|
|
435
|
+
orderType: z.ZodEnum<{
|
|
436
|
+
MARKET: "MARKET";
|
|
437
|
+
}>;
|
|
438
|
+
executionStatus: z.ZodEnum<{
|
|
439
|
+
CANCELLED: "CANCELLED";
|
|
440
|
+
IDLE: "IDLE";
|
|
441
|
+
ACTIVE: "ACTIVE";
|
|
442
|
+
COMPLETED: "COMPLETED";
|
|
443
|
+
FAILED: "FAILED";
|
|
444
|
+
}>;
|
|
445
|
+
positionId: z.ZodOptional<z.ZodUUID>;
|
|
446
|
+
scheduleId: z.ZodOptional<z.ZodUUID>;
|
|
447
|
+
triggerId: z.ZodOptional<z.ZodUUID>;
|
|
448
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
449
|
+
symbol: z.ZodString;
|
|
450
|
+
side: z.ZodEnum<{
|
|
451
|
+
BUY: "BUY";
|
|
452
|
+
SELL: "SELL";
|
|
453
|
+
}>;
|
|
454
|
+
reduceOnly: z.ZodBoolean;
|
|
455
|
+
}, z.core.$strip>>;
|
|
456
|
+
}, z.core.$strip>>;
|
|
330
457
|
notionalQuote: z.ZodOptional<z.ZodString>;
|
|
331
458
|
notionalUsd: z.ZodOptional<z.ZodString>;
|
|
332
459
|
weightedSlippageBps: z.ZodOptional<z.ZodString>;
|
|
@@ -344,6 +471,7 @@ export declare const TcaSummaryResponse: z.ZodObject<{
|
|
|
344
471
|
fillCount: z.ZodNumber;
|
|
345
472
|
notionalQuote: z.ZodOptional<z.ZodString>;
|
|
346
473
|
notionalUsd: z.ZodOptional<z.ZodString>;
|
|
474
|
+
weightedSlippageBps: z.ZodOptional<z.ZodString>;
|
|
347
475
|
totalSlippageUsd: z.ZodOptional<z.ZodString>;
|
|
348
476
|
totalTradeFee: z.ZodOptional<z.ZodString>;
|
|
349
477
|
totalPearFee: z.ZodOptional<z.ZodString>;
|
package/dist/tca/responses.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { Side } from '../common/schema';
|
|
2
3
|
import { Connector } from '../connector';
|
|
4
|
+
import { ExecutionStatus, ExecutionOrderType, ExecutionIntent } from '../execution/entities';
|
|
3
5
|
import { TcaMetricStatus, TcaTimingGranularity } from './entities';
|
|
4
6
|
|
|
5
7
|
const optionalNumeric = z.string().optional();
|
|
@@ -59,11 +61,26 @@ const TcaFillMetricResponse = z.object({
|
|
|
59
61
|
updatedAt: z.iso.datetime(),
|
|
60
62
|
benchmark: TcaBenchmarkResponse.optional()
|
|
61
63
|
});
|
|
64
|
+
const TcaExecutionSummaryLegResponse = z.object({
|
|
65
|
+
symbol: z.string(),
|
|
66
|
+
side: Side,
|
|
67
|
+
reduceOnly: z.boolean()
|
|
68
|
+
});
|
|
69
|
+
const TcaExecutionSummaryContextResponse = z.object({
|
|
70
|
+
intent: ExecutionIntent,
|
|
71
|
+
orderType: ExecutionOrderType,
|
|
72
|
+
executionStatus: ExecutionStatus,
|
|
73
|
+
positionId: z.uuid().optional(),
|
|
74
|
+
scheduleId: z.uuid().optional(),
|
|
75
|
+
triggerId: z.uuid().optional(),
|
|
76
|
+
legs: z.array(TcaExecutionSummaryLegResponse)
|
|
77
|
+
});
|
|
62
78
|
const TcaExecutionSummaryResponse = z.object({
|
|
63
79
|
id: z.uuid(),
|
|
64
80
|
executionId: z.uuid(),
|
|
65
81
|
tradeAccountId: z.uuid(),
|
|
66
82
|
connector: Connector,
|
|
83
|
+
executionContext: TcaExecutionSummaryContextResponse.optional(),
|
|
67
84
|
notionalQuote: optionalNumeric,
|
|
68
85
|
notionalUsd: optionalNumeric,
|
|
69
86
|
weightedSlippageBps: optionalNumeric,
|
|
@@ -90,6 +107,7 @@ const TcaSummaryTotalsResponse = z.object({
|
|
|
90
107
|
fillCount: z.number(),
|
|
91
108
|
notionalQuote: optionalNumeric,
|
|
92
109
|
notionalUsd: optionalNumeric,
|
|
110
|
+
weightedSlippageBps: optionalNumeric,
|
|
93
111
|
totalSlippageUsd: optionalNumeric,
|
|
94
112
|
totalTradeFee: optionalNumeric,
|
|
95
113
|
totalPearFee: optionalNumeric,
|
|
@@ -102,4 +120,4 @@ const TcaSummaryResponse = z.object({
|
|
|
102
120
|
totals: TcaSummaryTotalsResponse
|
|
103
121
|
});
|
|
104
122
|
|
|
105
|
-
export { TcaBenchmarkResponse, TcaExecutionResponse, TcaExecutionSummaryResponse, TcaFillMetricResponse, TcaPositionResponse, TcaSummaryResponse, TcaSummaryTotalsResponse };
|
|
123
|
+
export { TcaBenchmarkResponse, TcaExecutionResponse, TcaExecutionSummaryContextResponse, TcaExecutionSummaryLegResponse, TcaExecutionSummaryResponse, TcaFillMetricResponse, TcaPositionResponse, TcaSummaryResponse, TcaSummaryTotalsResponse };
|
package/dist/trade/payloads.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export declare const CreateMarketOpen: z.ZodObject<{
|
|
|
30
30
|
bracketType: z.ZodEnum<{
|
|
31
31
|
STOP_LOSS: "STOP_LOSS";
|
|
32
32
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
33
|
-
NONE: "NONE";
|
|
34
33
|
}>;
|
|
35
34
|
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
36
35
|
type: z.ZodLiteral<"notional">;
|
|
@@ -132,6 +131,10 @@ export declare const CreateMarketClose: z.ZodObject<{
|
|
|
132
131
|
type: z.ZodLiteral<"MARKET">;
|
|
133
132
|
clientId: z.ZodOptional<z.ZodString>;
|
|
134
133
|
}, z.core.$strip>;
|
|
134
|
+
export declare const CreateMarketReverse: z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"MARKET">;
|
|
136
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
135
138
|
export declare const CreateMarketCloseAll: z.ZodObject<{
|
|
136
139
|
type: z.ZodLiteral<"MARKET">;
|
|
137
140
|
clientId: z.ZodOptional<z.ZodString>;
|
|
@@ -167,7 +170,6 @@ export declare const CreateTradeOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
167
170
|
bracketType: z.ZodEnum<{
|
|
168
171
|
STOP_LOSS: "STOP_LOSS";
|
|
169
172
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
170
|
-
NONE: "NONE";
|
|
171
173
|
}>;
|
|
172
174
|
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
173
175
|
type: z.ZodLiteral<"notional">;
|
|
@@ -269,6 +271,10 @@ export declare const CreateTradeClose: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
269
271
|
type: z.ZodLiteral<"MARKET">;
|
|
270
272
|
clientId: z.ZodOptional<z.ZodString>;
|
|
271
273
|
}, z.core.$strip>], "type">;
|
|
274
|
+
export declare const CreateTradeReverse: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
275
|
+
type: z.ZodLiteral<"MARKET">;
|
|
276
|
+
clientId: z.ZodOptional<z.ZodString>;
|
|
277
|
+
}, z.core.$strip>], "type">;
|
|
272
278
|
export declare const CreateTradeCloseAll: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
273
279
|
type: z.ZodLiteral<"MARKET">;
|
|
274
280
|
clientId: z.ZodOptional<z.ZodString>;
|
|
@@ -276,8 +282,10 @@ export declare const CreateTradeCloseAll: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
276
282
|
export type CreateMarketOpen = z.output<typeof CreateMarketOpen>;
|
|
277
283
|
export type CreateMarketAdjust = z.output<typeof CreateMarketAdjust>;
|
|
278
284
|
export type CreateMarketClose = z.output<typeof CreateMarketClose>;
|
|
285
|
+
export type CreateMarketReverse = z.output<typeof CreateMarketReverse>;
|
|
279
286
|
export type CreateMarketCloseAll = z.output<typeof CreateMarketCloseAll>;
|
|
280
287
|
export type CreateTradeOpen = z.output<typeof CreateTradeOpen>;
|
|
281
288
|
export type CreateTradeAdjust = z.output<typeof CreateTradeAdjust>;
|
|
282
289
|
export type CreateTradeClose = z.output<typeof CreateTradeClose>;
|
|
290
|
+
export type CreateTradeReverse = z.output<typeof CreateTradeReverse>;
|
|
283
291
|
export type CreateTradeCloseAll = z.output<typeof CreateTradeCloseAll>;
|