Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/liq to consider deposit subacc #167

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
10 changes: 10 additions & 0 deletions src/bots/liquidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down