Skip to content

Commit

Permalink
fix: parse human calls in batch liquidator too
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Aug 8, 2024
1 parent a389d59 commit 6b42a29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/services/liquidate/AbstractLiquidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,9 @@ export default abstract class AbstractLiquidator {
const raw = await this.compressor.read.getCreditManagersV3List();
const result = raw.map(d => new CreditManagerData(d));

if (this.config.optimistic) {
for (const cm of result) {
for (const cm of result) {
TxParserHelper.addCreditManager(cm);
if (this.config.optimistic) {
this.#cmCache[cm.address.toLowerCase()] = cm;
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/services/liquidate/BatchLiquidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { parseEventLogs } from "viem";

import type { CreditAccountData, CreditManagerData } from "../../data/index.js";
import type { EstimateBatchInput } from "../../utils/ethers-6-temp/pathfinder/viem-types.js";
import { TxParserHelper } from "../../utils/ethers-6-temp/txparser/index.js";
import {
BatchLiquidationErrorMessage,
BatchLiquidationFinishedMessage,
Expand Down Expand Up @@ -189,7 +190,9 @@ export default class BatchLiquidator
};
const results = accounts.map(
(a): OptimisticResult => ({
callsHuman: [],
callsHuman: TxParserHelper.parseMultiCall({
calls: [...(batch[a.addr]?.calls ?? [])],
}),
balancesBefore: a.filterDust(),
balancesAfter: {},
hfBefore: a.healthFactor,
Expand Down

0 comments on commit 6b42a29

Please sign in to comment.