ts: fix bug in perp close all lot computation

Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
microwavedcola1 2023-08-28 08:44:13 +02:00
parent a855d5467a
commit e767990c64
1 changed files with 1 additions and 1 deletions

View File

@ -2419,7 +2419,7 @@ export class MangoClient {
pa.marketIndex,
isLong ? PerpOrderSide.ask : PerpOrderSide.bid,
pm.uiPrice * (isLong ? 1 - slippage : 1 + slippage), // Try to cross the spread to guarantee matching
pa.getBasePositionUi(pm) * 1.01, // Send a larger size to ensure full order is closed
Math.abs(pa.getBasePositionUi(pm) * 1.01), // Send a larger size to ensure full order is closed
undefined,
Date.now(),
PerpOrderType.immediateOrCancel,