diff --git a/x/amm/keeper/query_pool.go b/x/amm/keeper/query_pool.go index 4623940d1..945730fc4 100644 --- a/x/amm/keeper/query_pool.go +++ b/x/amm/keeper/query_pool.go @@ -18,7 +18,10 @@ func (k Keeper) PoolExtraInfo(ctx sdk.Context, pool types.Pool) types.PoolExtraI tvl, _ := pool.TVL(ctx, k.oracleKeeper, k.accountedPoolKeeper) lpTokenPrice, _ := pool.LpTokenPrice(ctx, k.oracleKeeper, k.accountedPoolKeeper) avg := k.GetWeightBreakingSlippageAvg(ctx, pool.PoolId) - apr := avg.Mul(math.LegacyNewDec(52)).Quo(tvl) + apr := math.LegacyZeroDec() + if tvl.IsPositive() { + apr = avg.Mul(math.LegacyNewDec(52)).Quo(tvl) + } return types.PoolExtraInfo{ Tvl: tvl, LpTokenPrice: lpTokenPrice, diff --git a/x/amm/keeper/update_pool_for_swap.go b/x/amm/keeper/update_pool_for_swap.go index 5da440793..f11a111e4 100644 --- a/x/amm/keeper/update_pool_for_swap.go +++ b/x/amm/keeper/update_pool_for_swap.go @@ -113,7 +113,6 @@ func (k Keeper) UpdatePoolForSwap( return err } - // TODO: Some issue in weight breaking fee amount as we already multiply it k.TrackWeightBreakingSlippage(ctx, pool.PoolId, sdk.NewCoin(tokenIn.Denom, weightRecoveryFeeAmount)) }