Send partial liquidate instruction just to force settle borrow

This commit is contained in:
dd 2021-06-22 09:33:17 -04:00
parent ecd854f601
commit c5cfcad99a
1 changed files with 20 additions and 20 deletions

View File

@ -450,7 +450,11 @@ async function runPartialLiquidator() {
}
}
if (minNetIndex !== -1) {
if (minNetIndex === -1) {
// In this case, send a random token account that is not maxNetIndex
minNetIndex = (maxNetIndex + 1) % NUM_TOKENS;
}
transaction.add(
makePartialLiquidateInstruction(
programId,
@ -467,11 +471,7 @@ async function runPartialLiquidator() {
liqorTokenValues[minNetIndex],
),
);
}
if (transaction.instructions.length === 0) {
continue;
}
await client.sendTransaction(connection, transaction, payer, []);
await sleep(2000);
ma = await client.getMarginAccount(