architect-py 5.0.0b1__py3-none-any.whl → 5.0.0b3__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 +291 -174
- 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 +19 -19
- architect_py/tests/test_orderflow.py +31 -28
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/METADATA +2 -3
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/RECORD +72 -42
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.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.0b3.dist-info}/licenses/LICENSE +0 -0
- {architect_py-5.0.0b1.dist-info → architect_py-5.0.0b3.dist-info}/top_level.txt +0 -0
@@ -64,4 +64,7 @@ async def resolve_endpoint(endpoint: str) -> Tuple[str, int, bool]:
|
|
64
64
|
|
65
65
|
record = cast(SRV, srv_records[0])
|
66
66
|
logging.info(f"Found {endpoint}: {record.target}:{record.port}")
|
67
|
-
|
67
|
+
|
68
|
+
host = str(record.target).rstrip(".") # strips the period off of FQDNs
|
69
|
+
|
70
|
+
return host, record.port, use_ssl
|
File without changes
|
architect_py/tests/conftest.py
CHANGED
@@ -17,6 +17,7 @@ Environment variables may be set in a `.env` file.
|
|
17
17
|
"""
|
18
18
|
|
19
19
|
import os
|
20
|
+
from datetime import datetime, timedelta
|
20
21
|
|
21
22
|
import pytest_asyncio
|
22
23
|
from dotenv import load_dotenv
|
@@ -95,14 +96,20 @@ async def async_client() -> AsyncClient:
|
|
95
96
|
return async_client
|
96
97
|
|
97
98
|
|
99
|
+
async def get_front_ES_future(async_client: AsyncClient) -> str:
|
100
|
+
series = await async_client.get_cme_futures_series("ES CME Futures")
|
101
|
+
series.sort()
|
102
|
+
today = datetime.now() + timedelta(days=30)
|
103
|
+
unexpired = list(filter(lambda item: item[0] > today.date(), series))
|
104
|
+
return unexpired[0][1]
|
105
|
+
|
106
|
+
|
98
107
|
@pytest_asyncio.fixture
|
99
108
|
async def front_ES_future(async_client: AsyncClient) -> str:
|
100
109
|
"""
|
101
110
|
Fixture for getting the name of the front month ES CME future.
|
102
111
|
"""
|
103
|
-
|
104
|
-
series.sort()
|
105
|
-
return series[-1][1]
|
112
|
+
return await get_front_ES_future(async_client)
|
106
113
|
|
107
114
|
|
108
115
|
@pytest_asyncio.fixture
|
@@ -110,9 +117,7 @@ async def front_ES_future_usd(async_client: AsyncClient) -> str:
|
|
110
117
|
"""
|
111
118
|
Fixture for getting the name of the front month ES CME future/USD pair.
|
112
119
|
"""
|
113
|
-
|
114
|
-
series.sort()
|
115
|
-
future = series[-1][1]
|
120
|
+
future = await get_front_ES_future(async_client)
|
116
121
|
return f"{future}/USD"
|
117
122
|
|
118
123
|
|
@@ -89,7 +89,7 @@ async def test_stream_l1_book_snapshots(
|
|
89
89
|
async_client: AsyncClient, venue: str, symbol: str
|
90
90
|
):
|
91
91
|
i = 0
|
92
|
-
async for snap in
|
92
|
+
async for snap in async_client.stream_l1_book_snapshots([symbol], venue):
|
93
93
|
assert snap is not None
|
94
94
|
assert snap.best_bid is not None
|
95
95
|
assert snap.best_ask is not None
|
@@ -113,7 +113,7 @@ async def test_stream_l2_book_updates(
|
|
113
113
|
i = 0
|
114
114
|
sid = None
|
115
115
|
sn = None
|
116
|
-
async for up in
|
116
|
+
async for up in async_client.stream_l2_book_updates(symbol, venue):
|
117
117
|
assert up is not None
|
118
118
|
if isinstance(up, Snapshot):
|
119
119
|
assert len(up.bids) > 0
|
@@ -143,26 +143,26 @@ async def test_stream_l2_book_updates(
|
|
143
143
|
)
|
144
144
|
async def test_stream_trades(async_client: AsyncClient, venue: str, symbol: str):
|
145
145
|
i = 0
|
146
|
-
async for trade in
|
146
|
+
async for trade in async_client.stream_trades(symbol, venue):
|
147
147
|
assert trade is not None
|
148
148
|
i += 1
|
149
149
|
if i > 20:
|
150
150
|
break
|
151
151
|
|
152
152
|
|
153
|
-
@pytest.mark.asyncio
|
154
|
-
@pytest.mark.parametrize(
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
)
|
160
|
-
async def test_stream_candles(async_client: AsyncClient, venue: str, symbol: str):
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
153
|
+
# @pytest.mark.asyncio
|
154
|
+
# @pytest.mark.parametrize(
|
155
|
+
# "venue,symbol",
|
156
|
+
# [
|
157
|
+
# ("BINANCE/USDM", "BTC-USDT BINANCE Perpetual/USDT Crypto"),
|
158
|
+
# ],
|
159
|
+
# )
|
160
|
+
# async def test_stream_candles(async_client: AsyncClient, venue: str, symbol: str):
|
161
|
+
# i = 0
|
162
|
+
# async for candle in async_client.stream_candles(
|
163
|
+
# symbol, venue, [CandleWidth.OneSecond]
|
164
|
+
# ):
|
165
|
+
# assert candle is not None
|
166
|
+
# i += 1
|
167
|
+
# if i > 3:
|
168
|
+
# break
|
@@ -1,38 +1,41 @@
|
|
1
|
-
|
1
|
+
"""
|
2
|
+
import asyncio
|
2
3
|
|
3
|
-
|
4
|
+
import pytest
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
from architect_py.async_client import AsyncClient
|
7
|
+
from architect_py.grpc.models.Orderflow.OrderflowRequest import OrderflowRequest
|
7
8
|
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
class OrderflowAsyncIterator:
|
11
|
+
queue: list[OrderflowRequest]
|
12
|
+
condition: asyncio.Condition
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def __init__(self):
|
15
|
+
self.queue: list[OrderflowRequest] = []
|
16
|
+
self.condition: asyncio.Condition = asyncio.Condition()
|
16
17
|
|
17
|
-
|
18
|
-
|
18
|
+
def __aiter__(self):
|
19
|
+
return self
|
19
20
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
async def __anext__(self) -> OrderflowRequest:
|
22
|
+
async with self.condition:
|
23
|
+
while not self.queue:
|
24
|
+
await self.condition.wait()
|
25
|
+
return self.queue.pop(0)
|
25
26
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
27
|
+
async def add_to_queue(self, item: OrderflowRequest):
|
28
|
+
async with self.condition:
|
29
|
+
self.queue.append(item)
|
30
|
+
self.condition.notify()
|
30
31
|
|
31
32
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
33
|
+
@pytest.mark.asyncio
|
34
|
+
@pytest.mark.timeout(10)
|
35
|
+
async def test_orderflow(async_client: AsyncClient):
|
36
|
+
oai = OrderflowAsyncIterator()
|
37
|
+
async for of in async_client.orderflow(oai):
|
38
|
+
assert of is not None
|
39
|
+
return
|
40
|
+
|
41
|
+
"""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: architect-py
|
3
|
-
Version: 5.0.
|
3
|
+
Version: 5.0.0b3
|
4
4
|
Summary: Python SDK for the Architect trading platform and brokerage.
|
5
5
|
Author-email: "Architect Financial Technologies, Inc." <hello@architect.co>
|
6
6
|
License-Expression: Apache-2.0
|
@@ -14,11 +14,10 @@ Requires-Dist: asyncio>=3
|
|
14
14
|
Requires-Dist: gql[httpx]<4,>=3.5.0
|
15
15
|
Requires-Dist: grpcio>=1.66.1
|
16
16
|
Requires-Dist: msgspec<0.20,>=0.19
|
17
|
+
Requires-Dist: pandas>=2
|
17
18
|
Requires-Dist: pydantic~=2.10
|
18
19
|
Requires-Dist: websockets>=11
|
19
20
|
Requires-Dist: dnspython>=2.0
|
20
|
-
Provides-Extra: pandas
|
21
|
-
Requires-Dist: pandas>=2; extra == "pandas"
|
22
21
|
Dynamic: license-file
|
23
22
|
|
24
23
|
# [](https://architect.co) architect_py
|
@@ -1,18 +1,18 @@
|
|
1
|
-
architect_py/__init__.py,sha256=
|
2
|
-
architect_py/async_client.py,sha256=
|
1
|
+
architect_py/__init__.py,sha256=rq7taTogU0hlt8SA9e2p-CRbRhPJyJ2rrCegrThZRdA,318
|
2
|
+
architect_py/async_client.py,sha256=Ea1Y3ITTeDrXt9H3Ch9gq2jDNRpeHvgP8zzLRI3Z43g,57586
|
3
3
|
architect_py/client.py,sha256=bpFpYAtLhSPKoCG3bb45GVW55l8iEdozhZefGjXdNc0,5857
|
4
|
-
architect_py/client_interface.py,sha256=
|
4
|
+
architect_py/client_interface.py,sha256=kYMat54f5YJZj8L5L0tG-Ijsanklot3VTxpNmpaYiQ0,5778
|
5
5
|
architect_py/common_types/__init__.py,sha256=ghDsHR6cjJUVxIY80N_Q6QXhMBJ5JMdTyBQW1mdLnNs,143
|
6
|
-
architect_py/common_types/order_dir.py,sha256=
|
6
|
+
architect_py/common_types/order_dir.py,sha256=ebyWTcXzJWrotkc2D9wNGc6JXbE5I3NLLuAz3I7FTZ8,2191
|
7
7
|
architect_py/common_types/scalars.py,sha256=YSgSXbw2ONMQF7w1JPY4NiFV2rIjLQNmIMafX57iHPo,919
|
8
8
|
architect_py/common_types/tradable_product.py,sha256=wZ3HdQWV3P_k_nD964_Gn4LbAP2thNjTODBBiHjRzqA,1929
|
9
|
-
architect_py/graphql_client/__init__.py,sha256=
|
9
|
+
architect_py/graphql_client/__init__.py,sha256=ANSbh6MKnlSvrVASTtu59qlHRbaHr9ogqrNLI34DLRE,8987
|
10
10
|
architect_py/graphql_client/base_model.py,sha256=o2d-DixASFCGztr3rTiGX0AwgFu7Awr7EgD70FI8a-I,620
|
11
11
|
architect_py/graphql_client/cancel_all_orders_mutation.py,sha256=h8S_lUy7rdSu1UgcUloiX2CCnuPIDaPCmfL2X2MOq8Y,352
|
12
12
|
architect_py/graphql_client/cancel_order_mutation.py,sha256=FGCNrbLFmPXAYQ1vmpGC44viu2K2lZSCtXiO3O214ic,499
|
13
13
|
architect_py/graphql_client/client.py,sha256=2umynBj67CiQg8PDt4o8S6GAu4eYecxtk5-i_068hLg,43266
|
14
14
|
architect_py/graphql_client/create_jwt.py,sha256=PiiOOjGnHLXro8AU7FSu_vQA_adEK1iZM6XAzHpJP5E,285
|
15
|
-
architect_py/graphql_client/enums.py,sha256=
|
15
|
+
architect_py/graphql_client/enums.py,sha256=ROE1yM0CFL0k2Jb9hUokSWlFPf1Sh9bbQLSrTSxX98Q,1532
|
16
16
|
architect_py/graphql_client/exceptions.py,sha256=OQu-ZYCCV4VyMWTd1HR8gIjIK2CrA_JMlFxqOAJugWY,2411
|
17
17
|
architect_py/graphql_client/fragments.py,sha256=Uj__FkVqkaSWeKZimw-_r7wxHZwgNBLfjXaTOlopLMM,6483
|
18
18
|
architect_py/graphql_client/get_account_history_query.py,sha256=eRx07b_vAroTOMvIxnigtSguQ3GmGBL8l8veS-ABRAM,605
|
@@ -43,23 +43,42 @@ architect_py/graphql_client/subscribe_orderflow.py,sha256=64GvkTUsHlkRFtZLa3NLnN
|
|
43
43
|
architect_py/graphql_client/subscribe_trades.py,sha256=105LyG0kPvYHk_IsJaEjpEQh2AGP9Wqmp93Q8HF89BA,654
|
44
44
|
architect_py/graphql_client/user_email_query.py,sha256=KDFLFfLW5YtAptBm6CMQ_dVpcuEBofv4XlaYkW-VmcA,305
|
45
45
|
architect_py/graphql_client/user_id_query.py,sha256=tWKJJLgEINzd8e7rYlGklQCnwcwHzYFpCGQvhxQGX20,334
|
46
|
-
architect_py/grpc/__init__.py,sha256=
|
47
|
-
architect_py/grpc/client.py,sha256=
|
48
|
-
architect_py/grpc/resolve_endpoint.py,sha256=
|
46
|
+
architect_py/grpc/__init__.py,sha256=jn_7Gbf2xH0nWSqEu259sXWO-0keBbkRCJGLJmFGWVo,5412
|
47
|
+
architect_py/grpc/client.py,sha256=sHNneD2kVBKdz4Y1j0VEekgME58UY5p76o5kPQiYtbU,3213
|
48
|
+
architect_py/grpc/resolve_endpoint.py,sha256=HnOYC7n7taeSdnGY5E4TCSArCuY2LTwsGOnt_YLh9vQ,2415
|
49
49
|
architect_py/grpc/server.py,sha256=Abmdfe1eYbctVgzoJYBBBLpd7UD70FbYQLtJImSyRzs,1934
|
50
50
|
architect_py/grpc/utils.py,sha256=0GV57DFY21ZNX1LWdoL-90W3ge_KuXymEH8bDRdvsfo,760
|
51
51
|
architect_py/grpc/models/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
52
|
-
architect_py/grpc/models/definitions.py,sha256=
|
53
|
-
architect_py/grpc/models/Accounts/AccountsRequest.py,sha256=
|
52
|
+
architect_py/grpc/models/definitions.py,sha256=yiYTfHLLeZfvJLADrfI7HZ6iKlYNz95wOXtiAFgo_C8,76263
|
53
|
+
architect_py/grpc/models/Accounts/AccountsRequest.py,sha256=1a88cltSebOb53EdJ0hKEGR7FlmBiibrCtGzLTKqDBY,1524
|
54
54
|
architect_py/grpc/models/Accounts/AccountsResponse.py,sha256=DlXbkd3UbRybblBAfokw-K6nRvLNZgqz7cc0EKiW1zI,636
|
55
55
|
architect_py/grpc/models/Accounts/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
56
|
-
architect_py/grpc/models/Algo/
|
57
|
-
architect_py/grpc/models/Algo/
|
58
|
-
architect_py/grpc/models/Algo/
|
56
|
+
architect_py/grpc/models/Algo/AlgoOrder.py,sha256=ugkS9xU4ujHW3PcZpCKThw76NNkUDNakCVMf3ZnmPMw,3892
|
57
|
+
architect_py/grpc/models/Algo/AlgoOrderRequest.py,sha256=uDqxNv6vKxtkrXyO_8l1kOtVkqEsppq-wCupawmEde8,1022
|
58
|
+
architect_py/grpc/models/Algo/AlgoOrdersRequest.py,sha256=UWgZZK2Mjdkx0R1_c7BAFzx2xVzDCEk7ud3BtjwNrx8,2256
|
59
|
+
architect_py/grpc/models/Algo/AlgoOrdersResponse.py,sha256=xq8GGZ_iQA2MANCWTnOclwsVzdEvbRvyepBI8ob6qtc,609
|
60
|
+
architect_py/grpc/models/Algo/CreateAlgoOrderRequest.py,sha256=YHlIMNKBA0fopdMQ9dfx0BVQTqyJr2GndOUnEmJjJy0,1475
|
61
|
+
architect_py/grpc/models/Algo/PauseAlgoRequest.py,sha256=V1c5bXNHWC9jtjvx3B4BKK2IC3ClLgEA3q0goEYo6dY,1005
|
62
|
+
architect_py/grpc/models/Algo/PauseAlgoResponse.py,sha256=NUWykoC0AUKxcs67N4iUK49-78x9vVCn9P_ULD_SqCs,421
|
63
|
+
architect_py/grpc/models/Algo/StartAlgoRequest.py,sha256=wo79itwoC_J4qHYh9Nygy1Ubhtv97cmQ3fRkLGSCLkw,1005
|
64
|
+
architect_py/grpc/models/Algo/StartAlgoResponse.py,sha256=mS5kF5NEreJo6cNu4HFoDk3kHM6njvJ6o0akgIX4Q2A,421
|
65
|
+
architect_py/grpc/models/Algo/StopAlgoRequest.py,sha256=pKmj0L9cNTfuA682QnM87PjRBcJ_IsWPvKJdulK8Nwo,997
|
66
|
+
architect_py/grpc/models/Algo/StopAlgoResponse.py,sha256=_HTDziNPpcVHTABHP-bdHGgro-lQRC44zf8J0Hv5dbA,418
|
59
67
|
architect_py/grpc/models/Algo/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
60
68
|
architect_py/grpc/models/Auth/CreateJwtRequest.py,sha256=3ezxlv3LbqZhM00kUrdn5OtYBGVMCZtw05m8NNOYMTI,1110
|
61
69
|
architect_py/grpc/models/Auth/CreateJwtResponse.py,sha256=G1rsG7f4gMiWK4WVxTZMzFSy08z80nQCnZHJWWfXDNQ,483
|
62
70
|
architect_py/grpc/models/Auth/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
71
|
+
architect_py/grpc/models/Boss/DepositsRequest.py,sha256=DFf4InRz52RQt4tGrbHsDyb_9iyCNFFbQYJL922nNs4,922
|
72
|
+
architect_py/grpc/models/Boss/DepositsResponse.py,sha256=_qJvMEu9MAw-mreuRpUkbHMo7D_vSVJru_HZV2BYPmA,602
|
73
|
+
architect_py/grpc/models/Boss/RqdAccountStatisticsRequest.py,sha256=gp51kcbU-9Iv_7TG-jcIN2owg9NIJDxFl755TJVk2TM,1027
|
74
|
+
architect_py/grpc/models/Boss/RqdAccountStatisticsResponse.py,sha256=6eXUsphh7MwLrGsIq3nt2jRaIrGNozbZy22Fr5uRvww,697
|
75
|
+
architect_py/grpc/models/Boss/StatementUrlRequest.py,sha256=ffOWj7p_lMX9X7s3uB8PnH6hxFUnsHnjoQqu0hchnn8,974
|
76
|
+
architect_py/grpc/models/Boss/StatementUrlResponse.py,sha256=1fjM1eBgR-XFC1OevgYWXK4_uI-y4gGY-AW4b6jZq4A,542
|
77
|
+
architect_py/grpc/models/Boss/StatementsRequest.py,sha256=8YghcPpXgHo5y0XReRLnqxhFElwy1cm2diMR7ZS78B8,938
|
78
|
+
architect_py/grpc/models/Boss/StatementsResponse.py,sha256=RmAaSRzMh19vZKQmEJS041rlh47u52MkQvG2xvDXbM0,622
|
79
|
+
architect_py/grpc/models/Boss/WithdrawalsRequest.py,sha256=876d2gsGbSTPZ74wCoe0nFD0dsUIwp5JHBeezf_to0U,946
|
80
|
+
architect_py/grpc/models/Boss/WithdrawalsResponse.py,sha256=th6r28rjNBUuMBs95lwf9pxaxFtrwKJ_VAq7egwMVM8,632
|
81
|
+
architect_py/grpc/models/Boss/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
63
82
|
architect_py/grpc/models/Core/ConfigRequest.py,sha256=9taH97J4b-_Co7d-o_zHOPg_vckc_InvnADXYpd_MlM,809
|
64
83
|
architect_py/grpc/models/Core/ConfigResponse.py,sha256=pQimTNwdE-FL2Z1Pq6_YRPmagt-ZgJoub9P1lpj0gVk,556
|
65
84
|
architect_py/grpc/models/Core/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
@@ -76,7 +95,7 @@ architect_py/grpc/models/Folio/AccountSummariesRequest.py,sha256=epYjLFc1cMblp04
|
|
76
95
|
architect_py/grpc/models/Folio/AccountSummariesResponse.py,sha256=YoJddUl0TB1pkoI7C_avt94RSL9ZCf2u8_kOYpewRGI,678
|
77
96
|
architect_py/grpc/models/Folio/AccountSummary.py,sha256=MtIzJ4v78gD1jZPoa4ooV6H3sctfOf1FV2vgiUiXDp4,3633
|
78
97
|
architect_py/grpc/models/Folio/AccountSummaryRequest.py,sha256=qu9f-liMEOqxq8LM2h9EosCj2vtTJwduUKjiwYO8GTo,1002
|
79
|
-
architect_py/grpc/models/Folio/HistoricalFillsRequest.py,sha256=
|
98
|
+
architect_py/grpc/models/Folio/HistoricalFillsRequest.py,sha256=ybd6vIO1xkiovUW9Q-Pl4K21kfmFX8uMOoE7LZqsOLU,2241
|
80
99
|
architect_py/grpc/models/Folio/HistoricalFillsResponse.py,sha256=MmHFvt-FuLgw93fHN8lfcyMsG2qHys1gUD0gq0QZGyM,775
|
81
100
|
architect_py/grpc/models/Folio/HistoricalOrdersRequest.py,sha256=SN_msSU5bHYxPEG4qW8Np_9U40E6OWgZQ534qPTUP1g,2558
|
82
101
|
architect_py/grpc/models/Folio/HistoricalOrdersResponse.py,sha256=_h3XgnGOGaHfVjtkTcyi5t805QLHNytPhjHgoiEzYV4,592
|
@@ -88,7 +107,7 @@ architect_py/grpc/models/Marketdata/ArrayOfL1BookSnapshot.py,sha256=Os13kKncZgwo
|
|
88
107
|
architect_py/grpc/models/Marketdata/Candle.py,sha256=VDGh7cDiDhu91dAxARLMJkE2CqJvOLL4m1Z8u-cK9KE,8259
|
89
108
|
architect_py/grpc/models/Marketdata/HistoricalCandlesRequest.py,sha256=uJvsHOn2gXD9w4ybk1iXu4Z1LJ4g5g89y_DIwAMUChY,1587
|
90
109
|
architect_py/grpc/models/Marketdata/HistoricalCandlesResponse.py,sha256=_LGtTw6dVMtF0U6N7l68IbxDDMcooOEW7YsJaoLtniY,604
|
91
|
-
architect_py/grpc/models/Marketdata/L1BookSnapshot.py,sha256=
|
110
|
+
architect_py/grpc/models/Marketdata/L1BookSnapshot.py,sha256=X7Jm7vpBuyDJx1XI5-1XvjH5gw8h-7pap_1RTv9PHw8,3541
|
92
111
|
architect_py/grpc/models/Marketdata/L1BookSnapshotRequest.py,sha256=9TxfqAivsmZgmIuIemmX6A9bTvMvVU6rWYDGi86gZZg,1072
|
93
112
|
architect_py/grpc/models/Marketdata/L1BookSnapshotsRequest.py,sha256=TFGnuPfTcHMSO849WnEPj1a52RsVReAEWqQ9Fb3La1g,1189
|
94
113
|
architect_py/grpc/models/Marketdata/L2BookSnapshot.py,sha256=MEyDSZ6LfAtyujGLRZ6pts5o7UNIp8A9_kqV6K7Y-k8,2572
|
@@ -112,17 +131,24 @@ architect_py/grpc/models/Marketdata/TickersRequest.py,sha256=Hzjj3vIdLHI3Iyw3Ncj
|
|
112
131
|
architect_py/grpc/models/Marketdata/TickersResponse.py,sha256=CLzKx-ItwH9-Qq8YruFhXh7TmtHwzNRMEOPJ9LQD9co,574
|
113
132
|
architect_py/grpc/models/Marketdata/Trade.py,sha256=iJOEhcObcNa9SLVug3rjKnNxDuQRyOpxYQnGi1OA2Rw,2503
|
114
133
|
architect_py/grpc/models/Marketdata/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
115
|
-
architect_py/grpc/models/Oms/Cancel.py,sha256
|
134
|
+
architect_py/grpc/models/Oms/Cancel.py,sha256=P550abgbBqVbC3UE7YaOaEytF__DsTYWsepNvkHaAQE,2357
|
116
135
|
architect_py/grpc/models/Oms/CancelAllOrdersRequest.py,sha256=oCRbluj6nyoDCHQszPDRIBt4ygFyO7QHZhCf8T8-fYM,1474
|
117
136
|
architect_py/grpc/models/Oms/CancelAllOrdersResponse.py,sha256=YM1H_nrV4RhpLMEwS6LHASZnS6tasDLtVGoa7UlbQ5U,438
|
118
137
|
architect_py/grpc/models/Oms/CancelOrderRequest.py,sha256=0yJysCf0IcwUevEqVnAkIm-OkOAbp_vOwh1p1ljSsp8,1939
|
119
138
|
architect_py/grpc/models/Oms/OpenOrdersRequest.py,sha256=5Uv9ndI2WqRJgOWNLeKcIV8czb0ff6wHUW0gokeBktg,1804
|
120
139
|
architect_py/grpc/models/Oms/OpenOrdersResponse.py,sha256=HT4YXjbbwdp2rLLXxoetF33DGe2j403soMLme2p18ts,592
|
121
|
-
architect_py/grpc/models/Oms/Order.py,sha256=
|
140
|
+
architect_py/grpc/models/Oms/Order.py,sha256=VvWAy9cp3fnKIvjR_ZSTcUZ_-lKZ4EadScE9exdhV9Q,9696
|
122
141
|
architect_py/grpc/models/Oms/PendingCancelsRequest.py,sha256=jdbBOpCHBlZFAZfF6urJZXXa5Dr5cTRR3AJ9ss4rY6E,1620
|
123
142
|
architect_py/grpc/models/Oms/PendingCancelsResponse.py,sha256=mWRNRDa489Vdg-r7dJMOmfOO8l57yg8lBMynBDcY60A,628
|
124
|
-
architect_py/grpc/models/Oms/PlaceOrderRequest.py,sha256=
|
143
|
+
architect_py/grpc/models/Oms/PlaceOrderRequest.py,sha256=U1TJFpyVS5cRGrF-H78RifYkLWqSi1yY7cddbsLSUgI,7732
|
125
144
|
architect_py/grpc/models/Oms/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
145
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsChain.py,sha256=8Sdp57aUXlW13X1POlBKxxaEZofwRZ7VGDLzq1l9GoU,732
|
146
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeks.py,sha256=Jhb5CM4t84EdETDO3SOakHkuaWG30Dm4lREpKgBFzFM,742
|
147
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeksRequest.py,sha256=Mmwv-3IGp7TpyogwLqh0HDgdrvuJjVdmKdnGJwlP_vQ,1145
|
148
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsChainRequest.py,sha256=LE2MkLUCLKdYpSjqrP3DdZiCB31mv4KEnsNYKZD3TQw,1088
|
149
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsExpirations.py,sha256=JwHKc6aaSrSL5HTFMuV_BSdPdipCevj8WfS214iHIQw,702
|
150
|
+
architect_py/grpc/models/OptionsMarketdata/OptionsExpirationsRequest.py,sha256=m_7ZIQk7O1WZLoEd-euoNgKFin13S2bFO4oBWbpApJg,1018
|
151
|
+
architect_py/grpc/models/OptionsMarketdata/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
126
152
|
architect_py/grpc/models/Orderflow/Dropcopy.py,sha256=hjcGXX1V-pWJNjirLW2a2-oLbb9WUw_h1nhFh-hPthM,621
|
127
153
|
architect_py/grpc/models/Orderflow/DropcopyRequest.py,sha256=LPJgD2wj4a7p1s8O32q6w7lU_pm4I2lqriPdLqyimUM,1831
|
128
154
|
architect_py/grpc/models/Orderflow/Orderflow.py,sha256=5y8d33GvVspOg5Nn_kXrV3VYKCts-MXiiFevrpRTORA,1894
|
@@ -131,6 +157,8 @@ architect_py/grpc/models/Orderflow/SubscribeOrderflowRequest.py,sha256=98Qs3jHXD
|
|
131
157
|
architect_py/grpc/models/Orderflow/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
132
158
|
architect_py/grpc/models/Symbology/DownloadProductCatalogRequest.py,sha256=67YWaTuNykzCoNRrTkN-KMDvhc68dNYZm6KBeW1h1DU,1048
|
133
159
|
architect_py/grpc/models/Symbology/DownloadProductCatalogResponse.py,sha256=dz8d7T4vzVIhY3Gia7SGJa5ZV1uHmjczTixKOpYkEBA,706
|
160
|
+
architect_py/grpc/models/Symbology/ExecutionInfoRequest.py,sha256=zqORuGcSzmLurEvlNrTBSj09-UlwuUEuT_j3FIK_gfc,1152
|
161
|
+
architect_py/grpc/models/Symbology/ExecutionInfoResponse.py,sha256=qSWUEetfRwln7Q8IO97cGs0vU-aUf7f6iMBzElD6-Ls,674
|
134
162
|
architect_py/grpc/models/Symbology/PruneExpiredSymbolsRequest.py,sha256=Yp-YyJRpvwBIumllqke1joFjaUsCyq21VkOHDyb06Xw,1431
|
135
163
|
architect_py/grpc/models/Symbology/PruneExpiredSymbolsResponse.py,sha256=vHldBb0QqXqGzM1yjUYrbiO3LCmojIKvdAU4inlYS3c,456
|
136
164
|
architect_py/grpc/models/Symbology/SubscribeSymbology.py,sha256=Cyyf6x1Syb40UNAA_ZrroNul3ccxHanvEHzBCajpArI,429
|
@@ -144,12 +172,14 @@ architect_py/grpc/models/Symbology/UploadProductCatalogResponse.py,sha256=AiUFNc
|
|
144
172
|
architect_py/grpc/models/Symbology/UploadSymbologyRequest.py,sha256=XRMC6W6LLG0dyAU54RitAD0p0dCZTs16NFxubK_WNI0,1840
|
145
173
|
architect_py/grpc/models/Symbology/UploadSymbologyResponse.py,sha256=LM6iHjta4yZY784qMR5etG9gKjiBsBCntZqAcmaOHac,444
|
146
174
|
architect_py/grpc/models/Symbology/__init__.py,sha256=sIyaEvJdP-VmGTGPPqZuRjKn4bc7NUClJ76Gd5uq-5s,57
|
175
|
+
architect_py/internal_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
176
|
+
architect_py/internal_utils/no_pandas.py,sha256=RFlzX85yjI7XnoWHutqvtYlzKVHw8DF2y-DyoeS_vys,44
|
147
177
|
architect_py/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
148
|
-
architect_py/tests/conftest.py,sha256=
|
178
|
+
architect_py/tests/conftest.py,sha256=5CcEuqakcU-ZapywYZRcLI5y1GicrTeOxiEixt--R0w,3552
|
149
179
|
architect_py/tests/test_book_building.py,sha256=biqs8X9bw1YSb6mrCDS-ELesdD-P5F6bE3MYXP0BeQ4,1236
|
150
|
-
architect_py/tests/test_marketdata.py,sha256=
|
180
|
+
architect_py/tests/test_marketdata.py,sha256=mhYIiNhmsY706PQD3Nvto0l4uDl5dPHn8BcqGPgFCA8,4714
|
151
181
|
architect_py/tests/test_order_entry.py,sha256=ytfvJVMsl6c0nyKP-oTwquxoOkrI57BlQsC6SKlWfSM,1193
|
152
|
-
architect_py/tests/test_orderflow.py,sha256=
|
182
|
+
architect_py/tests/test_orderflow.py,sha256=_EN-Y1NM8171KHhZ41xUg8f5ZFO0-r2HGjIWOTTJZ9s,1051
|
153
183
|
architect_py/tests/test_portfolio_management.py,sha256=LPlkLP2SllLPm0Un7OptfVo96uqiDI7-osTaHxH5m54,677
|
154
184
|
architect_py/tests/test_rounding.py,sha256=cAQ1-tWOVgxENt0Fzs9YcFDdDDYmCtOHvAA_w76wy9g,1417
|
155
185
|
architect_py/tests/test_symbology.py,sha256=892FN_FGwE8t4lVQtUMGKav69MGzHACeF5RAYrAEdBw,2707
|
@@ -159,26 +189,26 @@ architect_py/utils/orderbook.py,sha256=JM02NhHbmK3sNaS2Ara8FBY4TvKvtMIzJW1oVd8KC
|
|
159
189
|
architect_py/utils/pandas.py,sha256=a8P_jKPIhDubAyUjdhKnFMasZM_m_sDGNx4fq5ONOpo,982
|
160
190
|
architect_py/utils/price_bands.py,sha256=j7ioSA3dx025CD5E2Vg7XQvmjPvxQb-gzQBfQTovpTw,21874
|
161
191
|
architect_py/utils/symbol_parsing.py,sha256=OjJzk2c6QU2s0aJMSyVEzlWD5Vy-RlakJVW7jNHVDJk,845
|
162
|
-
architect_py-5.0.
|
192
|
+
architect_py-5.0.0b3.dist-info/licenses/LICENSE,sha256=6P0_5gYN8iPWPZeqA9nxiO3tRQmcSA1ijAVR7C8j1SI,11362
|
163
193
|
examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
164
|
-
examples/book_subscription.py,sha256=
|
165
|
-
examples/candles.py,sha256=
|
166
|
-
examples/common.py,sha256=
|
167
|
-
examples/external_cpty.py,sha256=
|
168
|
-
examples/funding_rate_mean_reversion_algo.py,sha256=
|
169
|
-
examples/order_sending.py,sha256=
|
170
|
-
examples/stream_l1_marketdata.py,sha256=
|
171
|
-
examples/stream_l2_marketdata.py,sha256=
|
172
|
-
examples/trades.py,sha256=
|
173
|
-
examples/tutorial_async.py,sha256=
|
174
|
-
examples/tutorial_sync.py,sha256=
|
175
|
-
scripts/generate_functions_md.py,sha256
|
176
|
-
scripts/generate_sync_interface.py,sha256=
|
177
|
-
scripts/postprocess_grpc.py,sha256
|
178
|
-
scripts/preprocess_grpc_schema.py,sha256=
|
194
|
+
examples/book_subscription.py,sha256=jw629X6V0kpIQp2WBBUdBQ_O-lsR6zwnIH1AnyrrINQ,1507
|
195
|
+
examples/candles.py,sha256=GKQcpsbMfG5gdgwinC1MdYNRGXjb629TFVWzu_raZ3I,850
|
196
|
+
examples/common.py,sha256=ja1ePszgGhL4cgPW_mlaS_I7iDvX0vD7sSJ00EpTMi4,3031
|
197
|
+
examples/external_cpty.py,sha256=x47tkdYeVoFuBmfura28BUu282097Pzv-WX_Z6ePgLo,2551
|
198
|
+
examples/funding_rate_mean_reversion_algo.py,sha256=vkT0ehYOjb4S05pBycja6qWIpEjzHp3lpoXkg4ctkJc,6631
|
199
|
+
examples/order_sending.py,sha256=agVwqkMCAUvzTu4rFd-cX6fYRajpltMRWXD65UYOm8c,2642
|
200
|
+
examples/stream_l1_marketdata.py,sha256=WBaiRY5QNBu3p9EkOpL1FvWRyFuoQprSKETnm61QoHQ,774
|
201
|
+
examples/stream_l2_marketdata.py,sha256=KGNnFoa2CMu3-iuEonjI6NJLWftTOf-zgUGO9cpRGVA,1137
|
202
|
+
examples/trades.py,sha256=gQDZN5OmbHlfnlB7Zg4V8JCkB9LCABjUBeTv5_cq1CM,607
|
203
|
+
examples/tutorial_async.py,sha256=jIaPonLpaovonEDjsbFOZQ_XxesqnXekqQsfIpc0u3k,2738
|
204
|
+
examples/tutorial_sync.py,sha256=AXZnTfr14ppWjH8s11BtWOwqb4W3yVyRgFFVP9xPWec,2881
|
205
|
+
scripts/generate_functions_md.py,sha256=-rVRhbHlDodGH2a32UCsMLIpgXtDvOhBmkHa0RqDpCA,6232
|
206
|
+
scripts/generate_sync_interface.py,sha256=oWR9JfNSP__GJNfDfb7rzGLWw1nFrpRHBX5CT6lMYx4,8349
|
207
|
+
scripts/postprocess_grpc.py,sha256=-yPbnSnK_JMzMiyCcQQe3Pc76Wu_LQT6Al03UzwyU60,21763
|
208
|
+
scripts/preprocess_grpc_schema.py,sha256=ZCMdJpOtkL5sZ4n6DxD8198zvsiC9jCFipwZGk3pN80,22828
|
179
209
|
templates/exceptions.py,sha256=tIHbiO5Q114h9nPwJXsgHvW_bERLwxuNp9Oj41p6t3A,2379
|
180
210
|
templates/juniper_base_client.py,sha256=x3W5bRmeAK-oznsjJm_4TvrRJJICW23jKHcCKUIj7Vg,12577
|
181
|
-
architect_py-5.0.
|
182
|
-
architect_py-5.0.
|
183
|
-
architect_py-5.0.
|
184
|
-
architect_py-5.0.
|
211
|
+
architect_py-5.0.0b3.dist-info/METADATA,sha256=2C40fxOMCJCu1muCYIbJ80TblcXBatzAdhUQYIMAeIE,3925
|
212
|
+
architect_py-5.0.0b3.dist-info/WHEEL,sha256=QZxptf4Y1BKFRCEDxD4h2V0mBFQOVFLFEpvxHmIs52A,91
|
213
|
+
architect_py-5.0.0b3.dist-info/top_level.txt,sha256=UjtO97OACFQ9z5MzS-X2wBlt5Ovk1vxakQPKfokI454,40
|
214
|
+
architect_py-5.0.0b3.dist-info/RECORD,,
|
examples/book_subscription.py
CHANGED
@@ -4,8 +4,8 @@ import os
|
|
4
4
|
from pydantic import ValidationError
|
5
5
|
|
6
6
|
from architect_py.async_client import AsyncClient
|
7
|
+
from architect_py.common_types.tradable_product import TradableProduct
|
7
8
|
from architect_py.graphql_client.exceptions import GraphQLClientHttpError
|
8
|
-
from architect_py.scalars import TradableProduct
|
9
9
|
|
10
10
|
from .common import connect_async_client
|
11
11
|
|
@@ -35,10 +35,9 @@ def print_book(book):
|
|
35
35
|
|
36
36
|
async def main():
|
37
37
|
c: AsyncClient = await connect_async_client()
|
38
|
-
await c.grpc_client.change_channel("binance.marketdata.architect.co")
|
39
38
|
symbol = TradableProduct("SOL-USDC BINANCE Perpetual/USDC Crypto")
|
40
39
|
try:
|
41
|
-
stream = c.
|
40
|
+
stream = c.stream_l1_book_snapshots(symbols=[symbol], venue="BINANCE")
|
42
41
|
# it is better to do `Decimal("0.1")` instead of Decimal(0.1) to avoid floating point errors
|
43
42
|
async for book in stream:
|
44
43
|
print_book(book)
|
examples/candles.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import asyncio
|
2
2
|
|
3
3
|
from architect_py.async_client import AsyncClient
|
4
|
+
from architect_py.common_types.tradable_product import TradableProduct
|
4
5
|
from architect_py.graphql_client.exceptions import GraphQLClientHttpError
|
5
|
-
from architect_py.
|
6
|
-
from architect_py.scalars import TradableProduct
|
6
|
+
from architect_py.grpc.models.definitions import CandleWidth
|
7
7
|
|
8
8
|
from .common import connect_async_client
|
9
9
|
|
@@ -15,7 +15,7 @@ async def main():
|
|
15
15
|
tradable_product = TradableProduct(symbol, quote)
|
16
16
|
venue = "CME"
|
17
17
|
try:
|
18
|
-
stream = c.
|
18
|
+
stream = c.stream_candles(
|
19
19
|
tradable_product,
|
20
20
|
venue,
|
21
21
|
candle_widths=[CandleWidth.OneHour],
|
examples/common.py
CHANGED
@@ -9,43 +9,53 @@ from architect_py.client import Client
|
|
9
9
|
|
10
10
|
@dataclass
|
11
11
|
class Config:
|
12
|
-
host: str
|
13
12
|
api_key: str
|
14
13
|
api_secret: str
|
15
|
-
|
14
|
+
paper_trading: bool
|
15
|
+
endpoint: str
|
16
16
|
|
17
17
|
|
18
18
|
def load_config() -> Config:
|
19
|
-
load_dotenv()
|
20
|
-
|
19
|
+
loaded = load_dotenv()
|
20
|
+
if not loaded:
|
21
|
+
raise ValueError(
|
22
|
+
"⚠️ .env file not found or had no new variables\n"
|
23
|
+
"Please create a .env file with the following variables:\n"
|
24
|
+
"ARCHITECT_ENDPOINT=your_endpoint (e.g. app.architect.co)\n"
|
25
|
+
"ARCHITECT_API_KEY=your_api_key (get from https://app.architect.co/user/account)\n"
|
26
|
+
"ARCHITECT_API_SECRET=your_api_secret\n"
|
27
|
+
"ARCHITECT_PAPER_TRADING=true/false\n"
|
28
|
+
)
|
29
|
+
endpoint = os.environ["ARCHITECT_ENDPOINT"]
|
21
30
|
api_key = os.getenv("ARCHITECT_API_KEY")
|
22
31
|
api_secret = os.getenv("ARCHITECT_API_SECRET")
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
if explicit_use_tls == "true" or explicit_use_tls == "1":
|
28
|
-
use_tls = True
|
29
|
-
elif explicit_use_tls is None:
|
30
|
-
use_tls = implicit_use_tls
|
32
|
+
paper_trading_str = os.getenv("ARCHITECT_PAPER_TRADING")
|
33
|
+
paper_trading: bool = paper_trading_str is not None and (
|
34
|
+
paper_trading_str.lower() == "true"
|
35
|
+
)
|
31
36
|
|
32
37
|
if api_key is None:
|
33
|
-
raise ValueError("API key is required")
|
38
|
+
raise ValueError("API key is required in .env file")
|
34
39
|
|
35
40
|
if api_secret is None:
|
36
|
-
raise ValueError("API secret is required")
|
41
|
+
raise ValueError("API secret is required in .env file")
|
37
42
|
|
38
|
-
return Config(
|
43
|
+
return Config(
|
44
|
+
api_key,
|
45
|
+
api_secret,
|
46
|
+
paper_trading,
|
47
|
+
endpoint,
|
48
|
+
)
|
39
49
|
|
40
50
|
|
41
51
|
def connect_client():
|
42
52
|
config = load_config()
|
43
53
|
|
44
54
|
c = Client(
|
45
|
-
|
55
|
+
endpoint=config.endpoint,
|
46
56
|
api_key=config.api_key,
|
47
57
|
api_secret=config.api_secret,
|
48
|
-
|
58
|
+
paper_trading=config.paper_trading,
|
49
59
|
)
|
50
60
|
return c
|
51
61
|
|
@@ -53,11 +63,10 @@ def connect_client():
|
|
53
63
|
async def connect_async_client():
|
54
64
|
config = load_config()
|
55
65
|
c = await AsyncClient.connect(
|
56
|
-
|
66
|
+
endpoint=config.endpoint,
|
57
67
|
api_key=config.api_key,
|
58
68
|
api_secret=config.api_secret,
|
59
|
-
paper_trading=
|
60
|
-
use_tls=config.use_tls,
|
69
|
+
paper_trading=config.paper_trading,
|
61
70
|
)
|
62
71
|
return c
|
63
72
|
|
examples/external_cpty.py
CHANGED
@@ -5,9 +5,8 @@ from typing import Iterator
|
|
5
5
|
|
6
6
|
import grpc
|
7
7
|
|
8
|
-
from architect_py.
|
9
|
-
from architect_py.
|
10
|
-
from architect_py.grpc_client.definitions import (
|
8
|
+
from architect_py.grpc.models.Cpty.CptyResponse import Symbology
|
9
|
+
from architect_py.grpc.models.definitions import (
|
11
10
|
CptyLoginRequest,
|
12
11
|
CptyLogoutRequest,
|
13
12
|
ExecutionInfo,
|
@@ -15,7 +14,8 @@ from architect_py.grpc_client.definitions import (
|
|
15
14
|
SimpleDecimal,
|
16
15
|
Unit,
|
17
16
|
)
|
18
|
-
from architect_py.
|
17
|
+
from architect_py.grpc.models.Orderflow.OrderflowRequest import CancelOrder, PlaceOrder
|
18
|
+
from architect_py.grpc.server import (
|
19
19
|
CptyServicer,
|
20
20
|
OrderflowServicer,
|
21
21
|
add_CptyServicer_to_server,
|