feat: 更新止损订单逻辑,针对Aster期货调整reduceOnly参数处理以符合交易所要求

This commit is contained in:
discountry
2025-10-11 21:27:37 +08:00
parent f991215d86
commit 8b20e60753
+5 -1
View File
@@ -241,18 +241,22 @@ export async function placeStopLossOrder(
}
const priceTick = opts?.priceTick ?? 0.1;
const qtyStep = opts?.qtyStep ?? 0.001;
const isAster = String((adapter as any).id ?? "").toLowerCase() === "aster";
const params: CreateOrderParams = {
symbol,
side,
type,
stopPrice: roundDownToTick(stopPrice, priceTick),
reduceOnly: "true",
closePosition: "true",
timeInForce: "GTC",
// Do not round down stop quantity here to avoid underflow to exchange min; gateway will quantize precisely
quantity,
triggerType: "STOP_LOSS",
};
// For Aster futures, STOP orders must not include reduceOnly; omit it specifically.
if (!isAster) {
params.reduceOnly = "true";
}
// Avoid forcing price for STOP_MARKET globally; keep this exchange-specific in gateways
await deduplicateOrders(adapter, symbol, openOrders, locks, timers, pendings, type, side, log);
lockOperating(locks, timers, pendings, type, log);