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
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeL1BookSnapshotsRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.L1BookSnapshot import L1BookSnapshot
|
6
6
|
|
7
7
|
from typing import Annotated, List, Optional
|
8
8
|
|
@@ -19,19 +19,22 @@ class SubscribeL1BookSnapshotsRequest(Struct, omit_defaults=True):
|
|
19
19
|
"""
|
20
20
|
If None, subscribe from all symbols on the feed
|
21
21
|
"""
|
22
|
+
venue: Optional[str] = None
|
22
23
|
|
23
|
-
#
|
24
|
+
# Constructor that takes all field titles as arguments for convenience
|
24
25
|
@classmethod
|
25
26
|
def new(
|
26
27
|
cls,
|
27
28
|
symbols: Optional[List[str]] = None,
|
29
|
+
venue: Optional[str] = None,
|
28
30
|
):
|
29
31
|
return cls(
|
30
32
|
symbols,
|
33
|
+
venue,
|
31
34
|
)
|
32
35
|
|
33
36
|
def __str__(self) -> str:
|
34
|
-
return f"SubscribeL1BookSnapshotsRequest(symbols={self.symbols})"
|
37
|
+
return f"SubscribeL1BookSnapshotsRequest(symbols={self.symbols},venue={self.venue})"
|
35
38
|
|
36
39
|
@staticmethod
|
37
40
|
def get_response_type():
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeL2BookUpdatesRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.L2BookUpdate import (
|
6
6
|
L2BookUpdate,
|
7
7
|
Snapshot,
|
8
8
|
Diff,
|
@@ -17,7 +17,7 @@ class SubscribeL2BookUpdatesRequest(Struct, omit_defaults=True):
|
|
17
17
|
symbol: str
|
18
18
|
venue: Optional[str] = None
|
19
19
|
|
20
|
-
#
|
20
|
+
# Constructor that takes all field titles as arguments for convenience
|
21
21
|
@classmethod
|
22
22
|
def new(
|
23
23
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeLiquidationsRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.Liquidation import Liquidation
|
6
6
|
|
7
7
|
from typing import List, Optional
|
8
8
|
|
@@ -12,7 +12,7 @@ from msgspec import Struct
|
|
12
12
|
class SubscribeLiquidationsRequest(Struct, omit_defaults=True):
|
13
13
|
symbols: Optional[List[str]] = None
|
14
14
|
|
15
|
-
#
|
15
|
+
# Constructor that takes all field titles as arguments for convenience
|
16
16
|
@classmethod
|
17
17
|
def new(
|
18
18
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeManyCandlesRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.Candle import Candle
|
6
6
|
|
7
7
|
from typing import Annotated, List, Optional
|
8
8
|
|
@@ -24,7 +24,7 @@ class SubscribeManyCandlesRequest(Struct, omit_defaults=True):
|
|
24
24
|
"""
|
25
25
|
venue: Optional[str] = None
|
26
26
|
|
27
|
-
#
|
27
|
+
# Constructor that takes all field titles as arguments for convenience
|
28
28
|
@classmethod
|
29
29
|
def new(
|
30
30
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeTickersRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.TickerUpdate import (
|
6
6
|
TickerUpdate,
|
7
7
|
Snapshot,
|
8
8
|
Diff,
|
@@ -28,7 +28,7 @@ class SubscribeTickersRequest(Struct, omit_defaults=True):
|
|
28
28
|
If None, subscribe from all symbols on the feed
|
29
29
|
"""
|
30
30
|
|
31
|
-
#
|
31
|
+
# Constructor that takes all field titles as arguments for convenience
|
32
32
|
@classmethod
|
33
33
|
def new(
|
34
34
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/SubscribeTradesRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.Trade import Trade
|
6
6
|
|
7
7
|
from typing import Annotated, Optional
|
8
8
|
|
@@ -21,7 +21,7 @@ class SubscribeTradesRequest(Struct, omit_defaults=True):
|
|
21
21
|
"""
|
22
22
|
venue: Optional[str] = None
|
23
23
|
|
24
|
-
#
|
24
|
+
# Constructor that takes all field titles as arguments for convenience
|
25
25
|
@classmethod
|
26
26
|
def new(
|
27
27
|
cls,
|
@@ -4,7 +4,7 @@
|
|
4
4
|
from __future__ import annotations
|
5
5
|
from datetime import datetime, timezone
|
6
6
|
|
7
|
-
from datetime import datetime
|
7
|
+
from datetime import date, datetime
|
8
8
|
from decimal import Decimal
|
9
9
|
from typing import Annotated, Optional
|
10
10
|
|
@@ -37,6 +37,7 @@ class Ticker(Struct, omit_defaults=True):
|
|
37
37
|
p: Optional[Annotated[Optional[Decimal], Meta(title="last_price")]] = None
|
38
38
|
price_to_earnings: Optional[Decimal] = None
|
39
39
|
q: Optional[Annotated[Optional[Decimal], Meta(title="last_size")]] = None
|
40
|
+
sd: Optional[Annotated[Optional[date], Meta(title="last_settlement_date")]] = None
|
40
41
|
shares_outstanding_weighted_adj: Optional[Decimal] = None
|
41
42
|
sp: Optional[Annotated[Optional[Decimal], Meta(title="last_settlement_price")]] = (
|
42
43
|
None
|
@@ -48,7 +49,7 @@ class Ticker(Struct, omit_defaults=True):
|
|
48
49
|
xo: Optional[Annotated[Optional[Decimal], Meta(title="session_open")]] = None
|
49
50
|
xv: Optional[Annotated[Optional[Decimal], Meta(title="session_volume")]] = None
|
50
51
|
|
51
|
-
#
|
52
|
+
# Constructor that takes all field titles as arguments for convenience
|
52
53
|
@classmethod
|
53
54
|
def new(
|
54
55
|
cls,
|
@@ -75,6 +76,7 @@ class Ticker(Struct, omit_defaults=True):
|
|
75
76
|
last_price: Optional[Decimal] = None,
|
76
77
|
price_to_earnings: Optional[Decimal] = None,
|
77
78
|
last_size: Optional[Decimal] = None,
|
79
|
+
last_settlement_date: Optional[date] = None,
|
78
80
|
shares_outstanding_weighted_adj: Optional[Decimal] = None,
|
79
81
|
last_settlement_price: Optional[Decimal] = None,
|
80
82
|
volume_24h: Optional[Decimal] = None,
|
@@ -108,6 +110,7 @@ class Ticker(Struct, omit_defaults=True):
|
|
108
110
|
last_price,
|
109
111
|
price_to_earnings,
|
110
112
|
last_size,
|
113
|
+
last_settlement_date,
|
111
114
|
shares_outstanding_weighted_adj,
|
112
115
|
last_settlement_price,
|
113
116
|
volume_24h,
|
@@ -119,7 +122,7 @@ class Ticker(Struct, omit_defaults=True):
|
|
119
122
|
)
|
120
123
|
|
121
124
|
def __str__(self) -> str:
|
122
|
-
return f"Ticker(symbol={self.s},timestamp_ns={self.tn},timestamp={self.ts},venue={self.ve},ask_price={self.ap},ask_size={self.as_},bid_price={self.bp},bid_size={self.bs},dividend={self.dividend},dividend_yield={self.dividend_yield},eps_adj={self.eps_adj},funding_rate={self.fr},next_funding_time={self.ft},high_24h={self.h},index_price={self.ip},low_24h={self.l},market_cap={self.market_cap},mark_price={self.mp},open_24h={self.o},open_interest={self.oi},last_price={self.p},price_to_earnings={self.price_to_earnings},last_size={self.q},shares_outstanding_weighted_adj={self.shares_outstanding_weighted_adj},last_settlement_price={self.sp},volume_24h={self.v},volume_30d={self.vm},session_high={self.xh},session_low={self.xl},session_open={self.xo},session_volume={self.xv})"
|
125
|
+
return f"Ticker(symbol={self.s},timestamp_ns={self.tn},timestamp={self.ts},venue={self.ve},ask_price={self.ap},ask_size={self.as_},bid_price={self.bp},bid_size={self.bs},dividend={self.dividend},dividend_yield={self.dividend_yield},eps_adj={self.eps_adj},funding_rate={self.fr},next_funding_time={self.ft},high_24h={self.h},index_price={self.ip},low_24h={self.l},market_cap={self.market_cap},mark_price={self.mp},open_24h={self.o},open_interest={self.oi},last_price={self.p},price_to_earnings={self.price_to_earnings},last_size={self.q},last_settlement_date={self.sd},shares_outstanding_weighted_adj={self.shares_outstanding_weighted_adj},last_settlement_price={self.sp},volume_24h={self.v},volume_30d={self.vm},session_high={self.xh},session_low={self.xl},session_open={self.xo},session_volume={self.xv})"
|
123
126
|
|
124
127
|
@property
|
125
128
|
def symbol(self) -> str:
|
@@ -273,6 +276,14 @@ class Ticker(Struct, omit_defaults=True):
|
|
273
276
|
def last_size(self, value: Optional[Decimal]) -> None:
|
274
277
|
self.q = value
|
275
278
|
|
279
|
+
@property
|
280
|
+
def last_settlement_date(self) -> Optional[date]:
|
281
|
+
return self.sd
|
282
|
+
|
283
|
+
@last_settlement_date.setter
|
284
|
+
def last_settlement_date(self, value: Optional[date]) -> None:
|
285
|
+
self.sd = value
|
286
|
+
|
276
287
|
@property
|
277
288
|
def last_settlement_price(self) -> Optional[Decimal]:
|
278
289
|
return self.sp
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/TickerRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.Ticker import Ticker
|
6
6
|
|
7
7
|
from typing import Optional
|
8
8
|
|
@@ -13,7 +13,7 @@ class TickerRequest(Struct, omit_defaults=True):
|
|
13
13
|
symbol: str
|
14
14
|
venue: Optional[str] = None
|
15
15
|
|
16
|
-
#
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
17
|
@classmethod
|
18
18
|
def new(
|
19
19
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/TickersRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Marketdata.TickersResponse import TickersResponse
|
6
6
|
|
7
7
|
from typing import List, Optional
|
8
8
|
|
@@ -18,7 +18,7 @@ class TickersRequest(Struct, omit_defaults=True):
|
|
18
18
|
symbols: Optional[List[str]] = None
|
19
19
|
venue: Optional[str] = None
|
20
20
|
|
21
|
-
#
|
21
|
+
# Constructor that takes all field titles as arguments for convenience
|
22
22
|
@classmethod
|
23
23
|
def new(
|
24
24
|
cls,
|
@@ -13,7 +13,7 @@ from .Ticker import Ticker
|
|
13
13
|
class TickersResponse(Struct, omit_defaults=True):
|
14
14
|
tickers: List[Ticker]
|
15
15
|
|
16
|
-
#
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
17
|
@classmethod
|
18
18
|
def new(
|
19
19
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Marketdata/Trade.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.common_types import OrderDir
|
6
6
|
from datetime import datetime, timezone
|
7
7
|
|
8
8
|
from decimal import Decimal
|
@@ -21,7 +21,7 @@ class Trade(Struct, omit_defaults=True):
|
|
21
21
|
ts: Annotated[int, Meta(title="timestamp")]
|
22
22
|
d: Optional[Annotated[Optional[OrderDir], Meta(title="direction")]] = None
|
23
23
|
|
24
|
-
#
|
24
|
+
# Constructor that takes all field titles as arguments for convenience
|
25
25
|
@classmethod
|
26
26
|
def new(
|
27
27
|
cls,
|
@@ -0,0 +1,90 @@
|
|
1
|
+
# generated by datamodel-codegen:
|
2
|
+
# filename: Oms/Cancel.json
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
from typing import Annotated, Optional
|
7
|
+
|
8
|
+
from msgspec import Meta, Struct
|
9
|
+
|
10
|
+
from .. import definitions
|
11
|
+
|
12
|
+
|
13
|
+
class Cancel(Struct, omit_defaults=True):
|
14
|
+
id: Annotated[definitions.OrderId, Meta(title="order_id")]
|
15
|
+
o: Annotated[definitions.CancelStatus, Meta(title="status")]
|
16
|
+
tn: Annotated[int, Meta(ge=0, title="recv_time_ns")]
|
17
|
+
ts: Annotated[int, Meta(title="recv_time")]
|
18
|
+
xid: Annotated[str, Meta(title="cancel_id")]
|
19
|
+
r: Optional[Annotated[Optional[str], Meta(title="reject_reason")]] = None
|
20
|
+
|
21
|
+
# Constructor that takes all field titles as arguments for convenience
|
22
|
+
@classmethod
|
23
|
+
def new(
|
24
|
+
cls,
|
25
|
+
order_id: definitions.OrderId,
|
26
|
+
status: definitions.CancelStatus,
|
27
|
+
recv_time_ns: int,
|
28
|
+
recv_time: int,
|
29
|
+
cancel_id: str,
|
30
|
+
reject_reason: Optional[str] = None,
|
31
|
+
):
|
32
|
+
return cls(
|
33
|
+
order_id,
|
34
|
+
status,
|
35
|
+
recv_time_ns,
|
36
|
+
recv_time,
|
37
|
+
cancel_id,
|
38
|
+
reject_reason,
|
39
|
+
)
|
40
|
+
|
41
|
+
def __str__(self) -> str:
|
42
|
+
return f"Cancel(order_id={self.id},status={self.o},recv_time_ns={self.tn},recv_time={self.ts},cancel_id={self.xid},reject_reason={self.r})"
|
43
|
+
|
44
|
+
@property
|
45
|
+
def order_id(self) -> definitions.OrderId:
|
46
|
+
return self.id
|
47
|
+
|
48
|
+
@order_id.setter
|
49
|
+
def order_id(self, value: definitions.OrderId) -> None:
|
50
|
+
self.id = value
|
51
|
+
|
52
|
+
@property
|
53
|
+
def status(self) -> definitions.CancelStatus:
|
54
|
+
return self.o
|
55
|
+
|
56
|
+
@status.setter
|
57
|
+
def status(self, value: definitions.CancelStatus) -> None:
|
58
|
+
self.o = value
|
59
|
+
|
60
|
+
@property
|
61
|
+
def recv_time_ns(self) -> int:
|
62
|
+
return self.tn
|
63
|
+
|
64
|
+
@recv_time_ns.setter
|
65
|
+
def recv_time_ns(self, value: int) -> None:
|
66
|
+
self.tn = value
|
67
|
+
|
68
|
+
@property
|
69
|
+
def recv_time(self) -> int:
|
70
|
+
return self.ts
|
71
|
+
|
72
|
+
@recv_time.setter
|
73
|
+
def recv_time(self, value: int) -> None:
|
74
|
+
self.ts = value
|
75
|
+
|
76
|
+
@property
|
77
|
+
def cancel_id(self) -> str:
|
78
|
+
return self.xid
|
79
|
+
|
80
|
+
@cancel_id.setter
|
81
|
+
def cancel_id(self, value: str) -> None:
|
82
|
+
self.xid = value
|
83
|
+
|
84
|
+
@property
|
85
|
+
def reject_reason(self) -> Optional[str]:
|
86
|
+
return self.r
|
87
|
+
|
88
|
+
@reject_reason.setter
|
89
|
+
def reject_reason(self, value: Optional[str]) -> None:
|
90
|
+
self.r = value
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Oms/CancelAllOrdersRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Oms.CancelAllOrdersResponse import CancelAllOrdersResponse
|
6
6
|
|
7
7
|
from typing import Optional
|
8
8
|
|
@@ -17,7 +17,7 @@ class CancelAllOrdersRequest(Struct, omit_defaults=True):
|
|
17
17
|
execution_venue: Optional[str] = None
|
18
18
|
trader: Optional[definitions.TraderIdOrEmail] = None
|
19
19
|
|
20
|
-
#
|
20
|
+
# Constructor that takes all field titles as arguments for convenience
|
21
21
|
@classmethod
|
22
22
|
def new(
|
23
23
|
cls,
|
@@ -9,7 +9,7 @@ from msgspec import Struct
|
|
9
9
|
class CancelAllOrdersResponse(Struct, omit_defaults=True):
|
10
10
|
pass
|
11
11
|
|
12
|
-
#
|
12
|
+
# Constructor that takes all field titles as arguments for convenience
|
13
13
|
@classmethod
|
14
14
|
def new(
|
15
15
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Oms/CancelOrderRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Oms.Cancel import Cancel
|
6
6
|
|
7
7
|
from typing import Annotated, Optional
|
8
8
|
|
@@ -26,7 +26,7 @@ class CancelOrderRequest(Struct, omit_defaults=True):
|
|
26
26
|
If not specified, one will be generated for you; note, in that case, you won't know for sure if the specific request went through.
|
27
27
|
"""
|
28
28
|
|
29
|
-
#
|
29
|
+
# Constructor that takes all field titles as arguments for convenience
|
30
30
|
@classmethod
|
31
31
|
def new(
|
32
32
|
cls,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Oms/OpenOrdersRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Oms.OpenOrdersResponse import OpenOrdersResponse
|
6
6
|
|
7
7
|
from typing import List, Optional
|
8
8
|
|
@@ -19,7 +19,7 @@ class OpenOrdersRequest(Struct, omit_defaults=True):
|
|
19
19
|
trader: Optional[definitions.TraderIdOrEmail] = None
|
20
20
|
venue: Optional[str] = None
|
21
21
|
|
22
|
-
#
|
22
|
+
# Constructor that takes all field titles as arguments for convenience
|
23
23
|
@classmethod
|
24
24
|
def new(
|
25
25
|
cls,
|
@@ -13,7 +13,7 @@ from .Order import Order
|
|
13
13
|
class OpenOrdersResponse(Struct, omit_defaults=True):
|
14
14
|
open_orders: List[Order]
|
15
15
|
|
16
|
-
#
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
17
|
@classmethod
|
18
18
|
def new(
|
19
19
|
cls,
|
@@ -2,10 +2,9 @@
|
|
2
2
|
# filename: Oms/Order.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.common_types import OrderDir
|
6
6
|
|
7
7
|
from decimal import Decimal
|
8
|
-
from enum import Enum
|
9
8
|
from typing import Annotated, Optional
|
10
9
|
|
11
10
|
from msgspec import Meta, Struct
|
@@ -13,12 +12,6 @@ from msgspec import Meta, Struct
|
|
13
12
|
from .. import definitions
|
14
13
|
|
15
14
|
|
16
|
-
class OrderType(str, Enum):
|
17
|
-
LIMIT = "LIMIT"
|
18
|
-
STOP_LOSS_LIMIT = "STOP_LOSS_LIMIT"
|
19
|
-
TAKE_PROFIT_LIMIT = "TAKE_PROFIT_LIMIT"
|
20
|
-
|
21
|
-
|
22
15
|
class Order(Struct, omit_defaults=True):
|
23
16
|
a: Annotated[str, Meta(title="account")]
|
24
17
|
d: Annotated[OrderDir, Meta(title="dir")]
|
@@ -34,7 +27,7 @@ class Order(Struct, omit_defaults=True):
|
|
34
27
|
ve: Annotated[str, Meta(title="execution_venue")]
|
35
28
|
xq: Annotated[Decimal, Meta(title="filled_quantity")]
|
36
29
|
p: Annotated[Decimal, Meta(title="limit_price")]
|
37
|
-
k: Annotated[OrderType, Meta(title="order_type")]
|
30
|
+
k: Annotated[definitions.OrderType, Meta(title="order_type")]
|
38
31
|
eid: Optional[Annotated[Optional[str], Meta(title="exchange_order_id")]] = None
|
39
32
|
pid: Optional[Annotated[Optional[definitions.OrderId], Meta(title="parent_id")]] = (
|
40
33
|
None
|
@@ -48,7 +41,7 @@ class Order(Struct, omit_defaults=True):
|
|
48
41
|
po: Optional[Annotated[bool, Meta(title="post_only")]] = None
|
49
42
|
tp: Optional[Annotated[Decimal, Meta(title="trigger_price")]] = None
|
50
43
|
|
51
|
-
#
|
44
|
+
# Constructor that takes all field titles as arguments for convenience
|
52
45
|
@classmethod
|
53
46
|
def new(
|
54
47
|
cls,
|
@@ -66,7 +59,7 @@ class Order(Struct, omit_defaults=True):
|
|
66
59
|
execution_venue: str,
|
67
60
|
filled_quantity: Decimal,
|
68
61
|
limit_price: Decimal,
|
69
|
-
order_type: OrderType,
|
62
|
+
order_type: definitions.OrderType,
|
70
63
|
exchange_order_id: Optional[str] = None,
|
71
64
|
parent_id: Optional[definitions.OrderId] = None,
|
72
65
|
reject_reason: Optional[definitions.OrderRejectReason] = None,
|
@@ -210,11 +203,11 @@ class Order(Struct, omit_defaults=True):
|
|
210
203
|
self.p = value
|
211
204
|
|
212
205
|
@property
|
213
|
-
def order_type(self) -> OrderType:
|
206
|
+
def order_type(self) -> definitions.OrderType:
|
214
207
|
return self.k
|
215
208
|
|
216
209
|
@order_type.setter
|
217
|
-
def order_type(self, value: OrderType) -> None:
|
210
|
+
def order_type(self, value: definitions.OrderType) -> None:
|
218
211
|
self.k = value
|
219
212
|
|
220
213
|
@property
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# filename: Oms/PendingCancelsRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Oms.PendingCancelsResponse import PendingCancelsResponse
|
6
6
|
|
7
7
|
from typing import List, Optional
|
8
8
|
|
@@ -18,7 +18,7 @@ class PendingCancelsRequest(Struct, omit_defaults=True):
|
|
18
18
|
trader: Optional[definitions.TraderIdOrEmail] = None
|
19
19
|
venue: Optional[str] = None
|
20
20
|
|
21
|
-
#
|
21
|
+
# Constructor that takes all field titles as arguments for convenience
|
22
22
|
@classmethod
|
23
23
|
def new(
|
24
24
|
cls,
|
@@ -13,7 +13,7 @@ from .Cancel import Cancel
|
|
13
13
|
class PendingCancelsResponse(Struct, omit_defaults=True):
|
14
14
|
pending_cancels: List[Cancel]
|
15
15
|
|
16
|
-
#
|
16
|
+
# Constructor that takes all field titles as arguments for convenience
|
17
17
|
@classmethod
|
18
18
|
def new(
|
19
19
|
cls,
|
@@ -2,11 +2,10 @@
|
|
2
2
|
# filename: Oms/PlaceOrderRequest.json
|
3
3
|
|
4
4
|
from __future__ import annotations
|
5
|
-
from architect_py.
|
6
|
-
from architect_py.
|
5
|
+
from architect_py.grpc.models.Oms.Order import Order
|
6
|
+
from architect_py.common_types import OrderDir
|
7
7
|
|
8
8
|
from decimal import Decimal
|
9
|
-
from enum import Enum
|
10
9
|
from typing import Annotated, Optional
|
11
10
|
|
12
11
|
from msgspec import Meta, Struct
|
@@ -14,19 +13,13 @@ from msgspec import Meta, Struct
|
|
14
13
|
from .. import definitions
|
15
14
|
|
16
15
|
|
17
|
-
class PlaceOrderRequestType(str, Enum):
|
18
|
-
LIMIT = "LIMIT"
|
19
|
-
STOP_LOSS_LIMIT = "STOP_LOSS_LIMIT"
|
20
|
-
TAKE_PROFIT_LIMIT = "TAKE_PROFIT_LIMIT"
|
21
|
-
|
22
|
-
|
23
16
|
class PlaceOrderRequest(Struct, omit_defaults=True):
|
24
17
|
d: Annotated[OrderDir, Meta(title="dir")]
|
25
18
|
q: Annotated[Decimal, Meta(title="quantity")]
|
26
19
|
s: Annotated[str, Meta(title="symbol")]
|
27
20
|
tif: Annotated[definitions.TimeInForce, Meta(title="time_in_force")]
|
28
21
|
p: Annotated[Decimal, Meta(title="limit_price")]
|
29
|
-
k: Annotated[
|
22
|
+
k: Annotated[definitions.OrderType, Meta(title="order_type")]
|
30
23
|
a: Optional[
|
31
24
|
Annotated[Optional[definitions.AccountIdOrName], Meta(title="account")]
|
32
25
|
] = None
|
@@ -54,7 +47,7 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
54
47
|
po: Optional[Annotated[bool, Meta(title="post_only")]] = None
|
55
48
|
tp: Optional[Annotated[Decimal, Meta(title="trigger_price")]] = None
|
56
49
|
|
57
|
-
#
|
50
|
+
# Constructor that takes all field titles as arguments for convenience
|
58
51
|
@classmethod
|
59
52
|
def new(
|
60
53
|
cls,
|
@@ -63,7 +56,7 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
63
56
|
symbol: str,
|
64
57
|
time_in_force: definitions.TimeInForce,
|
65
58
|
limit_price: Decimal,
|
66
|
-
|
59
|
+
order_type: definitions.OrderType,
|
67
60
|
account: Optional[definitions.AccountIdOrName] = None,
|
68
61
|
id: Optional[definitions.OrderId] = None,
|
69
62
|
parent_id: Optional[definitions.OrderId] = None,
|
@@ -79,7 +72,7 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
79
72
|
symbol,
|
80
73
|
time_in_force,
|
81
74
|
limit_price,
|
82
|
-
|
75
|
+
order_type,
|
83
76
|
account,
|
84
77
|
id,
|
85
78
|
parent_id,
|
@@ -91,7 +84,7 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
91
84
|
)
|
92
85
|
|
93
86
|
def __str__(self) -> str:
|
94
|
-
return f"PlaceOrderRequest(dir={self.d},quantity={self.q},symbol={self.s},time_in_force={self.tif},limit_price={self.p},
|
87
|
+
return f"PlaceOrderRequest(dir={self.d},quantity={self.q},symbol={self.s},time_in_force={self.tif},limit_price={self.p},order_type={self.k},account={self.a},id={self.id},parent_id={self.pid},source={self.src},trader={self.u},execution_venue={self.x},post_only={self.po},trigger_price={self.tp})"
|
95
88
|
|
96
89
|
@property
|
97
90
|
def dir(self) -> OrderDir:
|
@@ -134,11 +127,11 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
134
127
|
self.p = value
|
135
128
|
|
136
129
|
@property
|
137
|
-
def
|
130
|
+
def order_type(self) -> definitions.OrderType:
|
138
131
|
return self.k
|
139
132
|
|
140
|
-
@
|
141
|
-
def
|
133
|
+
@order_type.setter
|
134
|
+
def order_type(self, value: definitions.OrderType) -> None:
|
142
135
|
self.k = value
|
143
136
|
|
144
137
|
@property
|
@@ -217,27 +210,27 @@ class PlaceOrderRequest(Struct, omit_defaults=True):
|
|
217
210
|
if self.k == "LIMIT":
|
218
211
|
if not all(getattr(self, key) is not None for key in ["po"]):
|
219
212
|
raise ValueError(
|
220
|
-
f"When field k (
|
213
|
+
f"When field k (order_type) is of value LIMIT, class PlaceOrderRequest requires fields ['po']"
|
221
214
|
)
|
222
215
|
elif any(getattr(self, key) is not None for key in ["tp"]):
|
223
216
|
raise ValueError(
|
224
|
-
f"When field k (
|
217
|
+
f"When field k (order_type) is of value LIMIT, class PlaceOrderRequest should not have fields ['tp']"
|
225
218
|
)
|
226
219
|
elif self.k == "STOP_LOSS_LIMIT":
|
227
220
|
if not all(getattr(self, key) is not None for key in ["tp"]):
|
228
221
|
raise ValueError(
|
229
|
-
f"When field k (
|
222
|
+
f"When field k (order_type) is of value STOP_LOSS_LIMIT, class PlaceOrderRequest requires fields ['tp']"
|
230
223
|
)
|
231
224
|
elif any(getattr(self, key) is not None for key in ["po"]):
|
232
225
|
raise ValueError(
|
233
|
-
f"When field k (
|
226
|
+
f"When field k (order_type) is of value STOP_LOSS_LIMIT, class PlaceOrderRequest should not have fields ['po']"
|
234
227
|
)
|
235
228
|
elif self.k == "TAKE_PROFIT_LIMIT":
|
236
229
|
if not all(getattr(self, key) is not None for key in ["tp"]):
|
237
230
|
raise ValueError(
|
238
|
-
f"When field k (
|
231
|
+
f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class PlaceOrderRequest requires fields ['tp']"
|
239
232
|
)
|
240
233
|
elif any(getattr(self, key) is not None for key in ["po"]):
|
241
234
|
raise ValueError(
|
242
|
-
f"When field k (
|
235
|
+
f"When field k (order_type) is of value TAKE_PROFIT_LIMIT, class PlaceOrderRequest should not have fields ['po']"
|
243
236
|
)
|