Skip to content

Commit

Permalink
Fix insufficient total share creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ValarDragon committed Jun 8, 2022
1 parent 94a3878 commit 57b3a0b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x/gamm/pool-models/balancer/amm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -309,6 +307,8 @@ func (p *Pool) CalcJoinPoolShares(_ sdk.Context, tokensIn sdk.Coins, swapFee sdk
}
}

totalShares = totalShares.Add(numShares)

return numShares, newLiquidity, nil
}

Expand Down

0 comments on commit 57b3a0b

Please sign in to comment.