Extract calculation for DEx offer adjustment
Extract calculation for DEx offer adjustment

It was placed into the "legacy" namespace, to indicate that the use of floating numbers is discouraged, and should ideally be replaced at some point.

The calculation may be also be replaced as follows:

  double amountAdjusted = double(amountDesired) * double(amountAvailable) / double(amountOffered);

  return static_cast<int64_t>(rounduint64(amountAdjusted));

These are the same steps done in legacy::calculateDExTrade().

OmniLayer/omnicore,OmniLayer/omnicore,OmniLayer/omnicore,OmniLayer/omnicore,OmniLayer/omnicore,OmniLayer/omnicore