diff --git a/package.json b/package.json index bbd85d5..d864134 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "typecheck:ci": "tsc --noEmit" }, "dependencies": { - "@gearbox-protocol/sdk": "^1.7.12", + "@gearbox-protocol/sdk": "^1.8.11", "@types/commander": "^2.12.2", "@types/express": "^4.17.14", "amqp-ts": "^1.8.0", diff --git a/src/core/optimistic.ts b/src/core/optimistic.ts index de4745a..c8757f7 100644 --- a/src/core/optimistic.ts +++ b/src/core/optimistic.ts @@ -1,11 +1,25 @@ import { MultiCall } from "@gearbox-protocol/sdk"; export interface OptimisticResult { + // Credit Manager address creditManager: string; + + // Borrower address borrower: string; + + // Gas used for liquidation from tx recepit gasUsed: number; + + // Multicalls used as parameter in liquidateCreditAccount function calls: Array; + + // Estimated amount which was computed in pathfinder pathAmount: string; - remainingFunds: string; + + // How much tokens liquidator got on its account for the liquidation + // liquidatorPremium = underlyingBalanceAfterLiquidation - underlyingBalanceBeforeLiquidation + liquidatorPremium: string; + + // True if errors accrued isError: boolean; } diff --git a/src/services/liquidatorService.ts b/src/services/liquidatorService.ts index 7a01afa..d4598c5 100644 --- a/src/services/liquidatorService.ts +++ b/src/services/liquidatorService.ts @@ -170,7 +170,7 @@ export class LiquidatorService { calls: [], isError: false, pathAmount: "0", - remainingFunds: "0", + liquidatorPremium: "0", }; try { @@ -209,7 +209,7 @@ export class LiquidatorService { const receipt = await tx.wait(1); const balanceAfter = await getExecutorBalance(); - optimisticResult.remainingFunds = balanceAfter + optimisticResult.liquidatorPremium = balanceAfter .sub(balanceBefore) .toString(); diff --git a/yarn.lock b/yarn.lock index a55a73f..0a704fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -594,10 +594,10 @@ resolved "https://registry.yarnpkg.com/@gearbox-protocol/prettier-config/-/prettier-config-1.5.0.tgz#4df8e9fd2305fee6ab8c1417a02e31343836932a" integrity sha512-FUoprSsBdZyBjgxXCKL6mTkbeUJytaLzPJqIOoQpDmBRTX0seCc2o5I9PI9tySoRIlNnd/XXnKCXq1xHDEGbxw== -"@gearbox-protocol/sdk@^1.7.12": - version "1.7.12" - resolved "https://registry.yarnpkg.com/@gearbox-protocol/sdk/-/sdk-1.7.12.tgz#ae12ce9087efb4635670835db82e6cb57e2a76d4" - integrity sha512-XlJNCtB3XojuZXqgShYefjT5FV5MAVrrfZOVuBTKpiEsUpjQu1QVsiwJln2atR0Ex6rd1TbFW41AL1iSs7jMuw== +"@gearbox-protocol/sdk@^1.8.11": + version "1.8.11" + resolved "https://registry.yarnpkg.com/@gearbox-protocol/sdk/-/sdk-1.8.11.tgz#0ba8f1c0c75d485f8dece7c5932292b9b55e9161" + integrity sha512-sdZmOUQTR67K+wYVtTYUdhuQAM4FLthivMSeHbgLxaERoWR9vePCCKI75hzF9T3QCeMJnq4+6OqNCsphguaeDA== dependencies: "@types/deep-eql" "^4.0.0" decimal.js-light "^2.5.1"