You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For every router swap, I called the following 3 functions: (one of these functions is making massive amounts of calls, which degrades UI performance to the point it is not usable. Need to figure out a way to move these away from the main thread.
getBestRouteAndOutput is the main routing logic (uses breadth first search), returns an array of pools through with a swap should go through to go from input token to output token specified by the user.
expect gets the expected output from the swap by calling get_dy, or get_dy_underlying etc. of each individual pool in the calculated route.
price impact checks the difference between expected output calculated in step 2 versus the same for a very very small amount.
Source code: https://github.com/curvefi/curve-js/blob/master/src/router.ts
Router performance profile is in the following screenshot (in the comments).
Priority topic, since router is the landing page and needs to be as fast as possible.
Solutions involve optimising the router.js code.
The text was updated successfully, but these errors were encountered: