@pear-protocol/types 0.0.17 → 0.0.19
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/fill/responses.d.ts +2 -0
- package/dist/fill/responses.js +2 -0
- package/dist/trade/payloads.d.ts +88 -48
- package/dist/trigger/common/index.d.ts +40 -0
- package/dist/trigger/common/index.js +11 -0
- package/dist/trigger/entities/conditions.d.ts +215 -155
- package/dist/trigger/entities/conditions.js +81 -185
- package/dist/trigger/entities/index.d.ts +401 -352
- package/dist/trigger/entities/index.js +22 -8
- package/dist/trigger/index.d.ts +2 -0
- package/dist/trigger/index.js +2 -0
- package/dist/trigger/payloads/conditions.d.ts +117 -176
- package/dist/trigger/payloads/conditions.js +110 -57
- package/dist/trigger/payloads/index.d.ts +440 -164
- package/dist/trigger/payloads/index.js +32 -51
- package/dist/trigger/refinement/index.d.ts +2 -0
- package/dist/trigger/refinement/index.js +2 -0
- package/dist/trigger/refinement/static.refinement.d.ts +18 -0
- package/dist/trigger/refinement/static.refinement.js +40 -0
- package/dist/trigger/refinement/trailing.refinement.d.ts +27 -0
- package/dist/trigger/refinement/trailing.refinement.js +81 -0
- package/dist/trigger/responses.d.ts +262 -218
- package/package.json +4 -2
|
@@ -4,21 +4,35 @@ import { TradeLegPostOnly, TradeLeg } from '../../common/trade-legs';
|
|
|
4
4
|
import { Connector } from '../../connector';
|
|
5
5
|
import { Fill } from '../../fill';
|
|
6
6
|
import { InstrumentId } from '../../instrument';
|
|
7
|
+
import { TrailingMode, BracketType, TriggerStatus, TriggerCancelledReason } from '../common';
|
|
7
8
|
import { TriggerConditionOpen, TriggerConditionAdjust, TriggerConditionClose } from './conditions';
|
|
8
9
|
|
|
9
|
-
const TriggerIntent = z.enum(["OPEN", "CLOSE"]);
|
|
10
|
-
const TriggerStatus = z.enum(["ACTIVE", "TRIGGERED", "CANCELLED"]);
|
|
11
|
-
const TriggerCancelledReason = z.enum(["POSITION_CLOSED", "USER", "SYSTEM", "POSITION_NETTED"]);
|
|
12
|
-
const BracketType = z.enum(["STOP_LOSS", "TAKE_PROFIT", "NONE"]);
|
|
13
10
|
const Trailing = z.object({
|
|
14
11
|
/**
|
|
15
|
-
*
|
|
12
|
+
* Trailing mode to track the metric.
|
|
13
|
+
*/
|
|
14
|
+
mode: TrailingMode,
|
|
15
|
+
/**
|
|
16
|
+
* Delta value to track the metric in the given mode.
|
|
16
17
|
*/
|
|
17
18
|
deltaValue: z.number(),
|
|
18
19
|
/**
|
|
19
|
-
* Activation value
|
|
20
|
+
* Activation value to start tracking the metric.
|
|
21
|
+
* When omitted, trailing starts immediately from the current metric.
|
|
22
|
+
*/
|
|
23
|
+
activationValue: z.number().optional(),
|
|
24
|
+
/**
|
|
25
|
+
* Best metric seen
|
|
26
|
+
*/
|
|
27
|
+
bestMetricSeen: z.number().optional(),
|
|
28
|
+
/**
|
|
29
|
+
* Current stop value
|
|
30
|
+
*/
|
|
31
|
+
currentStopValue: z.number().optional(),
|
|
32
|
+
/**
|
|
33
|
+
* Timestamp (ms) when a stop/activation breach was detected.
|
|
20
34
|
*/
|
|
21
|
-
|
|
35
|
+
stopBreachedAt: z.number().optional()
|
|
22
36
|
});
|
|
23
37
|
const BaseTrigger = z.object({
|
|
24
38
|
/**
|
|
@@ -151,4 +165,4 @@ const TriggerMarket = z.discriminatedUnion("intent", [
|
|
|
151
165
|
]);
|
|
152
166
|
const Trigger = z.discriminatedUnion("type", [TriggerMarket]);
|
|
153
167
|
|
|
154
|
-
export {
|
|
168
|
+
export { Trailing, Trigger, TriggerMarket, TriggerMarketAdjust, TriggerMarketClose, TriggerMarketOpen };
|
package/dist/trigger/index.d.ts
CHANGED
package/dist/trigger/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
declare const
|
|
3
|
-
type: z.ZodLiteral<"
|
|
2
|
+
export declare const CreateTriggerConditionOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
type: z.ZodLiteral<"ratio">;
|
|
4
4
|
data: z.ZodObject<{
|
|
5
5
|
priceSource: z.ZodEnum<{
|
|
6
6
|
mid: "mid";
|
|
@@ -8,48 +8,28 @@ declare const CreateTriggerConditionRatioV1: z.ZodObject<{
|
|
|
8
8
|
}>;
|
|
9
9
|
symbol_a: z.ZodString;
|
|
10
10
|
symbol_b: z.ZodString;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
track: z.ZodEnum<{
|
|
12
|
+
PEAK: "PEAK";
|
|
13
|
+
TROUGH: "TROUGH";
|
|
14
14
|
}>;
|
|
15
15
|
threshold: z.ZodNumber;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
|
-
}, z.core.$strip
|
|
18
|
-
|
|
19
|
-
type: z.ZodLiteral<"price_v1">;
|
|
17
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"price">;
|
|
20
19
|
data: z.ZodObject<{
|
|
21
20
|
priceSource: z.ZodEnum<{
|
|
22
21
|
mid: "mid";
|
|
23
22
|
mark: "mark";
|
|
24
23
|
}>;
|
|
25
24
|
symbol: z.ZodString;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
track: z.ZodEnum<{
|
|
26
|
+
PEAK: "PEAK";
|
|
27
|
+
TROUGH: "TROUGH";
|
|
29
28
|
}>;
|
|
30
29
|
threshold: z.ZodNumber;
|
|
31
30
|
}, z.core.$strip>;
|
|
32
|
-
}, z.core.$strip
|
|
33
|
-
|
|
34
|
-
type: z.ZodLiteral<"index_v1">;
|
|
35
|
-
data: z.ZodObject<{
|
|
36
|
-
priceSource: z.ZodEnum<{
|
|
37
|
-
mid: "mid";
|
|
38
|
-
mark: "mark";
|
|
39
|
-
}>;
|
|
40
|
-
basket: z.ZodArray<z.ZodObject<{
|
|
41
|
-
symbol: z.ZodString;
|
|
42
|
-
weight: z.ZodNumber;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
direction: z.ZodEnum<{
|
|
45
|
-
ABOVE: "ABOVE";
|
|
46
|
-
BELOW: "BELOW";
|
|
47
|
-
}>;
|
|
48
|
-
threshold: z.ZodNumber;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
}, z.core.$strip>;
|
|
51
|
-
declare const CreateTriggerConditionWeightedRatioV1: z.ZodObject<{
|
|
52
|
-
type: z.ZodLiteral<"weighted_ratio_v1">;
|
|
31
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"weighted_ratio">;
|
|
53
33
|
data: z.ZodObject<{
|
|
54
34
|
priceSource: z.ZodEnum<{
|
|
55
35
|
mid: "mid";
|
|
@@ -63,125 +43,81 @@ declare const CreateTriggerConditionWeightedRatioV1: z.ZodObject<{
|
|
|
63
43
|
}>;
|
|
64
44
|
weight: z.ZodNumber;
|
|
65
45
|
}, z.core.$strip>>;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
track: z.ZodEnum<{
|
|
47
|
+
PEAK: "PEAK";
|
|
48
|
+
TROUGH: "TROUGH";
|
|
69
49
|
}>;
|
|
70
50
|
threshold: z.ZodNumber;
|
|
71
51
|
}, z.core.$strip>;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
declare const
|
|
74
|
-
type: z.ZodLiteral<"
|
|
52
|
+
}, z.core.$strip>], "type">;
|
|
53
|
+
export declare const CreateTriggerConditionCloseStatic: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
+
type: z.ZodLiteral<"ratio">;
|
|
75
55
|
data: z.ZodObject<{
|
|
76
56
|
priceSource: z.ZodEnum<{
|
|
77
57
|
mid: "mid";
|
|
78
58
|
mark: "mark";
|
|
79
59
|
}>;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
BELOW: "BELOW";
|
|
83
|
-
}>;
|
|
60
|
+
symbol_a: z.ZodString;
|
|
61
|
+
symbol_b: z.ZodString;
|
|
84
62
|
threshold: z.ZodNumber;
|
|
85
63
|
}, z.core.$strip>;
|
|
86
|
-
}, z.core.$strip
|
|
87
|
-
|
|
88
|
-
type: z.ZodLiteral<"position_upnl_value_v1">;
|
|
64
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
+
type: z.ZodLiteral<"price">;
|
|
89
66
|
data: z.ZodObject<{
|
|
90
67
|
priceSource: z.ZodEnum<{
|
|
91
68
|
mid: "mid";
|
|
92
69
|
mark: "mark";
|
|
93
70
|
}>;
|
|
94
|
-
|
|
95
|
-
ABOVE: "ABOVE";
|
|
96
|
-
BELOW: "BELOW";
|
|
97
|
-
}>;
|
|
71
|
+
symbol: z.ZodString;
|
|
98
72
|
threshold: z.ZodNumber;
|
|
99
73
|
}, z.core.$strip>;
|
|
100
|
-
}, z.core.$strip
|
|
101
|
-
|
|
102
|
-
type: z.ZodLiteral<"position_upnl_percentage_v1">;
|
|
103
|
-
data: z.ZodObject<{
|
|
104
|
-
priceSource: z.ZodEnum<{
|
|
105
|
-
mid: "mid";
|
|
106
|
-
mark: "mark";
|
|
107
|
-
}>;
|
|
108
|
-
direction: z.ZodEnum<{
|
|
109
|
-
ABOVE: "ABOVE";
|
|
110
|
-
BELOW: "BELOW";
|
|
111
|
-
}>;
|
|
112
|
-
threshold_bps: z.ZodNumber;
|
|
113
|
-
}, z.core.$strip>;
|
|
114
|
-
}, z.core.$strip>;
|
|
115
|
-
export declare const CreateTriggerConditionOpen: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
116
|
-
type: z.ZodLiteral<"ratio_v1">;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
type: z.ZodLiteral<"weighted_ratio">;
|
|
117
76
|
data: z.ZodObject<{
|
|
118
77
|
priceSource: z.ZodEnum<{
|
|
119
78
|
mid: "mid";
|
|
120
79
|
mark: "mark";
|
|
121
80
|
}>;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
81
|
+
basket: z.ZodArray<z.ZodObject<{
|
|
82
|
+
symbol: z.ZodString;
|
|
83
|
+
side: z.ZodEnum<{
|
|
84
|
+
BUY: "BUY";
|
|
85
|
+
SELL: "SELL";
|
|
86
|
+
}>;
|
|
87
|
+
weight: z.ZodNumber;
|
|
88
|
+
}, z.core.$strip>>;
|
|
128
89
|
threshold: z.ZodNumber;
|
|
129
90
|
}, z.core.$strip>;
|
|
130
91
|
}, z.core.$strip>, z.ZodObject<{
|
|
131
|
-
type: z.ZodLiteral<"
|
|
92
|
+
type: z.ZodLiteral<"notional">;
|
|
132
93
|
data: z.ZodObject<{
|
|
133
94
|
priceSource: z.ZodEnum<{
|
|
134
95
|
mid: "mid";
|
|
135
96
|
mark: "mark";
|
|
136
97
|
}>;
|
|
137
|
-
symbol: z.ZodString;
|
|
138
|
-
direction: z.ZodEnum<{
|
|
139
|
-
ABOVE: "ABOVE";
|
|
140
|
-
BELOW: "BELOW";
|
|
141
|
-
}>;
|
|
142
98
|
threshold: z.ZodNumber;
|
|
143
99
|
}, z.core.$strip>;
|
|
144
100
|
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
-
type: z.ZodLiteral<"
|
|
101
|
+
type: z.ZodLiteral<"upnl">;
|
|
146
102
|
data: z.ZodObject<{
|
|
147
103
|
priceSource: z.ZodEnum<{
|
|
148
104
|
mid: "mid";
|
|
149
105
|
mark: "mark";
|
|
150
106
|
}>;
|
|
151
|
-
basket: z.ZodArray<z.ZodObject<{
|
|
152
|
-
symbol: z.ZodString;
|
|
153
|
-
weight: z.ZodNumber;
|
|
154
|
-
}, z.core.$strip>>;
|
|
155
|
-
direction: z.ZodEnum<{
|
|
156
|
-
ABOVE: "ABOVE";
|
|
157
|
-
BELOW: "BELOW";
|
|
158
|
-
}>;
|
|
159
107
|
threshold: z.ZodNumber;
|
|
160
108
|
}, z.core.$strip>;
|
|
161
109
|
}, z.core.$strip>, z.ZodObject<{
|
|
162
|
-
type: z.ZodLiteral<"
|
|
110
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
163
111
|
data: z.ZodObject<{
|
|
164
112
|
priceSource: z.ZodEnum<{
|
|
165
113
|
mid: "mid";
|
|
166
114
|
mark: "mark";
|
|
167
115
|
}>;
|
|
168
|
-
basket: z.ZodArray<z.ZodObject<{
|
|
169
|
-
symbol: z.ZodString;
|
|
170
|
-
side: z.ZodEnum<{
|
|
171
|
-
BUY: "BUY";
|
|
172
|
-
SELL: "SELL";
|
|
173
|
-
}>;
|
|
174
|
-
weight: z.ZodNumber;
|
|
175
|
-
}, z.core.$strip>>;
|
|
176
|
-
direction: z.ZodEnum<{
|
|
177
|
-
ABOVE: "ABOVE";
|
|
178
|
-
BELOW: "BELOW";
|
|
179
|
-
}>;
|
|
180
116
|
threshold: z.ZodNumber;
|
|
181
117
|
}, z.core.$strip>;
|
|
182
118
|
}, z.core.$strip>], "type">;
|
|
183
|
-
export declare const
|
|
184
|
-
type: z.ZodLiteral<"
|
|
119
|
+
export declare const CreateTriggerConditionCloseTrailing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
120
|
+
type: z.ZodLiteral<"ratio_trailing">;
|
|
185
121
|
data: z.ZodObject<{
|
|
186
122
|
priceSource: z.ZodEnum<{
|
|
187
123
|
mid: "mid";
|
|
@@ -189,28 +125,18 @@ export declare const CreateTriggerConditionClose: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
189
125
|
}>;
|
|
190
126
|
symbol_a: z.ZodString;
|
|
191
127
|
symbol_b: z.ZodString;
|
|
192
|
-
direction: z.ZodEnum<{
|
|
193
|
-
ABOVE: "ABOVE";
|
|
194
|
-
BELOW: "BELOW";
|
|
195
|
-
}>;
|
|
196
|
-
threshold: z.ZodNumber;
|
|
197
128
|
}, z.core.$strip>;
|
|
198
129
|
}, z.core.$strip>, z.ZodObject<{
|
|
199
|
-
type: z.ZodLiteral<"
|
|
130
|
+
type: z.ZodLiteral<"price_trailing">;
|
|
200
131
|
data: z.ZodObject<{
|
|
201
132
|
priceSource: z.ZodEnum<{
|
|
202
133
|
mid: "mid";
|
|
203
134
|
mark: "mark";
|
|
204
135
|
}>;
|
|
205
136
|
symbol: z.ZodString;
|
|
206
|
-
direction: z.ZodEnum<{
|
|
207
|
-
ABOVE: "ABOVE";
|
|
208
|
-
BELOW: "BELOW";
|
|
209
|
-
}>;
|
|
210
|
-
threshold: z.ZodNumber;
|
|
211
137
|
}, z.core.$strip>;
|
|
212
138
|
}, z.core.$strip>, z.ZodObject<{
|
|
213
|
-
type: z.ZodLiteral<"
|
|
139
|
+
type: z.ZodLiteral<"weighted_ratio_trailing">;
|
|
214
140
|
data: z.ZodObject<{
|
|
215
141
|
priceSource: z.ZodEnum<{
|
|
216
142
|
mid: "mid";
|
|
@@ -218,123 +144,138 @@ export declare const CreateTriggerConditionClose: z.ZodDiscriminatedUnion<[z.Zod
|
|
|
218
144
|
}>;
|
|
219
145
|
basket: z.ZodArray<z.ZodObject<{
|
|
220
146
|
symbol: z.ZodString;
|
|
147
|
+
side: z.ZodEnum<{
|
|
148
|
+
BUY: "BUY";
|
|
149
|
+
SELL: "SELL";
|
|
150
|
+
}>;
|
|
221
151
|
weight: z.ZodNumber;
|
|
222
152
|
}, z.core.$strip>>;
|
|
223
|
-
direction: z.ZodEnum<{
|
|
224
|
-
ABOVE: "ABOVE";
|
|
225
|
-
BELOW: "BELOW";
|
|
226
|
-
}>;
|
|
227
|
-
threshold: z.ZodNumber;
|
|
228
153
|
}, z.core.$strip>;
|
|
229
154
|
}, z.core.$strip>, z.ZodObject<{
|
|
230
|
-
type: z.ZodLiteral<"
|
|
155
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
231
156
|
data: z.ZodObject<{
|
|
232
157
|
priceSource: z.ZodEnum<{
|
|
233
158
|
mid: "mid";
|
|
234
159
|
mark: "mark";
|
|
235
160
|
}>;
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
}, z.core.$strip>>;
|
|
244
|
-
direction: z.ZodEnum<{
|
|
245
|
-
ABOVE: "ABOVE";
|
|
246
|
-
BELOW: "BELOW";
|
|
161
|
+
}, z.core.$strip>;
|
|
162
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
163
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
164
|
+
data: z.ZodObject<{
|
|
165
|
+
priceSource: z.ZodEnum<{
|
|
166
|
+
mid: "mid";
|
|
167
|
+
mark: "mark";
|
|
247
168
|
}>;
|
|
248
|
-
threshold: z.ZodNumber;
|
|
249
169
|
}, z.core.$strip>;
|
|
250
170
|
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
-
type: z.ZodLiteral<"
|
|
171
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
252
172
|
data: z.ZodObject<{
|
|
253
173
|
priceSource: z.ZodEnum<{
|
|
254
174
|
mid: "mid";
|
|
255
175
|
mark: "mark";
|
|
256
176
|
}>;
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
}, z.core.$strip>], "type">;
|
|
179
|
+
export declare const CreateTriggerConditionAttachStatic: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"notional">;
|
|
181
|
+
data: z.ZodObject<{
|
|
182
|
+
priceSource: z.ZodEnum<{
|
|
183
|
+
mid: "mid";
|
|
184
|
+
mark: "mark";
|
|
260
185
|
}>;
|
|
261
186
|
threshold: z.ZodNumber;
|
|
262
187
|
}, z.core.$strip>;
|
|
263
188
|
}, z.core.$strip>, z.ZodObject<{
|
|
264
|
-
type: z.ZodLiteral<"
|
|
189
|
+
type: z.ZodLiteral<"upnl">;
|
|
265
190
|
data: z.ZodObject<{
|
|
266
191
|
priceSource: z.ZodEnum<{
|
|
267
192
|
mid: "mid";
|
|
268
193
|
mark: "mark";
|
|
269
194
|
}>;
|
|
270
|
-
direction: z.ZodEnum<{
|
|
271
|
-
ABOVE: "ABOVE";
|
|
272
|
-
BELOW: "BELOW";
|
|
273
|
-
}>;
|
|
274
195
|
threshold: z.ZodNumber;
|
|
275
196
|
}, z.core.$strip>;
|
|
276
197
|
}, z.core.$strip>, z.ZodObject<{
|
|
277
|
-
type: z.ZodLiteral<"
|
|
198
|
+
type: z.ZodLiteral<"upnl_bps">;
|
|
278
199
|
data: z.ZodObject<{
|
|
279
200
|
priceSource: z.ZodEnum<{
|
|
280
201
|
mid: "mid";
|
|
281
202
|
mark: "mark";
|
|
282
203
|
}>;
|
|
283
|
-
|
|
284
|
-
ABOVE: "ABOVE";
|
|
285
|
-
BELOW: "BELOW";
|
|
286
|
-
}>;
|
|
287
|
-
threshold_bps: z.ZodNumber;
|
|
204
|
+
threshold: z.ZodNumber;
|
|
288
205
|
}, z.core.$strip>;
|
|
289
206
|
}, z.core.$strip>], "type">;
|
|
290
|
-
export declare const
|
|
291
|
-
type: z.ZodLiteral<"
|
|
207
|
+
export declare const CreateTriggerConditionAttachTrailing: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
208
|
+
type: z.ZodLiteral<"notional_trailing">;
|
|
292
209
|
data: z.ZodObject<{
|
|
293
210
|
priceSource: z.ZodEnum<{
|
|
294
211
|
mid: "mid";
|
|
295
212
|
mark: "mark";
|
|
296
213
|
}>;
|
|
297
|
-
direction: z.ZodEnum<{
|
|
298
|
-
ABOVE: "ABOVE";
|
|
299
|
-
BELOW: "BELOW";
|
|
300
|
-
}>;
|
|
301
|
-
threshold: z.ZodNumber;
|
|
302
214
|
}, z.core.$strip>;
|
|
303
215
|
}, z.core.$strip>, z.ZodObject<{
|
|
304
|
-
type: z.ZodLiteral<"
|
|
216
|
+
type: z.ZodLiteral<"upnl_trailing">;
|
|
305
217
|
data: z.ZodObject<{
|
|
306
218
|
priceSource: z.ZodEnum<{
|
|
307
219
|
mid: "mid";
|
|
308
220
|
mark: "mark";
|
|
309
221
|
}>;
|
|
310
|
-
direction: z.ZodEnum<{
|
|
311
|
-
ABOVE: "ABOVE";
|
|
312
|
-
BELOW: "BELOW";
|
|
313
|
-
}>;
|
|
314
|
-
threshold: z.ZodNumber;
|
|
315
222
|
}, z.core.$strip>;
|
|
316
223
|
}, z.core.$strip>, z.ZodObject<{
|
|
317
|
-
type: z.ZodLiteral<"
|
|
224
|
+
type: z.ZodLiteral<"upnl_bps_trailing">;
|
|
318
225
|
data: z.ZodObject<{
|
|
319
226
|
priceSource: z.ZodEnum<{
|
|
320
227
|
mid: "mid";
|
|
321
228
|
mark: "mark";
|
|
322
229
|
}>;
|
|
323
|
-
direction: z.ZodEnum<{
|
|
324
|
-
ABOVE: "ABOVE";
|
|
325
|
-
BELOW: "BELOW";
|
|
326
|
-
}>;
|
|
327
|
-
threshold_bps: z.ZodNumber;
|
|
328
230
|
}, z.core.$strip>;
|
|
329
231
|
}, z.core.$strip>], "type">;
|
|
330
|
-
export type CreateTriggerConditionRatioV1 = z.output<typeof CreateTriggerConditionRatioV1>;
|
|
331
|
-
export type CreateTriggerConditionPriceV1 = z.output<typeof CreateTriggerConditionPriceV1>;
|
|
332
|
-
export type CreateTriggerConditionIndexV1 = z.output<typeof CreateTriggerConditionIndexV1>;
|
|
333
|
-
export type CreateTriggerConditionWeightedRatioV1 = z.output<typeof CreateTriggerConditionWeightedRatioV1>;
|
|
334
|
-
export type CreateTriggerConditionPositionValueV1 = z.output<typeof CreateTriggerConditionPositionValueV1>;
|
|
335
|
-
export type CreateTriggerConditionPositionUPnLValueV1 = z.output<typeof CreateTriggerConditionPositionUPnLValueV1>;
|
|
336
|
-
export type CreateTriggerConditionPositionUPnLPercentageV1 = z.output<typeof CreateTriggerConditionPositionUPnLPercentageV1>;
|
|
337
232
|
export type CreateTriggerConditionOpen = z.output<typeof CreateTriggerConditionOpen>;
|
|
338
|
-
export type
|
|
339
|
-
|
|
340
|
-
|
|
233
|
+
export type CreateTriggerConditionRatioOpen = Extract<CreateTriggerConditionOpen, {
|
|
234
|
+
type: 'ratio';
|
|
235
|
+
}>;
|
|
236
|
+
export type CreateTriggerConditionPriceOpen = Extract<CreateTriggerConditionOpen, {
|
|
237
|
+
type: 'price';
|
|
238
|
+
}>;
|
|
239
|
+
export type CreateTriggerConditionWeightedRatioOpen = Extract<CreateTriggerConditionOpen, {
|
|
240
|
+
type: 'weighted_ratio';
|
|
241
|
+
}>;
|
|
242
|
+
export type CreateTriggerConditionCloseStatic = z.output<typeof CreateTriggerConditionCloseStatic>;
|
|
243
|
+
export type CreateTriggerConditionRatioCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
244
|
+
type: 'ratio';
|
|
245
|
+
}>;
|
|
246
|
+
export type CreateTriggerConditionPriceCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
247
|
+
type: 'price';
|
|
248
|
+
}>;
|
|
249
|
+
export type CreateTriggerConditionWeightedRatioCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
250
|
+
type: 'weighted_ratio';
|
|
251
|
+
}>;
|
|
252
|
+
export type CreateTriggerConditionNotionalCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
253
|
+
type: 'notional';
|
|
254
|
+
}>;
|
|
255
|
+
export type CreateTriggerConditionUpnlCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
256
|
+
type: 'upnl';
|
|
257
|
+
}>;
|
|
258
|
+
export type CreateTriggerConditionUpnlBpsCloseStatic = Extract<CreateTriggerConditionCloseStatic, {
|
|
259
|
+
type: 'upnl_bps';
|
|
260
|
+
}>;
|
|
261
|
+
export type CreateTriggerConditionCloseTrailing = z.output<typeof CreateTriggerConditionCloseTrailing>;
|
|
262
|
+
export type CreateTriggerConditionRatioCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
263
|
+
type: 'ratio_trailing';
|
|
264
|
+
}>;
|
|
265
|
+
export type CreateTriggerConditionPriceCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
266
|
+
type: 'price_trailing';
|
|
267
|
+
}>;
|
|
268
|
+
export type CreateTriggerConditionWeightedRatioCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
269
|
+
type: 'weighted_ratio_trailing';
|
|
270
|
+
}>;
|
|
271
|
+
export type CreateTriggerConditionNotionalCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
272
|
+
type: 'notional_trailing';
|
|
273
|
+
}>;
|
|
274
|
+
export type CreateTriggerConditionUpnlCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
275
|
+
type: 'upnl_trailing';
|
|
276
|
+
}>;
|
|
277
|
+
export type CreateTriggerConditionUpnlBpsCloseTrailing = Extract<CreateTriggerConditionCloseTrailing, {
|
|
278
|
+
type: 'upnl_bps_trailing';
|
|
279
|
+
}>;
|
|
280
|
+
export type CreateTriggerConditionAttachStatic = z.output<typeof CreateTriggerConditionAttachStatic>;
|
|
281
|
+
export type CreateTriggerConditionAttachTrailing = z.output<typeof CreateTriggerConditionAttachTrailing>;
|