architect-py 5.0.0b1__py3-none-any.whl → 5.0.0b2__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.
- architect_py/__init__.py +10 -3
- architect_py/async_client.py +283 -169
- architect_py/client_interface.py +19 -18
- architect_py/common_types/order_dir.py +12 -6
- architect_py/graphql_client/__init__.py +2 -0
- architect_py/graphql_client/enums.py +5 -0
- architect_py/grpc/__init__.py +25 -7
- architect_py/grpc/client.py +13 -5
- architect_py/grpc/models/Accounts/AccountsRequest.py +4 -1
- architect_py/grpc/models/Algo/AlgoOrder.py +114 -0
- architect_py/grpc/models/Algo/{ModifyAlgoOrderRequestForTwapAlgo.py → AlgoOrderRequest.py} +11 -10
- architect_py/grpc/models/Algo/AlgoOrdersRequest.py +72 -0
- architect_py/grpc/models/Algo/AlgoOrdersResponse.py +27 -0
- architect_py/grpc/models/Algo/CreateAlgoOrderRequest.py +56 -0
- architect_py/grpc/models/Algo/PauseAlgoRequest.py +42 -0
- architect_py/grpc/models/Algo/PauseAlgoResponse.py +20 -0
- architect_py/grpc/models/Algo/StartAlgoRequest.py +42 -0
- architect_py/grpc/models/Algo/StartAlgoResponse.py +20 -0
- architect_py/grpc/models/Algo/StopAlgoRequest.py +42 -0
- architect_py/grpc/models/Algo/StopAlgoResponse.py +20 -0
- architect_py/grpc/models/Boss/DepositsRequest.py +40 -0
- architect_py/grpc/models/Boss/DepositsResponse.py +27 -0
- architect_py/grpc/models/Boss/RqdAccountStatisticsRequest.py +42 -0
- architect_py/grpc/models/Boss/RqdAccountStatisticsResponse.py +25 -0
- architect_py/grpc/models/Boss/StatementUrlRequest.py +40 -0
- architect_py/grpc/models/Boss/StatementUrlResponse.py +23 -0
- architect_py/grpc/models/Boss/StatementsRequest.py +40 -0
- architect_py/grpc/models/Boss/StatementsResponse.py +27 -0
- architect_py/grpc/models/Boss/WithdrawalsRequest.py +40 -0
- architect_py/grpc/models/Boss/WithdrawalsResponse.py +27 -0
- architect_py/grpc/models/Boss/__init__.py +2 -0
- architect_py/grpc/models/Folio/HistoricalFillsRequest.py +4 -1
- architect_py/grpc/models/Marketdata/L1BookSnapshot.py +16 -2
- architect_py/grpc/models/Oms/Cancel.py +67 -19
- architect_py/grpc/models/Oms/Order.py +4 -11
- architect_py/grpc/models/Oms/PlaceOrderRequest.py +13 -20
- architect_py/grpc/models/OptionsMarketdata/OptionsChain.py +30 -0
- architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeks.py +30 -0
- architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeksRequest.py +47 -0
- architect_py/grpc/models/OptionsMarketdata/OptionsChainRequest.py +45 -0
- architect_py/grpc/models/OptionsMarketdata/OptionsExpirations.py +29 -0
- architect_py/grpc/models/OptionsMarketdata/OptionsExpirationsRequest.py +42 -0
- architect_py/grpc/models/OptionsMarketdata/__init__.py +2 -0
- architect_py/grpc/models/Symbology/ExecutionInfoRequest.py +47 -0
- architect_py/grpc/models/Symbology/ExecutionInfoResponse.py +27 -0
- architect_py/grpc/models/definitions.py +457 -790
- architect_py/grpc/resolve_endpoint.py +4 -1
- architect_py/internal_utils/__init__.py +0 -0
- architect_py/internal_utils/no_pandas.py +3 -0
- architect_py/tests/conftest.py +11 -6
- architect_py/tests/test_marketdata.py +4 -4
- architect_py/tests/test_orderflow.py +31 -28
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b2.dist-info}/METADATA +2 -3
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b2.dist-info}/RECORD +72 -42
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b2.dist-info}/WHEEL +1 -1
- examples/book_subscription.py +2 -3
- examples/candles.py +3 -3
- examples/common.py +29 -20
- examples/external_cpty.py +4 -4
- examples/funding_rate_mean_reversion_algo.py +14 -20
- examples/order_sending.py +32 -33
- examples/stream_l1_marketdata.py +2 -2
- examples/stream_l2_marketdata.py +1 -3
- examples/trades.py +2 -2
- examples/tutorial_async.py +9 -7
- examples/tutorial_sync.py +5 -5
- scripts/generate_functions_md.py +3 -1
- scripts/generate_sync_interface.py +30 -11
- scripts/postprocess_grpc.py +21 -11
- scripts/preprocess_grpc_schema.py +174 -113
- architect_py/grpc/models/Algo/AlgoOrderForTwapAlgo.py +0 -61
- architect_py/grpc/models/Algo/CreateAlgoOrderRequestForTwapAlgo.py +0 -59
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b2.dist-info}/licenses/LICENSE +0 -0
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b2.dist-info}/top_level.txt +0 -0
architect_py/client_interface.py
CHANGED
@@ -13,17 +13,17 @@
|
|
13
13
|
from typing import Any, Union
|
14
14
|
from .graphql_client import *
|
15
15
|
from .async_client import *
|
16
|
-
|
17
|
-
|
16
|
+
from .grpc.models.definitions import *
|
18
17
|
class ClientProtocol:
|
19
|
-
def cancel_all_orders(self) -> bool: ...
|
20
|
-
def cancel_order(self, order_id: str) ->
|
18
|
+
def cancel_all_orders(self, account: Optional[str] = None, execution_venue: Optional[str] = None, trader: Optional[str] = None) -> bool: ...
|
19
|
+
def cancel_order(self, order_id: str) -> Cancel: ...
|
21
20
|
def core(self) -> GrpcClient: ...
|
22
21
|
def discover_marketdata(self) -> Any: ...
|
23
|
-
def
|
24
|
-
def
|
25
|
-
def
|
26
|
-
def
|
22
|
+
def enable_orderflow(self) -> Any: ...
|
23
|
+
def get_account_history(self, account: str, from_inclusive: Optional[datetime] = None, to_exclusive: Optional[datetime] = None) -> list[AccountSummary]: ...
|
24
|
+
def get_account_summaries(self, accounts: Optional[list[str]] = None, trader: Optional[str] = None) -> list[AccountSummary]: ...
|
25
|
+
def get_account_summary(self, account: str) -> AccountSummary: ...
|
26
|
+
def get_all_open_orders(self) -> list[Order]: ...
|
27
27
|
def get_cme_first_notice_date(self, symbol: str) -> Optional[date]: ...
|
28
28
|
def get_cme_future_from_root_month_year(self, root: str, month: int, year: int) -> str: ...
|
29
29
|
def get_cme_futures_series(self, series: str) -> list[tuple[date, str]]: ...
|
@@ -31,32 +31,33 @@ class ClientProtocol:
|
|
31
31
|
def get_execution_infos(self, symbols: Optional[list[TradableProduct]], execution_venue: Optional[str] = None) -> Sequence[ExecutionInfoFields]: ...
|
32
32
|
@staticmethod
|
33
33
|
def get_expiration_from_CME_name(name: str) -> Optional[date]: ...
|
34
|
-
def get_fills(self, from_inclusive: Optional[datetime] = None, to_exclusive: Optional[datetime] = None, venue: Optional[str] = None, account: Optional[str] = None, order_id: Optional[str] = None) ->
|
34
|
+
def get_fills(self, from_inclusive: Optional[datetime] = None, to_exclusive: Optional[datetime] = None, venue: Optional[str] = None, account: Optional[str] = None, order_id: Optional[str] = None, limit: Optional[int] = None) -> HistoricalFillsResponse: ...
|
35
|
+
def get_future_series(self, series_symbol: str) -> list[str]: ...
|
35
36
|
def get_futures_series(self, series_symbol: str) -> list[str]: ...
|
36
37
|
def get_historical_candles(self, symbol: Union[TradableProduct, str], venue: str, candle_width: CandleWidth, start: datetime, end: datetime, *, as_dataframe: bool = False) -> Union[list[Candle], pd.DataFrame]: ...
|
37
|
-
def get_historical_orders(self, order_ids: Optional[list[str]] = None, from_inclusive: Optional[datetime] = None, to_exclusive: Optional[datetime] = None, venue: Optional[str] = None, account: Optional[str] = None, parent_order_id: Optional[str] = None) ->
|
38
|
+
def get_historical_orders(self, order_ids: Optional[list[str]] = None, from_inclusive: Optional[datetime] = None, to_exclusive: Optional[datetime] = None, venue: Optional[str] = None, account: Optional[str] = None, parent_order_id: Optional[str] = None) -> list[Order]: ...
|
38
39
|
def get_l1_book_snapshot(self, symbol: Union[TradableProduct, str], venue: str) -> L1BookSnapshot: ...
|
39
40
|
def get_l1_book_snapshots(self, symbols: list[Union[TradableProduct, str]], venue: str) -> Sequence[L1BookSnapshot]: ...
|
40
41
|
def get_l2_book_snapshot(self, symbol: Union[TradableProduct, str], venue: str) -> L2BookSnapshot: ...
|
41
42
|
def get_market_snapshot(self, symbol: Union[TradableProduct, str], venue: str) -> L1BookSnapshot: ...
|
42
43
|
def get_market_snapshots(self, symbols: list[Union[TradableProduct, str]], venue: str) -> Sequence[L1BookSnapshot]: ...
|
43
44
|
def get_market_status(self, symbol: Union[TradableProduct, str], venue: str) -> MarketStatus: ...
|
44
|
-
def get_open_orders(self, order_ids: Optional[list[str]] = None, venue: Optional[str] = None, account: Optional[str] = None, trader: Optional[str] = None, symbol: Optional[str] = None, parent_order_id: Optional[str] = None) ->
|
45
|
-
def get_order(self, order_id: str) -> Optional[
|
46
|
-
def get_orders(self, order_ids: list[str]) -> list[Optional[
|
45
|
+
def get_open_orders(self, order_ids: Optional[list[str]] = None, venue: Optional[str] = None, account: Optional[str] = None, trader: Optional[str] = None, symbol: Optional[str] = None, parent_order_id: Optional[str] = None) -> list[Order]: ...
|
46
|
+
def get_order(self, order_id: str) -> Optional[Order]: ...
|
47
|
+
def get_orders(self, order_ids: list[str]) -> list[Optional[Order]]: ...
|
47
48
|
def get_product_info(self, symbol: str) -> Optional[ProductInfoFields]: ...
|
48
49
|
def get_product_infos(self, symbols: Optional[list[str]]) -> Sequence[ProductInfoFields]: ...
|
49
50
|
def get_ticker(self, symbol: Union[TradableProduct, str], venue: str) -> Ticker: ...
|
50
51
|
def hmart(self) -> GrpcClient: ...
|
51
|
-
def list_accounts(self) ->
|
52
|
+
def list_accounts(self) -> list[AccountWithPermissions]: ...
|
52
53
|
def list_symbols(self, *, marketdata: Optional[str] = None) -> list[str]: ...
|
53
54
|
def marketdata(self, venue: str) -> GrpcClient: ...
|
54
|
-
def
|
55
|
-
def place_limit_order(self, *, id: Optional[str] = None, symbol: Union[TradableProduct, str], execution_venue: Optional[str], odir: OrderDir, quantity: Decimal, limit_price: Decimal, order_type: OrderType = OrderType.LIMIT, time_in_force: TimeInForce = TimeInForce.DAY, good_til_date: Optional[datetime] = None, price_round_method: Optional[TickRoundMethod] = None, account: Optional[str] = None, trader: Optional[str] = None, post_only: bool = False, trigger_price: Optional[Decimal] = None) -> OrderFields: ...
|
55
|
+
def place_limit_order(self, *, id: Optional[str] = None, symbol: Union[TradableProduct, str], execution_venue: Optional[str] = None, dir: Optional[OrderDir] = None, quantity: Decimal, limit_price: Decimal, order_type: OrderType = OrderType.LIMIT, time_in_force: Union[GoodTilDate, TimeInForceEnum] = TimeInForceEnum.DAY, price_round_method: Optional[TickRoundMethod] = None, account: Optional[str] = None, trader: Optional[str] = None, post_only: bool = False, trigger_price: Optional[Decimal] = None, **kwargs: Any) -> Order: ...
|
56
56
|
def refresh_jwt(self, force: bool = False) -> Any: ...
|
57
57
|
def search_symbols(self, search_string: Optional[str] = None, execution_venue: Optional[str] = None, offset: int = 0, limit: int = 20) -> list[TradableProduct]: ...
|
58
|
-
def
|
58
|
+
def send_limit_order(self, *args: Any, **kwargs: Any) -> Order: ...
|
59
|
+
def send_market_pro_order(self, *, id: Optional[str] = None, symbol: Union[TradableProduct, str], execution_venue: str, odir: OrderDir, quantity: Decimal, time_in_force: Union[GoodTilDate, TimeInForceEnum] = TimeInForceEnum.DAY, account: Optional[str] = None, fraction_through_market: Decimal = Decimal('0.001')) -> Order: ...
|
59
60
|
def set_hmart(self, endpoint: str) -> Any: ...
|
60
61
|
def set_jwt(self, jwt: Optional[str], jwt_expiration: Optional[datetime] = None) -> Any: ...
|
61
62
|
def set_marketdata(self, venue: str, endpoint: str) -> Any: ...
|
62
|
-
def who_am_i(self) -> tuple[str, str]: ...
|
63
|
+
def who_am_i(self) -> tuple[str, str]: ...
|
@@ -6,22 +6,28 @@ class OrderDir(str, Enum):
|
|
6
6
|
BUY = "BUY"
|
7
7
|
SELL = "SELL"
|
8
8
|
|
9
|
-
def
|
9
|
+
def flip(self) -> "OrderDir":
|
10
|
+
"""
|
11
|
+
Returns the opposite direction.
|
12
|
+
"""
|
10
13
|
if self == OrderDir.BUY:
|
11
|
-
return
|
14
|
+
return OrderDir.SELL
|
12
15
|
elif self == OrderDir.SELL:
|
13
|
-
return
|
16
|
+
return OrderDir.BUY
|
14
17
|
else:
|
15
18
|
raise ValueError(f"Unknown Dir: {self}")
|
16
19
|
|
17
20
|
def get_opposite(self) -> "OrderDir":
|
18
21
|
"""
|
19
|
-
|
22
|
+
@deprecated(reason="Use flip instead")
|
20
23
|
"""
|
24
|
+
return self.flip()
|
25
|
+
|
26
|
+
def __int__(self):
|
21
27
|
if self == OrderDir.BUY:
|
22
|
-
return
|
28
|
+
return 1
|
23
29
|
elif self == OrderDir.SELL:
|
24
|
-
return
|
30
|
+
return -1
|
25
31
|
else:
|
26
32
|
raise ValueError(f"Unknown Dir: {self}")
|
27
33
|
|
@@ -20,6 +20,7 @@ from .enums import (
|
|
20
20
|
OrderSource,
|
21
21
|
OrderStatus,
|
22
22
|
OrderType,
|
23
|
+
PutOrCall,
|
23
24
|
SortTickersBy,
|
24
25
|
TimeInForce,
|
25
26
|
)
|
@@ -259,6 +260,7 @@ __all__ = [
|
|
259
260
|
"PlaceOrderMutationOmsPlaceOrder",
|
260
261
|
"ProductInfoFields",
|
261
262
|
"ProductInfoFieldsSpreadLegs",
|
263
|
+
"PutOrCall",
|
262
264
|
"SearchSymbolsQuery",
|
263
265
|
"SearchSymbolsQuerySymbology",
|
264
266
|
"SortTickersBy",
|
architect_py/grpc/__init__.py
CHANGED
@@ -12,10 +12,19 @@ from .models.Cpty.CptyStatus import CptyStatus
|
|
12
12
|
from .models.Cpty.CptyStatusRequest import CptyStatusRequest
|
13
13
|
from .models.definitions import (
|
14
14
|
Account,
|
15
|
+
AccountIdOrName,
|
15
16
|
AccountPosition,
|
16
17
|
AccountStatistics,
|
18
|
+
AccountWithPermissions,
|
17
19
|
CandleWidth,
|
18
20
|
L2BookDiff,
|
21
|
+
OrderId,
|
22
|
+
OrderSource,
|
23
|
+
OrderType,
|
24
|
+
SortTickersBy,
|
25
|
+
TimeInForce,
|
26
|
+
TimeInForceEnum,
|
27
|
+
TraderIdOrEmail,
|
19
28
|
)
|
20
29
|
from .models.Folio.AccountHistoryRequest import AccountHistoryRequest
|
21
30
|
from .models.Folio.AccountHistoryResponse import AccountHistoryResponse
|
@@ -66,11 +75,20 @@ from .resolve_endpoint import resolve_endpoint
|
|
66
75
|
|
67
76
|
__all__ = [
|
68
77
|
"Account",
|
78
|
+
"AccountHistoryRequest",
|
79
|
+
"AccountHistoryResponse",
|
80
|
+
"AccountIdOrName",
|
69
81
|
"AccountPosition",
|
70
82
|
"AccountStatistics",
|
71
83
|
"AccountsRequest",
|
72
84
|
"AccountsResponse",
|
85
|
+
"AccountSummaryRequest",
|
86
|
+
"AccountSummary",
|
87
|
+
"AccountSummariesRequest",
|
88
|
+
"AccountSummariesResponse",
|
89
|
+
"AccountWithPermissions",
|
73
90
|
"ArrayOfL1BookSnapshot",
|
91
|
+
"Candle",
|
74
92
|
"CandleWidth",
|
75
93
|
"CreateJwtRequest",
|
76
94
|
"CreateJwtResponse",
|
@@ -82,17 +100,10 @@ __all__ = [
|
|
82
100
|
"CptysResponse",
|
83
101
|
"CptyStatus",
|
84
102
|
"CptyStatusRequest",
|
85
|
-
"AccountHistoryRequest",
|
86
|
-
"AccountHistoryResponse",
|
87
|
-
"AccountSummaryRequest",
|
88
|
-
"AccountSummary",
|
89
|
-
"AccountSummariesRequest",
|
90
|
-
"AccountSummariesResponse",
|
91
103
|
"HistoricalFillsRequest",
|
92
104
|
"HistoricalFillsResponse",
|
93
105
|
"HistoricalOrdersRequest",
|
94
106
|
"HistoricalOrdersResponse",
|
95
|
-
"Candle",
|
96
107
|
"HistoricalCandlesRequest",
|
97
108
|
"HistoricalCandlesResponse",
|
98
109
|
"L1BookSnapshot",
|
@@ -105,6 +116,10 @@ __all__ = [
|
|
105
116
|
"Liquidation",
|
106
117
|
"MarketStatus",
|
107
118
|
"MarketStatusRequest",
|
119
|
+
"OrderId",
|
120
|
+
"OrderSource",
|
121
|
+
"OrderType",
|
122
|
+
"SortTickersBy",
|
108
123
|
"SubscribeCandlesRequest",
|
109
124
|
"SubscribeCurrentCandlesRequest",
|
110
125
|
"SubscribeL1BookSnapshotsRequest",
|
@@ -118,7 +133,10 @@ __all__ = [
|
|
118
133
|
"TickersRequest",
|
119
134
|
"TickersResponse",
|
120
135
|
"TickerUpdate",
|
136
|
+
"TimeInForce",
|
137
|
+
"TimeInForceEnum",
|
121
138
|
"Trade",
|
139
|
+
"TraderIdOrEmail",
|
122
140
|
"resolve_endpoint",
|
123
141
|
"SymbolsRequest",
|
124
142
|
"SymbolsResponse",
|
architect_py/grpc/client.py
CHANGED
@@ -51,14 +51,17 @@ class GrpcClient:
|
|
51
51
|
decoder: msgspec.json.Decoder[ResponseTypeGeneric] = self.get_decoder(
|
52
52
|
request.get_unannotated_response_type()
|
53
53
|
)
|
54
|
-
stub
|
54
|
+
stub: grpc.aio.UnaryUnaryMultiCallable[
|
55
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
56
|
+
] = self.channel.unary_unary(
|
55
57
|
request.get_route(),
|
56
58
|
request_serializer=encoder.encode,
|
57
59
|
response_deserializer=decoder.decode,
|
58
60
|
)
|
59
|
-
metadata = ()
|
60
61
|
if self.jwt is not None:
|
61
62
|
metadata = (("authorization", f"Bearer {self.jwt}"),)
|
63
|
+
else:
|
64
|
+
metadata = ()
|
62
65
|
return await stub(request, metadata=metadata)
|
63
66
|
|
64
67
|
async def unary_stream(
|
@@ -73,14 +76,19 @@ class GrpcClient:
|
|
73
76
|
decoder: msgspec.json.Decoder[ResponseTypeGeneric] = self.get_decoder(
|
74
77
|
request.get_unannotated_response_type()
|
75
78
|
)
|
76
|
-
stub
|
79
|
+
stub: grpc.aio.UnaryStreamMultiCallable[
|
80
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
81
|
+
] = self.channel.unary_stream(
|
77
82
|
request.get_route(),
|
78
83
|
request_serializer=encoder.encode,
|
79
84
|
response_deserializer=decoder.decode,
|
80
85
|
)
|
81
|
-
metadata = ()
|
82
86
|
if self.jwt is not None:
|
83
87
|
metadata = (("authorization", f"Bearer {self.jwt}"),)
|
84
|
-
|
88
|
+
else:
|
89
|
+
metadata = ()
|
90
|
+
call: grpc.aio._base_call.UnaryStreamCall[
|
91
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
92
|
+
] = stub(request, metadata=metadata)
|
85
93
|
async for update in call:
|
86
94
|
yield update
|
@@ -12,6 +12,7 @@ from .. import definitions
|
|
12
12
|
|
13
13
|
|
14
14
|
class AccountsRequest(Struct, omit_defaults=True):
|
15
|
+
paper: Optional[bool] = False
|
15
16
|
trader: Optional[
|
16
17
|
Annotated[
|
17
18
|
Optional[definitions.TraderIdOrEmail],
|
@@ -28,14 +29,16 @@ class AccountsRequest(Struct, omit_defaults=True):
|
|
28
29
|
@classmethod
|
29
30
|
def new(
|
30
31
|
cls,
|
32
|
+
paper: Optional[bool] = False,
|
31
33
|
trader: Optional[definitions.TraderIdOrEmail] = None,
|
32
34
|
):
|
33
35
|
return cls(
|
36
|
+
paper,
|
34
37
|
trader,
|
35
38
|
)
|
36
39
|
|
37
40
|
def __str__(self) -> str:
|
38
|
-
return f"AccountsRequest(trader={self.trader})"
|
41
|
+
return f"AccountsRequest(paper={self.paper},trader={self.trader})"
|
39
42
|
|
40
43
|
@staticmethod
|
41
44
|
def get_response_type():
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/AlgoOrder.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from datetime import datetime
|
7
|
+
from typing import Annotated, Any, List, Optional
|
8
|
+
|
9
|
+
from msgspec import Meta, Struct
|
10
|
+
|
11
|
+
from .. import definitions
|
12
|
+
|
13
|
+
|
14
|
+
class AlgoOrder(Struct, omit_defaults=True):
|
15
|
+
algo: str
|
16
|
+
create_time: datetime
|
17
|
+
id: definitions.OrderId
|
18
|
+
num_errors: Annotated[int, Meta(ge=0)]
|
19
|
+
num_open_orders: Annotated[int, Meta(ge=0)]
|
20
|
+
num_rejects: Annotated[int, Meta(ge=0)]
|
21
|
+
num_sent_orders: Annotated[int, Meta(ge=0)]
|
22
|
+
params: Any
|
23
|
+
status: definitions.AlgoOrderStatus
|
24
|
+
status_details: Any
|
25
|
+
trader: definitions.UserId
|
26
|
+
display_symbols: Optional[List[str]] = None
|
27
|
+
finish_success: Optional[
|
28
|
+
Annotated[
|
29
|
+
Optional[bool],
|
30
|
+
Meta(
|
31
|
+
description="If the algo order is stopped, whether the stop was successful."
|
32
|
+
),
|
33
|
+
]
|
34
|
+
] = None
|
35
|
+
"""
|
36
|
+
If the algo order is stopped, whether the stop was successful.
|
37
|
+
"""
|
38
|
+
finish_time: Optional[
|
39
|
+
Annotated[
|
40
|
+
Optional[datetime],
|
41
|
+
Meta(
|
42
|
+
description="If the algo order is stopped, the time at which it was stopped."
|
43
|
+
),
|
44
|
+
]
|
45
|
+
] = None
|
46
|
+
"""
|
47
|
+
If the algo order is stopped, the time at which it was stopped.
|
48
|
+
"""
|
49
|
+
parent_id: Optional[definitions.OrderId] = None
|
50
|
+
reject_or_error_reason: Optional[
|
51
|
+
Annotated[
|
52
|
+
Optional[str],
|
53
|
+
Meta(
|
54
|
+
description="If algo order status is rejected, contains the reject reason; for algo orders that finished unsuccessfully, contains the error reason."
|
55
|
+
),
|
56
|
+
]
|
57
|
+
] = None
|
58
|
+
"""
|
59
|
+
If algo order status is rejected, contains the reject reason; for algo orders that finished unsuccessfully, contains the error reason.
|
60
|
+
"""
|
61
|
+
working_progress: Optional[
|
62
|
+
Annotated[
|
63
|
+
Optional[float],
|
64
|
+
Meta(description="Progress of the algo, 0.0 to 1.0, if computable"),
|
65
|
+
]
|
66
|
+
] = None
|
67
|
+
"""
|
68
|
+
Progress of the algo, 0.0 to 1.0, if computable
|
69
|
+
"""
|
70
|
+
|
71
|
+
# Constructor that takes all field titles as arguments for convenience
|
72
|
+
@classmethod
|
73
|
+
def new(
|
74
|
+
cls,
|
75
|
+
algo: str,
|
76
|
+
create_time: datetime,
|
77
|
+
id: definitions.OrderId,
|
78
|
+
num_errors: int,
|
79
|
+
num_open_orders: int,
|
80
|
+
num_rejects: int,
|
81
|
+
num_sent_orders: int,
|
82
|
+
params: Any,
|
83
|
+
status: definitions.AlgoOrderStatus,
|
84
|
+
status_details: Any,
|
85
|
+
trader: definitions.UserId,
|
86
|
+
display_symbols: Optional[List[str]] = None,
|
87
|
+
finish_success: Optional[bool] = None,
|
88
|
+
finish_time: Optional[datetime] = None,
|
89
|
+
parent_id: Optional[definitions.OrderId] = None,
|
90
|
+
reject_or_error_reason: Optional[str] = None,
|
91
|
+
working_progress: Optional[float] = None,
|
92
|
+
):
|
93
|
+
return cls(
|
94
|
+
algo,
|
95
|
+
create_time,
|
96
|
+
id,
|
97
|
+
num_errors,
|
98
|
+
num_open_orders,
|
99
|
+
num_rejects,
|
100
|
+
num_sent_orders,
|
101
|
+
params,
|
102
|
+
status,
|
103
|
+
status_details,
|
104
|
+
trader,
|
105
|
+
display_symbols,
|
106
|
+
finish_success,
|
107
|
+
finish_time,
|
108
|
+
parent_id,
|
109
|
+
reject_or_error_reason,
|
110
|
+
working_progress,
|
111
|
+
)
|
112
|
+
|
113
|
+
def __str__(self) -> str:
|
114
|
+
return f"AlgoOrder(algo={self.algo},create_time={self.create_time},id={self.id},num_errors={self.num_errors},num_open_orders={self.num_open_orders},num_rejects={self.num_rejects},num_sent_orders={self.num_sent_orders},params={self.params},status={self.status},status_details={self.status_details},trader={self.trader},display_symbols={self.display_symbols},finish_success={self.finish_success},finish_time={self.finish_time},parent_id={self.parent_id},reject_or_error_reason={self.reject_or_error_reason},working_progress={self.working_progress})"
|
@@ -1,44 +1,45 @@
|
|
1
1
|
# generated by datamodel-codegen:
|
2
|
-
# filename: Algo/
|
2
|
+
# filename: Algo/AlgoOrderRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.grpc.models.Algo.
|
5
|
+
from architect_py.grpc.models.Algo.AlgoOrder import AlgoOrder
|
6
6
|
|
7
7
|
from msgspec import Struct
|
8
8
|
|
9
9
|
from .. import definitions
|
10
10
|
|
11
11
|
|
12
|
-
class
|
12
|
+
class AlgoOrderRequest(Struct, omit_defaults=True):
|
13
|
+
"""
|
14
|
+
Get generic algo run status
|
15
|
+
"""
|
16
|
+
|
13
17
|
algo_order_id: definitions.OrderId
|
14
|
-
params: definitions.TwapParams
|
15
18
|
|
16
19
|
# Constructor that takes all field titles as arguments for convenience
|
17
20
|
@classmethod
|
18
21
|
def new(
|
19
22
|
cls,
|
20
23
|
algo_order_id: definitions.OrderId,
|
21
|
-
params: definitions.TwapParams,
|
22
24
|
):
|
23
25
|
return cls(
|
24
26
|
algo_order_id,
|
25
|
-
params,
|
26
27
|
)
|
27
28
|
|
28
29
|
def __str__(self) -> str:
|
29
|
-
return f"
|
30
|
+
return f"AlgoOrderRequest(algo_order_id={self.algo_order_id})"
|
30
31
|
|
31
32
|
@staticmethod
|
32
33
|
def get_response_type():
|
33
|
-
return
|
34
|
+
return AlgoOrder
|
34
35
|
|
35
36
|
@staticmethod
|
36
37
|
def get_unannotated_response_type():
|
37
|
-
return
|
38
|
+
return AlgoOrder
|
38
39
|
|
39
40
|
@staticmethod
|
40
41
|
def get_route() -> str:
|
41
|
-
return "/json.architect.Algo/
|
42
|
+
return "/json.architect.Algo/AlgoOrder"
|
42
43
|
|
43
44
|
@staticmethod
|
44
45
|
def get_rpc_method():
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/AlgoOrdersRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.AlgoOrdersResponse import AlgoOrdersResponse
|
6
|
+
|
7
|
+
from datetime import datetime
|
8
|
+
from typing import List, Optional
|
9
|
+
|
10
|
+
from msgspec import Struct
|
11
|
+
|
12
|
+
from .. import definitions
|
13
|
+
|
14
|
+
|
15
|
+
class AlgoOrdersRequest(Struct, omit_defaults=True):
|
16
|
+
"""
|
17
|
+
Find all algo orders matching the given criteria.
|
18
|
+
|
19
|
+
If limit is not specified, it will default to 100.
|
20
|
+
"""
|
21
|
+
|
22
|
+
algo: Optional[str] = None
|
23
|
+
display_symbol: Optional[str] = None
|
24
|
+
from_inclusive: Optional[datetime] = None
|
25
|
+
limit: Optional[int] = None
|
26
|
+
parent_order_id: Optional[definitions.OrderId] = None
|
27
|
+
status: Optional[List[definitions.AlgoOrderStatus]] = None
|
28
|
+
to_exclusive: Optional[datetime] = None
|
29
|
+
trader: Optional[definitions.TraderIdOrEmail] = None
|
30
|
+
|
31
|
+
# Constructor that takes all field titles as arguments for convenience
|
32
|
+
@classmethod
|
33
|
+
def new(
|
34
|
+
cls,
|
35
|
+
algo: Optional[str] = None,
|
36
|
+
display_symbol: Optional[str] = None,
|
37
|
+
from_inclusive: Optional[datetime] = None,
|
38
|
+
limit: Optional[int] = None,
|
39
|
+
parent_order_id: Optional[definitions.OrderId] = None,
|
40
|
+
status: Optional[List[definitions.AlgoOrderStatus]] = None,
|
41
|
+
to_exclusive: Optional[datetime] = None,
|
42
|
+
trader: Optional[definitions.TraderIdOrEmail] = None,
|
43
|
+
):
|
44
|
+
return cls(
|
45
|
+
algo,
|
46
|
+
display_symbol,
|
47
|
+
from_inclusive,
|
48
|
+
limit,
|
49
|
+
parent_order_id,
|
50
|
+
status,
|
51
|
+
to_exclusive,
|
52
|
+
trader,
|
53
|
+
)
|
54
|
+
|
55
|
+
def __str__(self) -> str:
|
56
|
+
return f"AlgoOrdersRequest(algo={self.algo},display_symbol={self.display_symbol},from_inclusive={self.from_inclusive},limit={self.limit},parent_order_id={self.parent_order_id},status={self.status},to_exclusive={self.to_exclusive},trader={self.trader})"
|
57
|
+
|
58
|
+
@staticmethod
|
59
|
+
def get_response_type():
|
60
|
+
return AlgoOrdersResponse
|
61
|
+
|
62
|
+
@staticmethod
|
63
|
+
def get_unannotated_response_type():
|
64
|
+
return AlgoOrdersResponse
|
65
|
+
|
66
|
+
@staticmethod
|
67
|
+
def get_route() -> str:
|
68
|
+
return "/json.architect.Algo/AlgoOrders"
|
69
|
+
|
70
|
+
@staticmethod
|
71
|
+
def get_rpc_method():
|
72
|
+
return "unary"
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/AlgoOrdersResponse.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from typing import List
|
7
|
+
|
8
|
+
from msgspec import Struct
|
9
|
+
|
10
|
+
from .AlgoOrder import AlgoOrder
|
11
|
+
|
12
|
+
|
13
|
+
class AlgoOrdersResponse(Struct, omit_defaults=True):
|
14
|
+
algo_orders: List[AlgoOrder]
|
15
|
+
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
|
+
@classmethod
|
18
|
+
def new(
|
19
|
+
cls,
|
20
|
+
algo_orders: List[AlgoOrder],
|
21
|
+
):
|
22
|
+
return cls(
|
23
|
+
algo_orders,
|
24
|
+
)
|
25
|
+
|
26
|
+
def __str__(self) -> str:
|
27
|
+
return f"AlgoOrdersResponse(algo_orders={self.algo_orders})"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/CreateAlgoOrderRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.AlgoOrder import AlgoOrder
|
6
|
+
|
7
|
+
from typing import Any, Optional
|
8
|
+
|
9
|
+
from msgspec import Struct
|
10
|
+
|
11
|
+
from .. import definitions
|
12
|
+
|
13
|
+
|
14
|
+
class CreateAlgoOrderRequest(Struct, omit_defaults=True):
|
15
|
+
algo: str
|
16
|
+
params: Any
|
17
|
+
id: Optional[definitions.OrderId] = None
|
18
|
+
parent_id: Optional[definitions.OrderId] = None
|
19
|
+
trader: Optional[definitions.TraderIdOrEmail] = None
|
20
|
+
|
21
|
+
# Constructor that takes all field titles as arguments for convenience
|
22
|
+
@classmethod
|
23
|
+
def new(
|
24
|
+
cls,
|
25
|
+
algo: str,
|
26
|
+
params: Any,
|
27
|
+
id: Optional[definitions.OrderId] = None,
|
28
|
+
parent_id: Optional[definitions.OrderId] = None,
|
29
|
+
trader: Optional[definitions.TraderIdOrEmail] = None,
|
30
|
+
):
|
31
|
+
return cls(
|
32
|
+
algo,
|
33
|
+
params,
|
34
|
+
id,
|
35
|
+
parent_id,
|
36
|
+
trader,
|
37
|
+
)
|
38
|
+
|
39
|
+
def __str__(self) -> str:
|
40
|
+
return f"CreateAlgoOrderRequest(algo={self.algo},params={self.params},id={self.id},parent_id={self.parent_id},trader={self.trader})"
|
41
|
+
|
42
|
+
@staticmethod
|
43
|
+
def get_response_type():
|
44
|
+
return AlgoOrder
|
45
|
+
|
46
|
+
@staticmethod
|
47
|
+
def get_unannotated_response_type():
|
48
|
+
return AlgoOrder
|
49
|
+
|
50
|
+
@staticmethod
|
51
|
+
def get_route() -> str:
|
52
|
+
return "/json.architect.Algo/CreateAlgoOrder"
|
53
|
+
|
54
|
+
@staticmethod
|
55
|
+
def get_rpc_method():
|
56
|
+
return "unary"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/PauseAlgoRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.PauseAlgoResponse import PauseAlgoResponse
|
6
|
+
|
7
|
+
from msgspec import Struct
|
8
|
+
|
9
|
+
from .. import definitions
|
10
|
+
|
11
|
+
|
12
|
+
class PauseAlgoRequest(Struct, omit_defaults=True):
|
13
|
+
algo_order_id: definitions.OrderId
|
14
|
+
|
15
|
+
# Constructor that takes all field titles as arguments for convenience
|
16
|
+
@classmethod
|
17
|
+
def new(
|
18
|
+
cls,
|
19
|
+
algo_order_id: definitions.OrderId,
|
20
|
+
):
|
21
|
+
return cls(
|
22
|
+
algo_order_id,
|
23
|
+
)
|
24
|
+
|
25
|
+
def __str__(self) -> str:
|
26
|
+
return f"PauseAlgoRequest(algo_order_id={self.algo_order_id})"
|
27
|
+
|
28
|
+
@staticmethod
|
29
|
+
def get_response_type():
|
30
|
+
return PauseAlgoResponse
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def get_unannotated_response_type():
|
34
|
+
return PauseAlgoResponse
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def get_route() -> str:
|
38
|
+
return "/json.architect.Algo/PauseAlgo"
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def get_rpc_method():
|
42
|
+
return "unary"
|