mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
fix size (#20)
This commit is contained in:
@@ -602,7 +602,10 @@ export class ParadexGateway {
|
||||
// Only omit amount for MARKET close-position orders; STOP requires explicit size
|
||||
const shouldOmitAmount = isClosePosition && type === "market";
|
||||
const amountArg: any = shouldOmitAmount ? undefined : amount;
|
||||
if (!shouldOmitAmount && amountArg != null && extraParams.size === undefined) {
|
||||
// Paradex/ccxt may require `size` even when amount is omitted for closePosition MARKET orders.
|
||||
if (shouldOmitAmount && amount != null && extraParams.size === undefined) {
|
||||
extraParams.size = amount.toString();
|
||||
} else if (!shouldOmitAmount && amountArg != null && extraParams.size === undefined) {
|
||||
extraParams.size = amountArg.toString();
|
||||
}
|
||||
const order = (await this.exchange.createOrder(
|
||||
|
||||
Reference in New Issue
Block a user