Skip to content

Commit

Permalink
Merge branch 'main' into incentive_staking_reward_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmic-vagabond authored Feb 12, 2024
2 parents 7856640 + 7a05e8c commit e71d4b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion x/amm/keeper/calc_swap_estimation_by_denom.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (k Keeper) CalcSwapEstimationByDenom(
// Initialize return variables
inRoute, outRoute = nil, nil
outAmount, availableLiquidity = sdk.Coin{}, sdk.Coin{}
spotPrice, swapFeeOut, discountOut, weightBonus, priceImpact = sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()
spotPrice, swapFeeOut, discountOut, weightBonus, priceImpact = sdk.ZeroDec(), sdk.ZeroDec(), discount, sdk.ZeroDec(), sdk.ZeroDec()

// Determine the correct route based on the amount's denom
if amount.Denom == denomIn {
Expand Down
9 changes: 9 additions & 0 deletions x/incentive/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,15 @@ func (k Keeper) UpdateStakersRewardsUnclaimed(ctx sdk.Context, stakeIncentive ty
edenRemained := stakersEdenAmountPerDistribution.Sub(totalEdenGiven)
dexRewardsRemained := dexRevenueStakersAmtPerDistribution.Sub(sdk.NewDecFromInt(totalRewardsGiven))

// if edenRemained is negative, override it with zero
if edenRemained.IsNegative() {
edenRemained = sdk.ZeroInt()
}
// if dexRewardsRemained is negative, override it with zero
if dexRewardsRemained.IsNegative() {
dexRewardsRemained = sdk.ZeroDec()
}

// Fund community the remain coins
// ----------------------------------
edenRemainedCoin := sdk.NewDecCoin(ptypes.Eden, edenRemained)
Expand Down

0 comments on commit e71d4b7

Please sign in to comment.