From 189fed0f6ee061aae3ba8cb53dd71c2a1887a391 Mon Sep 17 00:00:00 2001 From: discountry Date: Sat, 11 Oct 2025 22:05:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E6=AD=A2=E6=8D=9F?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=80=BB=E8=BE=91=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E6=AD=A5=E8=BF=9B=E5=92=8C=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=A4=84=E7=90=86=E4=BB=A5=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E6=89=80=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/order-coordinator.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/order-coordinator.ts b/src/core/order-coordinator.ts index de72d73..dd323a8 100644 --- a/src/core/order-coordinator.ts +++ b/src/core/order-coordinator.ts @@ -247,15 +247,21 @@ export async function placeStopLossOrder( } } const priceTick = opts?.priceTick ?? 0.1; + const qtyStep = opts?.qtyStep ?? 0.001; const params: CreateOrderParams = { symbol, side, type, + quantity: roundQtyDownToStep(quantity, qtyStep), stopPrice: roundDownToTick(stopPrice, priceTick), + // Always mark reduce-only semantics; some exchanges (e.g. Aster) ignore this on STOP + reduceOnly: "true", + // Some exchanges prefer explicit close-position semantics; gateways will normalize closePosition: "true", timeInForce: "GTC", - triggerType: "STOP_LOSS", + // GRVT requires triggerType to match side semantics: BUY -> TAKE_PROFIT, SELL -> STOP_LOSS + triggerType: side === "BUY" ? "TAKE_PROFIT" : "STOP_LOSS", }; // Avoid forcing price for STOP_MARKET globally; keep this exchange-specific in gateways