architect-py 5.1.4rc1__py3-none-any.whl → 5.1.6__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.
Files changed (49) hide show
  1. architect_py/__init__.py +24 -4
  2. architect_py/async_client.py +121 -67
  3. architect_py/client.pyi +16 -37
  4. architect_py/grpc/models/Accounts/ResetPaperAccountRequest.py +59 -0
  5. architect_py/grpc/models/Accounts/ResetPaperAccountResponse.py +20 -0
  6. architect_py/grpc/models/Boss/OptionsTransactionsRequest.py +42 -0
  7. architect_py/grpc/models/Boss/OptionsTransactionsResponse.py +27 -0
  8. architect_py/grpc/models/Core/ConfigResponse.py +7 -2
  9. architect_py/grpc/models/Folio/AccountSummary.py +7 -1
  10. architect_py/grpc/models/Marketdata/Candle.py +6 -0
  11. architect_py/grpc/models/Marketdata/L1BookSnapshot.py +6 -0
  12. architect_py/grpc/models/Marketdata/L2BookSnapshot.py +6 -0
  13. architect_py/grpc/models/Marketdata/Liquidation.py +6 -0
  14. architect_py/grpc/models/Marketdata/Ticker.py +6 -0
  15. architect_py/grpc/models/Marketdata/Trade.py +6 -0
  16. architect_py/grpc/models/OptionsMarketdata/OptionsChain.py +5 -5
  17. architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeks.py +5 -5
  18. architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeksRequest.py +5 -1
  19. architect_py/grpc/models/OptionsMarketdata/OptionsChainRequest.py +5 -1
  20. architect_py/grpc/models/OptionsMarketdata/OptionsContract.py +45 -0
  21. architect_py/grpc/models/OptionsMarketdata/OptionsContractGreeksRequest.py +40 -0
  22. architect_py/grpc/models/OptionsMarketdata/OptionsContractRequest.py +40 -0
  23. architect_py/grpc/models/OptionsMarketdata/OptionsExpirations.py +4 -1
  24. architect_py/grpc/models/OptionsMarketdata/OptionsExpirationsRequest.py +8 -1
  25. architect_py/grpc/models/OptionsMarketdata/OptionsGreeks.py +58 -0
  26. architect_py/grpc/models/OptionsMarketdata/OptionsWraps.py +28 -0
  27. architect_py/grpc/models/OptionsMarketdata/OptionsWrapsRequest.py +40 -0
  28. architect_py/grpc/models/__init__.py +11 -1
  29. architect_py/grpc/models/definitions.py +57 -86
  30. architect_py/grpc/orderflow.py +3 -7
  31. architect_py/grpc/server.py +1 -3
  32. architect_py/tests/test_order_entry.py +120 -1
  33. architect_py/tests/test_positions.py +364 -0
  34. architect_py/tests/test_rounding.py +28 -28
  35. architect_py/utils/pandas.py +50 -1
  36. {architect_py-5.1.4rc1.dist-info → architect_py-5.1.6.dist-info}/METADATA +1 -1
  37. {architect_py-5.1.4rc1.dist-info → architect_py-5.1.6.dist-info}/RECORD +49 -38
  38. examples/external_cpty.py +2 -1
  39. examples/funding_rate_mean_reversion_algo.py +4 -4
  40. examples/order_sending.py +3 -3
  41. examples/orderflow_channel.py +75 -56
  42. examples/stream_l1_marketdata.py +3 -1
  43. examples/stream_l2_marketdata.py +3 -1
  44. examples/tutorial_async.py +3 -2
  45. examples/tutorial_sync.py +4 -3
  46. scripts/generate_functions_md.py +2 -1
  47. {architect_py-5.1.4rc1.dist-info → architect_py-5.1.6.dist-info}/WHEEL +0 -0
  48. {architect_py-5.1.4rc1.dist-info → architect_py-5.1.6.dist-info}/licenses/LICENSE +0 -0
  49. {architect_py-5.1.4rc1.dist-info → architect_py-5.1.6.dist-info}/top_level.txt +0 -0
architect_py/client.pyi CHANGED
@@ -14,7 +14,7 @@ from architect_py.grpc.orderflow import OrderflowChannel as OrderflowChannel
14
14
  from architect_py.grpc.resolve_endpoint import PAPER_GRPC_PORT as PAPER_GRPC_PORT, resolve_endpoint as resolve_endpoint
15
15
  from architect_py.utils.nearest_tick import TickRoundMethod as TickRoundMethod
16
16
  from architect_py.utils.orderbook import update_orderbook_side as update_orderbook_side
17
- from architect_py.utils.pandas import candles_to_dataframe as candles_to_dataframe
17
+ from architect_py.utils.pandas import candles_to_dataframe as candles_to_dataframe, tickers_to_dataframe as tickers_to_dataframe
18
18
  from architect_py.utils.price_bands import price_band_pairs as price_band_pairs
19
19
  from architect_py.utils.symbol_parsing import nominative_expiration as nominative_expiration
20
20
  from datetime import date, datetime
@@ -75,45 +75,14 @@ class Client:
75
75
 
76
76
  Query methods on Client that require auth will call this method internally.
77
77
  """
78
- def set_jwt(self, jwt: str | None, jwt_expiration: datetime | None = None):
79
- """
80
- Manually set the JWT for gRPC authentication.
81
-
82
- Args:
83
- jwt: the JWT to set;
84
- None to clear the JWT
85
- jwt_expiration: when to expire the JWT
86
- """
87
- def discover_marketdata(self) -> None:
88
- """
89
- Load marketdata endpoints from the server config.
90
-
91
- The Architect core is responsible for telling you where to find marketdata as per
92
- its configuration. You can also manually set marketdata endpoints by calling
93
- set_marketdata directly.
94
-
95
- This method is called on Client.connect.
96
- """
97
78
  def set_marketdata(self, venue: Venue, endpoint: str):
98
79
  """
99
80
  Manually set the marketdata endpoint for a venue.
100
81
  """
101
- def marketdata(self, venue: Venue) -> GrpcClient:
102
- """
103
- Get the marketdata client for a venue.
104
- """
105
82
  def set_hmart(self, endpoint: str):
106
83
  """
107
84
  Manually set the hmart (historical marketdata service) endpoint.
108
85
  """
109
- def hmart(self) -> GrpcClient:
110
- """
111
- Get the hmart (historical marketdata service) client.
112
- """
113
- def core(self) -> GrpcClient:
114
- """
115
- Get the core client.
116
- """
117
86
  def who_am_i(self) -> tuple[str, str]:
118
87
  """
119
88
  Gets the user_id and user_email for the user that the API key belongs to.
@@ -121,7 +90,6 @@ class Client:
121
90
  Returns:
122
91
  (user_id, user_email)
123
92
  """
124
- def auth_info(self) -> AuthInfoResponse: ...
125
93
  def cpty_status(self, kind: str, instance: str | None = None) -> CptyStatus:
126
94
  """
127
95
  Get cpty status.
@@ -353,6 +321,10 @@ class Client:
353
321
  """
354
322
  Gets the ticker for a symbol.
355
323
  """
324
+ def get_tickers(self, *, venue: Venue, symbols: Sequence[TradableProduct | str] | None = None, include_options: bool = False, sort_by: SortTickersBy | str | None = None, offset: int | None = None, limit: int | None = None, as_dataframe: bool = False) -> Sequence[Ticker] | pd.DataFrame:
325
+ """
326
+ Gets the tickers for a list of symbols.
327
+ """
356
328
  def list_accounts(self) -> list[AccountWithPermissions]:
357
329
  """
358
330
  List accounts for the user that the API key belongs to.
@@ -370,6 +342,13 @@ class Client:
370
342
  account: account uuid or name
371
343
  Examples: "00000000-0000-0000-0000-000000000000", "STONEX:000000/JDoe"
372
344
  '''
345
+ def get_positions(self, accounts: list[str] | None = None, trader: str | None = None) -> dict[str, Decimal]:
346
+ """
347
+ Get positions for the specified symbols.
348
+
349
+ Args:
350
+ symbols: list of symbol strings
351
+ """
373
352
  def get_account_summaries(self, accounts: list[str] | None = None, trader: str | None = None) -> list[AccountSummary]:
374
353
  """
375
354
  Get account summaries for accounts matching the filters.
@@ -489,7 +468,7 @@ class Client:
489
468
  trigger_price=trigger_price,
490
469
  )
491
470
  """
492
- def place_order(self, *, id: OrderId | None = None, symbol: TradableProduct | str, execution_venue: str | None = None, dir: OrderDir, quantity: Decimal, limit_price: Decimal, order_type: OrderType = ..., time_in_force: TimeInForce = ..., price_round_method: TickRoundMethod | None = None, account: str | None = None, trader: str | None = None, post_only: bool | None = None, trigger_price: Decimal | None = None, stop_loss: TriggerLimitOrderType | None = None, take_profit_price: Decimal | None = None, **kwargs: Any) -> Order:
471
+ def place_order(self, *, id: OrderId | None = None, symbol: TradableProduct | str, execution_venue: str | None = None, dir: OrderDir, quantity: Decimal, limit_price: Decimal | None = None, order_type: OrderType = ..., time_in_force: TimeInForce = ..., price_round_method: TickRoundMethod | None = None, account: str | None = None, trader: str | None = None, post_only: bool | None = None, trigger_price: Decimal | None = None, stop_loss: TriggerLimitOrderType | None = None, take_profit_price: Decimal | None = None, **kwargs: Any) -> Order:
493
472
  '''
494
473
  Sends a regular order.
495
474
 
@@ -498,7 +477,7 @@ class Client:
498
477
  symbol: the symbol to send the order for
499
478
  execution_venue: the execution venue to send the order to,
500
479
  if execution_venue is set to None, the OMS will send the order to the primary_exchange
501
- the primary_exchange can be deduced from `get_product_info`
480
+ the primary_exchange can be deduced from `get_product_info` (generally will be "CME" or "US-EQUITIES")
502
481
  dir: the direction of the order, BUY or SELL
503
482
  quantity: the quantity of the order
504
483
  limit_price: the limit price of the order
@@ -510,7 +489,7 @@ class Client:
510
489
  While technically optional, for most order types, the account is required
511
490
  trader: the trader to send the order for, defaults to the user\'s trader
512
491
  for when sending order for another user, not relevant for vast majority of users
513
- post_only: whether the order should be post only, not supported by all exchanges
492
+ post_only: whether the order should be post only, NOT SUPPORTED BY ALL EXCHANGES (e.g. CME)
514
493
  trigger_price: the trigger price for the order, only relevant for stop / take_profit orders
515
494
  stop_loss_price: the stop loss price for a bracket order.
516
495
  profit_price: the take profit price for a bracket order.
@@ -558,7 +537,7 @@ class Client:
558
537
  True if all orders were cancelled successfully
559
538
  False if there was an error
560
539
  """
561
- def create_algo_order(self, *, params: SpreaderParams, id: str | None = None, trader: str | None = None):
540
+ def place_algo_order(self, *, params: SpreaderParams, id: str | None = None, trader: str | None = None):
562
541
  """
563
542
  Sends an advanced algo order such as the spreader.
564
543
  """
@@ -0,0 +1,59 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Accounts/ResetPaperAccountRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Accounts.ResetPaperAccountResponse import (
6
+ ResetPaperAccountResponse,
7
+ )
8
+
9
+ from typing import Annotated, Optional
10
+
11
+ from msgspec import Meta, Struct
12
+
13
+ from .. import definitions
14
+
15
+
16
+ class ResetPaperAccountRequest(Struct, omit_defaults=True):
17
+ account: Annotated[
18
+ definitions.AccountIdOrName,
19
+ Meta(
20
+ description="The trader for whom to reset paper accounts. If not specified, defaults to the caller user."
21
+ ),
22
+ ]
23
+ """
24
+ The trader for whom to reset paper accounts. If not specified, defaults to the caller user.
25
+ """
26
+ balance: Optional[int] = None
27
+
28
+ # Constructor that takes all field titles as arguments for convenience
29
+ @classmethod
30
+ def new(
31
+ cls,
32
+ account: definitions.AccountIdOrName,
33
+ balance: Optional[int] = None,
34
+ ):
35
+ return cls(
36
+ account,
37
+ balance,
38
+ )
39
+
40
+ def __str__(self) -> str:
41
+ return (
42
+ f"ResetPaperAccountRequest(account={self.account},balance={self.balance})"
43
+ )
44
+
45
+ @staticmethod
46
+ def get_response_type():
47
+ return ResetPaperAccountResponse
48
+
49
+ @staticmethod
50
+ def get_unannotated_response_type():
51
+ return ResetPaperAccountResponse
52
+
53
+ @staticmethod
54
+ def get_route() -> str:
55
+ return "/json.architect.Accounts/ResetPaperAccount"
56
+
57
+ @staticmethod
58
+ def get_rpc_method():
59
+ return "unary"
@@ -0,0 +1,20 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Accounts/ResetPaperAccountResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from msgspec import Struct
7
+
8
+
9
+ class ResetPaperAccountResponse(Struct, omit_defaults=True):
10
+ pass
11
+
12
+ # Constructor that takes all field titles as arguments for convenience
13
+ @classmethod
14
+ def new(
15
+ cls,
16
+ ):
17
+ return cls()
18
+
19
+ def __str__(self) -> str:
20
+ return f"ResetPaperAccountResponse()"
@@ -0,0 +1,42 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/OptionsTransactionsRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.Boss.OptionsTransactionsResponse import (
6
+ OptionsTransactionsResponse,
7
+ )
8
+
9
+ from msgspec import Struct
10
+
11
+
12
+ class OptionsTransactionsRequest(Struct, omit_defaults=True):
13
+ account_id: str
14
+
15
+ # Constructor that takes all field titles as arguments for convenience
16
+ @classmethod
17
+ def new(
18
+ cls,
19
+ account_id: str,
20
+ ):
21
+ return cls(
22
+ account_id,
23
+ )
24
+
25
+ def __str__(self) -> str:
26
+ return f"OptionsTransactionsRequest(account_id={self.account_id})"
27
+
28
+ @staticmethod
29
+ def get_response_type():
30
+ return OptionsTransactionsResponse
31
+
32
+ @staticmethod
33
+ def get_unannotated_response_type():
34
+ return OptionsTransactionsResponse
35
+
36
+ @staticmethod
37
+ def get_route() -> str:
38
+ return "/json.architect.Boss/OptionsTransactions"
39
+
40
+ @staticmethod
41
+ def get_rpc_method():
42
+ return "unary"
@@ -0,0 +1,27 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: Boss/OptionsTransactionsResponse.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import List
7
+
8
+ from msgspec import Struct
9
+
10
+ from .. import definitions
11
+
12
+
13
+ class OptionsTransactionsResponse(Struct, omit_defaults=True):
14
+ options_transactions: List[definitions.OptionsTransaction]
15
+
16
+ # Constructor that takes all field titles as arguments for convenience
17
+ @classmethod
18
+ def new(
19
+ cls,
20
+ options_transactions: List[definitions.OptionsTransaction],
21
+ ):
22
+ return cls(
23
+ options_transactions,
24
+ )
25
+
26
+ def __str__(self) -> str:
27
+ return f"OptionsTransactionsResponse(options_transactions={self.options_transactions})"
@@ -3,23 +3,28 @@
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
- from typing import Dict
6
+ from typing import Dict, Optional
7
7
 
8
8
  from msgspec import Struct
9
9
 
10
10
 
11
11
  class ConfigResponse(Struct, omit_defaults=True):
12
12
  marketdata: Dict[str, str]
13
+ symbology: Optional[str] = None
13
14
 
14
15
  # Constructor that takes all field titles as arguments for convenience
15
16
  @classmethod
16
17
  def new(
17
18
  cls,
18
19
  marketdata: Dict[str, str],
20
+ symbology: Optional[str] = None,
19
21
  ):
20
22
  return cls(
21
23
  marketdata,
24
+ symbology,
22
25
  )
23
26
 
24
27
  def __str__(self) -> str:
25
- return f"ConfigResponse(marketdata={self.marketdata})"
28
+ return (
29
+ f"ConfigResponse(marketdata={self.marketdata},symbology={self.symbology})"
30
+ )
@@ -15,7 +15,13 @@ from .. import definitions
15
15
  class AccountSummary(Struct, omit_defaults=True):
16
16
  account: str
17
17
  balances: Dict[str, Decimal]
18
- positions: Dict[str, List[definitions.AccountPosition]]
18
+ positions: Annotated[
19
+ Dict[str, List[definitions.AccountPosition]],
20
+ Meta(description="map from TradableProduct to a list of AccountPosition"),
21
+ ]
22
+ """
23
+ map from TradableProduct to a list of AccountPosition
24
+ """
19
25
  timestamp: datetime
20
26
  cash_excess: Optional[
21
27
  Annotated[Optional[Decimal], Meta(description="Cash available to withdraw.")]
@@ -136,10 +136,16 @@ class Candle(Struct, omit_defaults=True):
136
136
 
137
137
  @property
138
138
  def datetime(self) -> datetime:
139
+ """
140
+ Convenience property to get the timestamp as a datetime object in UTC.
141
+ """
139
142
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
140
143
 
141
144
  @property
142
145
  def datetime_local(self) -> datetime:
146
+ """
147
+ Convenience property to get the timestamp as a datetime object in local time.
148
+ """
143
149
  return datetime.fromtimestamp(self.ts)
144
150
 
145
151
  @property
@@ -103,10 +103,16 @@ class L1BookSnapshot(Struct, omit_defaults=True):
103
103
 
104
104
  @property
105
105
  def datetime(self) -> datetime:
106
+ """
107
+ Convenience property to get the timestamp as a datetime object in UTC.
108
+ """
106
109
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
107
110
 
108
111
  @property
109
112
  def datetime_local(self) -> datetime:
113
+ """
114
+ Convenience property to get the timestamp as a datetime object in local time.
115
+ """
110
116
  return datetime.fromtimestamp(self.ts)
111
117
 
112
118
  @property
@@ -100,8 +100,14 @@ class L2BookSnapshot(Struct, omit_defaults=True):
100
100
 
101
101
  @property
102
102
  def datetime(self) -> datetime:
103
+ """
104
+ Convenience property to get the timestamp as a datetime object in UTC.
105
+ """
103
106
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
104
107
 
105
108
  @property
106
109
  def datetime_local(self) -> datetime:
110
+ """
111
+ Convenience property to get the timestamp as a datetime object in local time.
112
+ """
107
113
  return datetime.fromtimestamp(self.ts)
@@ -93,8 +93,14 @@ class Liquidation(Struct, omit_defaults=True):
93
93
 
94
94
  @property
95
95
  def datetime(self) -> datetime:
96
+ """
97
+ Convenience property to get the timestamp as a datetime object in UTC.
98
+ """
96
99
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
97
100
 
98
101
  @property
99
102
  def datetime_local(self) -> datetime:
103
+ """
104
+ Convenience property to get the timestamp as a datetime object in local time.
105
+ """
100
106
  return datetime.fromtimestamp(self.ts)
@@ -155,10 +155,16 @@ class Ticker(Struct, omit_defaults=True):
155
155
 
156
156
  @property
157
157
  def datetime(self) -> datetime:
158
+ """
159
+ Convenience property to get the timestamp as a datetime object in UTC.
160
+ """
158
161
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
159
162
 
160
163
  @property
161
164
  def datetime_local(self) -> datetime:
165
+ """
166
+ Convenience property to get the timestamp as a datetime object in local time.
167
+ """
162
168
  return datetime.fromtimestamp(self.ts)
163
169
 
164
170
  @property
@@ -85,10 +85,16 @@ class Trade(Struct, omit_defaults=True):
85
85
 
86
86
  @property
87
87
  def datetime(self) -> datetime:
88
+ """
89
+ Convenience property to get the timestamp as a datetime object in UTC.
90
+ """
88
91
  return datetime.fromtimestamp(self.ts, tz=timezone.utc)
89
92
 
90
93
  @property
91
94
  def datetime_local(self) -> datetime:
95
+ """
96
+ Convenience property to get the timestamp as a datetime object in local time.
97
+ """
92
98
  return datetime.fromtimestamp(self.ts)
93
99
 
94
100
  @property
@@ -7,19 +7,19 @@ from typing import List
7
7
 
8
8
  from msgspec import Struct
9
9
 
10
- from .. import definitions
10
+ from .OptionsContract import OptionsContract
11
11
 
12
12
 
13
13
  class OptionsChain(Struct, omit_defaults=True):
14
- calls: List[definitions.OptionsContract]
15
- puts: List[definitions.OptionsContract]
14
+ calls: List[OptionsContract]
15
+ puts: List[OptionsContract]
16
16
 
17
17
  # Constructor that takes all field titles as arguments for convenience
18
18
  @classmethod
19
19
  def new(
20
20
  cls,
21
- calls: List[definitions.OptionsContract],
22
- puts: List[definitions.OptionsContract],
21
+ calls: List[OptionsContract],
22
+ puts: List[OptionsContract],
23
23
  ):
24
24
  return cls(
25
25
  calls,
@@ -7,19 +7,19 @@ from typing import List
7
7
 
8
8
  from msgspec import Struct
9
9
 
10
- from .. import definitions
10
+ from .OptionsGreeks import OptionsGreeks
11
11
 
12
12
 
13
13
  class OptionsChainGreeks(Struct, omit_defaults=True):
14
- calls: List[definitions.OptionsGreeks]
15
- puts: List[definitions.OptionsGreeks]
14
+ calls: List[OptionsGreeks]
15
+ puts: List[OptionsGreeks]
16
16
 
17
17
  # Constructor that takes all field titles as arguments for convenience
18
18
  @classmethod
19
19
  def new(
20
20
  cls,
21
- calls: List[definitions.OptionsGreeks],
22
- puts: List[definitions.OptionsGreeks],
21
+ calls: List[OptionsGreeks],
22
+ puts: List[OptionsGreeks],
23
23
  ):
24
24
  return cls(
25
25
  calls,
@@ -7,6 +7,7 @@ from architect_py.grpc.models.OptionsMarketdata.OptionsChainGreeks import (
7
7
  )
8
8
 
9
9
  from datetime import date
10
+ from typing import Optional
10
11
 
11
12
  from msgspec import Struct
12
13
 
@@ -14,6 +15,7 @@ from msgspec import Struct
14
15
  class OptionsChainGreeksRequest(Struct, omit_defaults=True):
15
16
  expiration: date
16
17
  underlying: str
18
+ wrap: Optional[str] = None
17
19
 
18
20
  # Constructor that takes all field titles as arguments for convenience
19
21
  @classmethod
@@ -21,14 +23,16 @@ class OptionsChainGreeksRequest(Struct, omit_defaults=True):
21
23
  cls,
22
24
  expiration: date,
23
25
  underlying: str,
26
+ wrap: Optional[str] = None,
24
27
  ):
25
28
  return cls(
26
29
  expiration,
27
30
  underlying,
31
+ wrap,
28
32
  )
29
33
 
30
34
  def __str__(self) -> str:
31
- return f"OptionsChainGreeksRequest(expiration={self.expiration},underlying={self.underlying})"
35
+ return f"OptionsChainGreeksRequest(expiration={self.expiration},underlying={self.underlying},wrap={self.wrap})"
32
36
 
33
37
  @staticmethod
34
38
  def get_response_type():
@@ -5,6 +5,7 @@ from __future__ import annotations
5
5
  from architect_py.grpc.models.OptionsMarketdata.OptionsChain import OptionsChain
6
6
 
7
7
  from datetime import date
8
+ from typing import Optional
8
9
 
9
10
  from msgspec import Struct
10
11
 
@@ -12,6 +13,7 @@ from msgspec import Struct
12
13
  class OptionsChainRequest(Struct, omit_defaults=True):
13
14
  expiration: date
14
15
  underlying: str
16
+ wrap: Optional[str] = None
15
17
 
16
18
  # Constructor that takes all field titles as arguments for convenience
17
19
  @classmethod
@@ -19,14 +21,16 @@ class OptionsChainRequest(Struct, omit_defaults=True):
19
21
  cls,
20
22
  expiration: date,
21
23
  underlying: str,
24
+ wrap: Optional[str] = None,
22
25
  ):
23
26
  return cls(
24
27
  expiration,
25
28
  underlying,
29
+ wrap,
26
30
  )
27
31
 
28
32
  def __str__(self) -> str:
29
- return f"OptionsChainRequest(expiration={self.expiration},underlying={self.underlying})"
33
+ return f"OptionsChainRequest(expiration={self.expiration},underlying={self.underlying},wrap={self.wrap})"
30
34
 
31
35
  @staticmethod
32
36
  def get_response_type():
@@ -0,0 +1,45 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: OptionsMarketdata/OptionsContract.json
3
+
4
+ from __future__ import annotations
5
+
6
+ from datetime import date
7
+ from decimal import Decimal
8
+ from typing import Optional
9
+
10
+ from msgspec import Struct
11
+
12
+ from .. import definitions
13
+ from ..Marketdata.Ticker import Ticker
14
+
15
+
16
+ class OptionsContract(Struct, omit_defaults=True):
17
+ expiration: date
18
+ put_or_call: definitions.PutOrCall
19
+ strike: Decimal
20
+ ticker: Ticker
21
+ underlying: str
22
+ in_the_money: Optional[bool] = None
23
+
24
+ # Constructor that takes all field titles as arguments for convenience
25
+ @classmethod
26
+ def new(
27
+ cls,
28
+ expiration: date,
29
+ put_or_call: definitions.PutOrCall,
30
+ strike: Decimal,
31
+ ticker: Ticker,
32
+ underlying: str,
33
+ in_the_money: Optional[bool] = None,
34
+ ):
35
+ return cls(
36
+ expiration,
37
+ put_or_call,
38
+ strike,
39
+ ticker,
40
+ underlying,
41
+ in_the_money,
42
+ )
43
+
44
+ def __str__(self) -> str:
45
+ return f"OptionsContract(expiration={self.expiration},put_or_call={self.put_or_call},strike={self.strike},ticker={self.ticker},underlying={self.underlying},in_the_money={self.in_the_money})"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: OptionsMarketdata/OptionsContractGreeksRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.OptionsMarketdata.OptionsGreeks import OptionsGreeks
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class OptionsContractGreeksRequest(Struct, omit_defaults=True):
11
+ tradable_product: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ tradable_product: str,
18
+ ):
19
+ return cls(
20
+ tradable_product,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"OptionsContractGreeksRequest(tradable_product={self.tradable_product})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return OptionsGreeks
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return OptionsGreeks
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.OptionsMarketdata/OptionsContractGreeks"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"
@@ -0,0 +1,40 @@
1
+ # generated by datamodel-codegen:
2
+ # filename: OptionsMarketdata/OptionsContractRequest.json
3
+
4
+ from __future__ import annotations
5
+ from architect_py.grpc.models.OptionsMarketdata.OptionsContract import OptionsContract
6
+
7
+ from msgspec import Struct
8
+
9
+
10
+ class OptionsContractRequest(Struct, omit_defaults=True):
11
+ tradable_product: str
12
+
13
+ # Constructor that takes all field titles as arguments for convenience
14
+ @classmethod
15
+ def new(
16
+ cls,
17
+ tradable_product: str,
18
+ ):
19
+ return cls(
20
+ tradable_product,
21
+ )
22
+
23
+ def __str__(self) -> str:
24
+ return f"OptionsContractRequest(tradable_product={self.tradable_product})"
25
+
26
+ @staticmethod
27
+ def get_response_type():
28
+ return OptionsContract
29
+
30
+ @staticmethod
31
+ def get_unannotated_response_type():
32
+ return OptionsContract
33
+
34
+ @staticmethod
35
+ def get_route() -> str:
36
+ return "/json.architect.OptionsMarketdata/OptionsContract"
37
+
38
+ @staticmethod
39
+ def get_rpc_method():
40
+ return "unary"