diff --git a/src/kraken/futures/trade.py b/src/kraken/futures/trade.py index 97fa826..eb343d7 100644 --- a/src/kraken/futures/trade.py +++ b/src/kraken/futures/trade.py @@ -20,6 +20,7 @@ from __future__ import annotations +import json from typing import Self from kraken.base_api import FuturesClient, defined @@ -239,7 +240,7 @@ def create_batch_order( } """ batchorder: dict = {"batchOrder": batchorder_list} - params = {"json": f"{batchorder}"} + params = {"json": json.dumps(batchorder)} if processBefore: params["processBefore"] = processBefore diff --git a/tests/futures/test_futures_trade.py b/tests/futures/test_futures_trade.py index 87596ae..1589a91 100644 --- a/tests/futures/test_futures_trade.py +++ b/tests/futures/test_futures_trade.py @@ -198,6 +198,16 @@ def test_create_batch_order(futures_demo_trade: Trade) -> None: "limitPrice": 2.00, "stopPrice": 3.00, }, + { + "order": "send", + "order_tag": "3", + "orderType": "post", + "symbol": "PI_XBTUSD", + "side": "buy", + "size": 5, + "limitPrice": 1.00, + "reduceOnly": True, + }, ], processBefore="3033-11-08T19:56:35.441899Z", ),