setupBinance = async logger => {
  PubSub.subscribe('reset-all-websockets', async (message, data) => {
    logger.info(`Message: ${message}, Data: ${data}`);

    PubSub.publish('frontend-notification', {
      type: 'info',
      title: 'Restarting bot...'
    });

    await syncAll(logger);
  });
  PubSub.subscribe('reset-symbol-websockets', async (message, data) => {
    logger.info(`Message: ${message}, Data: ${data}`);

    const symbol = data;

    PubSub.publish('frontend-notification', {
      type: 'info',
      title: `Restarting ${symbol} websockets...`
    });

    // Get configuration
    const globalConfiguration = await getGlobalConfiguration(logger);

    // Retrieve list of monitoring symbols
    const { symbols } = globalConfiguration;

    // Candles & ATH candles should receive all monitoring symbols to create their connection from scratch
    // because they are grouped by symbols intervals and not by their names
    await Promise.all([
      setupCandlesWebsocket(logger, symbols),
      setupATHCandlesWebsocket(logger, symbols),
      setupTickersWebsocket(logger, [symbol])
    ]);

    await syncCandles(logger, [symbol]);
    await syncATHCandles(logger, [symbol]);
  });
  PubSub.subscribe('check-open-orders', async (message, data) => {
    logger.info(`Message: ${message}, Data: ${data}`);

    const cachedOpenOrders = await cache.hgetall(
      'trailing-trade-open-orders:',
      'trailing-trade-open-orders:*'
    );

    const symbols = _.keys(cachedOpenOrders);

    await Promise.all(
      symbols.map(async symbol =>
        queue.execute(logger, symbol, { processFn: executeTrailingTrade })
      )
    );
  });

  await syncAll(logger);
}
Setup retrieving latest candle from live server via Web Socket

@param {*} logger