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 5, 2024
1 parent 1320d7c commit d0b40cc
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 d0b40cc

Please sign in to comment.