yearn / yearn-sdk

🦧 SDK for the yearn.finance platform. WIP
https://npm.im/@yfi/sdk
MIT License
53 stars 56 forks source link

Support multicall getNormalizedValueUsdc for optimization #57

Open storming0x opened 3 years ago

storming0x commented 3 years ago

It seems getNormalizedValueUsdc method is good for what yearn watch wants, it would be great if it supported batch calls (multicall), since potentially we will be calling this with all the want tokens we support which is a lot of promises and calls to web3 provider

x48115 commented 2 years ago

@pmdaly can you reach out to me on telegram? @x48114

I believe we should tackle this bug with a different approach. Rather than implementing multicall in the SDK (where the SDK does not use multicall at all) we should update the appropriate lens contract to give you the data you need:

https://github.com/yearn/yearn-lens/blob/master/contracts/Utilities/Helper/Helpers/PricesHelper.sol

The SDK utilizes lens contracts for data aggregation instead of multicall.

karelianpie commented 2 years ago

@storming0x @pmdaly can this issue be closed?

storming0x commented 2 years ago

https://github.com/yearn/yearn-lens/blob/master/contracts/Utilities/Helper/Helpers/PricesHelper.sol

Yes, will share w yearn watch team to follow on integration for SDK