minimumAmoutOut function

double minimumAmoutOut(
  1. double amount,
  2. double slippageTorrelance, {
  3. bool isExactOut = false,
})

minimumAmoutOut computes the minimum output amount given the slippage parcentage

Implementation

double minimumAmoutOut(double amount, double slippageTorrelance,
    {bool isExactOut = false}) {
  if (isExactOut) return amount;
  final slippageAmount = amount.toDouble() * slippageTorrelance / 100.00;
  return amount - slippageAmount;
}