From 22c44abca316af334ec2e1101eab39582253231e Mon Sep 17 00:00:00 2001 From: alex101xela Date: Tue, 21 Jul 2026 16:05:52 +0400 Subject: [PATCH 1/2] Add missing RFQ adjustments --- tests/clients/test_rest_api_client.py | 1 + tests/fixtures/market.py | 1 + x10/clients/blocking/blocking_trading_client.py | 3 +++ x10/clients/rest/rest_api_client.py | 2 ++ x10/models/market.py | 7 +++++++ x10/tools/mcp/place_order_tool.py | 5 ++++- 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/clients/test_rest_api_client.py b/tests/clients/test_rest_api_client.py index 376dc94..0313729 100644 --- a/tests/clients/test_rest_api_client.py +++ b/tests/clients/test_rest_api_client.py @@ -53,6 +53,7 @@ async def test_get_markets(aiohttp_server, create_btc_usd_market): "active": True, "isRfq": False, "isOffHours": False, + "tradingHours": "CONTINUOUS", "marketStats": { "dailyVolume": "2410800.768021", "dailyVolumeBase": "37.94502", diff --git a/tests/fixtures/market.py b/tests/fixtures/market.py index 8d0eaa9..9e3a2f3 100644 --- a/tests/fixtures/market.py +++ b/tests/fixtures/market.py @@ -17,6 +17,7 @@ def get_btc_usd_market_json_data(): "active": true, "isRfq": false, "isOffHours": false, + "tradingHours": "CONTINUOUS", "marketStats": { "dailyVolume": "2410800.768021", "dailyVolumeBase": "37.94502", diff --git a/x10/clients/blocking/blocking_trading_client.py b/x10/clients/blocking/blocking_trading_client.py index 7375c80..a4f93b9 100644 --- a/x10/clients/blocking/blocking_trading_client.py +++ b/x10/clients/blocking/blocking_trading_client.py @@ -209,6 +209,7 @@ async def create_and_place_order( order_type: OrderType = OrderType.LIMIT, ) -> TimedOpenOrderModel: market = (await self.get_markets()).get(market_name) + if not market: raise ValidationError(f"Market '{market_name}' not found.") @@ -239,8 +240,10 @@ async def create_and_place_order( ) placed_order_task = asyncio.create_task(place_order) order_waiter = self.__order_waiters[order.id] + if order_waiter.open_order: return order_waiter.open_order + async with order_waiter.condition: await asyncio.gather( placed_order_task, diff --git a/x10/clients/rest/rest_api_client.py b/x10/clients/rest/rest_api_client.py index ce66297..7e81102 100644 --- a/x10/clients/rest/rest_api_client.py +++ b/x10/clients/rest/rest_api_client.py @@ -100,8 +100,10 @@ async def place_order( take_profit=take_profit, stop_loss=stop_loss, ) + if market.is_rfq: return await self.__order_management_module.place_rfq_order(order) + return await self.__order_management_module.place_order(order) async def close(self): diff --git a/x10/models/market.py b/x10/models/market.py index d41dbf4..17cb6df 100644 --- a/x10/models/market.py +++ b/x10/models/market.py @@ -100,6 +100,12 @@ class MarketType(StrEnum): PERPETUAL = "PERPETUAL" +class MarketTradingHours(StrEnum): + CONTINUOUS = "CONTINUOUS" + WEEKDAYS = "WEEKDAYS" + REGULAR = "REGULAR" + + class MarketModel(X10BaseModel): name: str type: MarketType @@ -110,6 +116,7 @@ class MarketModel(X10BaseModel): active: bool is_rfq: bool is_off_hours: bool + trading_hours: MarketTradingHours market_stats: MarketStatsModel trading_config: TradingConfigModel l2_config: L2ConfigModel diff --git a/x10/tools/mcp/place_order_tool.py b/x10/tools/mcp/place_order_tool.py index d5db2ba..263cda2 100644 --- a/x10/tools/mcp/place_order_tool.py +++ b/x10/tools/mcp/place_order_tool.py @@ -213,5 +213,8 @@ async def place_order( else None, ) - result = await client.orders.place_order(order=order) + result = await ( + client.orders.place_rfq_order(order=order) if market.is_rfq else client.orders.place_order(order=order) + ) + return serialize_tool_result(result.data) From 9d510866619d385fbe817265cfcdebeee612227e Mon Sep 17 00:00:00 2001 From: alex101xela Date: Tue, 21 Jul 2026 16:07:23 +0400 Subject: [PATCH 2/2] Add missing RFQ adjustments --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 23f0776..af38eaa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "x10-python-trading-starknet" -version = "2.4.0" +version = "2.4.1" description = "Python client for X10 API" authors = ["X10 "] repository = "https://github.com/x10xchange/python_sdk"