architect-py 3.2.1__py3-none-any.whl → 5.0.0__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 +18 -2
- architect_py/async_client.py +1089 -658
- architect_py/client.py +36 -33
- architect_py/client_interface.py +63 -0
- architect_py/common_types/__init__.py +6 -0
- architect_py/common_types/order_dir.py +91 -0
- architect_py/common_types/scalars.py +25 -0
- architect_py/common_types/tradable_product.py +59 -0
- architect_py/graphql_client/__init__.py +2 -0
- architect_py/graphql_client/client.py +3 -6
- architect_py/graphql_client/enums.py +5 -0
- architect_py/graphql_client/fragments.py +3 -6
- architect_py/graphql_client/get_fills_query.py +2 -1
- architect_py/graphql_client/search_symbols_query.py +2 -1
- architect_py/graphql_client/subscribe_orderflow.py +2 -1
- architect_py/graphql_client/subscribe_trades.py +2 -1
- architect_py/grpc/__init__.py +145 -0
- architect_py/grpc/client.py +94 -0
- architect_py/{grpc_client → grpc/models}/Accounts/AccountsRequest.py +6 -3
- architect_py/{grpc_client → grpc/models}/Accounts/AccountsResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Accounts/__init__.py +1 -1
- architect_py/grpc/models/Algo/AlgoOrder.py +114 -0
- architect_py/grpc/models/Algo/AlgoOrderRequest.py +46 -0
- 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_client → grpc/models}/Algo/__init__.py +1 -1
- architect_py/grpc/models/Auth/CreateJwtRequest.py +47 -0
- architect_py/grpc/models/Auth/CreateJwtResponse.py +23 -0
- architect_py/{grpc_client/Cpty → grpc/models/Auth}/__init__.py +1 -1
- 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_client/Folio → grpc/models/Boss}/__init__.py +1 -1
- architect_py/grpc/models/Core/ConfigRequest.py +37 -0
- architect_py/grpc/models/Core/ConfigResponse.py +25 -0
- architect_py/grpc/models/Core/__init__.py +2 -0
- architect_py/{grpc_client → grpc/models}/Cpty/CptyRequest.py +5 -4
- architect_py/{grpc_client → grpc/models}/Cpty/CptyResponse.py +6 -6
- architect_py/grpc/models/Cpty/CptyStatus.py +48 -0
- architect_py/grpc/models/Cpty/CptyStatusRequest.py +45 -0
- architect_py/grpc/models/Cpty/CptysRequest.py +37 -0
- architect_py/grpc/models/Cpty/CptysResponse.py +27 -0
- architect_py/grpc/models/Cpty/__init__.py +2 -0
- architect_py/{grpc_client → grpc/models}/Folio/AccountHistoryRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Folio/AccountHistoryResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Folio/AccountSummariesRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Folio/AccountSummariesResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Folio/AccountSummary.py +1 -1
- architect_py/{grpc_client → grpc/models}/Folio/AccountSummaryRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Folio/HistoricalFillsRequest.py +7 -4
- architect_py/{grpc_client → grpc/models}/Folio/HistoricalFillsResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Folio/HistoricalOrdersRequest.py +3 -3
- architect_py/{grpc_client → grpc/models}/Folio/HistoricalOrdersResponse.py +1 -1
- architect_py/grpc/models/Folio/__init__.py +2 -0
- architect_py/{grpc_client → grpc/models}/Health/HealthCheckRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Health/HealthCheckResponse.py +1 -1
- architect_py/grpc/models/Health/__init__.py +2 -0
- architect_py/{grpc_client → grpc/models}/Marketdata/Candle.py +1 -1
- architect_py/{grpc_client → grpc/models}/Marketdata/HistoricalCandlesRequest.py +11 -8
- architect_py/{grpc_client → grpc/models}/Marketdata/HistoricalCandlesResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Marketdata/L1BookSnapshot.py +52 -5
- architect_py/{grpc_client → grpc/models}/Marketdata/L1BookSnapshotRequest.py +8 -3
- architect_py/{grpc_client → grpc/models}/Marketdata/L1BookSnapshotsRequest.py +6 -3
- architect_py/{grpc_client → grpc/models}/Marketdata/L2BookSnapshot.py +1 -1
- architect_py/{grpc_client → grpc/models}/Marketdata/L2BookSnapshotRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/Liquidation.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/MarketStatus.py +1 -1
- architect_py/{grpc_client → grpc/models}/Marketdata/MarketStatusRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeCandlesRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeCurrentCandlesRequest.py +3 -4
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeL1BookSnapshotsRequest.py +6 -3
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeL2BookUpdatesRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeLiquidationsRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeManyCandlesRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeTickersRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/SubscribeTradesRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/Ticker.py +14 -3
- architect_py/{grpc_client → grpc/models}/Marketdata/TickerRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/TickersRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Marketdata/TickersResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Marketdata/Trade.py +2 -2
- architect_py/grpc/models/Marketdata/__init__.py +2 -0
- architect_py/grpc/models/Oms/Cancel.py +90 -0
- architect_py/{grpc_client → grpc/models}/Oms/CancelAllOrdersRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Oms/CancelAllOrdersResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Oms/CancelOrderRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Oms/OpenOrdersRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Oms/OpenOrdersResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Oms/Order.py +6 -13
- architect_py/{grpc_client → grpc/models}/Oms/PendingCancelsRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Oms/PendingCancelsResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Oms/PlaceOrderRequest.py +16 -23
- architect_py/grpc/models/Oms/__init__.py +2 -0
- 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_client → grpc/models}/Orderflow/DropcopyRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Orderflow/OrderflowRequest.py +2 -1
- architect_py/{grpc_client → grpc/models}/Orderflow/SubscribeOrderflowRequest.py +2 -2
- architect_py/grpc/models/Orderflow/__init__.py +2 -0
- architect_py/grpc/models/Symbology/DownloadProductCatalogRequest.py +42 -0
- architect_py/grpc/models/Symbology/DownloadProductCatalogResponse.py +27 -0
- architect_py/grpc/models/Symbology/ExecutionInfoRequest.py +47 -0
- architect_py/grpc/models/Symbology/ExecutionInfoResponse.py +27 -0
- architect_py/{grpc_client → grpc/models}/Symbology/PruneExpiredSymbolsRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Symbology/PruneExpiredSymbolsResponse.py +1 -1
- architect_py/{grpc_client → grpc/models}/Symbology/SubscribeSymbology.py +1 -1
- architect_py/{grpc_client → grpc/models}/Symbology/SymbologyRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Symbology/SymbologySnapshot.py +7 -2
- architect_py/{grpc_client → grpc/models}/Symbology/SymbologyUpdate.py +9 -2
- architect_py/{grpc_client → grpc/models}/Symbology/SymbolsRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Symbology/SymbolsResponse.py +1 -1
- architect_py/grpc/models/Symbology/UploadProductCatalogRequest.py +49 -0
- architect_py/grpc/models/Symbology/UploadProductCatalogResponse.py +20 -0
- architect_py/{grpc_client → grpc/models}/Symbology/UploadSymbologyRequest.py +2 -2
- architect_py/{grpc_client → grpc/models}/Symbology/UploadSymbologyResponse.py +1 -1
- architect_py/grpc/models/Symbology/__init__.py +2 -0
- architect_py/grpc/models/__init__.py +2 -0
- architect_py/{grpc_client → grpc/models}/definitions.py +671 -934
- architect_py/grpc/resolve_endpoint.py +70 -0
- architect_py/{grpc_client/grpc_server.py → grpc/server.py} +13 -9
- architect_py/grpc/utils.py +32 -0
- architect_py/internal_utils/__init__.py +0 -0
- architect_py/internal_utils/no_pandas.py +3 -0
- architect_py/tests/conftest.py +91 -85
- architect_py/tests/test_book_building.py +49 -50
- architect_py/tests/test_marketdata.py +168 -0
- architect_py/tests/test_order_entry.py +37 -0
- architect_py/tests/test_orderflow.py +41 -0
- architect_py/tests/test_portfolio_management.py +23 -0
- architect_py/tests/test_rounding.py +28 -28
- architect_py/tests/test_symbology.py +37 -30
- architect_py/utils/nearest_tick.py +2 -5
- architect_py/utils/nearest_tick_2.py +1 -2
- architect_py/utils/orderbook.py +35 -0
- architect_py/utils/pandas.py +44 -0
- architect_py/utils/price_bands.py +0 -3
- architect_py/utils/symbol_parsing.py +29 -0
- architect_py-5.0.0.dist-info/METADATA +54 -0
- architect_py-5.0.0.dist-info/RECORD +214 -0
- {architect_py-3.2.1.dist-info → architect_py-5.0.0.dist-info}/WHEEL +2 -1
- architect_py-5.0.0.dist-info/top_level.txt +4 -0
- examples/__init__.py +0 -0
- examples/book_subscription.py +52 -0
- examples/candles.py +30 -0
- examples/common.py +116 -0
- examples/external_cpty.py +77 -0
- examples/funding_rate_mean_reversion_algo.py +186 -0
- examples/order_sending.py +91 -0
- examples/stream_l1_marketdata.py +25 -0
- examples/stream_l2_marketdata.py +38 -0
- examples/trades.py +21 -0
- examples/tutorial_async.py +86 -0
- examples/tutorial_sync.py +95 -0
- scripts/generate_functions_md.py +166 -0
- scripts/generate_sync_interface.py +226 -0
- scripts/postprocess_grpc.py +604 -0
- scripts/preprocess_grpc_schema.py +708 -0
- templates/exceptions.py +83 -0
- templates/juniper_base_client.py +371 -0
- architect_py/client_protocol.py +0 -52
- architect_py/grpc_client/Algo/AlgoOrderForTwapAlgo.py +0 -61
- architect_py/grpc_client/Algo/CreateAlgoOrderRequestForTwapAlgo.py +0 -59
- architect_py/grpc_client/Algo/ModifyAlgoOrderRequestForTwapAlgo.py +0 -45
- architect_py/grpc_client/Folio/AggregatedAccountSummariesRequest.py +0 -59
- architect_py/grpc_client/Folio/AggregatedAccountSummariesResponse.py +0 -27
- architect_py/grpc_client/Health/__init__.py +0 -2
- architect_py/grpc_client/Marketdata/__init__.py +0 -2
- architect_py/grpc_client/Oms/Cancel.py +0 -42
- architect_py/grpc_client/Oms/__init__.py +0 -2
- architect_py/grpc_client/Orderflow/__init__.py +0 -2
- architect_py/grpc_client/Symbology/__init__.py +0 -2
- architect_py/grpc_client/__init__.py +0 -2
- architect_py/grpc_client/grpc_client.py +0 -405
- architect_py/scalars.py +0 -172
- architect_py/tests/test_accounts.py +0 -31
- architect_py/tests/test_client.py +0 -29
- architect_py/tests/test_grpc_client.py +0 -30
- architect_py/tests/test_order_sending.py +0 -61
- architect_py/tests/test_snapshots.py +0 -52
- architect_py/tests/test_subscriptions.py +0 -129
- architect_py-3.2.1.dist-info/METADATA +0 -212
- architect_py-3.2.1.dist-info/RECORD +0 -146
- /architect_py/{grpc_client → grpc/models}/Marketdata/ArrayOfL1BookSnapshot.py +0 -0
- /architect_py/{grpc_client → grpc/models}/Marketdata/L2BookUpdate.py +0 -0
- /architect_py/{grpc_client → grpc/models}/Marketdata/TickerUpdate.py +0 -0
- /architect_py/{grpc_client → grpc/models}/Orderflow/Dropcopy.py +0 -0
- /architect_py/{grpc_client → grpc/models}/Orderflow/Orderflow.py +0 -0
- {architect_py-3.2.1.dist-info → architect_py-5.0.0.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,94 @@
|
|
1
|
+
from types import UnionType
|
2
|
+
from typing import AsyncIterator
|
3
|
+
|
4
|
+
import grpc
|
5
|
+
import msgspec
|
6
|
+
|
7
|
+
from . import *
|
8
|
+
from .utils import RequestType, ResponseTypeGeneric, decoders, encoder
|
9
|
+
|
10
|
+
|
11
|
+
class GrpcClient:
|
12
|
+
endpoint: str
|
13
|
+
channel: grpc.aio.Channel
|
14
|
+
jwt: str | None = None
|
15
|
+
|
16
|
+
def __init__(self, *, host: str, port: int, use_ssl: bool = False):
|
17
|
+
scheme = "https" if use_ssl else "http"
|
18
|
+
self.endpoint = f"{scheme}://{host}:{port}"
|
19
|
+
if use_ssl:
|
20
|
+
credentials = grpc.ssl_channel_credentials()
|
21
|
+
self.channel = grpc.aio.secure_channel(f"{host}:{port}", credentials)
|
22
|
+
else:
|
23
|
+
self.channel = grpc.aio.insecure_channel(f"{host}:{port}")
|
24
|
+
|
25
|
+
def set_jwt(self, jwt: str | None):
|
26
|
+
self.jwt = jwt
|
27
|
+
|
28
|
+
@staticmethod
|
29
|
+
def encoder() -> msgspec.json.Encoder:
|
30
|
+
return encoder
|
31
|
+
|
32
|
+
def get_decoder(
|
33
|
+
self, response_type: type[ResponseTypeGeneric] | UnionType
|
34
|
+
) -> msgspec.json.Decoder:
|
35
|
+
try:
|
36
|
+
return decoders[response_type]
|
37
|
+
except KeyError:
|
38
|
+
decoder = msgspec.json.Decoder(type=response_type)
|
39
|
+
decoders[response_type] = decoder
|
40
|
+
return decoder
|
41
|
+
|
42
|
+
async def unary_unary(
|
43
|
+
self,
|
44
|
+
request: RequestType[ResponseTypeGeneric],
|
45
|
+
) -> ResponseTypeGeneric:
|
46
|
+
"""
|
47
|
+
Generic function for making a unary RPC call to the gRPC server.
|
48
|
+
|
49
|
+
NB: request_type and ResponseTypeGeneric *cannot* be union types
|
50
|
+
"""
|
51
|
+
decoder: msgspec.json.Decoder[ResponseTypeGeneric] = self.get_decoder(
|
52
|
+
request.get_unannotated_response_type()
|
53
|
+
)
|
54
|
+
stub: grpc.aio.UnaryUnaryMultiCallable[
|
55
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
56
|
+
] = self.channel.unary_unary(
|
57
|
+
request.get_route(),
|
58
|
+
request_serializer=encoder.encode,
|
59
|
+
response_deserializer=decoder.decode,
|
60
|
+
)
|
61
|
+
if self.jwt is not None:
|
62
|
+
metadata = (("authorization", f"Bearer {self.jwt}"),)
|
63
|
+
else:
|
64
|
+
metadata = ()
|
65
|
+
return await stub(request, metadata=metadata)
|
66
|
+
|
67
|
+
async def unary_stream(
|
68
|
+
self,
|
69
|
+
request: RequestType[ResponseTypeGeneric],
|
70
|
+
) -> AsyncIterator[ResponseTypeGeneric]:
|
71
|
+
"""
|
72
|
+
Generic function for subscribing to a stream of updates from the gRPC server.
|
73
|
+
|
74
|
+
NB: request_type and ResponseTypeGeneric *cannot* be union types
|
75
|
+
"""
|
76
|
+
decoder: msgspec.json.Decoder[ResponseTypeGeneric] = self.get_decoder(
|
77
|
+
request.get_unannotated_response_type()
|
78
|
+
)
|
79
|
+
stub: grpc.aio.UnaryStreamMultiCallable[
|
80
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
81
|
+
] = self.channel.unary_stream(
|
82
|
+
request.get_route(),
|
83
|
+
request_serializer=encoder.encode,
|
84
|
+
response_deserializer=decoder.decode,
|
85
|
+
)
|
86
|
+
if self.jwt is not None:
|
87
|
+
metadata = (("authorization", f"Bearer {self.jwt}"),)
|
88
|
+
else:
|
89
|
+
metadata = ()
|
90
|
+
call: grpc.aio._base_call.UnaryStreamCall[
|
91
|
+
RequestType[ResponseTypeGeneric], ResponseTypeGeneric
|
92
|
+
] = stub(request, metadata=metadata)
|
93
|
+
async for update in call:
|
94
|
+
yield update
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Accounts/AccountsRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Accounts.AccountsResponse import AccountsResponse
|
6
6
|
|
7
7
|
from typing import Annotated, Optional
|
8
8
|
|
@@ -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],
|
@@ -24,18 +25,20 @@ class AccountsRequest(Struct, omit_defaults=True):
|
|
24
25
|
Request accounts from the perspective of this trader; if not specified, defaults to the caller user.
|
25
26
|
"""
|
26
27
|
|
27
|
-
#
|
28
|
+
# Constructor that takes all field titles as arguments for convenience
|
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():
|
@@ -13,7 +13,7 @@ from .. import definitions
|
|
13
13
|
class AccountsResponse(Struct, omit_defaults=True):
|
14
14
|
accounts: List[definitions.AccountWithPermissions]
|
15
15
|
|
16
|
-
#
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
17
|
@classmethod
|
18
18
|
def new(
|
19
19
|
cls,
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# generated by datamodel-codegen:
|
2
|
-
# filename:
|
2
|
+
# filename: schemas
|
@@ -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})"
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/AlgoOrderRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.AlgoOrder import AlgoOrder
|
6
|
+
|
7
|
+
from msgspec import Struct
|
8
|
+
|
9
|
+
from .. import definitions
|
10
|
+
|
11
|
+
|
12
|
+
class AlgoOrderRequest(Struct, omit_defaults=True):
|
13
|
+
"""
|
14
|
+
Get generic algo run status
|
15
|
+
"""
|
16
|
+
|
17
|
+
algo_order_id: definitions.OrderId
|
18
|
+
|
19
|
+
# Constructor that takes all field titles as arguments for convenience
|
20
|
+
@classmethod
|
21
|
+
def new(
|
22
|
+
cls,
|
23
|
+
algo_order_id: definitions.OrderId,
|
24
|
+
):
|
25
|
+
return cls(
|
26
|
+
algo_order_id,
|
27
|
+
)
|
28
|
+
|
29
|
+
def __str__(self) -> str:
|
30
|
+
return f"AlgoOrderRequest(algo_order_id={self.algo_order_id})"
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def get_response_type():
|
34
|
+
return AlgoOrder
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def get_unannotated_response_type():
|
38
|
+
return AlgoOrder
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def get_route() -> str:
|
42
|
+
return "/json.architect.Algo/AlgoOrder"
|
43
|
+
|
44
|
+
@staticmethod
|
45
|
+
def get_rpc_method():
|
46
|
+
return "unary"
|
@@ -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"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/PauseAlgoResponse.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from msgspec import Struct
|
7
|
+
|
8
|
+
|
9
|
+
class PauseAlgoResponse(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"PauseAlgoResponse()"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/StartAlgoRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.StartAlgoResponse import StartAlgoResponse
|
6
|
+
|
7
|
+
from msgspec import Struct
|
8
|
+
|
9
|
+
from .. import definitions
|
10
|
+
|
11
|
+
|
12
|
+
class StartAlgoRequest(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"StartAlgoRequest(algo_order_id={self.algo_order_id})"
|
27
|
+
|
28
|
+
@staticmethod
|
29
|
+
def get_response_type():
|
30
|
+
return StartAlgoResponse
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def get_unannotated_response_type():
|
34
|
+
return StartAlgoResponse
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def get_route() -> str:
|
38
|
+
return "/json.architect.Algo/StartAlgo"
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def get_rpc_method():
|
42
|
+
return "unary"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/StartAlgoResponse.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from msgspec import Struct
|
7
|
+
|
8
|
+
|
9
|
+
class StartAlgoResponse(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"StartAlgoResponse()"
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/StopAlgoRequest.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
from architect_py.grpc.models.Algo.StopAlgoResponse import StopAlgoResponse
|
6
|
+
|
7
|
+
from msgspec import Struct
|
8
|
+
|
9
|
+
from .. import definitions
|
10
|
+
|
11
|
+
|
12
|
+
class StopAlgoRequest(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"StopAlgoRequest(algo_order_id={self.algo_order_id})"
|
27
|
+
|
28
|
+
@staticmethod
|
29
|
+
def get_response_type():
|
30
|
+
return StopAlgoResponse
|
31
|
+
|
32
|
+
@staticmethod
|
33
|
+
def get_unannotated_response_type():
|
34
|
+
return StopAlgoResponse
|
35
|
+
|
36
|
+
@staticmethod
|
37
|
+
def get_route() -> str:
|
38
|
+
return "/json.architect.Algo/StopAlgo"
|
39
|
+
|
40
|
+
@staticmethod
|
41
|
+
def get_rpc_method():
|
42
|
+
return "unary"
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Algo/StopAlgoResponse.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from msgspec import Struct
|
7
|
+
|
8
|
+
|
9
|
+
class StopAlgoResponse(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"StopAlgoResponse()"
|
@@ -1,2 +1,2 @@
|
|
1
1
|
# generated by datamodel-codegen:
|
2
|
-
# filename:
|
2
|
+
# filename: schemas
|