ts: fix bug in perp close all lot computation
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
This commit is contained in:
parent
a855d5467a
commit
e767990c64
|
@ -2419,7 +2419,7 @@ export class MangoClient {
|
||||||
pa.marketIndex,
|
pa.marketIndex,
|
||||||
isLong ? PerpOrderSide.ask : PerpOrderSide.bid,
|
isLong ? PerpOrderSide.ask : PerpOrderSide.bid,
|
||||||
pm.uiPrice * (isLong ? 1 - slippage : 1 + slippage), // Try to cross the spread to guarantee matching
|
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,
|
undefined,
|
||||||
Date.now(),
|
Date.now(),
|
||||||
PerpOrderType.immediateOrCancel,
|
PerpOrderType.immediateOrCancel,
|
||||||
|
|
Loading…
Reference in New Issue