diff --git a/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.ts b/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.ts index e5035a7..fe05088 100644 --- a/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.ts +++ b/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.ts @@ -56,10 +56,10 @@ export const provideHandleTransaction = (cometWithdrawSupplySignatures: string[] ? await positionFetcherUSDC.delegateCall(call, txEvent.from, txEvent.blockNumber) : call.address === positionFetcherWETH.cometAddress ? await positionFetcherWETH.delegateCall(call, txEvent.from, txEvent.blockNumber) - : { newPosition: false, position: emptyPositionData }; + : { newOrUpdatedPosition: false, position: emptyPositionData }; // generate findings for new or updated positions - if (positionResponse.newPosition) { + if (positionResponse.newOrUpdatedPosition) { findings.push(createNewPositionFinding(baseAssetAddresses, positionResponse.position)); } }) diff --git a/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.utils.ts b/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.utils.ts index 03029c0..7a4839d 100644 --- a/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.utils.ts +++ b/Forta-Bots-Challenge-4/liquidatable-positions/src/agent.utils.ts @@ -22,7 +22,7 @@ export type PositionData = { }; export type PositionDataResponse = { - newPosition: boolean; + newOrUpdatedPosition: boolean; position: PositionData; }; @@ -48,7 +48,7 @@ export const emptyPositionData: PositionData = { }; export const emptyPositionDataResponse: PositionDataResponse = { - newPosition: false, + newOrUpdatedPosition: false, position: emptyPositionData, }; diff --git a/Forta-Bots-Challenge-4/liquidatable-positions/src/position.fetcher.ts b/Forta-Bots-Challenge-4/liquidatable-positions/src/position.fetcher.ts index c2cc955..7e82dab 100644 --- a/Forta-Bots-Challenge-4/liquidatable-positions/src/position.fetcher.ts +++ b/Forta-Bots-Challenge-4/liquidatable-positions/src/position.fetcher.ts @@ -108,7 +108,7 @@ export default class PositionFetcher { token: asset, }; this.addToCache(borrower, position); - return { newPosition: true, position }; + return { newOrUpdatedPosition: true, position }; } return { ...emptyPositionDataResponse }; }