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

refactor updatePoolWeights to avoid on-chain calls #537

Open
mendesfabio opened this issue Nov 28, 2023 · 2 comments
Open

refactor updatePoolWeights to avoid on-chain calls #537

mendesfabio opened this issue Nov 28, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mendesfabio
Copy link
Member

mendesfabio commented Nov 28, 2023

On every Swap event we update pool's tokens weights if they're variable (e.g. LBPs) by making on-chain calls. We could improve this and avoid the calls by calculating the weights at the timestamp of the swap using the GradualWeightUpdate entities. This is pretty much a refactor of the updatePoolWeights function.

Please use the comments to document your journey from cloning the repository and setting up the environment to coding the solution. You can ignore most of the README and it has instructions to run graph-node locally and that's not what we're looking for.

https://github.com/balancer/balancer-subgraph-v2

Relevant commands are the following:

  1. yarn
  2. yarn generate-assets
  3. yarn codegen
  4. yarn deploy

* Recommend yarn since that's the package manager we're using and there's already a yarn.lock file.

@thetroyharris
Copy link

thetroyharris commented Nov 29, 2023

  • Repo cloned
  • yarn installed, env setup, dependencies installed
  • yarn generate-assets no issues
  • yarn codegen no issues
  • Deployed a mainnet copy of the current subgraph to my own endpoint

Will begin working on refactoring the function.

@mendesfabio mendesfabio added enhancement New feature or request and removed needs requirements labels Nov 29, 2023
@thetroyharris
Copy link

Draft pull request has been opened. See #541
I have deployed to my own endpoint and will begin testing the results of these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants