diff --git a/src/liquidator.ts b/src/liquidator.ts index 588e05d..0a0ac20 100644 --- a/src/liquidator.ts +++ b/src/liquidator.ts @@ -65,6 +65,13 @@ const groupIds = config.getGroup(cluster, groupName) ?? (() => { throw new Error const TARGETS = process.env.TARGETS?.replace(/\s+/g,' ').trim().split(' ').map((s) => parseFloat(s)) ?? [0, 0, 0, 0, 0, 0, 0, 0, 0]; +// Do not liquidate accounts that have less than this much in value +const minEquity = parseInt( + process.env.MIN_EQUITY || '5', +); +console.log(`Minimum equity required to bother: ${minEquity}`); + + const mangoProgramId = groupIds.mangoProgramId; const mangoGroupKey = groupIds.publicKey; @@ -276,6 +283,13 @@ async function maybeLiquidateAccount(mangoAccount: MangoAccount): Promise