                if total_share == Uint128::zero() {
                    // Make sure at least MINIMUM_LIQUIDITY_AMOUNT is deposited to mitigate the risk of the first
                    // depositor preventing small liquidity providers from joining the pool
                    let share = Uint128::new(
                        (U256::from(deposits[0].amount.u128())
                            .checked_mul(U256::from(deposits[1].amount.u128()))
                            .ok_or::<ContractError>(
                                ContractError::LiquidityShareComputationFailed,
                            ))?
                        .integer_sqrt()
                        .as_u128(),
                    )
                    .saturating_sub(MINIMUM_LIQUIDITY_AMOUNT);

                    // share should be above zero after subtracting the MINIMUM_LIQUIDITY_AMOUNT
                    if share.is_zero() {
                        return Err(ContractError::InvalidInitialLiquidityAmount(
                            MINIMUM_LIQUIDITY_AMOUNT,
                        ));
                    }

                    messages.push(amm::lp_common::mint_lp_token_msg(
                        liquidity_token.clone(),
                        &env.contract.address,
                        &env.contract.address,
                        MINIMUM_LIQUIDITY_AMOUNT,
                    )?);

                    share
if total_share == Uint128::zero() {
    // Minimum liquidity check only happens on first deposit
    // But total_share is not zero, just very small
    ...
}
        // Increment the pool asset amount by the amount sent
        for asset in deposits.iter() {
            let asset_denom = &asset.denom;
            let pool_asset_index = pool_assets
                .iter()
                .position(|pool_asset| &pool_asset.denom == asset_denom)
                .ok_or(ContractError::AssetMismatch)?;

            pool_assets[pool_asset_index].amount = pool_assets[pool_asset_index]
                .amount
                .checked_add(asset.amount)?;
        }

        pool.assets = pool_assets.clone();
    // Burn the LP tokens
    messages.push(amm::lp_common::burn_lp_asset_msg(
        liquidity_token,
        env.contract.address,
        amount,
    )?);
