diff --git a/app/upgrades.go b/app/upgrades.go index 478c4d3917..5d67885276 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -23,6 +23,7 @@ import ( appparams "github.com/umee-network/umee/v6/app/params" "github.com/umee-network/umee/v6/util" leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" + "github.com/umee-network/umee/v6/x/metoken" ) // RegisterUpgradeHandlersregisters upgrade handlers. @@ -50,9 +51,40 @@ func (app UmeeApp) RegisterUpgradeHandlers() { app.registerOutdatedPlaceholderUpgrade("v6.1") app.registerOutdatedPlaceholderUpgrade("v6.2") app.registerUpgrade("v6.3", upgradeInfo, nil, nil, nil) - app.registerUpgrade6_4(upgradeInfo) - app.registerUpgrade("v6.5", upgradeInfo, nil, []string{crisistypes.ModuleName}, nil) + + app.registerUpgrade6_5(upgradeInfo) +} + +func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { + planName := "v6.5" + + app.UpgradeKeeper.SetUpgradeHandler(planName, + func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + printPlanName(planName, ctx.Logger()) + + // update leverage and metoken params to include burn auction fee share. + lparams := app.LeverageKeeper.GetParams(ctx) + lparams.RewardsAuctionFactor = leveragetypes.DefaultParams().RewardsAuctionFactor + if err := app.LeverageKeeper.SetParams(ctx, lparams); err != nil { + return err + } + + mekeeper := app.MetokenKeeperB.Keeper(&ctx) + meparams := mekeeper.GetParams() + meparams.RewardsAuctionFactor = metoken.DefaultParams().RewardsAuctionFactor + if err := mekeeper.SetParams(meparams); err != nil { + return err + } + + return app.mm.RunMigrations(ctx, app.configurator, fromVM) + }, + ) + + app.storeUpgrade(planName, upgradeInfo, storetypes.StoreUpgrades{ + Added: []string{auction.ModuleName}, + Deleted: []string{crisistypes.ModuleName} + }) } func (app *UmeeApp) registerUpgrade6_4(upgradeInfo upgradetypes.Plan) { diff --git a/x/leverage/types/params.go b/x/leverage/types/params.go index 8fee658d90..690120ab04 100644 --- a/x/leverage/types/params.go +++ b/x/leverage/types/params.go @@ -12,7 +12,7 @@ func DefaultParams() Params { CompleteLiquidationThreshold: sdk.MustNewDecFromStr("0.4"), MinimumCloseFactor: sdk.MustNewDecFromStr("0.05"), OracleRewardFactor: sdk.MustNewDecFromStr("0.01"), - RewardsAuctionFactor: sdk.MustNewDecFromStr("0.02"), + RewardsAuctionFactor: sdk.MustNewDecFromStr("0.20"), SmallLiquidationSize: sdk.MustNewDecFromStr("500.00"), DirectLiquidationFee: sdk.MustNewDecFromStr("0.05"), } diff --git a/x/metoken/params.go b/x/metoken/params.go index eb6ce7f178..87ebcb4c2f 100644 --- a/x/metoken/params.go +++ b/x/metoken/params.go @@ -5,6 +5,6 @@ func DefaultParams() Params { return Params{ RebalancingFrequency: 60 * 60 * 12, // 12h ClaimingFrequency: 60 * 60 * 24 * 7, // 7d - RewardsAuctionFactor: 1000, // 10% of fees goes to rewards auction + RewardsAuctionFactor: 2000, // 20% of fees goes to rewards auction } }