Added forceCancelOrders before a partialLiquidate in tests

This commit is contained in:
dd 2021-06-01 09:51:58 -04:00
parent e6f273410d
commit 2fa1557b56
1 changed files with 2 additions and 0 deletions

View File

@ -348,6 +348,8 @@ async function stressTestLiquidation(params: {
));
let liquidationTxHash: string;
if (shouldPartialLiquidate) {
const forceCancelTx = await client.forceCancelOrders(connection, mangoProgramId, mangoGroup, liqeeMarginAccount, liqorOwner, spotMarket, 5)
console.log('forceCancelTxHash', forceCancelTx)
liquidationTxHash = await client.partialLiquidate(connection, mangoProgramId, mangoGroup, liqeeMarginAccount, liqorOwner, tokenWallets[quoteSymbolIndex], tokenWallets[baseSymbolIndex], quoteSymbolIndex, baseSymbolIndex, neededQuoteAmountForAllTrades);
} else {
const depositQuantities = new Array(tokenWallets.length).fill(0);