diff --git a/x/gamm/pool-models/balancer/amm.go b/x/gamm/pool-models/balancer/amm.go index b81b9cb4c3c..a0cd9990255 100644 --- a/x/gamm/pool-models/balancer/amm.go +++ b/x/gamm/pool-models/balancer/amm.go @@ -293,8 +293,6 @@ func (p *Pool) CalcJoinPoolShares(_ sdk.Context, tokensIn sdk.Coins, swapFee sdk poolAssetsByDenom[coin.Denom] = poolAsset } - totalShares = totalShares.Add(numShares) - // If there are coins that couldn't be perfectly joined, do single asset joins // for each of them. if !remCoins.Empty() { @@ -309,6 +307,8 @@ func (p *Pool) CalcJoinPoolShares(_ sdk.Context, tokensIn sdk.Coins, swapFee sdk } } + totalShares = totalShares.Add(numShares) + return numShares, newLiquidity, nil }