Skip to content

refactor updatePoolWeights to avoid on-chain calls #537

@mendesfabio

Description

@mendesfabio

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions