pub fn get_min_amount_out(swap_config: &SwapConfig, pool: &dyn PoolTrait) -> u64Expand description
Calculate minimum amount out for a swap based on slippage tolerance. Uses the formula: min_amount_out = amount_in * price_lp * (10^9 - slippage_lp) / (10^9 * 10^9)`. This calculation does not account for price impact or swap fees, which prevents execution when pools have extreme fees (100%) or zero liquidity. For exact calculations, use protocol-specific functions that support manual amount specification. Note: 100% slippage means accepting nothing for the trade (industry standard).