diff --git a/README.md b/README.md index 47079db..1919df3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ To run the liquidator you will need: * A Solana account with some SOL deposited to cover transaction fees * A Mango Account with some collateral deposited * Your wallet keypair saved as a JSON file -* `node` and `yarn` +* `node` (v14+) and `yarn` * A clone of this repository * Dependencies installed with `yarn install` @@ -64,6 +64,7 @@ This mode never triggers advanced orders. | `LIQOR_PK` | N/A | Liqor Mango Account Public Key, by default uses the largest value account owned by the keypair | | `WEBHOOK_URL` | N/A | Discord webhook URL to post liquidation events and errors to | | `LIAB_LIMIT` | `0.9` | Percentage of your available margin to use when taking on liabilities | +| `MIN_EQUITY` | `0` | Minimum account equity required to liquidate | | `LIQUIDATABLE_FEED_WEBSOCKET_ADDRESS` | N/A | Websocket URL of the liquidatable-accounts-feed service, see above | You can add these variables to a `.env` file in the project root to load automatically on liquidator startup. For example: diff --git a/src/liquidator.ts b/src/liquidator.ts index 09e2e5f..34136f5 100644 --- a/src/liquidator.ts +++ b/src/liquidator.ts @@ -67,10 +67,11 @@ const TARGETS = process.env.TARGETS?.replace(/\s+/g,' ').trim().split(' ').map(( // Do not liquidate accounts that have less than this much in value const minEquity = parseInt( - process.env.MIN_EQUITY || '5', + process.env.MIN_EQUITY || '0', ); -console.log(`Minimum equity required to bother: ${minEquity}`); - +if(minEquity > 0) { + console.log(`Minimum equity required to liquidate: ${minEquity}`); +} const mangoProgramId = groupIds.mangoProgramId; const mangoGroupKey = groupIds.publicKey; @@ -284,7 +285,7 @@ async function maybeLiquidateAccount(mangoAccount: MangoAccount): Promise 0) { // console.log(`Account ${mangoAccountKeyString} only has ${equity}, PASS`); return false; }