maximumAmoutIn function

double maximumAmoutIn(
  1. double amount,
  2. double slippageTorrelance, {
  3. bool isExactIn = false,
})

maximumAmoutIn computes the maximum input amount given the slippage parcentage

Implementation

double maximumAmoutIn(double amount, double slippageTorrelance,
    {bool isExactIn = false}) {
  if (isExactIn) return amount;
  final slippageAmount = amount.toDouble() * slippageTorrelance / 100.00;
  return amount + slippageAmount;
}