let new_pool = calculate_stableswap_y(
    n_coins,
    offer_pool,
    ask_pool,
    offer_amount,
    amp,
    ask_precision,
    StableSwapDirection::Simulate,
)?;
let pool_sum = match direction {
    StableSwapDirection::Simulate => offer_pool.checked_add(offer_amount)?,
    StableSwapDirection::ReverseSimulate => ask_pool.checked_sub(offer_amount)?,
for _i in range(N_COINS):
    if _i == i:
        _x = x
    elif _i != j:
        _x = xp_[_i]
    else:
        continue
    S_ += _x
let sum_pools = offer_pool.checked_add(ask_pool)?;
n_coins: Uint256::from(pool_info.assets.len() as u128),
