Skip to content

Commit

Permalink
Merge pull request #591 from balancer/fix-holders-count
Browse files Browse the repository at this point in the history
fix holders count
  • Loading branch information
mendesfabio authored May 6, 2024
2 parents 49a0e34 + e68786a commit b1d1c1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ mainnet:
network: mainnet
graft:
# Apr-11-2024 02:34:11 PM +UTC
block: 19633000
# block: 19633000
# always make sure the base subgraph has not been pruned
# it should be possible to run time travel queries on it going back to the vault's startBlock
base: QmX6XKG5dSUf2FjKpeAdVPjbZSZ5qptnGGegHcwk4367Ph
# base: QmX6XKG5dSUf2FjKpeAdVPjbZSZ5qptnGGegHcwk4367Ph
EventEmitter:
address: "0x1ACfEEA57d2ac674d7E65964f155AB9348A6C290"
startBlock: 16419620
Expand Down
7 changes: 5 additions & 2 deletions src/mappings/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
}
}

pool.save();

// Managed, StablePhantom and ComposableStable pools only emit the PoolBalanceChanged event
// with a non-zero value for the BPT amount when the pool is initialized,
// when the amount of BPT informed in the event corresponds to the "excess" BPT that was preminted
Expand All @@ -267,6 +269,9 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
}
}
pool.totalShares = pool.totalShares.minus(scaledPreMintedBpt);

pool.save();

// This amount will also be transferred to the vault,
// causing the vault's 'user shares' to incorrectly increase,
// so we need to negate it. We do so by processing a mock transfer event
Expand All @@ -288,8 +293,6 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
handleTransfer(mockEvent);
}

pool.save();

updatePoolLiquidity(poolId, event.block.number, event.block.timestamp);
}

Expand Down

0 comments on commit b1d1c1f

Please sign in to comment.