Presently, utils.ts contains inefficient code for calculating total liquidity where it walks through all pools on all supported networks to calculate total liquidity. This work is compounded since it repeats this calculation for each pool.
If there are 50 pools then it will walk through each of the 50 pools and for each, repeat the total liquidity calculation so it becomes 50 x 50 =2,500 calls. Actually that calculation only needs to run once and so it should be 50 calls to get the sum then use that result one for each of the pools so closer to 100 calls.
Presently, utils.ts contains inefficient code for calculating total liquidity where it walks through all pools on all supported networks to calculate total liquidity. This work is compounded since it repeats this calculation for each pool.
If there are 50 pools then it will walk through each of the 50 pools and for each, repeat the total liquidity calculation so it becomes 50 x 50 =2,500 calls. Actually that calculation only needs to run once and so it should be 50 calls to get the sum then use that result one for each of the pools so closer to 100 calls.