@pear-protocol/types 1.19.0 → 1.21.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/auth/payloads.d.ts +3 -0
- package/dist/auth/payloads.js +4 -1
- package/dist/ladder/entities.d.ts +87 -0
- package/dist/ladder/entities.js +2 -0
- package/dist/ladder/payloads.d.ts +146 -2
- package/dist/ladder/payloads.js +14 -1
- package/dist/ladder/responses.d.ts +261 -0
- package/dist/notification/entities.d.ts +33 -2
- package/dist/notification/entities.js +18 -4
- package/dist/notification/responses.d.ts +15 -0
- package/dist/sync/payloads.d.ts +2 -0
- package/dist/sync/payloads.js +5 -1
- package/dist/trade/responses.d.ts +1 -273
- package/dist/trade/responses.js +1 -1
- package/dist/trigger/entities/index.d.ts +50 -0
- package/dist/trigger/entities/index.js +7 -0
- package/dist/trigger/payloads/index.d.ts +85 -0
- package/dist/trigger/payloads/index.js +14 -10
- package/dist/trigger/refinement/static.refinement.d.ts +11 -3
- package/dist/trigger/refinement/static.refinement.js +9 -2
- package/dist/trigger/responses.d.ts +30 -0
- package/package.json +1 -1
|
@@ -21,6 +21,78 @@ export declare const CreateLadderResponse: z.ZodObject<{
|
|
|
21
21
|
ACTIVE: "ACTIVE";
|
|
22
22
|
COMPLETED: "COMPLETED";
|
|
23
23
|
}>;
|
|
24
|
+
attachTriggers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
25
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
26
|
+
type: z.ZodLiteral<"MARKET">;
|
|
27
|
+
bracketType: z.ZodEnum<{
|
|
28
|
+
STOP_LOSS: "STOP_LOSS";
|
|
29
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
30
|
+
}>;
|
|
31
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"notional">;
|
|
33
|
+
data: z.ZodObject<{
|
|
34
|
+
priceSource: z.ZodEnum<{
|
|
35
|
+
mid: "mid";
|
|
36
|
+
mark: "mark";
|
|
37
|
+
}>;
|
|
38
|
+
threshold: z.ZodNumber;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
41
|
+
type: z.ZodLiteral<"upnl">;
|
|
42
|
+
data: z.ZodObject<{
|
|
43
|
+
priceSource: z.ZodEnum<{
|
|
44
|
+
mid: "mid";
|
|
45
|
+
mark: "mark";
|
|
46
|
+
}>;
|
|
47
|
+
threshold: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
50
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
51
|
+
data: z.ZodObject<{
|
|
52
|
+
priceSource: z.ZodEnum<{
|
|
53
|
+
mid: "mid";
|
|
54
|
+
mark: "mark";
|
|
55
|
+
}>;
|
|
56
|
+
threshold: z.ZodNumber;
|
|
57
|
+
}, z.core.$strip>;
|
|
58
|
+
}, z.core.$strip>], "type">;
|
|
59
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
60
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
61
|
+
type: z.ZodLiteral<"MARKET">;
|
|
62
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
64
|
+
data: z.ZodObject<{
|
|
65
|
+
priceSource: z.ZodEnum<{
|
|
66
|
+
mid: "mid";
|
|
67
|
+
mark: "mark";
|
|
68
|
+
}>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
72
|
+
data: z.ZodObject<{
|
|
73
|
+
priceSource: z.ZodEnum<{
|
|
74
|
+
mid: "mid";
|
|
75
|
+
mark: "mark";
|
|
76
|
+
}>;
|
|
77
|
+
}, z.core.$strip>;
|
|
78
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
79
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
80
|
+
data: z.ZodObject<{
|
|
81
|
+
priceSource: z.ZodEnum<{
|
|
82
|
+
mid: "mid";
|
|
83
|
+
mark: "mark";
|
|
84
|
+
}>;
|
|
85
|
+
}, z.core.$strip>;
|
|
86
|
+
}, z.core.$strip>], "type">;
|
|
87
|
+
trailing: z.ZodObject<{
|
|
88
|
+
mode: z.ZodEnum<{
|
|
89
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
90
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
91
|
+
}>;
|
|
92
|
+
deltaValue: z.ZodNumber;
|
|
93
|
+
activationValue: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
}, z.core.$strip>;
|
|
95
|
+
}, z.core.$strip>]>>>;
|
|
24
96
|
triggers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
25
97
|
id: z.ZodUUID;
|
|
26
98
|
tradeAccountId: z.ZodUUID;
|
|
@@ -90,6 +162,11 @@ export declare const CreateLadderResponse: z.ZodObject<{
|
|
|
90
162
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
91
163
|
NONE: "NONE";
|
|
92
164
|
}>;
|
|
165
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
166
|
+
STOP_LOSS: "STOP_LOSS";
|
|
167
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
168
|
+
NONE: "NONE";
|
|
169
|
+
}>>;
|
|
93
170
|
createdAt: z.ZodString;
|
|
94
171
|
updatedAt: z.ZodString;
|
|
95
172
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -291,6 +368,11 @@ export declare const CreateLadderResponse: z.ZodObject<{
|
|
|
291
368
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
292
369
|
NONE: "NONE";
|
|
293
370
|
}>;
|
|
371
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
372
|
+
STOP_LOSS: "STOP_LOSS";
|
|
373
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
374
|
+
NONE: "NONE";
|
|
375
|
+
}>>;
|
|
294
376
|
createdAt: z.ZodString;
|
|
295
377
|
updatedAt: z.ZodString;
|
|
296
378
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -538,6 +620,11 @@ export declare const CreateLadderResponse: z.ZodObject<{
|
|
|
538
620
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
539
621
|
NONE: "NONE";
|
|
540
622
|
}>;
|
|
623
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
624
|
+
STOP_LOSS: "STOP_LOSS";
|
|
625
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
626
|
+
NONE: "NONE";
|
|
627
|
+
}>>;
|
|
541
628
|
createdAt: z.ZodString;
|
|
542
629
|
updatedAt: z.ZodString;
|
|
543
630
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -778,6 +865,78 @@ export declare const LadderResponse: z.ZodObject<{
|
|
|
778
865
|
ACTIVE: "ACTIVE";
|
|
779
866
|
COMPLETED: "COMPLETED";
|
|
780
867
|
}>;
|
|
868
|
+
attachTriggers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
869
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
870
|
+
type: z.ZodLiteral<"MARKET">;
|
|
871
|
+
bracketType: z.ZodEnum<{
|
|
872
|
+
STOP_LOSS: "STOP_LOSS";
|
|
873
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
874
|
+
}>;
|
|
875
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
876
|
+
type: z.ZodLiteral<"notional">;
|
|
877
|
+
data: z.ZodObject<{
|
|
878
|
+
priceSource: z.ZodEnum<{
|
|
879
|
+
mid: "mid";
|
|
880
|
+
mark: "mark";
|
|
881
|
+
}>;
|
|
882
|
+
threshold: z.ZodNumber;
|
|
883
|
+
}, z.core.$strip>;
|
|
884
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
885
|
+
type: z.ZodLiteral<"upnl">;
|
|
886
|
+
data: z.ZodObject<{
|
|
887
|
+
priceSource: z.ZodEnum<{
|
|
888
|
+
mid: "mid";
|
|
889
|
+
mark: "mark";
|
|
890
|
+
}>;
|
|
891
|
+
threshold: z.ZodNumber;
|
|
892
|
+
}, z.core.$strip>;
|
|
893
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
894
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
895
|
+
data: z.ZodObject<{
|
|
896
|
+
priceSource: z.ZodEnum<{
|
|
897
|
+
mid: "mid";
|
|
898
|
+
mark: "mark";
|
|
899
|
+
}>;
|
|
900
|
+
threshold: z.ZodNumber;
|
|
901
|
+
}, z.core.$strip>;
|
|
902
|
+
}, z.core.$strip>], "type">;
|
|
903
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
904
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
905
|
+
type: z.ZodLiteral<"MARKET">;
|
|
906
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
907
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
908
|
+
data: z.ZodObject<{
|
|
909
|
+
priceSource: z.ZodEnum<{
|
|
910
|
+
mid: "mid";
|
|
911
|
+
mark: "mark";
|
|
912
|
+
}>;
|
|
913
|
+
}, z.core.$strip>;
|
|
914
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
915
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
916
|
+
data: z.ZodObject<{
|
|
917
|
+
priceSource: z.ZodEnum<{
|
|
918
|
+
mid: "mid";
|
|
919
|
+
mark: "mark";
|
|
920
|
+
}>;
|
|
921
|
+
}, z.core.$strip>;
|
|
922
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
923
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
924
|
+
data: z.ZodObject<{
|
|
925
|
+
priceSource: z.ZodEnum<{
|
|
926
|
+
mid: "mid";
|
|
927
|
+
mark: "mark";
|
|
928
|
+
}>;
|
|
929
|
+
}, z.core.$strip>;
|
|
930
|
+
}, z.core.$strip>], "type">;
|
|
931
|
+
trailing: z.ZodObject<{
|
|
932
|
+
mode: z.ZodEnum<{
|
|
933
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
934
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
935
|
+
}>;
|
|
936
|
+
deltaValue: z.ZodNumber;
|
|
937
|
+
activationValue: z.ZodOptional<z.ZodNumber>;
|
|
938
|
+
}, z.core.$strip>;
|
|
939
|
+
}, z.core.$strip>]>>>;
|
|
781
940
|
triggers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
782
941
|
id: z.ZodUUID;
|
|
783
942
|
tradeAccountId: z.ZodUUID;
|
|
@@ -847,6 +1006,11 @@ export declare const LadderResponse: z.ZodObject<{
|
|
|
847
1006
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
848
1007
|
NONE: "NONE";
|
|
849
1008
|
}>;
|
|
1009
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
1010
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1011
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1012
|
+
NONE: "NONE";
|
|
1013
|
+
}>>;
|
|
850
1014
|
createdAt: z.ZodString;
|
|
851
1015
|
updatedAt: z.ZodString;
|
|
852
1016
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -1048,6 +1212,11 @@ export declare const LadderResponse: z.ZodObject<{
|
|
|
1048
1212
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1049
1213
|
NONE: "NONE";
|
|
1050
1214
|
}>;
|
|
1215
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
1216
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1217
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1218
|
+
NONE: "NONE";
|
|
1219
|
+
}>>;
|
|
1051
1220
|
createdAt: z.ZodString;
|
|
1052
1221
|
updatedAt: z.ZodString;
|
|
1053
1222
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -1295,6 +1464,11 @@ export declare const LadderResponse: z.ZodObject<{
|
|
|
1295
1464
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1296
1465
|
NONE: "NONE";
|
|
1297
1466
|
}>;
|
|
1467
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
1468
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1469
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1470
|
+
NONE: "NONE";
|
|
1471
|
+
}>>;
|
|
1298
1472
|
createdAt: z.ZodString;
|
|
1299
1473
|
updatedAt: z.ZodString;
|
|
1300
1474
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -1537,6 +1711,78 @@ export declare const LadderListResponse: z.ZodObject<{
|
|
|
1537
1711
|
ACTIVE: "ACTIVE";
|
|
1538
1712
|
COMPLETED: "COMPLETED";
|
|
1539
1713
|
}>;
|
|
1714
|
+
attachTriggers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
1715
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
1716
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1717
|
+
bracketType: z.ZodEnum<{
|
|
1718
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1719
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1720
|
+
}>;
|
|
1721
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1722
|
+
type: z.ZodLiteral<"notional">;
|
|
1723
|
+
data: z.ZodObject<{
|
|
1724
|
+
priceSource: z.ZodEnum<{
|
|
1725
|
+
mid: "mid";
|
|
1726
|
+
mark: "mark";
|
|
1727
|
+
}>;
|
|
1728
|
+
threshold: z.ZodNumber;
|
|
1729
|
+
}, z.core.$strip>;
|
|
1730
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1731
|
+
type: z.ZodLiteral<"upnl">;
|
|
1732
|
+
data: z.ZodObject<{
|
|
1733
|
+
priceSource: z.ZodEnum<{
|
|
1734
|
+
mid: "mid";
|
|
1735
|
+
mark: "mark";
|
|
1736
|
+
}>;
|
|
1737
|
+
threshold: z.ZodNumber;
|
|
1738
|
+
}, z.core.$strip>;
|
|
1739
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1740
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
1741
|
+
data: z.ZodObject<{
|
|
1742
|
+
priceSource: z.ZodEnum<{
|
|
1743
|
+
mid: "mid";
|
|
1744
|
+
mark: "mark";
|
|
1745
|
+
}>;
|
|
1746
|
+
threshold: z.ZodNumber;
|
|
1747
|
+
}, z.core.$strip>;
|
|
1748
|
+
}, z.core.$strip>], "type">;
|
|
1749
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1750
|
+
intent: z.ZodLiteral<"CLOSE">;
|
|
1751
|
+
type: z.ZodLiteral<"MARKET">;
|
|
1752
|
+
condition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1753
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
1754
|
+
data: z.ZodObject<{
|
|
1755
|
+
priceSource: z.ZodEnum<{
|
|
1756
|
+
mid: "mid";
|
|
1757
|
+
mark: "mark";
|
|
1758
|
+
}>;
|
|
1759
|
+
}, z.core.$strip>;
|
|
1760
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1761
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
1762
|
+
data: z.ZodObject<{
|
|
1763
|
+
priceSource: z.ZodEnum<{
|
|
1764
|
+
mid: "mid";
|
|
1765
|
+
mark: "mark";
|
|
1766
|
+
}>;
|
|
1767
|
+
}, z.core.$strip>;
|
|
1768
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
1769
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
1770
|
+
data: z.ZodObject<{
|
|
1771
|
+
priceSource: z.ZodEnum<{
|
|
1772
|
+
mid: "mid";
|
|
1773
|
+
mark: "mark";
|
|
1774
|
+
}>;
|
|
1775
|
+
}, z.core.$strip>;
|
|
1776
|
+
}, z.core.$strip>], "type">;
|
|
1777
|
+
trailing: z.ZodObject<{
|
|
1778
|
+
mode: z.ZodEnum<{
|
|
1779
|
+
RELATIVE_BPS: "RELATIVE_BPS";
|
|
1780
|
+
ABSOLUTE_POINTS: "ABSOLUTE_POINTS";
|
|
1781
|
+
}>;
|
|
1782
|
+
deltaValue: z.ZodNumber;
|
|
1783
|
+
activationValue: z.ZodOptional<z.ZodNumber>;
|
|
1784
|
+
}, z.core.$strip>;
|
|
1785
|
+
}, z.core.$strip>]>>>;
|
|
1540
1786
|
triggers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1541
1787
|
id: z.ZodUUID;
|
|
1542
1788
|
tradeAccountId: z.ZodUUID;
|
|
@@ -1606,6 +1852,11 @@ export declare const LadderListResponse: z.ZodObject<{
|
|
|
1606
1852
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1607
1853
|
NONE: "NONE";
|
|
1608
1854
|
}>;
|
|
1855
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
1856
|
+
STOP_LOSS: "STOP_LOSS";
|
|
1857
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1858
|
+
NONE: "NONE";
|
|
1859
|
+
}>>;
|
|
1609
1860
|
createdAt: z.ZodString;
|
|
1610
1861
|
updatedAt: z.ZodString;
|
|
1611
1862
|
intent: z.ZodLiteral<"OPEN">;
|
|
@@ -1807,6 +2058,11 @@ export declare const LadderListResponse: z.ZodObject<{
|
|
|
1807
2058
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
1808
2059
|
NONE: "NONE";
|
|
1809
2060
|
}>;
|
|
2061
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
2062
|
+
STOP_LOSS: "STOP_LOSS";
|
|
2063
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
2064
|
+
NONE: "NONE";
|
|
2065
|
+
}>>;
|
|
1810
2066
|
createdAt: z.ZodString;
|
|
1811
2067
|
updatedAt: z.ZodString;
|
|
1812
2068
|
intent: z.ZodLiteral<"ADJUST">;
|
|
@@ -2054,6 +2310,11 @@ export declare const LadderListResponse: z.ZodObject<{
|
|
|
2054
2310
|
TAKE_PROFIT: "TAKE_PROFIT";
|
|
2055
2311
|
NONE: "NONE";
|
|
2056
2312
|
}>;
|
|
2313
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
2314
|
+
STOP_LOSS: "STOP_LOSS";
|
|
2315
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
2316
|
+
NONE: "NONE";
|
|
2317
|
+
}>>;
|
|
2057
2318
|
createdAt: z.ZodString;
|
|
2058
2319
|
updatedAt: z.ZodString;
|
|
2059
2320
|
intent: z.ZodLiteral<"CLOSE">;
|
|
@@ -5,8 +5,9 @@ import { z } from 'zod';
|
|
|
5
5
|
* execute; `ATTACHED_TRIGGER_DISCARDED` means requested close protection could
|
|
6
6
|
* not be placed after a position opened; the `AUTO_REBALANCE_*` categories cover
|
|
7
7
|
* an auto-rebalance config acting on, or stopping itself over, the position it
|
|
8
|
-
* watches
|
|
9
|
-
*
|
|
8
|
+
* watches; `TRIGGER_CANCELLED_MIS_SCALED` means the remediation sweep cancelled
|
|
9
|
+
* an unreachable stop loss. Outcome lives here in the category; display details
|
|
10
|
+
* live in the `parameters` payload below.
|
|
10
11
|
*/
|
|
11
12
|
export declare const NotificationCategory: z.ZodEnum<{
|
|
12
13
|
TAKE_PROFIT_HIT: "TAKE_PROFIT_HIT";
|
|
@@ -19,6 +20,7 @@ export declare const NotificationCategory: z.ZodEnum<{
|
|
|
19
20
|
AUTO_REBALANCE_EXECUTED: "AUTO_REBALANCE_EXECUTED";
|
|
20
21
|
AUTO_REBALANCE_FAILED: "AUTO_REBALANCE_FAILED";
|
|
21
22
|
AUTO_REBALANCE_PAUSED: "AUTO_REBALANCE_PAUSED";
|
|
23
|
+
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
22
24
|
}>;
|
|
23
25
|
export type NotificationCategory = z.infer<typeof NotificationCategory>;
|
|
24
26
|
export declare const NotificationMetric: z.ZodEnum<{
|
|
@@ -48,6 +50,10 @@ export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
48
50
|
SELL: "SELL";
|
|
49
51
|
}>;
|
|
50
52
|
}, z.core.$strip>>;
|
|
53
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
STOP_LOSS: "STOP_LOSS";
|
|
55
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
56
|
+
}>>;
|
|
51
57
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
52
58
|
price: "price";
|
|
53
59
|
notional: "notional";
|
|
@@ -86,6 +92,10 @@ export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
86
92
|
SELL: "SELL";
|
|
87
93
|
}>;
|
|
88
94
|
}, z.core.$strip>>;
|
|
95
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
96
|
+
STOP_LOSS: "STOP_LOSS";
|
|
97
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
98
|
+
}>>;
|
|
89
99
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
90
100
|
price: "price";
|
|
91
101
|
notional: "notional";
|
|
@@ -323,6 +333,12 @@ export declare const NotificationParameters: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
323
333
|
LIVE_BETA: "LIVE_BETA";
|
|
324
334
|
}>;
|
|
325
335
|
type: z.ZodLiteral<"auto_rebalance_paused">;
|
|
336
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
337
|
+
type: z.ZodLiteral<"trigger_cancelled_mis_scaled">;
|
|
338
|
+
triggerId: z.ZodUUID;
|
|
339
|
+
positionKey: z.ZodString;
|
|
340
|
+
storedBps: z.ZodNumber;
|
|
341
|
+
readingMarginPct: z.ZodNumber;
|
|
326
342
|
}, z.core.$strip>], "type">;
|
|
327
343
|
export type NotificationParameters = z.output<typeof NotificationParameters>;
|
|
328
344
|
export declare const Notification: z.ZodObject<{
|
|
@@ -338,6 +354,7 @@ export declare const Notification: z.ZodObject<{
|
|
|
338
354
|
AUTO_REBALANCE_EXECUTED: "AUTO_REBALANCE_EXECUTED";
|
|
339
355
|
AUTO_REBALANCE_FAILED: "AUTO_REBALANCE_FAILED";
|
|
340
356
|
AUTO_REBALANCE_PAUSED: "AUTO_REBALANCE_PAUSED";
|
|
357
|
+
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
341
358
|
}>;
|
|
342
359
|
parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
343
360
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -348,6 +365,10 @@ export declare const Notification: z.ZodObject<{
|
|
|
348
365
|
SELL: "SELL";
|
|
349
366
|
}>;
|
|
350
367
|
}, z.core.$strip>>;
|
|
368
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
369
|
+
STOP_LOSS: "STOP_LOSS";
|
|
370
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
371
|
+
}>>;
|
|
351
372
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
352
373
|
price: "price";
|
|
353
374
|
notional: "notional";
|
|
@@ -386,6 +407,10 @@ export declare const Notification: z.ZodObject<{
|
|
|
386
407
|
SELL: "SELL";
|
|
387
408
|
}>;
|
|
388
409
|
}, z.core.$strip>>;
|
|
410
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
411
|
+
STOP_LOSS: "STOP_LOSS";
|
|
412
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
413
|
+
}>>;
|
|
389
414
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
390
415
|
price: "price";
|
|
391
416
|
notional: "notional";
|
|
@@ -623,6 +648,12 @@ export declare const Notification: z.ZodObject<{
|
|
|
623
648
|
LIVE_BETA: "LIVE_BETA";
|
|
624
649
|
}>;
|
|
625
650
|
type: z.ZodLiteral<"auto_rebalance_paused">;
|
|
651
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
652
|
+
type: z.ZodLiteral<"trigger_cancelled_mis_scaled">;
|
|
653
|
+
triggerId: z.ZodUUID;
|
|
654
|
+
positionKey: z.ZodString;
|
|
655
|
+
storedBps: z.ZodNumber;
|
|
656
|
+
readingMarginPct: z.ZodNumber;
|
|
626
657
|
}, z.core.$strip>], "type">;
|
|
627
658
|
isRead: z.ZodBoolean;
|
|
628
659
|
createdAt: z.ZodString;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { Side } from '../common/schema';
|
|
3
3
|
import { Connector } from '../connector';
|
|
4
|
+
import { TpSlBracketType } from '../trigger/common';
|
|
4
5
|
|
|
5
6
|
const NotificationCategory = z.enum([
|
|
6
7
|
"TAKE_PROFIT_HIT",
|
|
@@ -12,7 +13,8 @@ const NotificationCategory = z.enum([
|
|
|
12
13
|
"ATTACHED_TRIGGER_DISCARDED",
|
|
13
14
|
"AUTO_REBALANCE_EXECUTED",
|
|
14
15
|
"AUTO_REBALANCE_FAILED",
|
|
15
|
-
"AUTO_REBALANCE_PAUSED"
|
|
16
|
+
"AUTO_REBALANCE_PAUSED",
|
|
17
|
+
"TRIGGER_CANCELLED_MIS_SCALED"
|
|
16
18
|
]);
|
|
17
19
|
const NotificationMetric = z.enum([
|
|
18
20
|
"ratio",
|
|
@@ -49,14 +51,18 @@ const TakeProfitNotificationParameters = PositionLegParameters.safeExtend({
|
|
|
49
51
|
triggerId: z.uuid(),
|
|
50
52
|
positionId: z.uuid(),
|
|
51
53
|
connector: Connector,
|
|
52
|
-
...TriggerNotificationEnrichment
|
|
54
|
+
...TriggerNotificationEnrichment,
|
|
55
|
+
// User-facing bracket semantics; absent when a legacy trigger's intent is unknown.
|
|
56
|
+
semanticBracketType: TpSlBracketType.optional()
|
|
53
57
|
});
|
|
54
58
|
const StopLossNotificationParameters = PositionLegParameters.safeExtend({
|
|
55
59
|
type: z.literal("stop_loss"),
|
|
56
60
|
triggerId: z.uuid(),
|
|
57
61
|
positionId: z.uuid(),
|
|
58
62
|
connector: Connector,
|
|
59
|
-
...TriggerNotificationEnrichment
|
|
63
|
+
...TriggerNotificationEnrichment,
|
|
64
|
+
// User-facing bracket semantics; absent when a legacy trigger's intent is unknown.
|
|
65
|
+
semanticBracketType: TpSlBracketType.optional()
|
|
60
66
|
});
|
|
61
67
|
const TriggerOrderNotificationParameters = PositionLegParameters.safeExtend({
|
|
62
68
|
type: z.literal("trigger_order"),
|
|
@@ -124,6 +130,13 @@ const AutoRebalancePausedNotificationParameters = z.object({
|
|
|
124
130
|
legs: z.array(AutoRebalanceLeg),
|
|
125
131
|
pausedReason: z.enum(["POSITION_CHANGED", "REPEATED_FAILURES", "INVALID_LIVE_BETA_EXPOSURE"])
|
|
126
132
|
});
|
|
133
|
+
const TriggerCancelledMisScaledNotificationParameters = z.object({
|
|
134
|
+
type: z.literal("trigger_cancelled_mis_scaled"),
|
|
135
|
+
triggerId: z.uuid(),
|
|
136
|
+
positionKey: z.string().min(1),
|
|
137
|
+
storedBps: z.number(),
|
|
138
|
+
readingMarginPct: z.number()
|
|
139
|
+
});
|
|
127
140
|
const NotificationParameters = z.discriminatedUnion("type", [
|
|
128
141
|
TakeProfitNotificationParameters,
|
|
129
142
|
StopLossNotificationParameters,
|
|
@@ -132,7 +145,8 @@ const NotificationParameters = z.discriminatedUnion("type", [
|
|
|
132
145
|
AttachedTriggerDiscardedNotificationParameters,
|
|
133
146
|
AutoRebalanceExecutedNotificationParameters,
|
|
134
147
|
AutoRebalanceFailedNotificationParameters,
|
|
135
|
-
AutoRebalancePausedNotificationParameters
|
|
148
|
+
AutoRebalancePausedNotificationParameters,
|
|
149
|
+
TriggerCancelledMisScaledNotificationParameters
|
|
136
150
|
]);
|
|
137
151
|
const Notification = z.object({
|
|
138
152
|
/**
|
|
@@ -13,6 +13,7 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
13
13
|
AUTO_REBALANCE_EXECUTED: "AUTO_REBALANCE_EXECUTED";
|
|
14
14
|
AUTO_REBALANCE_FAILED: "AUTO_REBALANCE_FAILED";
|
|
15
15
|
AUTO_REBALANCE_PAUSED: "AUTO_REBALANCE_PAUSED";
|
|
16
|
+
TRIGGER_CANCELLED_MIS_SCALED: "TRIGGER_CANCELLED_MIS_SCALED";
|
|
16
17
|
}>;
|
|
17
18
|
parameters: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
18
19
|
legs: z.ZodArray<z.ZodObject<{
|
|
@@ -23,6 +24,10 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
23
24
|
SELL: "SELL";
|
|
24
25
|
}>;
|
|
25
26
|
}, z.core.$strip>>;
|
|
27
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
STOP_LOSS: "STOP_LOSS";
|
|
29
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
30
|
+
}>>;
|
|
26
31
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
27
32
|
price: "price";
|
|
28
33
|
notional: "notional";
|
|
@@ -61,6 +66,10 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
61
66
|
SELL: "SELL";
|
|
62
67
|
}>;
|
|
63
68
|
}, z.core.$strip>>;
|
|
69
|
+
semanticBracketType: z.ZodOptional<z.ZodEnum<{
|
|
70
|
+
STOP_LOSS: "STOP_LOSS";
|
|
71
|
+
TAKE_PROFIT: "TAKE_PROFIT";
|
|
72
|
+
}>>;
|
|
64
73
|
metric: z.ZodOptional<z.ZodEnum<{
|
|
65
74
|
price: "price";
|
|
66
75
|
notional: "notional";
|
|
@@ -298,6 +307,12 @@ export declare const NotificationListResponse: z.ZodObject<{
|
|
|
298
307
|
LIVE_BETA: "LIVE_BETA";
|
|
299
308
|
}>;
|
|
300
309
|
type: z.ZodLiteral<"auto_rebalance_paused">;
|
|
310
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
311
|
+
type: z.ZodLiteral<"trigger_cancelled_mis_scaled">;
|
|
312
|
+
triggerId: z.ZodUUID;
|
|
313
|
+
positionKey: z.ZodString;
|
|
314
|
+
storedBps: z.ZodNumber;
|
|
315
|
+
readingMarginPct: z.ZodNumber;
|
|
301
316
|
}, z.core.$strip>], "type">;
|
|
302
317
|
isRead: z.ZodBoolean;
|
|
303
318
|
createdAt: z.ZodString;
|
package/dist/sync/payloads.d.ts
CHANGED
|
@@ -348,6 +348,7 @@ export type SyncMeta = z.output<typeof SyncMeta>;
|
|
|
348
348
|
export declare const CreateApplicablesMeta: z.ZodObject<{
|
|
349
349
|
externalMaxTs: z.ZodNullable<z.ZodNumber>;
|
|
350
350
|
firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
351
|
+
newestFillTs: z.ZodOptional<z.ZodNumber>;
|
|
351
352
|
}, z.core.$strip>;
|
|
352
353
|
export type CreateApplicablesMeta = z.output<typeof CreateApplicablesMeta>;
|
|
353
354
|
/**
|
|
@@ -429,6 +430,7 @@ export declare const CreateApplicablesRequest: z.ZodObject<{
|
|
|
429
430
|
meta: z.ZodObject<{
|
|
430
431
|
externalMaxTs: z.ZodNullable<z.ZodNumber>;
|
|
431
432
|
firstSyncStartedAt: z.ZodOptional<z.ZodNumber>;
|
|
433
|
+
newestFillTs: z.ZodOptional<z.ZodNumber>;
|
|
432
434
|
}, z.core.$strip>;
|
|
433
435
|
}, z.core.$strip>;
|
|
434
436
|
export type CreateApplicablesRequest = z.output<typeof CreateApplicablesRequest>;
|
package/dist/sync/payloads.js
CHANGED
|
@@ -111,7 +111,11 @@ const SyncMeta = z.object({
|
|
|
111
111
|
).nullable().describe("watermark advance source")
|
|
112
112
|
});
|
|
113
113
|
const CreateApplicablesMeta = SyncMeta.extend({
|
|
114
|
-
firstSyncStartedAt: z.number().int().nonnegative().optional().describe("backend-issued timestamp returned before the first fill-history fetch")
|
|
114
|
+
firstSyncStartedAt: z.number().int().nonnegative().optional().describe("backend-issued timestamp returned before the first fill-history fetch"),
|
|
115
|
+
newestFillTs: z.number().int().nonnegative().refine(
|
|
116
|
+
(timestamp) => timestamp <= Date.now() + WATERMARK_FUTURE_SKEW_MS,
|
|
117
|
+
"newestFillTs must not be ahead of server time"
|
|
118
|
+
).optional().describe("raw newest fetched fill \u2014 settle-gate source, never trim-advanced")
|
|
115
119
|
});
|
|
116
120
|
const CreateApplicablesRequest = z.object({
|
|
117
121
|
applicables: z.array(ApplicablePosition),
|