From 1426d1906717663ba8d04a6f87c4032beea25b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20J=2E=20Me=CC=81ndez?= Date: Sun, 14 Apr 2024 08:30:20 +0200 Subject: [PATCH] Liquidator wasn't using subaccount config for deposit liq It was only checking that it had a subaccount for the borrow to be liquidated, but not that it was also configured for the deposit it would try to use. --- src/bots/liquidator.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/bots/liquidator.ts b/src/bots/liquidator.ts index f3e4092b..920ddd3a 100644 --- a/src/bots/liquidator.ts +++ b/src/bots/liquidator.ts @@ -1630,6 +1630,16 @@ export class LiquidatorBot implements Bot { return; } + const subAccountToLiqDep = this.getSubAccountIdToLiquidateSpot( + depositMarketIndextoLiq + ); + if (subAccountToLiqDep === undefined) { + logger.info( + `skipping liquidateSpot call for ${user.userAccountPublicKey.toBase58()} because the deposit market it not in subaccounts` + ); + return; + } + const start = Date.now(); this.driftClient .liquidateSpot(