match pool_type {
    PoolType::StableSwap { .. } => {
        let pools_total: Uint256 = pools
            .into_iter()
            .fold(Uint256::zero(), |acc, x| acc.checked_add(x).unwrap());

        let deposits_total: Uint256 = deposits
            .into_iter()
            .fold(Uint256::zero(), |acc, x| acc.checked_add(x).unwrap());

        let pool_ratio = Decimal256::from_ratio(pools_total, pool_token_supply);
        let deposit_ratio = Decimal256::from_ratio(deposits_total, amount);

        if pool_ratio * one_minus_slippage_tolerance > deposit_ratio {
            return Err(ContractError::MaxSlippageAssertion);
        }
    }
}
