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

Replace dataQueries with multicallV3 (with batching) #101

Merged
merged 20 commits into from
Oct 12, 2023

Conversation

johngrantuk
Copy link
Member

@johngrantuk johngrantuk commented Oct 11, 2023

Replace dataQueries:

  • Remove BALANCER_POOL_DATA_QUERIES_ADDRESSES
  • Remove tokenRates and dataQueries ABI
  • Removed queryFailed as not used anywhere and was misleading into thinking it was handled - logging error instead
  • Remove old multicall implementations

Add MulticallV3:

  • Add multicallV3 ABI
  • fetchAdditionalPoolData only makes working calls to existing pools (reduces call amount)
  • Update onChainPoolDataEnricher
  • Add manual batching (instead of Viems) so we can maintain custom blockNo
  • Replace old data queries call
  • Update debug script

Other:

  • Filter bricked pools from vulnerability
  • Fix scalingFactor scaling

@johngrantuk johngrantuk marked this pull request as ready for review October 11, 2023 12:52
Copy link
Member

@brunoguerios brunoguerios left a comment

Choose a reason for hiding this comment

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

Nice and clean implementation 👏 LGTM 👍

src/utils/constants.ts Outdated Show resolved Hide resolved
'0xac4b72c01072a52b73ca71105504f1372efcce0d000000000000000000000003',
'0xbfd65c6160cfd638a85c645e6e6d8acac5dac935000000000000000000000004',
'0xe274c9deb6ed34cfe4130f8d0a8a948dea5bb28600000000000000000000000d',
];
Copy link
Contributor

Choose a reason for hiding this comment

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

any way to filter them out in the subgraph, or RPC?

Copy link
Member Author

Choose a reason for hiding this comment

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

These get used in the Subgraph provider query to filter. Or do you mean by default at source?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, at source, since we know the pool is bricked, we could set a flag somewhere that it's killed, is there something like that on a contract?

@johngrantuk johngrantuk merged commit 558ffc0 into main Oct 12, 2023
3 of 4 checks passed
@johngrantuk johngrantuk deleted the replace-onchainPoolData branch October 12, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants