architect-py 5.1.2__tar.gz → 5.1.4__tar.gz
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-5.1.2 → architect_py-5.1.4}/PKG-INFO +3 -3
- {architect_py-5.1.2 → architect_py-5.1.4}/README.md +1 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/__init__.py +19 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/async_client.py +149 -65
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/client.py +15 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/client.pyi +26 -8
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/client.py +37 -13
- architect_py-5.1.4/architect_py/grpc/models/AlgoHelper/AlgoParamTypes.py +31 -0
- architect_py-5.1.4/architect_py/grpc/models/Auth/AuthInfoRequest.py +37 -0
- architect_py-5.1.4/architect_py/grpc/models/Auth/AuthInfoResponse.py +30 -0
- architect_py-5.1.4/architect_py/grpc/models/Folio/AccountHistoryRequest.py +82 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/Candle.py +6 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L1BookSnapshot.py +17 -3
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L2BookSnapshot.py +6 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/Liquidation.py +6 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeL1BookSnapshotsRequest.py +14 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/Ticker.py +6 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/TickersRequest.py +4 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/Trade.py +6 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/Order.py +38 -14
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/PlaceOrderRequest.py +38 -14
- architect_py-5.1.4/architect_py/grpc/models/Symbology/__init__.py +2 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/__init__.py +4 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/definitions.py +174 -0
- architect_py-5.1.4/architect_py/grpc/orderflow.py +138 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_order_entry.py +9 -6
- architect_py-5.1.4/architect_py/tests/test_orderflow.py +130 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py.egg-info/PKG-INFO +3 -3
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py.egg-info/SOURCES.txt +9 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/book_subscription.py +1 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/candles.py +1 -1
- architect_py-5.1.2/examples/common.py → architect_py-5.1.4/examples/config.py +4 -48
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/funding_rate_mean_reversion_algo.py +24 -48
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/order_sending.py +1 -1
- architect_py-5.1.4/examples/orderflow_channel.py +56 -0
- architect_py-5.1.4/examples/orderflow_streaming.py +47 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/stream_l1_marketdata.py +1 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/stream_l2_marketdata.py +1 -1
- architect_py-5.1.4/examples/termutils.py +44 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/trades.py +1 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/tutorial_async.py +2 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/tutorial_sync.py +2 -1
- {architect_py-5.1.2 → architect_py-5.1.4}/pyproject.toml +3 -3
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/correct_sync_interface.py +5 -2
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/postprocess_grpc.py +17 -2
- architect_py-5.1.2/architect_py/grpc/models/Folio/AccountHistoryRequest.py +0 -51
- architect_py-5.1.2/architect_py/tests/test_orderflow.py +0 -41
- {architect_py-5.1.2 → architect_py-5.1.4}/LICENSE +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/common_types/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/common_types/order_dir.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/common_types/time_in_force.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/common_types/tradable_product.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/base_model.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/client.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/enums.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/exceptions.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/fragments.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_execution_info_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_execution_infos_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_first_notice_date_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_future_series_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_product_info_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/get_product_infos_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/input_types.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/juniper_base_client.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/search_symbols_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/graphql_client/user_id_query.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Accounts/AccountsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Accounts/AccountsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Accounts/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/AlgoOrder.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/AlgoOrderRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/AlgoOrdersRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/AlgoOrdersResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/CreateAlgoOrderRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/PauseAlgoRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/PauseAlgoResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/StartAlgoRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/StartAlgoResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/StopAlgoRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/StopAlgoResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Algo/__init__.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Auth → architect_py-5.1.4/architect_py/grpc/models/AlgoHelper}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Auth/CreateJwtRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Auth/CreateJwtResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Boss → architect_py-5.1.4/architect_py/grpc/models/Auth}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/DepositsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/DepositsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/RqdAccountStatisticsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/RqdAccountStatisticsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/StatementUrlRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/StatementUrlResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/StatementsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/StatementsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/WithdrawalsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Boss/WithdrawalsResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Core → architect_py-5.1.4/architect_py/grpc/models/Boss}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Core/ConfigRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Core/ConfigResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Core/RestartCptyRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Core/RestartCptyResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Cpty → architect_py-5.1.4/architect_py/grpc/models/Core}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptyRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptyResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptyStatus.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptyStatusRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptysRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Cpty/CptysResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Folio → architect_py-5.1.4/architect_py/grpc/models/Cpty}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/AccountHistoryResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/AccountSummariesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/AccountSummariesResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/AccountSummary.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/AccountSummaryRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/HistoricalFillsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/HistoricalFillsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/HistoricalOrdersRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Folio/HistoricalOrdersResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Health → architect_py-5.1.4/architect_py/grpc/models/Folio}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Health/HealthCheckRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Health/HealthCheckResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Marketdata → architect_py-5.1.4/architect_py/grpc/models/Health}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/ArrayOfL1BookSnapshot.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/HistoricalCandlesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/HistoricalCandlesResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L1BookSnapshotRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L1BookSnapshotsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L2BookSnapshotRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/L2BookUpdate.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/MarketStatus.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/MarketStatusRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeCandlesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeCurrentCandlesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeL2BookUpdatesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeLiquidationsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeManyCandlesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeTickersRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/SubscribeTradesRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/TickerRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/TickerUpdate.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Marketdata/TickersResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Oms → architect_py-5.1.4/architect_py/grpc/models/Marketdata}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/Cancel.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/CancelAllOrdersRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/CancelAllOrdersResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/CancelOrderRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/OpenOrdersRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/OpenOrdersResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/PendingCancelsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Oms/PendingCancelsResponse.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/OptionsMarketdata → architect_py-5.1.4/architect_py/grpc/models/Oms}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsChain.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeks.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsChainGreeksRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsChainRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsExpirations.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/OptionsMarketdata/OptionsExpirationsRequest.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Orderflow → architect_py-5.1.4/architect_py/grpc/models/OptionsMarketdata}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Orderflow/Dropcopy.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Orderflow/DropcopyRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Orderflow/Orderflow.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Orderflow/OrderflowRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Orderflow/SubscribeOrderflowRequest.py +0 -0
- {architect_py-5.1.2/architect_py/grpc/models/Symbology → architect_py-5.1.4/architect_py/grpc/models/Orderflow}/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/DownloadProductCatalogRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/DownloadProductCatalogResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/ExecutionInfoRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/ExecutionInfoResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/PruneExpiredSymbolsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/PruneExpiredSymbolsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SubscribeSymbology.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SymbologyRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SymbologySnapshot.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SymbologyUpdate.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SymbolsRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/SymbolsResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/UploadProductCatalogRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/UploadProductCatalogResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/UploadSymbologyRequest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/models/Symbology/UploadSymbologyResponse.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/resolve_endpoint.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/server.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/grpc/utils.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/conftest.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_book_building.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_encoding.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_marketdata.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_portfolio_management.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_rounding.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_symbology.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/tests/test_sync_client.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/nearest_tick.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/nearest_tick_2.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/orderbook.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/pandas.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/price_bands.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py/utils/symbol_parsing.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py.egg-info/dependency_links.txt +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py.egg-info/requires.txt +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/architect_py.egg-info/top_level.txt +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/__init__.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/examples/external_cpty.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/add_imports_to_inits.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/generate_functions_md.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/preprocess_grpc_schema.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/scripts/prune_graphql_schema.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/setup.cfg +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/templates/exceptions.py +0 -0
- {architect_py-5.1.2 → architect_py-5.1.4}/templates/juniper_base_client.py +0 -0
@@ -1,11 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: architect-py
|
3
|
-
Version: 5.1.
|
3
|
+
Version: 5.1.4
|
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
|
7
|
-
Project-URL: Homepage, https://www.architect.co/brokerage/overview
|
8
7
|
Project-URL: Documentation, https://docs.architect.co
|
8
|
+
Project-URL: Homepage, https://www.architect.co/brokerage/overview
|
9
9
|
Project-URL: Repository, https://github.com/architect-xyz/architect-py
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
11
11
|
Classifier: Operating System :: OS Independent
|
@@ -48,7 +48,7 @@ Go to [FUNCTIONS.md](FUNCTIONS.md) file to see a catalog of methods.
|
|
48
48
|
|
49
49
|
## Examples
|
50
50
|
|
51
|
-
Go to the [Examples](./examples) to see examples of a variety of common use cases.
|
51
|
+
Go to the [Examples](./examples) to see examples of a variety of common use cases. To run a specific example, use e.g. `python -m examples.orderflow_streaming`.
|
52
52
|
|
53
53
|
## Documentation
|
54
54
|
|
@@ -23,7 +23,7 @@ Go to [FUNCTIONS.md](FUNCTIONS.md) file to see a catalog of methods.
|
|
23
23
|
|
24
24
|
## Examples
|
25
25
|
|
26
|
-
Go to the [Examples](./examples) to see examples of a variety of common use cases.
|
26
|
+
Go to the [Examples](./examples) to see examples of a variety of common use cases. To run a specific example, use e.g. `python -m examples.orderflow_streaming`.
|
27
27
|
|
28
28
|
## Documentation
|
29
29
|
|
@@ -1,12 +1,13 @@
|
|
1
1
|
# ruff: noqa:I001
|
2
2
|
|
3
|
-
__version__ = "5.1.
|
3
|
+
__version__ = "5.1.4"
|
4
4
|
|
5
5
|
from .utils.nearest_tick import TickRoundMethod
|
6
6
|
from .async_client import AsyncClient
|
7
7
|
from .client import Client
|
8
8
|
from .common_types import OrderDir, TradableProduct, TimeInForce, Venue
|
9
9
|
from .grpc.models.definitions import (
|
10
|
+
AccountHistoryGranularity,
|
10
11
|
AccountIdOrName,
|
11
12
|
AccountPosition,
|
12
13
|
AccountStatistics,
|
@@ -32,12 +33,14 @@ from .grpc.models.definitions import (
|
|
32
33
|
SortTickersBy,
|
33
34
|
Statement,
|
34
35
|
TraderIdOrEmail,
|
36
|
+
TriggerLimitOrderType,
|
35
37
|
UserId,
|
36
38
|
Withdrawal,
|
37
39
|
AccountPermissions,
|
38
40
|
AliasKind,
|
39
41
|
DerivativeKind,
|
40
42
|
FillKind,
|
43
|
+
HumanDuration,
|
41
44
|
Unit,
|
42
45
|
MinOrderQuantityUnit,
|
43
46
|
OptionsExerciseType,
|
@@ -55,6 +58,7 @@ from .grpc.models.definitions import (
|
|
55
58
|
SnapshotOrUpdateForStringAndProductCatalogInfo2,
|
56
59
|
SnapshotOrUpdateForStringAndString1,
|
57
60
|
SnapshotOrUpdateForStringAndString2,
|
61
|
+
SpreaderPhase,
|
58
62
|
SimpleDecimal,
|
59
63
|
Varying1,
|
60
64
|
Varying,
|
@@ -82,6 +86,8 @@ from .grpc.models.definitions import (
|
|
82
86
|
SnapshotOrUpdateForStringAndOptionsSeriesInfo2,
|
83
87
|
SnapshotOrUpdateForStringAndSnapshotOrUpdateForStringAndProductCatalogInfo1,
|
84
88
|
SnapshotOrUpdateForStringAndSnapshotOrUpdateForStringAndProductCatalogInfo2,
|
89
|
+
SpreaderParams,
|
90
|
+
SpreaderStatus,
|
85
91
|
Account,
|
86
92
|
FutureSpread,
|
87
93
|
Option,
|
@@ -110,6 +116,9 @@ from .grpc.models.Algo.StartAlgoRequest import StartAlgoRequest
|
|
110
116
|
from .grpc.models.Algo.StartAlgoResponse import StartAlgoResponse
|
111
117
|
from .grpc.models.Algo.StopAlgoRequest import StopAlgoRequest
|
112
118
|
from .grpc.models.Algo.StopAlgoResponse import StopAlgoResponse
|
119
|
+
from .grpc.models.AlgoHelper.AlgoParamTypes import AlgoParamTypes
|
120
|
+
from .grpc.models.Auth.AuthInfoRequest import AuthInfoRequest
|
121
|
+
from .grpc.models.Auth.AuthInfoResponse import AuthInfoResponse
|
113
122
|
from .grpc.models.Auth.CreateJwtRequest import CreateJwtRequest
|
114
123
|
from .grpc.models.Auth.CreateJwtResponse import CreateJwtResponse
|
115
124
|
from .grpc.models.Boss.DepositsRequest import DepositsRequest
|
@@ -236,6 +245,7 @@ from .grpc.models.Symbology.UploadSymbologyResponse import UploadSymbologyRespon
|
|
236
245
|
__all__ = [
|
237
246
|
"AberrantFill",
|
238
247
|
"Account",
|
248
|
+
"AccountHistoryGranularity",
|
239
249
|
"AccountHistoryRequest",
|
240
250
|
"AccountHistoryResponse",
|
241
251
|
"AccountIdOrName",
|
@@ -255,9 +265,12 @@ __all__ = [
|
|
255
265
|
"AlgoOrderStatus",
|
256
266
|
"AlgoOrdersRequest",
|
257
267
|
"AlgoOrdersResponse",
|
268
|
+
"AlgoParamTypes",
|
258
269
|
"AliasKind",
|
259
270
|
"ArrayOfL1BookSnapshot",
|
260
271
|
"AsyncClient",
|
272
|
+
"AuthInfoRequest",
|
273
|
+
"AuthInfoResponse",
|
261
274
|
"Cancel",
|
262
275
|
"CancelAllOrdersRequest",
|
263
276
|
"CancelAllOrdersResponse",
|
@@ -315,6 +328,7 @@ __all__ = [
|
|
315
328
|
"HistoricalFillsResponse",
|
316
329
|
"HistoricalOrdersRequest",
|
317
330
|
"HistoricalOrdersResponse",
|
331
|
+
"HumanDuration",
|
318
332
|
"Index",
|
319
333
|
"L1BookSnapshot",
|
320
334
|
"L1BookSnapshotRequest",
|
@@ -394,6 +408,9 @@ __all__ = [
|
|
394
408
|
"SnapshotOrUpdateForStringAndString2",
|
395
409
|
"SortTickersBy",
|
396
410
|
"SpreadLeg",
|
411
|
+
"SpreaderParams",
|
412
|
+
"SpreaderPhase",
|
413
|
+
"SpreaderStatus",
|
397
414
|
"StartAlgoRequest",
|
398
415
|
"StartAlgoResponse",
|
399
416
|
"Statement",
|
@@ -428,6 +445,7 @@ __all__ = [
|
|
428
445
|
"TradableProduct",
|
429
446
|
"Trade",
|
430
447
|
"TraderIdOrEmail",
|
448
|
+
"TriggerLimitOrderType",
|
431
449
|
"Unit",
|
432
450
|
"Unknown",
|
433
451
|
"UploadProductCatalogRequest",
|
@@ -6,16 +6,15 @@ from decimal import Decimal
|
|
6
6
|
from typing import (
|
7
7
|
Any,
|
8
8
|
AsyncGenerator,
|
9
|
-
AsyncIterator,
|
10
9
|
List,
|
11
10
|
Literal,
|
12
11
|
Optional,
|
13
12
|
Sequence,
|
13
|
+
Tuple,
|
14
14
|
Union,
|
15
15
|
overload,
|
16
16
|
)
|
17
17
|
|
18
|
-
import grpc
|
19
18
|
import pandas as pd
|
20
19
|
|
21
20
|
# cannot do architect_py import * due to circular import
|
@@ -37,12 +36,11 @@ from architect_py.grpc.models.definitions import (
|
|
37
36
|
OrderSource,
|
38
37
|
OrderType,
|
39
38
|
SortTickersBy,
|
39
|
+
SpreaderParams,
|
40
40
|
TraderIdOrEmail,
|
41
|
+
TriggerLimitOrderType,
|
41
42
|
)
|
42
|
-
from architect_py.grpc.
|
43
|
-
OrderflowRequest_route,
|
44
|
-
OrderflowRequestUnannotatedResponseType,
|
45
|
-
)
|
43
|
+
from architect_py.grpc.orderflow import OrderflowChannel
|
46
44
|
from architect_py.grpc.resolve_endpoint import PAPER_GRPC_PORT, resolve_endpoint
|
47
45
|
from architect_py.utils.nearest_tick import TickRoundMethod
|
48
46
|
from architect_py.utils.orderbook import update_orderbook_side
|
@@ -55,7 +53,10 @@ class AsyncClient:
|
|
55
53
|
api_key: Optional[str] = None
|
56
54
|
api_secret: Optional[str] = None
|
57
55
|
paper_trading: bool
|
56
|
+
as_user: Optional[str] = None
|
57
|
+
as_role: Optional[str] = None
|
58
58
|
graphql_client: GraphQLClient
|
59
|
+
grpc_options: Sequence[Tuple[str, Any]] | None = None
|
59
60
|
grpc_core: Optional[GrpcClient] = None
|
60
61
|
grpc_marketdata: dict[Venue, GrpcClient] = {}
|
61
62
|
grpc_hmart: Optional[GrpcClient] = None
|
@@ -77,14 +78,24 @@ class AsyncClient:
|
|
77
78
|
paper_trading: bool,
|
78
79
|
endpoint: str = "https://app.architect.co",
|
79
80
|
graphql_port: Optional[int] = None,
|
81
|
+
grpc_options: Sequence[Tuple[str, Any]] | None = None,
|
82
|
+
as_user: Optional[str] = None,
|
83
|
+
as_role: Optional[str] = None,
|
80
84
|
**kwargs: Any,
|
81
85
|
) -> "AsyncClient":
|
82
86
|
"""
|
83
87
|
Connect to an Architect installation.
|
84
88
|
|
85
|
-
An `api_key` and `api_secret` can be created at https://app.architect.co/api-keys
|
89
|
+
An `api_key` and `api_secret` can be created at https://app.architect.co/api-keys.
|
86
90
|
|
87
91
|
Raises ValueError if the API key and secret are not the correct length or contain invalid characters.
|
92
|
+
|
93
|
+
## Advanced configuration
|
94
|
+
|
95
|
+
### gRPC channel options
|
96
|
+
|
97
|
+
Use `grpc_options` to configure gRPC channels created by this client.
|
98
|
+
See https://grpc.github.io/grpc/python/glossary.html#term-channel_arguments for reference.
|
88
99
|
"""
|
89
100
|
if paper_trading:
|
90
101
|
COLOR = "\033[30;43m"
|
@@ -121,8 +132,11 @@ class AsyncClient:
|
|
121
132
|
api_key=api_key,
|
122
133
|
api_secret=api_secret,
|
123
134
|
paper_trading=paper_trading,
|
135
|
+
as_user=as_user,
|
136
|
+
as_role=as_role,
|
124
137
|
grpc_host=grpc_host,
|
125
138
|
grpc_port=grpc_port,
|
139
|
+
grpc_options=grpc_options,
|
126
140
|
graphql_port=graphql_port,
|
127
141
|
use_ssl=use_ssl,
|
128
142
|
_i_know_what_i_am_doing=True,
|
@@ -142,8 +156,11 @@ class AsyncClient:
|
|
142
156
|
api_key: Optional[str] = None,
|
143
157
|
api_secret: Optional[str] = None,
|
144
158
|
paper_trading: bool,
|
159
|
+
as_user: Optional[str] = None,
|
160
|
+
as_role: Optional[str] = None,
|
145
161
|
grpc_host: str = "app.architect.co",
|
146
162
|
grpc_port: int,
|
163
|
+
grpc_options: Sequence[Tuple[str, Any]] | None = None,
|
147
164
|
graphql_port: Optional[int] = None,
|
148
165
|
use_ssl: bool = True,
|
149
166
|
_i_know_what_i_am_doing: bool = False,
|
@@ -172,6 +189,8 @@ class AsyncClient:
|
|
172
189
|
self.api_key = api_key
|
173
190
|
self.api_secret = api_secret
|
174
191
|
self.paper_trading = paper_trading
|
192
|
+
self.as_user = as_user
|
193
|
+
self.as_role = as_role
|
175
194
|
self.graphql_client = GraphQLClient(
|
176
195
|
host=grpc_host,
|
177
196
|
port=graphql_port,
|
@@ -179,7 +198,15 @@ class AsyncClient:
|
|
179
198
|
api_key=api_key,
|
180
199
|
api_secret=api_secret,
|
181
200
|
)
|
182
|
-
self.
|
201
|
+
self.grpc_options = grpc_options
|
202
|
+
self.grpc_core = GrpcClient(
|
203
|
+
host=grpc_host,
|
204
|
+
port=grpc_port,
|
205
|
+
use_ssl=use_ssl,
|
206
|
+
options=grpc_options,
|
207
|
+
as_user=as_user,
|
208
|
+
as_role=as_role,
|
209
|
+
)
|
183
210
|
|
184
211
|
async def close(self):
|
185
212
|
"""
|
@@ -223,7 +250,9 @@ class AsyncClient:
|
|
223
250
|
):
|
224
251
|
try:
|
225
252
|
req = CreateJwtRequest(api_key=self.api_key, api_secret=self.api_secret)
|
226
|
-
res: CreateJwtResponse = await self.grpc_core.unary_unary(
|
253
|
+
res: CreateJwtResponse = await self.grpc_core.unary_unary(
|
254
|
+
req, no_metadata=True
|
255
|
+
)
|
227
256
|
self.jwt = res.jwt
|
228
257
|
# CR alee: actually read the JWT to get the expiration time;
|
229
258
|
# for now, we just "know" that the JWTs are granted for an hour
|
@@ -268,7 +297,12 @@ class AsyncClient:
|
|
268
297
|
use_ssl,
|
269
298
|
)
|
270
299
|
self.grpc_marketdata[venue] = GrpcClient(
|
271
|
-
host=grpc_host,
|
300
|
+
host=grpc_host,
|
301
|
+
port=grpc_port,
|
302
|
+
use_ssl=use_ssl,
|
303
|
+
options=self.grpc_options,
|
304
|
+
as_user=self.as_user,
|
305
|
+
as_role=self.as_role,
|
272
306
|
)
|
273
307
|
except Exception as e:
|
274
308
|
logging.error("Failed to set marketdata endpoint: %s", e)
|
@@ -282,7 +316,12 @@ class AsyncClient:
|
|
282
316
|
try:
|
283
317
|
grpc_host, grpc_port, use_ssl = await resolve_endpoint(endpoint)
|
284
318
|
self.grpc_marketdata[venue] = GrpcClient(
|
285
|
-
host=grpc_host,
|
319
|
+
host=grpc_host,
|
320
|
+
port=grpc_port,
|
321
|
+
use_ssl=use_ssl,
|
322
|
+
options=self.grpc_options,
|
323
|
+
as_user=self.as_user,
|
324
|
+
as_role=self.as_role,
|
286
325
|
)
|
287
326
|
logging.debug(
|
288
327
|
f"Setting marketdata endpoint for {venue}: {grpc_host}:{grpc_port} use_ssl={use_ssl}"
|
@@ -315,7 +354,12 @@ class AsyncClient:
|
|
315
354
|
use_ssl,
|
316
355
|
)
|
317
356
|
self.grpc_hmart = GrpcClient(
|
318
|
-
host=grpc_host,
|
357
|
+
host=grpc_host,
|
358
|
+
port=grpc_port,
|
359
|
+
use_ssl=use_ssl,
|
360
|
+
options=self.grpc_options,
|
361
|
+
as_user=self.as_user,
|
362
|
+
as_role=self.as_role,
|
319
363
|
)
|
320
364
|
except Exception as e:
|
321
365
|
logging.error("Failed to set hmart endpoint: %s", e)
|
@@ -356,6 +400,12 @@ class AsyncClient:
|
|
356
400
|
res = await self.graphql_client.user_id_query()
|
357
401
|
return res.user_id, res.user_email
|
358
402
|
|
403
|
+
async def auth_info(self) -> AuthInfoResponse:
|
404
|
+
grpc_client = await self.core()
|
405
|
+
req = AuthInfoRequest()
|
406
|
+
res: AuthInfoResponse = await grpc_client.unary_unary(req)
|
407
|
+
return res
|
408
|
+
|
359
409
|
def enable_orderflow(self):
|
360
410
|
"""
|
361
411
|
@deprecated(reason="No longer needed; orderflow is enabled by default")
|
@@ -364,6 +414,17 @@ class AsyncClient:
|
|
364
414
|
"as of v5.0.0: enable_orderflow is deprecated; orderflow is enabled by default"
|
365
415
|
)
|
366
416
|
|
417
|
+
async def cpty_status(
|
418
|
+
self, kind: str, instance: Optional[str] = None
|
419
|
+
) -> CptyStatus:
|
420
|
+
"""
|
421
|
+
Get cpty status.
|
422
|
+
"""
|
423
|
+
grpc_client = await self.core()
|
424
|
+
req = CptyStatusRequest(kind=kind, instance=instance)
|
425
|
+
res: CptyStatus = await grpc_client.unary_unary(req)
|
426
|
+
return res
|
427
|
+
|
367
428
|
# ------------------------------------------------------------
|
368
429
|
# Symbology
|
369
430
|
# ------------------------------------------------------------
|
@@ -830,7 +891,11 @@ class AsyncClient:
|
|
830
891
|
return res
|
831
892
|
|
832
893
|
async def stream_l1_book_snapshots(
|
833
|
-
self,
|
894
|
+
self,
|
895
|
+
symbols: Sequence[TradableProduct | str],
|
896
|
+
venue: Venue,
|
897
|
+
*,
|
898
|
+
send_initial_snapshots: Optional[bool] = False,
|
834
899
|
) -> AsyncGenerator[L1BookSnapshot, None]:
|
835
900
|
"""
|
836
901
|
Subscribe to the stream of L1BookSnapshots for a symbol.
|
@@ -841,7 +906,11 @@ class AsyncClient:
|
|
841
906
|
venue: the venue to subscribe to
|
842
907
|
"""
|
843
908
|
grpc_client = await self.marketdata(venue)
|
844
|
-
req = SubscribeL1BookSnapshotsRequest(
|
909
|
+
req = SubscribeL1BookSnapshotsRequest(
|
910
|
+
symbols=list(symbols),
|
911
|
+
venue=venue,
|
912
|
+
send_initial_snapshots=send_initial_snapshots,
|
913
|
+
)
|
845
914
|
async for res in grpc_client.unary_stream(req):
|
846
915
|
yield res
|
847
916
|
|
@@ -1346,30 +1415,17 @@ class AsyncClient:
|
|
1346
1415
|
|
1347
1416
|
async def orderflow(
|
1348
1417
|
self,
|
1349
|
-
|
1350
|
-
) ->
|
1418
|
+
max_queue_size: int = 1024,
|
1419
|
+
) -> OrderflowChannel:
|
1351
1420
|
"""
|
1352
1421
|
A two-way channel for both order entry and listening to order updates (fills, acks, outs, etc.).
|
1353
1422
|
|
1354
1423
|
This is considered the most efficient way to trade in this SDK.
|
1355
1424
|
|
1356
|
-
|
1357
|
-
|
1358
|
-
|
1359
|
-
This WILL block the event loop until the stream is closed.
|
1425
|
+
This requires advanced knowledge of the SDK and asyncio, not recommended for beginners.
|
1426
|
+
See the OrderflowManager documentation for more details.
|
1360
1427
|
"""
|
1361
|
-
|
1362
|
-
decoder = grpc_client.get_decoder(OrderflowRequestUnannotatedResponseType)
|
1363
|
-
stub: grpc.aio.StreamStreamMultiCallable = grpc_client.channel.stream_stream(
|
1364
|
-
OrderflowRequest_route,
|
1365
|
-
request_serializer=grpc_client.encoder().encode,
|
1366
|
-
response_deserializer=decoder.decode,
|
1367
|
-
)
|
1368
|
-
call: grpc.aio._base_call.StreamStreamCall[OrderflowRequest, Orderflow] = stub(
|
1369
|
-
request_iterator, metadata=(("authorization", f"Bearer {grpc_client.jwt}"),)
|
1370
|
-
)
|
1371
|
-
async for update in call:
|
1372
|
-
yield update
|
1428
|
+
return OrderflowChannel(self, max_queue_size=max_queue_size)
|
1373
1429
|
|
1374
1430
|
async def stream_orderflow(
|
1375
1431
|
self,
|
@@ -1382,28 +1438,16 @@ class AsyncClient:
|
|
1382
1438
|
|
1383
1439
|
Example:
|
1384
1440
|
```python
|
1385
|
-
async for
|
1386
|
-
print(
|
1441
|
+
async for event in client.stream_orderflow(account, execution_venue, trader):
|
1442
|
+
print(event)
|
1387
1443
|
```
|
1388
1444
|
"""
|
1389
1445
|
grpc_client = await self.core()
|
1390
|
-
|
1446
|
+
req: SubscribeOrderflowRequest = SubscribeOrderflowRequest(
|
1391
1447
|
account=account, execution_venue=execution_venue, trader=trader
|
1392
1448
|
)
|
1393
|
-
|
1394
|
-
|
1395
|
-
stub: grpc.aio.UnaryStreamMultiCallable[
|
1396
|
-
SubscribeOrderflowRequest, Orderflow
|
1397
|
-
] = grpc_client.channel.unary_stream(
|
1398
|
-
SubscribeOrderflowRequest.get_route(),
|
1399
|
-
request_serializer=grpc_client.encoder().encode,
|
1400
|
-
response_deserializer=decoder.decode,
|
1401
|
-
)
|
1402
|
-
call: grpc.aio._base_call.UnaryStreamCall[
|
1403
|
-
SubscribeOrderflowRequest, Orderflow
|
1404
|
-
] = stub(request, metadata=(("authorization", f"Bearer {grpc_client.jwt}"),))
|
1405
|
-
async for update in call:
|
1406
|
-
yield update
|
1449
|
+
async for res in grpc_client.unary_stream(req): # type: ignore
|
1450
|
+
yield res
|
1407
1451
|
|
1408
1452
|
# ------------------------------------------------------------
|
1409
1453
|
# Order entry
|
@@ -1415,9 +1459,27 @@ class AsyncClient:
|
|
1415
1459
|
**kwargs,
|
1416
1460
|
) -> Order:
|
1417
1461
|
"""
|
1418
|
-
@deprecated(reason="Use
|
1462
|
+
@deprecated(reason="Use place_order instead")
|
1419
1463
|
"""
|
1420
|
-
|
1464
|
+
logging.warning(
|
1465
|
+
"send_limit_order is deprecated, use place_order instead. "
|
1466
|
+
"This will be removed in a future version."
|
1467
|
+
)
|
1468
|
+
return await self.place_order(*args, **kwargs)
|
1469
|
+
|
1470
|
+
async def place_limit_order(
|
1471
|
+
self,
|
1472
|
+
*args,
|
1473
|
+
**kwargs,
|
1474
|
+
) -> Order:
|
1475
|
+
"""
|
1476
|
+
@deprecated(reason="Use place_order instead")
|
1477
|
+
"""
|
1478
|
+
logging.warning(
|
1479
|
+
"place_limit_order is deprecated, use place_order instead. "
|
1480
|
+
"This will be removed in a future version."
|
1481
|
+
)
|
1482
|
+
return await self.place_order(*args, **kwargs)
|
1421
1483
|
|
1422
1484
|
async def place_orders(
|
1423
1485
|
self, order_requests: Sequence[PlaceOrderRequest]
|
@@ -1461,26 +1523,28 @@ class AsyncClient:
|
|
1461
1523
|
|
1462
1524
|
return res
|
1463
1525
|
|
1464
|
-
async def
|
1526
|
+
async def place_order(
|
1465
1527
|
self,
|
1466
1528
|
*,
|
1467
1529
|
id: Optional[OrderId] = None,
|
1468
1530
|
symbol: TradableProduct | str,
|
1469
1531
|
execution_venue: Optional[str] = None,
|
1470
|
-
dir:
|
1532
|
+
dir: OrderDir,
|
1471
1533
|
quantity: Decimal,
|
1472
|
-
limit_price: Decimal,
|
1534
|
+
limit_price: Optional[Decimal] = None,
|
1473
1535
|
order_type: OrderType = OrderType.LIMIT,
|
1474
1536
|
time_in_force: TimeInForce = TimeInForce.DAY,
|
1475
1537
|
price_round_method: Optional[TickRoundMethod] = None,
|
1476
1538
|
account: Optional[str] = None,
|
1477
1539
|
trader: Optional[str] = None,
|
1478
|
-
post_only: bool =
|
1540
|
+
post_only: Optional[bool] = None,
|
1479
1541
|
trigger_price: Optional[Decimal] = None,
|
1542
|
+
stop_loss: Optional[TriggerLimitOrderType] = None,
|
1543
|
+
take_profit_price: Optional[Decimal] = None,
|
1480
1544
|
**kwargs: Any,
|
1481
1545
|
) -> Order:
|
1482
1546
|
"""
|
1483
|
-
Sends a regular
|
1547
|
+
Sends a regular order.
|
1484
1548
|
|
1485
1549
|
Args:
|
1486
1550
|
id: in case user wants to generate their own order id, otherwise it will be generated automatically
|
@@ -1499,8 +1563,10 @@ class AsyncClient:
|
|
1499
1563
|
While technically optional, for most order types, the account is required
|
1500
1564
|
trader: the trader to send the order for, defaults to the user's trader
|
1501
1565
|
for when sending order for another user, not relevant for vast majority of users
|
1502
|
-
post_only: whether the order should be post only,
|
1566
|
+
post_only: whether the order should be post only, NOT SUPPORTED BY ALL EXCHANGES (e.g. CME)
|
1503
1567
|
trigger_price: the trigger price for the order, only relevant for stop / take_profit orders
|
1568
|
+
stop_loss_price: the stop loss price for a bracket order.
|
1569
|
+
profit_price: the take profit price for a bracket order.
|
1504
1570
|
Returns:
|
1505
1571
|
the Order object for the order
|
1506
1572
|
The order.status should be "PENDING" until the order is "OPEN" / "REJECTED" / "OUT" / "CANCELED" / "STALE"
|
@@ -1510,14 +1576,7 @@ class AsyncClient:
|
|
1510
1576
|
grpc_client = await self.core()
|
1511
1577
|
assert quantity > 0, "quantity must be positive"
|
1512
1578
|
|
1513
|
-
if
|
1514
|
-
if "odir" in kwargs and isinstance(kwargs["odir"], OrderDir):
|
1515
|
-
logging.warning("odir is deprecated, use dir instead")
|
1516
|
-
dir = kwargs["odir"]
|
1517
|
-
else:
|
1518
|
-
raise ValueError("dir is required")
|
1519
|
-
|
1520
|
-
if price_round_method is not None:
|
1579
|
+
if limit_price is not None and price_round_method is not None:
|
1521
1580
|
if execution_venue is None:
|
1522
1581
|
product_info = await self.get_product_info(symbol)
|
1523
1582
|
if product_info is None:
|
@@ -1557,6 +1616,8 @@ class AsyncClient:
|
|
1557
1616
|
execution_venue=execution_venue,
|
1558
1617
|
post_only=post_only,
|
1559
1618
|
trigger_price=trigger_price,
|
1619
|
+
stop_loss=stop_loss,
|
1620
|
+
take_profit_price=take_profit_price,
|
1560
1621
|
)
|
1561
1622
|
res = await grpc_client.unary_unary(req)
|
1562
1623
|
return res
|
@@ -1701,3 +1762,26 @@ class AsyncClient:
|
|
1701
1762
|
# )
|
1702
1763
|
# res = await grpc_client.unary_unary(req)
|
1703
1764
|
# return True
|
1765
|
+
|
1766
|
+
async def create_algo_order(
|
1767
|
+
self,
|
1768
|
+
*,
|
1769
|
+
params: SpreaderParams,
|
1770
|
+
id: Optional[str] = None,
|
1771
|
+
trader: Optional[str] = None,
|
1772
|
+
):
|
1773
|
+
"""
|
1774
|
+
Sends an advanced algo order such as the spreader.
|
1775
|
+
"""
|
1776
|
+
grpc_client = await self.core()
|
1777
|
+
|
1778
|
+
if isinstance(params, SpreaderParams):
|
1779
|
+
algo = "SPREADER"
|
1780
|
+
else:
|
1781
|
+
raise ValueError(
|
1782
|
+
"Unsupported algo type. Only SpreaderParams is supported for now."
|
1783
|
+
)
|
1784
|
+
|
1785
|
+
req = CreateAlgoOrderRequest(algo=algo, params=params, id=id, trader=trader)
|
1786
|
+
res = await grpc_client.unary_unary(req)
|
1787
|
+
return res
|
@@ -4,7 +4,15 @@ import threading
|
|
4
4
|
from asyncio import AbstractEventLoop
|
5
5
|
from collections.abc import Callable
|
6
6
|
from functools import partial
|
7
|
-
from typing import
|
7
|
+
from typing import (
|
8
|
+
Any,
|
9
|
+
Concatenate,
|
10
|
+
Coroutine,
|
11
|
+
Optional,
|
12
|
+
ParamSpec,
|
13
|
+
Sequence,
|
14
|
+
TypeVar,
|
15
|
+
)
|
8
16
|
|
9
17
|
from .async_client import AsyncClient
|
10
18
|
|
@@ -48,8 +56,11 @@ class Client:
|
|
48
56
|
api_key: str,
|
49
57
|
api_secret: str,
|
50
58
|
paper_trading: bool,
|
59
|
+
as_user: Optional[str] = None,
|
60
|
+
as_role: Optional[str] = None,
|
51
61
|
endpoint: str = "https://app.architect.co",
|
52
62
|
graphql_port: Optional[int] = None,
|
63
|
+
grpc_options: Sequence[tuple[str, Any]] | None = None,
|
53
64
|
event_loop: Optional[AbstractEventLoop] = None,
|
54
65
|
**kwargs,
|
55
66
|
):
|
@@ -76,8 +87,11 @@ class Client:
|
|
76
87
|
api_key=api_key,
|
77
88
|
api_secret=api_secret,
|
78
89
|
paper_trading=paper_trading,
|
90
|
+
as_user=as_user,
|
91
|
+
as_role=as_role,
|
79
92
|
endpoint=endpoint,
|
80
93
|
graphql_port=graphql_port,
|
94
|
+
grpc_options=grpc_options,
|
81
95
|
**kwargs,
|
82
96
|
)
|
83
97
|
|