code: protected function updateExchangeRate(SaleInterface $sale)
      {
          if (null !== $sale->getExchangeRate()) {
              return false;
          }
  
          $date = $sale->getExchangeDate() ?? new \DateTime();
  
          $rate = $this->currencyConverter->getRate(
              $this->currencyConverter->getDefaultCurrency(),
              $sale->getCurrency()->getCode(),
              $date
          );
  
          $sale
              ->setExchangeRate($rate)
              ->setExchangeDate($date);
  
          return true;
      }
docs: Sets the sale's exchange rate.
  
  @param SaleInterface $sale
  
  @return bool