Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix holders count #591

Merged
merged 2 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading