From 265cb6df509823780acc72a8c5c20945162704c3 Mon Sep 17 00:00:00 2001 From: discountry Date: Tue, 28 Oct 2025 12:50:31 +0800 Subject: [PATCH] feat: enhance close position handling in AsterRestClient to support STOP_MARKET and TAKE_PROFIT_MARKET types --- src/exchanges/aster/client.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/exchanges/aster/client.ts b/src/exchanges/aster/client.ts index b4c172b..e8bf5dc 100644 --- a/src/exchanges/aster/client.ts +++ b/src/exchanges/aster/client.ts @@ -795,8 +795,11 @@ export class AsterRestClient { // Keep the behavior exchange-specific by stripping them here for Aster. const type = String(params.type).toUpperCase(); const isStopOrTrailing = type === "STOP_MARKET" || type === "TRAILING_STOP_MARKET"; + const supportsClosePosition = type === "STOP_MARKET" || type === "TAKE_PROFIT_MARKET"; if (!isStopOrTrailing) { if (params.reduceOnly !== undefined) payload.reduceOnly = params.reduceOnly; + } + if (supportsClosePosition) { if (params.closePosition !== undefined) payload.closePosition = params.closePosition; }