diff --git a/CHANGELOG.md b/CHANGELOG.md index cc5f36c8a..3eb1573b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#1670](https://github.com/NibiruChain/nibiru/pull/1670) - feat(inflation): Make inflation polynomial * [#1695](https://github.com/NibiruChain/nibiru/pull/1695) - feat(inflation): add events for inflation distribution +### Bug Fixes + +* [#1688](https://github.com/NibiruChain/nibiru/pull/1688) - fix(inflation): make default inflation allocation follow tokenomics + ## [v1.0.0](https://github.com/NibiruChain/nibiru/releases/tag/v1.0.0) ### Features diff --git a/x/inflation/keeper/hooks_test.go b/x/inflation/keeper/hooks_test.go index 0db86f9bc..a64f0a048 100644 --- a/x/inflation/keeper/hooks_test.go +++ b/x/inflation/keeper/hooks_test.go @@ -161,7 +161,6 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) { // Perform Epoch Hooks futureCtx := ctx.WithBlockTime(time.Now().Add(time.Minute)) - fmt.Println("tc.height", tc.height) nibiruApp.EpochsKeeper.BeforeEpochStart(futureCtx, tc.epochIdentifier, tc.height) nibiruApp.EpochsKeeper.AfterEpochEnd(futureCtx, tc.epochIdentifier, tc.height) @@ -169,7 +168,6 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) { period := nibiruApp.InflationKeeper.CurrentPeriod.Peek(ctx) if tc.periodChanges { - fmt.Println("periodChanges", tc.periodChanges) newProvision := nibiruApp.InflationKeeper.GetEpochMintProvision(ctx) expectedProvision := types.CalculateEpochMintProvision( @@ -177,11 +175,6 @@ func TestPeriodChangesSkippedEpochsAfterEpochEnd(t *testing.T) { period, ) - fmt.Println("periodChanges", tc.periodChanges) - fmt.Println("newProvision", newProvision) - fmt.Println("expectedProvision", expectedProvision) - fmt.Println("originalProvision", originalProvision) - require.Equal(t, expectedProvision, newProvision) // mint provisions will change require.NotEqual(t, newProvision, originalProvision) diff --git a/x/inflation/keeper/inflation_test.go b/x/inflation/keeper/inflation_test.go index 9bba60cea..5b157d641 100644 --- a/x/inflation/keeper/inflation_test.go +++ b/x/inflation/keeper/inflation_test.go @@ -37,12 +37,12 @@ func TestMintAndAllocateInflation(t *testing.T) { { name: "pass", coinsToMint: sdk.NewCoin(denoms.NIBI, sdk.NewInt(1_000_000)), - expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)), - expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)), - expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(622_000)), - expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)), - expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)), - expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(622_000))), + expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)), + expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)), + expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(351_591)), + expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)), + expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)), + expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(351_591))), rootAccount: "nibi1qyqf35fkhn73hjr70442fctpq8prpqr9ysj9sn", }, { @@ -59,12 +59,12 @@ func TestMintAndAllocateInflation(t *testing.T) { { name: "pass - no root account", coinsToMint: sdk.NewCoin(denoms.NIBI, sdk.NewInt(1_000_000)), - expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)), - expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)), - expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(622_000)), - expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(278_000)), - expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(100_000)), - expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(622_000))), + expectedStakingAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)), + expectedStrategicAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)), + expectedCommunityAmt: sdk.NewCoin(denoms.NIBI, sdk.NewInt(351_591)), + expectedStakingRewardsBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(277_572)), + expectedStrategicReservesBalance: sdk.NewCoin(denoms.NIBI, sdk.NewInt(370_837)), + expectedCommunityPoolBalance: sdk.NewDecCoins(sdk.NewDecCoin(denoms.NIBI, sdk.NewInt(351_591))), rootAccount: "", }, } diff --git a/x/inflation/types/params.go b/x/inflation/types/params.go index 9d0be967a..89d684b1b 100644 --- a/x/inflation/types/params.go +++ b/x/inflation/types/params.go @@ -28,9 +28,9 @@ var ( sdk.MustNewDecFromStr("18063678.8582418"), } DefaultInflationDistribution = InflationDistribution{ - StakingRewards: sdk.NewDecWithPrec(27_8, 3), // 27.8% - CommunityPool: sdk.NewDecWithPrec(62_20, 4), // 62.20% - StrategicReserves: sdk.NewDecWithPrec(10, 2), // 10% + CommunityPool: sdk.NewDecWithPrec(35_159141, 8), // 35.159141% + StakingRewards: sdk.NewDecWithPrec(27_757217, 8), // 27.757217% + StrategicReserves: sdk.NewDecWithPrec(37_083642, 8), // 37.083642% } DefaultEpochsPerPeriod = uint64(30) DefaultPeriodsPerYear = uint64(12)