Skip to content

legacy cleanup - #605

Merged
mendesfabio merged 28 commits into
masterfrom
cleanup
May 5, 2026
Merged

mendesfabio merged 28 commits into
masterfrom
cleanup

Conversation

@gmbronco

@gmbronco gmbronco commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Description

Refactored to align with the API requirements and optimised for minimal entities count. Removed legacy data, removed USD pricing, pruned swap and liquidity events indexing.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency changes
  • Code refactor / cleanup
  • Documentation or wording changes
  • Other

@gmbronco
gmbronco requested a review from mendesfabio as a code owner January 7, 2026 15:00
Comment thread src/mappings/vault.ts
Comment on lines -330 to +204
exit.user = event.params.liquidityProvider.toHexString();
exit.user = event.params.liquidityProvider;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this changed? What is the effect of this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

user is defined as bytes and since toHexString() converts to a string it throws a type error.

Comment thread src/mappings/vault.ts Outdated
Comment thread src/mappings/vault.ts Outdated
Comment thread src/mappings/poolFactory.ts Outdated
Comment on lines +821 to +829

// Handle BPT
if (tokensAddresses[i] === pool.address) {
let bpt = Token.load(pool.address.toHexString());
if (bpt !== null) {
bpt.pool = pool.id;
bpt.save();
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does this need to be added?

@gmbronco gmbronco Jan 8, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's needed to assign poolId to a bpt token, it was handled with

  let pool = WeightedPool.bind(tokenAddress);
  let isPoolCall = pool.try_getPoolId();
  if (!isPoolCall.reverted) {
    let poolId = isPoolCall.value;
    token.pool = poolId.toHexString();
  }

but this was failing - afair there were some pools that didn't have getPoolId implemented properly

@franzns franzns Jan 8, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think this is the same logic. before, it added the pool ID of a nested pool to the pool token. Now you're handling phantom BPTs.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it also shouldnt fail as it does a try_getPoolId()

Comment thread manifest.template.yaml
Comment thread schema.graphql Outdated
Comment thread schema.graphql Outdated
Comment thread schema.graphql Outdated
Comment thread schema.graphql
Comment on lines -209 to -215
type UserInternalBalance @entity {
id: ID!
userAddress: User
token: Bytes!
tokenInfo: Token
balance: BigDecimal!
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mendesfabio do you think this is still needed for exploit recovery purposes?

Comment thread schema.graphql Outdated
Comment thread schema.graphql Outdated
balance: BigDecimal!
}

type GradualWeightUpdate @entity(immutable: true) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed too, its from managed pools

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also remove swapfeeupdate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like it's related to LBPs as well

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we dont need LBPs on v2, can remove it too

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as discussed, we need LBPs on v2

@mendesfabio
mendesfabio merged commit 8040b35 into master May 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants