-
Notifications
You must be signed in to change notification settings - Fork 38
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
Await Token Info in Parallel #868
Comments
I would suggest using https://web3js.readthedocs.io/en/v1.2.9/include_package-core.html?highlight=batch#batchrequest This would send all the EVM calls to the node in a single batch request, which would (in theory) allow the node to better optimize the access to blockchain data and improve performance even further. |
Very nice suggestion! Thanks @nlordell. This also means we now have many other places we can improve with this! |
@nlordell - Not sure that we have access to the web3 artifact from within this method. Is this going to be more involved that originally expected? Do I really want to pass this into the function...? |
I think you have access to the underlying Web3 contract instance with |
This method is currently inefficient and slow when used to fetch many tokens at once. This could be easily improved by sending out EVM queries in parallel (i.e. with
await Promise.all
).dex-contracts/src/fee_token_liquidity.ts
Lines 29 to 51 in f5a3dbc
While improving this, it would also be nice to refactor this to use the batch exchange viewer contract changes that were introduced in #860
The text was updated successfully, but these errors were encountered: