Skip to content

Commit

Permalink
Update EventProcessor.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alfulinku committed Oct 18, 2024
1 parent 4d386ba commit e803a17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/EventProcessor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ async function buildMessageFromEvent(event: EventData): Promise<string | undefin
);
}
case 'reallocatesupply': {
await getMarketDataLabel(event.eventArgs[1] as string);
// event ReallocateSupply(address indexed caller, Id indexed id, uint256 suppliedAssets, uint256 suppliedShares);
const assetThreshold = process.env.ASSET_THRESHOLD;
if (!assetThreshold) {
Expand Down Expand Up @@ -268,6 +269,7 @@ async function buildMessageFromEvent(event: EventData): Promise<string | undefin
}
}
case 'reallocatewithdraw': {
await getMarketDataLabel(event.eventArgs[1] as string);
// event ReallocateWithdraw(address indexed caller, Id indexed id, uint256 withdrawnAssets, uint256 withdrawnShares);
const assetThreshold = process.env.ASSET_THRESHOLD;
if (!assetThreshold) {
Expand Down Expand Up @@ -317,7 +319,9 @@ async function getMarketDataLabel(marketId: string) {

let marketDataLabel = '';
if (allMarketData[marketId]) {
marketDataLabel = `[${allMarketData[marketId].collateralSymbol}/${allMarketData[marketId].debtSymbol}/${allMarketData[marketId].lltv}%]`;
marketDataLabel = `[${allMarketData[marketId].collateralSymbol}/${allMarketData[marketId].debtSymbol}/${
allMarketData[marketId].lltv * 100
}%]`;
}
return marketDataLabel;
} catch (e) {
Expand Down

0 comments on commit e803a17

Please sign in to comment.