From 2ba3e80ad95013f948dc5c28d3f8b954cc3c6ab8 Mon Sep 17 00:00:00 2001 From: discountry Date: Fri, 16 Jan 2026 22:59:38 +0800 Subject: [PATCH] fix sl --- src/core/order-coordinator.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/order-coordinator.ts b/src/core/order-coordinator.ts index 253bd21..d41e0f3 100644 --- a/src/core/order-coordinator.ts +++ b/src/core/order-coordinator.ts @@ -169,6 +169,9 @@ export async function placeOrder( lockOperating(locks, timers, pendings, type, log); try { const closePosition = reduceOnly ? true : undefined; + // StandX API: reduce-only 订单不能设置 tp/sl + const slPrice = reduceOnly ? undefined : opts?.slPrice; + const tpPrice = reduceOnly ? undefined : opts?.tpPrice; const order = await routeLimitOrder({ adapter, symbol, @@ -178,8 +181,8 @@ export async function placeOrder( timeInForce: reduceOnly ? "GTC" : "GTX", reduceOnly: reduceOnly ? true : undefined, closePosition, - slPrice: opts?.slPrice, - tpPrice: opts?.tpPrice, + slPrice, + tpPrice, }); pendings[type] = String(order.orderId); log("order", `挂限价单: ${side} @ ${priceNum} 数量 ${quantity} reduceOnly=${reduceOnly}${opts?.slPrice ? ` sl=${opts.slPrice}` : ""}`);