architect-py 5.1.4b1__py3-none-any.whl → 5.1.4rc1__py3-none-any.whl

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.
@@ -0,0 +1,30 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Auth/AuthInfoResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import Optional
7
+
8
+ from msgspec import Struct
9
+
10
+ from .. import definitions
11
+
12
+
13
+ class AuthInfoResponse(Struct, omit_defaults=True):
14
+ original_user_id: Optional[definitions.UserId] = None
15
+ user_id: Optional[definitions.UserId] = None
16
+
17
+ # Constructor that takes all field titles as arguments for convenience
18
+ @classmethod
19
+ def new(
20
+ cls,
21
+ original_user_id: Optional[definitions.UserId] = None,
22
+ user_id: Optional[definitions.UserId] = None,
23
+ ):
24
+ return cls(
25
+ original_user_id,
26
+ user_id,
27
+ )
28
+
29
+ def __str__(self) -> str:
30
+ return f"AuthInfoResponse(original_user_id={self.original_user_id},user_id={self.user_id})"
@@ -4,10 +4,10 @@
4
4
  from __future__ import annotations
5
5
  from architect_py.grpc.models.Folio.AccountHistoryResponse import AccountHistoryResponse
6
6
 
7
- from datetime import datetime
8
- from typing import Optional
7
+ from datetime import datetime, time
8
+ from typing import Annotated, Optional
9
9
 
10
- from msgspec import Struct
10
+ from msgspec import Meta, Struct
11
11
 
12
12
  from .. import definitions
13
13
 
@@ -15,6 +15,31 @@ from .. import definitions
15
15
  class AccountHistoryRequest(Struct, omit_defaults=True):
16
16
  account: definitions.AccountIdOrName
17
17
  from_inclusive: Optional[datetime] = None
18
+ granularity: Optional[definitions.AccountHistoryGranularity] = None
19
+ limit: Optional[
20
+ Annotated[
21
+ Optional[int],
22
+ Meta(
23
+ description="Default maximum of 100 data points. If the number of data points between from_inclusive and to_exclusive exceeds the limit, the response will be truncated. Data is always returned in descending timestamp order."
24
+ ),
25
+ ]
26
+ ] = None
27
+ """
28
+ Default maximum of 100 data points. If the number of data points between from_inclusive and to_exclusive exceeds the limit, the response will be truncated. Data is always returned in descending timestamp order.
29
+ """
30
+ time_of_day: Optional[
31
+ Annotated[
32
+ Optional[time],
33
+ Meta(
34
+ description="For daily granularity, the UTC time of day to use for each day.\n\nCurrently the seconds and subseconds parts are ignored."
35
+ ),
36
+ ]
37
+ ] = None
38
+ """
39
+ For daily granularity, the UTC time of day to use for each day.
40
+
41
+ Currently the seconds and subseconds parts are ignored.
42
+ """
18
43
  to_exclusive: Optional[datetime] = None
19
44
 
20
45
  # Constructor that takes all field titles as arguments for convenience
@@ -23,16 +48,22 @@ class AccountHistoryRequest(Struct, omit_defaults=True):
23
48
  cls,
24
49
  account: definitions.AccountIdOrName,
25
50
  from_inclusive: Optional[datetime] = None,
51
+ granularity: Optional[definitions.AccountHistoryGranularity] = None,
52
+ limit: Optional[int] = None,
53
+ time_of_day: Optional[time] = None,
26
54
  to_exclusive: Optional[datetime] = None,
27
55
  ):
28
56
  return cls(
29
57
  account,
30
58
  from_inclusive,
59
+ granularity,
60
+ limit,
61
+ time_of_day,
31
62
  to_exclusive,
32
63
  )
33
64
 
34
65
  def __str__(self) -> str:
35
- return f"AccountHistoryRequest(account={self.account},from_inclusive={self.from_inclusive},to_exclusive={self.to_exclusive})"
66
+ return f"AccountHistoryRequest(account={self.account},from_inclusive={self.from_inclusive},granularity={self.granularity},limit={self.limit},time_of_day={self.time_of_day},to_exclusive={self.to_exclusive})"
36
67
 
37
68
  @staticmethod
38
69
  def get_response_type():
@@ -13,7 +13,15 @@ from msgspec import Meta, Struct
13
13
  class L1BookSnapshot(Struct, omit_defaults=True):
14
14
  s: Annotated[str, Meta(title="symbol")]
15
15
  tn: Annotated[int, Meta(ge=0, title="timestamp_ns")]
16
- ts: Annotated[int, Meta(title="timestamp")]
16
+ ts: Annotated[
17
+ int,
18
+ Meta(
19
+ description="Time that the exchange stamped the message", title="timestamp"
20
+ ),
21
+ ]
22
+ """
23
+ Time that the exchange stamped the message
24
+ """
17
25
  a: Optional[
18
26
  Annotated[
19
27
  List[Decimal], Meta(description="(price, quantity)", title="best_ask")
@@ -34,13 +42,13 @@ class L1BookSnapshot(Struct, omit_defaults=True):
34
42
  Annotated[
35
43
  Optional[int],
36
44
  Meta(
37
- description="Time that Architect feed received the message; only set if streaming from direct L1 feeds",
45
+ description="Time that Architect feed received the message that updated the BBO",
38
46
  title="recv_time",
39
47
  ),
40
48
  ]
41
49
  ] = None
42
50
  """
43
- Time that Architect feed received the message; only set if streaming from direct L1 feeds
51
+ Time that Architect feed received the message that updated the BBO
44
52
  """
45
53
  rtn: Optional[Annotated[Optional[int], Meta(title="recv_time_ns")]] = None
46
54
 
@@ -51,6 +51,10 @@ class Order(Struct, omit_defaults=True):
51
51
  p: Optional[Annotated[Decimal, Meta(title="limit_price")]] = None
52
52
  po: Optional[Annotated[bool, Meta(title="post_only")]] = None
53
53
  tp: Optional[Annotated[Decimal, Meta(title="trigger_price")]] = None
54
+ sl: Optional[
55
+ Annotated[Optional[definitions.TriggerLimitOrderType], Meta(title="stop_loss")]
56
+ ] = None
57
+ tpp: Optional[Annotated[Optional[Decimal], Meta(title="take_profit_price")]] = None
54
58
 
55
59
  # Constructor that takes all field titles as arguments for convenience
56
60
  @classmethod
@@ -79,6 +83,8 @@ class Order(Struct, omit_defaults=True):
79
83
  limit_price: Optional[Decimal] = None,
80
84
  post_only: Optional[bool] = None,
81
85
  trigger_price: Optional[Decimal] = None,
86
+ stop_loss: Optional[definitions.TriggerLimitOrderType] = None,
87
+ take_profit_price: Optional[Decimal] = None,
82
88
  ):
83
89
  return cls(
84
90
  account,
@@ -104,10 +110,12 @@ class Order(Struct, omit_defaults=True):
104
110
  limit_price,
105
111
  post_only,
106
112
  trigger_price,
113
+ stop_loss,
114
+ take_profit_price,
107
115
  )
108
116
 
109
117
  def __str__(self) -> str:
110
- return f"Order(account={self.a},dir={self.d},id={self.id},status={self.o},quantity={self.q},symbol={self.s},source={self.src},time_in_force={self.tif},recv_time_ns={self.tn},recv_time={self.ts},trader={self.u},execution_venue={self.ve},filled_quantity={self.xq},order_type={self.k},exchange_order_id={self.eid},parent_id={self.pid},reject_reason={self.r},reject_message={self.rm},is_short_sale={self.ss},average_fill_price={self.xp},limit_price={self.p},post_only={self.po},trigger_price={self.tp})"
118
+ return f"Order(account={self.a},dir={self.d},id={self.id},status={self.o},quantity={self.q},symbol={self.s},source={self.src},time_in_force={self.tif},recv_time_ns={self.tn},recv_time={self.ts},trader={self.u},execution_venue={self.ve},filled_quantity={self.xq},order_type={self.k},exchange_order_id={self.eid},parent_id={self.pid},reject_reason={self.r},reject_message={self.rm},is_short_sale={self.ss},average_fill_price={self.xp},limit_price={self.p},post_only={self.po},trigger_price={self.tp},stop_loss={self.sl},take_profit_price={self.tpp})"
111
119
 
112
120
  @property
113
121
  def account(self) -> str:
@@ -285,20 +293,27 @@ class Order(Struct, omit_defaults=True):
285
293
  def trigger_price(self, value: Optional[Decimal]) -> None:
286
294
  self.tp = value
287
295
 
296
+ @property
297
+ def stop_loss(self) -> Optional[definitions.TriggerLimitOrderType]:
298
+ return self.sl
299
+
300
+ @stop_loss.setter
301
+ def stop_loss(self, value: Optional[definitions.TriggerLimitOrderType]) -> None:
302
+ self.sl = value
303
+
304
+ @property
305
+ def take_profit_price(self) -> Optional[Decimal]:
306
+ return self.tpp
307
+
308
+ @take_profit_price.setter
309
+ def take_profit_price(self, value: Optional[Decimal]) -> None:
310
+ self.tpp = value
311
+
288
312
  def __post_init__(self):
289
- if self.k == "MARKET":
290
- if not all(getattr(self, key) is not None for key in []):
291
- raise ValueError(
292
- f"When field k (order_type) is of value MARKET, class Order requires fields []"
293
- )
294
- elif any(getattr(self, key) is not None for key in ["p", "po", "tp"]):
295
- raise ValueError(
296
- f"When field k (order_type) is of value MARKET, class Order should not have fields ['p', 'po', 'tp']"
297
- )
298
- elif self.k == "LIMIT":
313
+ if self.k == "LIMIT":
299
314
  if not all(getattr(self, key) is not None for key in ["p", "po"]):
300
315
  raise ValueError(
301
- f"When field k (order_type) is of value LIMIT, class Order requires fields ['p', 'po']"
316
+ f"When field k (order_type) is of value LIMIT, class Order requires fields ['limit_price (p)', 'post_only (po)']"
302
317
  )
303
318
  elif any(getattr(self, key) is not None for key in ["tp"]):
304
319
  raise ValueError(
@@ -307,7 +322,7 @@ class Order(Struct, omit_defaults=True):
307
322
  elif self.k == "STOP_LOSS_LIMIT":
308
323
  if not all(getattr(self, key) is not None for key in ["p", "tp"]):
309
324
  raise ValueError(
310
- f"When field k (order_type) is of value STOP_LOSS_LIMIT, class Order requires fields ['p', 'tp']"
325
+ f"When field k (order_type) is of value STOP_LOSS_LIMIT, class Order requires fields ['limit_price (p)', 'trigger_price (tp)']"
311
326
  )
312
327
  elif any(getattr(self, key) is not None for key in ["po"]):
313
328
  raise ValueError(
@@ -316,9 +331,18 @@ class Order(Struct, omit_defaults=True):
316
331
  elif self.k == "TAKE_PROFIT_LIMIT":
317
332
  if not all(getattr(self, key) is not None for key in ["p", "tp"]):
318
333
  raise ValueError(
319
- f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class Order requires fields ['p', 'tp']"
334
+ f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class Order requires fields ['limit_price (p)', 'trigger_price (tp)']"
320
335
  )
321
336
  elif any(getattr(self, key) is not None for key in ["po"]):
322
337
  raise ValueError(
323
338
  f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class Order should not have fields ['po']"
324
339
  )
340
+ elif self.k == "BRACKET":
341
+ if not all(getattr(self, key) is not None for key in ["p", "po"]):
342
+ raise ValueError(
343
+ f"When field k (order_type) is of value BRACKET, class Order requires fields ['limit_price (p)', 'post_only (po)']"
344
+ )
345
+ elif any(getattr(self, key) is not None for key in ["tp"]):
346
+ raise ValueError(
347
+ f"When field k (order_type) is of value BRACKET, class Order should not have fields ['tp']"
348
+ )
@@ -46,6 +46,10 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
46
46
  p: Optional[Annotated[Decimal, Meta(title="limit_price")]] = None
47
47
  po: Optional[Annotated[bool, Meta(title="post_only")]] = None
48
48
  tp: Optional[Annotated[Decimal, Meta(title="trigger_price")]] = None
49
+ sl: Optional[
50
+ Annotated[Optional[definitions.TriggerLimitOrderType], Meta(title="stop_loss")]
51
+ ] = None
52
+ tpp: Optional[Annotated[Optional[Decimal], Meta(title="take_profit_price")]] = None
49
53
 
50
54
  # Constructor that takes all field titles as arguments for convenience
51
55
  @classmethod
@@ -65,6 +69,8 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
65
69
  limit_price: Optional[Decimal] = None,
66
70
  post_only: Optional[bool] = None,
67
71
  trigger_price: Optional[Decimal] = None,
72
+ stop_loss: Optional[definitions.TriggerLimitOrderType] = None,
73
+ take_profit_price: Optional[Decimal] = None,
68
74
  ):
69
75
  return cls(
70
76
  dir,
@@ -81,10 +87,12 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
81
87
  limit_price,
82
88
  post_only,
83
89
  trigger_price,
90
+ stop_loss,
91
+ take_profit_price,
84
92
  )
85
93
 
86
94
  def __str__(self) -> str:
87
- return f"PlaceOrderRequest(dir={self.d},quantity={self.q},symbol={self.s},time_in_force={self.tif},order_type={self.k},account={self.a},id={self.id},parent_id={self.pid},source={self.src},trader={self.u},execution_venue={self.x},limit_price={self.p},post_only={self.po},trigger_price={self.tp})"
95
+ return f"PlaceOrderRequest(dir={self.d},quantity={self.q},symbol={self.s},time_in_force={self.tif},order_type={self.k},account={self.a},id={self.id},parent_id={self.pid},source={self.src},trader={self.u},execution_venue={self.x},limit_price={self.p},post_only={self.po},trigger_price={self.tp},stop_loss={self.sl},take_profit_price={self.tpp})"
88
96
 
89
97
  @property
90
98
  def dir(self) -> OrderDir:
@@ -190,6 +198,22 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
190
198
  def trigger_price(self, value: Optional[Decimal]) -> None:
191
199
  self.tp = value
192
200
 
201
+ @property
202
+ def stop_loss(self) -> Optional[definitions.TriggerLimitOrderType]:
203
+ return self.sl
204
+
205
+ @stop_loss.setter
206
+ def stop_loss(self, value: Optional[definitions.TriggerLimitOrderType]) -> None:
207
+ self.sl = value
208
+
209
+ @property
210
+ def take_profit_price(self) -> Optional[Decimal]:
211
+ return self.tpp
212
+
213
+ @take_profit_price.setter
214
+ def take_profit_price(self, value: Optional[Decimal]) -> None:
215
+ self.tpp = value
216
+
193
217
  @staticmethod
194
218
  def get_response_type():
195
219
  return Order
@@ -207,19 +231,10 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
207
231
  return "unary"
208
232
 
209
233
  def __post_init__(self):
210
- if self.k == "MARKET":
211
- if not all(getattr(self, key) is not None for key in []):
212
- raise ValueError(
213
- f"When field k (order_type) is of value MARKET, class PlaceOrderRequest requires fields []"
214
- )
215
- elif any(getattr(self, key) is not None for key in ["p", "po", "tp"]):
216
- raise ValueError(
217
- f"When field k (order_type) is of value MARKET, class PlaceOrderRequest should not have fields ['p', 'po', 'tp']"
218
- )
219
- elif self.k == "LIMIT":
234
+ if self.k == "LIMIT":
220
235
  if not all(getattr(self, key) is not None for key in ["p", "po"]):
221
236
  raise ValueError(
222
- f"When field k (order_type) is of value LIMIT, class PlaceOrderRequest requires fields ['p', 'po']"
237
+ f"When field k (order_type) is of value LIMIT, class PlaceOrderRequest requires fields ['limit_price (p)', 'post_only (po)']"
223
238
  )
224
239
  elif any(getattr(self, key) is not None for key in ["tp"]):
225
240
  raise ValueError(
@@ -228,7 +243,7 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
228
243
  elif self.k == "STOP_LOSS_LIMIT":
229
244
  if not all(getattr(self, key) is not None for key in ["p", "tp"]):
230
245
  raise ValueError(
231
- f"When field k (order_type) is of value STOP_LOSS_LIMIT, class PlaceOrderRequest requires fields ['p', 'tp']"
246
+ f"When field k (order_type) is of value STOP_LOSS_LIMIT, class PlaceOrderRequest requires fields ['limit_price (p)', 'trigger_price (tp)']"
232
247
  )
233
248
  elif any(getattr(self, key) is not None for key in ["po"]):
234
249
  raise ValueError(
@@ -237,9 +252,18 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
237
252
  elif self.k == "TAKE_PROFIT_LIMIT":
238
253
  if not all(getattr(self, key) is not None for key in ["p", "tp"]):
239
254
  raise ValueError(
240
- f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class PlaceOrderRequest requires fields ['p', 'tp']"
255
+ f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class PlaceOrderRequest requires fields ['limit_price (p)', 'trigger_price (tp)']"
241
256
  )
242
257
  elif any(getattr(self, key) is not None for key in ["po"]):
243
258
  raise ValueError(
244
259
  f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class PlaceOrderRequest should not have fields ['po']"
245
260
  )
261
+ elif self.k == "BRACKET":
262
+ if not all(getattr(self, key) is not None for key in ["p", "po"]):
263
+ raise ValueError(
264
+ f"When field k (order_type) is of value BRACKET, class PlaceOrderRequest requires fields ['limit_price (p)', 'post_only (po)']"
265
+ )
266
+ elif any(getattr(self, key) is not None for key in ["tp"]):
267
+ raise ValueError(
268
+ f"When field k (order_type) is of value BRACKET, class PlaceOrderRequest should not have fields ['tp']"
269
+ )
@@ -11,6 +11,9 @@ from .Algo.StartAlgoRequest import StartAlgoRequest
11
11
  from .Algo.StartAlgoResponse import StartAlgoResponse
12
12
  from .Algo.StopAlgoRequest import StopAlgoRequest
13
13
  from .Algo.StopAlgoResponse import StopAlgoResponse
14
+ from .AlgoHelper.AlgoParamTypes import AlgoParamTypes
15
+ from .Auth.AuthInfoRequest import AuthInfoRequest
16
+ from .Auth.AuthInfoResponse import AuthInfoResponse
14
17
  from .Auth.CreateJwtRequest import CreateJwtRequest
15
18
  from .Auth.CreateJwtResponse import CreateJwtResponse
16
19
  from .Boss.DepositsRequest import DepositsRequest
@@ -110,4 +113,4 @@ from .Symbology.UploadProductCatalogResponse import UploadProductCatalogResponse
110
113
  from .Symbology.UploadSymbologyRequest import UploadSymbologyRequest
111
114
  from .Symbology.UploadSymbologyResponse import UploadSymbologyResponse
112
115
 
113
- __all__ = ["AccountsRequest", "AccountsResponse", "AlgoOrder", "AlgoOrderRequest", "AlgoOrdersRequest", "AlgoOrdersResponse", "CreateAlgoOrderRequest", "PauseAlgoRequest", "PauseAlgoResponse", "StartAlgoRequest", "StartAlgoResponse", "StopAlgoRequest", "StopAlgoResponse", "CreateJwtRequest", "CreateJwtResponse", "DepositsRequest", "DepositsResponse", "RqdAccountStatisticsRequest", "RqdAccountStatisticsResponse", "StatementUrlRequest", "StatementUrlResponse", "StatementsRequest", "StatementsResponse", "WithdrawalsRequest", "WithdrawalsResponse", "ConfigRequest", "ConfigResponse", "RestartCptyRequest", "RestartCptyResponse", "CptyRequest", "CptyResponse", "CptyStatus", "CptyStatusRequest", "CptysRequest", "CptysResponse", "AccountHistoryRequest", "AccountHistoryResponse", "AccountSummariesRequest", "AccountSummariesResponse", "AccountSummary", "AccountSummaryRequest", "HistoricalFillsRequest", "HistoricalFillsResponse", "HistoricalOrdersRequest", "HistoricalOrdersResponse", "HealthCheckRequest", "HealthCheckResponse", "ArrayOfL1BookSnapshot", "Candle", "HistoricalCandlesRequest", "HistoricalCandlesResponse", "L1BookSnapshot", "L1BookSnapshotRequest", "L1BookSnapshotsRequest", "L2BookSnapshot", "L2BookSnapshotRequest", "L2BookUpdate", "Liquidation", "MarketStatus", "MarketStatusRequest", "SubscribeCandlesRequest", "SubscribeCurrentCandlesRequest", "SubscribeL1BookSnapshotsRequest", "SubscribeL2BookUpdatesRequest", "SubscribeLiquidationsRequest", "SubscribeManyCandlesRequest", "SubscribeTickersRequest", "SubscribeTradesRequest", "Ticker", "TickerRequest", "TickerUpdate", "TickersRequest", "TickersResponse", "Trade", "Cancel", "CancelAllOrdersRequest", "CancelAllOrdersResponse", "CancelOrderRequest", "OpenOrdersRequest", "OpenOrdersResponse", "Order", "PendingCancelsRequest", "PendingCancelsResponse", "PlaceOrderRequest", "OptionsChain", "OptionsChainGreeks", "OptionsChainGreeksRequest", "OptionsChainRequest", "OptionsExpirations", "OptionsExpirationsRequest", "Dropcopy", "DropcopyRequest", "Orderflow", "OrderflowRequest", "SubscribeOrderflowRequest", "DownloadProductCatalogRequest", "DownloadProductCatalogResponse", "ExecutionInfoRequest", "ExecutionInfoResponse", "PruneExpiredSymbolsRequest", "PruneExpiredSymbolsResponse", "SubscribeSymbology", "SymbologyRequest", "SymbologySnapshot", "SymbologyUpdate", "SymbolsRequest", "SymbolsResponse", "UploadProductCatalogRequest", "UploadProductCatalogResponse", "UploadSymbologyRequest", "UploadSymbologyResponse"]
116
+ __all__ = ["AccountsRequest", "AccountsResponse", "AlgoOrder", "AlgoOrderRequest", "AlgoOrdersRequest", "AlgoOrdersResponse", "CreateAlgoOrderRequest", "PauseAlgoRequest", "PauseAlgoResponse", "StartAlgoRequest", "StartAlgoResponse", "StopAlgoRequest", "StopAlgoResponse", "AlgoParamTypes", "AuthInfoRequest", "AuthInfoResponse", "CreateJwtRequest", "CreateJwtResponse", "DepositsRequest", "DepositsResponse", "RqdAccountStatisticsRequest", "RqdAccountStatisticsResponse", "StatementUrlRequest", "StatementUrlResponse", "StatementsRequest", "StatementsResponse", "WithdrawalsRequest", "WithdrawalsResponse", "ConfigRequest", "ConfigResponse", "RestartCptyRequest", "RestartCptyResponse", "CptyRequest", "CptyResponse", "CptyStatus", "CptyStatusRequest", "CptysRequest", "CptysResponse", "AccountHistoryRequest", "AccountHistoryResponse", "AccountSummariesRequest", "AccountSummariesResponse", "AccountSummary", "AccountSummaryRequest", "HistoricalFillsRequest", "HistoricalFillsResponse", "HistoricalOrdersRequest", "HistoricalOrdersResponse", "HealthCheckRequest", "HealthCheckResponse", "ArrayOfL1BookSnapshot", "Candle", "HistoricalCandlesRequest", "HistoricalCandlesResponse", "L1BookSnapshot", "L1BookSnapshotRequest", "L1BookSnapshotsRequest", "L2BookSnapshot", "L2BookSnapshotRequest", "L2BookUpdate", "Liquidation", "MarketStatus", "MarketStatusRequest", "SubscribeCandlesRequest", "SubscribeCurrentCandlesRequest", "SubscribeL1BookSnapshotsRequest", "SubscribeL2BookUpdatesRequest", "SubscribeLiquidationsRequest", "SubscribeManyCandlesRequest", "SubscribeTickersRequest", "SubscribeTradesRequest", "Ticker", "TickerRequest", "TickerUpdate", "TickersRequest", "TickersResponse", "Trade", "Cancel", "CancelAllOrdersRequest", "CancelAllOrdersResponse", "CancelOrderRequest", "OpenOrdersRequest", "OpenOrdersResponse", "Order", "PendingCancelsRequest", "PendingCancelsResponse", "PlaceOrderRequest", "OptionsChain", "OptionsChainGreeks", "OptionsChainGreeksRequest", "OptionsChainRequest", "OptionsExpirations", "OptionsExpirationsRequest", "Dropcopy", "DropcopyRequest", "Orderflow", "OrderflowRequest", "SubscribeOrderflowRequest", "DownloadProductCatalogRequest", "DownloadProductCatalogResponse", "ExecutionInfoRequest", "ExecutionInfoResponse", "PruneExpiredSymbolsRequest", "PruneExpiredSymbolsResponse", "SubscribeSymbology", "SymbologyRequest", "SymbologySnapshot", "SymbologyUpdate", "SymbolsRequest", "SymbolsResponse", "UploadProductCatalogRequest", "UploadProductCatalogResponse", "UploadSymbologyRequest", "UploadSymbologyResponse"]
@@ -15,6 +15,12 @@ from msgspec import Meta, Struct
15
15
  from .Marketdata.Ticker import Ticker
16
16
 
17
17
 
18
+ class AccountHistoryGranularity(str, Enum):
19
+ FiveMinutes = "FiveMinutes"
20
+ Hourly = "Hourly"
21
+ Daily = "Daily"
22
+
23
+
18
24
  AccountIdOrName = str
19
25
 
20
26
 
@@ -177,6 +183,8 @@ class CandleWidth(int, Enum):
177
183
  OneSecond = 1
178
184
  FiveSecond = 5
179
185
  OneMinute = 60
186
+ TwoMinute = 120
187
+ ThreeMinute = 180
180
188
  FifteenMinute = 900
181
189
  OneHour = 3600
182
190
  OneDay = 86400
@@ -502,6 +510,7 @@ class OrderType(str, Enum):
502
510
  LIMIT = "LIMIT"
503
511
  STOP_LOSS_LIMIT = "STOP_LOSS_LIMIT"
504
512
  TAKE_PROFIT_LIMIT = "TAKE_PROFIT_LIMIT"
513
+ BRACKET = "BRACKET"
505
514
 
506
515
 
507
516
  class ProductCatalogInfo(Struct, omit_defaults=True):
@@ -790,6 +799,42 @@ class Statement(Struct, omit_defaults=True):
790
799
  TraderIdOrEmail = str
791
800
 
792
801
 
802
+ class TriggerLimitOrderType(Struct, omit_defaults=True):
803
+ p: Annotated[Decimal, Meta(title="limit_price")]
804
+ tp: Annotated[Decimal, Meta(title="trigger_price")]
805
+
806
+ # Constructor that takes all field titles as arguments for convenience
807
+ @classmethod
808
+ def new(
809
+ cls,
810
+ limit_price: Decimal,
811
+ trigger_price: Decimal,
812
+ ):
813
+ return cls(
814
+ limit_price,
815
+ trigger_price,
816
+ )
817
+
818
+ def __str__(self) -> str:
819
+ return f"TriggerLimitOrderType(limit_price={self.p},trigger_price={self.tp})"
820
+
821
+ @property
822
+ def limit_price(self) -> Decimal:
823
+ return self.p
824
+
825
+ @limit_price.setter
826
+ def limit_price(self, value: Decimal) -> None:
827
+ self.p = value
828
+
829
+ @property
830
+ def trigger_price(self) -> Decimal:
831
+ return self.tp
832
+
833
+ @trigger_price.setter
834
+ def trigger_price(self, value: Decimal) -> None:
835
+ self.tp = value
836
+
837
+
793
838
  UserId = str
794
839
 
795
840
 
@@ -869,6 +914,9 @@ class FillKind(int, Enum):
869
914
  Correction = 2
870
915
 
871
916
 
917
+ HumanDuration = str
918
+
919
+
872
920
  class Unit(str, Enum):
873
921
  base = "base"
874
922
  quote = "quote"
@@ -1160,6 +1208,17 @@ SnapshotOrUpdateForStringAndString = Union[
1160
1208
  ]
1161
1209
 
1162
1210
 
1211
+ class SpreaderPhase(str, Enum):
1212
+ ScanningForTakes = "ScanningForTakes"
1213
+ AwaitingOrderResults = "AwaitingOrderResults"
1214
+ OrderLockout = "OrderLockout"
1215
+ NoBbo = "NoBbo"
1216
+ NotEnoughBboSize = "NotEnoughBboSize"
1217
+ DoneOverfilled = "DoneOverfilled"
1218
+ DoneAndFullyHedged = "DoneAndFullyHedged"
1219
+ DoneAndGivingUp = "DoneAndGivingUp"
1220
+
1221
+
1163
1222
  class SimpleDecimal(Struct, omit_defaults=True):
1164
1223
  simple: Decimal
1165
1224
 
@@ -2256,6 +2315,100 @@ SnapshotOrUpdateForStringAndSnapshotOrUpdateForStringAndProductCatalogInfo = Uni
2256
2315
  ]
2257
2316
 
2258
2317
 
2318
+ class SpreaderParams(Struct, omit_defaults=True):
2319
+ dir: OrderDir
2320
+ leg1_marketdata_venue: str
2321
+ leg1_price_offset: Decimal
2322
+ leg1_price_ratio: Decimal
2323
+ leg1_quantity_ratio: Decimal
2324
+ leg1_symbol: str
2325
+ leg2_marketdata_venue: str
2326
+ leg2_price_offset: Decimal
2327
+ leg2_price_ratio: Decimal
2328
+ leg2_quantity_ratio: Decimal
2329
+ leg2_symbol: str
2330
+ limit_price: Decimal
2331
+ order_lockout: HumanDuration
2332
+ quantity: Decimal
2333
+ leg1_account: Optional[AccountIdOrName] = None
2334
+ leg1_execution_venue: Optional[str] = None
2335
+ leg2_account: Optional[AccountIdOrName] = None
2336
+ leg2_execution_venue: Optional[str] = None
2337
+
2338
+ # Constructor that takes all field titles as arguments for convenience
2339
+ @classmethod
2340
+ def new(
2341
+ cls,
2342
+ dir: OrderDir,
2343
+ leg1_marketdata_venue: str,
2344
+ leg1_price_offset: Decimal,
2345
+ leg1_price_ratio: Decimal,
2346
+ leg1_quantity_ratio: Decimal,
2347
+ leg1_symbol: str,
2348
+ leg2_marketdata_venue: str,
2349
+ leg2_price_offset: Decimal,
2350
+ leg2_price_ratio: Decimal,
2351
+ leg2_quantity_ratio: Decimal,
2352
+ leg2_symbol: str,
2353
+ limit_price: Decimal,
2354
+ order_lockout: HumanDuration,
2355
+ quantity: Decimal,
2356
+ leg1_account: Optional[AccountIdOrName] = None,
2357
+ leg1_execution_venue: Optional[str] = None,
2358
+ leg2_account: Optional[AccountIdOrName] = None,
2359
+ leg2_execution_venue: Optional[str] = None,
2360
+ ):
2361
+ return cls(
2362
+ dir,
2363
+ leg1_marketdata_venue,
2364
+ leg1_price_offset,
2365
+ leg1_price_ratio,
2366
+ leg1_quantity_ratio,
2367
+ leg1_symbol,
2368
+ leg2_marketdata_venue,
2369
+ leg2_price_offset,
2370
+ leg2_price_ratio,
2371
+ leg2_quantity_ratio,
2372
+ leg2_symbol,
2373
+ limit_price,
2374
+ order_lockout,
2375
+ quantity,
2376
+ leg1_account,
2377
+ leg1_execution_venue,
2378
+ leg2_account,
2379
+ leg2_execution_venue,
2380
+ )
2381
+
2382
+ def __str__(self) -> str:
2383
+ return f"SpreaderParams(dir={self.dir},leg1_marketdata_venue={self.leg1_marketdata_venue},leg1_price_offset={self.leg1_price_offset},leg1_price_ratio={self.leg1_price_ratio},leg1_quantity_ratio={self.leg1_quantity_ratio},leg1_symbol={self.leg1_symbol},leg2_marketdata_venue={self.leg2_marketdata_venue},leg2_price_offset={self.leg2_price_offset},leg2_price_ratio={self.leg2_price_ratio},leg2_quantity_ratio={self.leg2_quantity_ratio},leg2_symbol={self.leg2_symbol},limit_price={self.limit_price},order_lockout={self.order_lockout},quantity={self.quantity},leg1_account={self.leg1_account},leg1_execution_venue={self.leg1_execution_venue},leg2_account={self.leg2_account},leg2_execution_venue={self.leg2_execution_venue})"
2384
+
2385
+
2386
+ class SpreaderStatus(Struct, omit_defaults=True):
2387
+ current_spreader_phase: SpreaderPhase
2388
+ leg1_fill_quantity: Decimal
2389
+ leg2_fill_quantity: Decimal
2390
+ implied_spread_vwap: Optional[Decimal] = None
2391
+
2392
+ # Constructor that takes all field titles as arguments for convenience
2393
+ @classmethod
2394
+ def new(
2395
+ cls,
2396
+ current_spreader_phase: SpreaderPhase,
2397
+ leg1_fill_quantity: Decimal,
2398
+ leg2_fill_quantity: Decimal,
2399
+ implied_spread_vwap: Optional[Decimal] = None,
2400
+ ):
2401
+ return cls(
2402
+ current_spreader_phase,
2403
+ leg1_fill_quantity,
2404
+ leg2_fill_quantity,
2405
+ implied_spread_vwap,
2406
+ )
2407
+
2408
+ def __str__(self) -> str:
2409
+ return f"SpreaderStatus(current_spreader_phase={self.current_spreader_phase},leg1_fill_quantity={self.leg1_fill_quantity},leg2_fill_quantity={self.leg2_fill_quantity},implied_spread_vwap={self.implied_spread_vwap})"
2410
+
2411
+
2259
2412
  class Account(Struct, omit_defaults=True):
2260
2413
  id: str
2261
2414
  name: AccountName