Skip to content

Commit

Permalink
Use correct asset settings for bulk grown stalk changes
Browse files Browse the repository at this point in the history
  • Loading branch information
cujowolf committed Jan 10, 2024
1 parent d0bc266 commit 7e92612
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions projects/subgraph-beanstalk/src/SiloHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,9 +935,10 @@ export function handleUpdatedStalkPerBdvPerSeason(event: UpdatedStalkPerBdvPerSe

for (let i = 0; i < beanstalkSilo.whitelistedTokens.length; i++) {
let asset = loadSiloAsset(BEANSTALK, Address.fromString(beanstalkSilo.whitelistedTokens[i]));
let assetSettings = loadWhitelistTokenSetting(Address.fromString(beanstalkSilo.whitelistedTokens[i]));

newGrownStalkAmount = newGrownStalkAmount.plus(
asset.depositedBDV.times(siloSettings.stalkEarnedPerSeason).div(BigInt.fromI32(1000000))
asset.depositedBDV.times(assetSettings.stalkEarnedPerSeason).div(BigInt.fromI32(1000000))
);
}

Expand All @@ -954,9 +955,10 @@ export function handleUpdatedStalkPerBdvPerSeason(event: UpdatedStalkPerBdvPerSe

for (let i = 0; i < beanstalkSilo.whitelistedTokens.length; i++) {
let asset = loadSiloAsset(account, Address.fromString(beanstalkSilo.whitelistedTokens[i]));
let assetSettings = loadWhitelistTokenSetting(Address.fromString(beanstalkSilo.whitelistedTokens[i]));

newGrownStalkAmount = newGrownStalkAmount.plus(
asset.depositedBDV.times(siloSettings.stalkEarnedPerSeason).div(BigInt.fromI32(1000000))
asset.depositedBDV.times(assetSettings.stalkEarnedPerSeason).div(BigInt.fromI32(1000000))
);
}

Expand Down

0 comments on commit 7e92612

Please sign in to comment.