code: public void placeOrderAndWaitUntilActive(final BitfinexNewOrder order) throws BitfinexClientException, InterruptedException {
  
  		final BitfinexApiKeyPermissions capabilities = client.getApiKeyPermissions();
  
  		if(! capabilities.isOrderWritePermission()) {
  			throw new BitfinexClientException("Unable to wait for order " + order + " connection has not enough capabilities: " + capabilities);
  		}
  
  		order.setApiKey(client.getConfiguration().getApiKey());
  
  		final Callable<Boolean> orderCallable = () -> placeOrderOrderOnAPI(order);
  
  		// Bitfinex does not implement a happens-before relationship. Sometimes
  		// canceling a stop-loss order and placing a new stop-loss order results
  		// in an 'ERROR, reason is Invalid order: not enough exchange balance'
  		// error for some seconds. The retryer tries to place the order up to
  		// three times
  		final Retryer<Boolean> retryer = new Retryer<>(ORDER_RETRIES, RETRY_DELAY_IN_MS,
  				TimeUnit.MILLISECONDS, orderCallable);
  		retryer.execute();
  
  		if(retryer.getNeededExecutions() > 1) {
  			logger.info("Nedded {} executions for placing the order", retryer.getNeededExecutions());
  		}
  
  		if(! retryer.isSuccessfully()) {
  			final Exception lastException = retryer.getLastException();
  
  			if(lastException == null) {
  				throw new BitfinexClientException("Unable to execute order");
  			} else {
  				throw new BitfinexClientException(lastException);
  			}
  		}
  	}
docs: Place an order and retry if Exception occur
  @param order - new BitfinexOrder to place
  @throws BitfinexClientException
  @throws InterruptedException