GoodDollar / GoodWeb3-Mono

mono repo with GoodDollar's web3 UI components and SDK
https://gooddollar-storybook.vercel.app
0 stars 1 forks source link

Bug (sdk-v1): calculating pair combo's cause excessive network requests #91

Open L03TJ3 opened 1 year ago

L03TJ3 commented 1 year ago

Description

After filling in an amount on the swap-module (fuse-network) from gooddapp it calculates toReceive amount. This causes excessive network requests and continues even after the calculation is done.

These requests make us not able to use an rpc like chainstacklabs as they block the rpc because of too many requests being done

Steps to reproduce

  1. go to gooddapp
  2. connect a wallet to the fuse network
  3. go to swap
  4. fill in amount and check network tab in console

Which network did you use?

Fuse

Supporting data

All I got so far is that it traces down to here: https://github.com/GoodDollar/GoodWeb3-Mono/blob/2020fe5d55166268b8f7448c4d650f9dfd2c5a35/packages/sdk/src/methods/v2Pairs.ts#L30

Have checked dependencies and there don't seem to be significant changes done to them (full stack-trace leads to getUrl from ethers library, but we are already at the latest of the v5 packages)