@@ -22,7 +22,7 @@ import (
2222func (k Keeper ) BeginBlocker (ctx sdk.Context ) error {
2323 params := k .parameterKeeper .GetParams (ctx )
2424 // convert balances in taker address to elys and burn them
25- if ctx .BlockHeight ()% int64 (params .TakerFeeCollectionInterval ) == 0 && params . EnableTakerFeeSwap {
25+ if params . EnableTakerFeeSwap && params . TakerFeeCollectionInterval > 0 && ctx .BlockHeight ()% int64 (params .TakerFeeCollectionInterval ) == 0 {
2626 k .ProcessTakerFee (ctx )
2727 }
2828 return nil
@@ -244,11 +244,14 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error {
244244 Quo (edenDenomPrice )
245245
246246 // Use min amount (eden allocation from tokenomics and max apr based eden amount)
247+ newEdenAllocatedForPoolAmount := newEdenAllocatedForPool .Dec ().TruncateInt ()
247248 if pool .EnableEdenRewards {
248249 newEdenAllocatedForPool = poolShareEdenEnable .Mul (osmomath .BigDecFromSDKInt (lpsEdenAmount ))
249250 newEdenAllocatedForPool = osmomath .MinBigDec (newEdenAllocatedForPool , poolMaxEdenAmount )
250- if newEdenAllocatedForPool .IsPositive () {
251- err = k .commitmentKeeper .MintCoins (ctx , types .ModuleName , sdk.Coins {sdk .NewCoin (ptypes .Eden , newEdenAllocatedForPool .Dec ().TruncateInt ())})
251+
252+ newEdenAllocatedForPoolAmount = newEdenAllocatedForPool .Dec ().TruncateInt ()
253+ if newEdenAllocatedForPoolAmount .IsPositive () {
254+ err = k .commitmentKeeper .MintCoins (ctx , types .ModuleName , sdk.Coins {sdk .NewCoin (ptypes .Eden , newEdenAllocatedForPoolAmount )})
252255 if err != nil {
253256 return err
254257 }
@@ -270,8 +273,8 @@ func (k Keeper) UpdateLPRewards(ctx sdk.Context) error {
270273 k .AddEdenInfo (ctx , newEdenAllocatedForPool )
271274
272275 // Distribute Eden
273- if pool .EnableEdenRewards {
274- k .UpdateAccPerShare (ctx , pool .PoolId , ptypes .Eden , newEdenAllocatedForPool . Dec (). TruncateInt () )
276+ if pool .EnableEdenRewards && newEdenAllocatedForPoolAmount . IsPositive () {
277+ k .UpdateAccPerShare (ctx , pool .PoolId , ptypes .Eden , newEdenAllocatedForPoolAmount )
275278 }
276279 // Distribute Gas fees + Dex rewards (USDC)
277280 k .UpdateAccPerShare (ctx , pool .PoolId , k .GetBaseCurrencyDenom (ctx ), gasRewardsAllocatedForPool .Add (dexRewardsAllocatedForPool ).Dec ().TruncateInt ())
0 commit comments