mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-11 17:28:08 +00:00
fix: ensure explicit size is always sent for close-position MARKET orders in ParadexGateway to comply with exchange requirements
This commit is contained in:
@@ -599,8 +599,8 @@ export class ParadexGateway {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const isClosePosition = (extraParams as any).closePosition === true;
|
const isClosePosition = (extraParams as any).closePosition === true;
|
||||||
// Only omit amount for MARKET close-position orders; STOP requires explicit size
|
// Paradex requires explicit size for close-position MARKET orders; always send amount
|
||||||
const shouldOmitAmount = isClosePosition && type === "market";
|
const shouldOmitAmount = false;
|
||||||
const amountArg: any = shouldOmitAmount ? undefined : amount;
|
const amountArg: any = shouldOmitAmount ? undefined : amount;
|
||||||
if (!shouldOmitAmount && amountArg != null && extraParams.size === undefined) {
|
if (!shouldOmitAmount && amountArg != null && extraParams.size === undefined) {
|
||||||
extraParams.size = amountArg.toString();
|
extraParams.size = amountArg.toString();
|
||||||
|
|||||||
Reference in New Issue
Block a user