Skip to content

Commit

Permalink
Subgraph - Withdrawal crate total (#532)
Browse files Browse the repository at this point in the history
  • Loading branch information
silochad authored Jul 4, 2023
2 parents ae97780 + 246be7f commit f5d5b48
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/subgraph-beanstalk/src/SiloHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ export function handleRemoveDeposits(event: RemoveDeposits): void {

export function handleAddWithdrawal(event: AddWithdrawal): void {
let withdraw = loadSiloWithdraw(event.params.account, event.params.token, event.params.season.toI32());
withdraw.amount = event.params.amount;
withdraw.amount = withdraw.amount.plus(event.params.amount);
let withdrawHashes = withdraw.hashes;
withdrawHashes.push(event.transaction.hash.toHexString());
withdraw.hashes = withdrawHashes;
withdraw.createdAt = event.block.timestamp;
withdraw.createdAt = withdraw.createdAt == ZERO_BI ? event.block.timestamp : withdraw.createdAt;
withdraw.save();

addWithdrawToSiloAsset(
Expand Down

0 comments on commit f5d5b48

Please sign in to comment.