async updateLeverage(symbol) {
    const { logger } = this;

    return new Promise((resolve, reject) => {
      const config = this.symbols.find(cSymbol => cSymbol.symbol === symbol);
      if (!config) {
        this.logger.error(`Bitmex: Invalid leverage config for:${symbol}`);
        resolve(false);

        return;
      }

      // use default leverage to "3"
      const leverageSize = _.get(config, 'extra.bitmex_leverage', 3);

      if (leverageSize < 0 || leverageSize > 100) {
        throw `Invalid leverage size for: ${leverageSize} ${symbol}`;
      }

      // we dont get the selected leverage value in websocket or api endpoints
      // so we update them only in a given time window; system overload is often blocked
      if (symbol in this.leverageUpdated && this.leverageUpdated[symbol] > moment().subtract(45, 'minutes')) {
        this.logger.debug(`Bitmex: leverage update not needed: ${symbol}`);
        resolve(true);
        return;
      }

      const verb = 'POST';
      const path = '/api/v1/position/leverage';
      const expires = new Date().getTime() + 60 * 1000; // 1 min in the future
      const data = {
        symbol: symbol,
        leverage: leverageSize
      };

      const postBody = JSON.stringify(data);
      const signature = crypto
        .createHmac('sha256', this.apiSecret)
        .update(verb + path + expires + postBody)
        .digest('hex');

      const headers = {
        'content-type': 'application/json',
        Accept: 'application/json',
        'X-Requested-With': 'XMLHttpRequest',
        'api-expires': expires,
        'api-key': this.apiKey,
        'api-signature': signature
      };

      const me = this;
      request(
        {
          headers: headers,
          url: this.getBaseUrl() + path,
          method: verb,
          body: postBody
        },
        (error, response, body) => {
          if (error) {
            logger.error(`Bitmex: Invalid leverage update request:${JSON.stringify({ error: error, body: body })}`);
            console.error(`Bitmex: Invalid leverage update request:${JSON.stringify({ error: error, body: body })}`);
            resolve(false);

            return;
          }

          const result = JSON.parse(body);
          if (result.error) {
            logger.error(`Bitmex: Invalid leverage update request:${body}`);
            console.error(`Bitmex: Invalid leverage update request:${body}`);
            resolve(false);
            return;
          }

          logger.debug(`Bitmex: Leverage update:${JSON.stringify(symbol)}`);

          // set updated indicator; for not update on next request
          me.leverageUpdated[symbol] = new Date();

          resolve(true);
        }
      );
    });
  }
Set the configured leverage size "0-100" for pair before creating an order default "3" if not provided in configuration

symbol configuration via:

"extra.bitmex_leverage": 5

@param symbol
@returns {Promise<any>}