added min deficit of 0.001

This commit is contained in:
dd 2021-03-19 14:44:15 -04:00
parent 75b64e02cc
commit e95366c64b
1 changed files with 6 additions and 0 deletions

View File

@ -179,8 +179,14 @@ async function runLiquidator() {
const deficit = liabsVal * mangoGroup.initCollRatio - assetsVal
description = ma.toPrettyString(mangoGroup, prices)
if (deficit < 0.001) { // too small of an account; number precision may cause errors
break
}
console.log('liquidatable', deficit)
console.log(description)
await client.liquidate(connection, programId, mangoGroup, ma, payer,
tokenWallets, [0, 0, deficit * 1.01])
liquidated = true