Skip to content

Commit

Permalink
Fixed halving calculation for volts
Browse files Browse the repository at this point in the history
  • Loading branch information
cyborgshead committed Oct 20, 2024
1 parent ecf4289 commit 6db73aa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions x/resources/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,10 @@ func (k Keeper) CalculateInvestmint(ctx sdk.Context, amt sdk.Coin, resource stri
case ctypes.VOLT:
cycles := sdk.NewDec(int64(length)).QuoInt64(int64(params.BaseInvestmintPeriodVolt))
base := sdk.NewDec(amt.Amount.Int64()).QuoInt64(params.BaseInvestmintAmountVolt.Amount.Int64())

// TODO double check when third halving will be applied?
// NOTE out of parametrization custom code is applied here in order to shift the FIRST HALVING 6M BLOCKS LATER but keep base halving parameter same

// NOTE out of parametrization, custom code is applied here in order to shift the HALVINGS START 6M BLOCKS LATER but keep base halving parameter same
if ctx.BlockHeight() > 15000000 {
halving = sdk.NewDecWithPrec(int64(math.Pow(0.5, float64((ctx.BlockHeight()-600000)/int64(params.HalvingPeriodVoltBlocks)))*10000), 4)
halving = sdk.NewDecWithPrec(int64(math.Pow(0.5, float64((ctx.BlockHeight()-6000000)/int64(params.HalvingPeriodVoltBlocks)))*10000), 4)
} else {
halving = sdk.OneDec()
}
Expand Down

0 comments on commit 6db73aa

Please sign in to comment.