message: Improve performance of prices endpoint
diff: @@ -9,11 +9,17 @@ const web3 = new Web3(process.env.BSC_RPC_3 || process.env.BSC_RPC);
  const getCakeLpPrices = async () => {
  let prices = {};
  + console.time('Prices');
  - for (lpToken of lpTokens) {
  - prices[lpToken.name] = await getLpTokenPrice(lpToken);
  + let promises = [];
  + lpTokens.forEach(lpToken => promises.push(getLpTokenPrice(lpToken)));
  + const values = await Promise.all(promises);
  +
  + for (item of values) {
  + prices = { ...prices, ...item };
  }
  + console.timeEnd('Prices');
  return prices;
  };
  @@ -22,19 +28,27 @@ const getLpTokenPrice = async lpToken => {
  const totalSupply = await tokenPairContract.methods.totalSupply().call();
  const token0Contract = await new web3.eth.Contract(ERC20, lpToken.lp0.address);
  - const reserve0 = new BigNumber(await token0Contract.methods.balanceOf(lpToken.address).call());
  - const token0Price = await getPrice(lpToken.lp0.oracle, lpToken.lp0.oracleId);
  - const token0StakedInUsd = reserve0.times(token0Price);
  -
  const token1Contract = await new web3.eth.Contract(ERC20, lpToken.lp1.address);
  - const reserve1 = new BigNumber(await token1Contract.methods.balanceOf(lpToken.address).call());
  - const token1Price = await getPrice(lpToken.lp1.oracle, lpToken.lp1.oracleId);
  +
  + let [reserve0, reserve1, token0Price, token1Price] = await Promise.all([
  + token0Contract.methods.balanceOf(lpToken.address).call(),
  + token1Contract.methods.balanceOf(lpToken.address).call(),
  + getPrice(lpToken.lp0.oracle, lpToken.lp0.oracleId),
  + getPrice(lpToken.lp1.oracle, lpToken.lp1.oracleId),
  + ]);
  +
  + reserve0 = new BigNumber(reserve0);
  + reserve1 = new BigNumber(reserve1);
  +
  + const token0StakedInUsd = reserve0.times(token0Price);
  const token1StakedInUsd = reserve1.times(token1Price);
  const totalStakedInUsd = token0StakedInUsd.plus(token1StakedInUsd);
  const lpTokenPrice = totalStakedInUsd.dividedBy(totalSupply);
  - return Number(lpTokenPrice);
  + return { [lpToken.name]: Number(lpTokenPrice) };
  };
  +getCakeLpPrices();
  +
  module.exports = getCakeLpPrices;
  