From 29ba0f4611547e5de3d88a953d3a6dbce63c1ec7 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 15 May 2024 16:33:05 +0200 Subject: [PATCH 1/8] feat(auction): upgrade handler and params --- app/upgrades.go | 36 ++++++++++++++++++++++++++++++++++-- x/leverage/types/params.go | 2 +- x/metoken/params.go | 2 +- 3 files changed, 36 insertions(+), 4 deletions(-) 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 } } From aae72f6ac9a4855f330450c1ee71002e48bd79ec Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 15 May 2024 16:50:05 +0200 Subject: [PATCH 2/8] fix --- app/upgrades.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 5d67885276..13f496b810 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -22,6 +22,7 @@ import ( appparams "github.com/umee-network/umee/v6/app/params" "github.com/umee-network/umee/v6/util" + "github.com/umee-network/umee/v6/x/auction" leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" "github.com/umee-network/umee/v6/x/metoken" ) @@ -67,14 +68,14 @@ func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { lparams := app.LeverageKeeper.GetParams(ctx) lparams.RewardsAuctionFactor = leveragetypes.DefaultParams().RewardsAuctionFactor if err := app.LeverageKeeper.SetParams(ctx, lparams); err != nil { - return err + return nil, err } mekeeper := app.MetokenKeeperB.Keeper(&ctx) meparams := mekeeper.GetParams() meparams.RewardsAuctionFactor = metoken.DefaultParams().RewardsAuctionFactor if err := mekeeper.SetParams(meparams); err != nil { - return err + return nil, err } return app.mm.RunMigrations(ctx, app.configurator, fromVM) @@ -82,8 +83,8 @@ func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { ) app.storeUpgrade(planName, upgradeInfo, storetypes.StoreUpgrades{ - Added: []string{auction.ModuleName}, - Deleted: []string{crisistypes.ModuleName} + Added: []string{auction.ModuleName}, + Deleted: []string{crisistypes.ModuleName}, }) } From 15d9dbee2c850ab243ee2d70224d0424fadf18eb Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 15 May 2024 17:28:09 +0200 Subject: [PATCH 3/8] update metoken params name and docs --- app/upgrades.go | 2 +- proto/umee/metoken/v1/metoken.proto | 7 +- swagger/swagger.yaml | 33 +++--- x/metoken/keeper/intest/msg_server_test.go | 4 +- x/metoken/keeper/swap.go | 2 +- x/metoken/keeper/swap_test.go | 4 +- x/metoken/metoken.pb.go | 115 +++++++++++---------- x/metoken/params.go | 2 +- 8 files changed, 90 insertions(+), 79 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 13f496b810..0964f363ac 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -73,7 +73,7 @@ func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { mekeeper := app.MetokenKeeperB.Keeper(&ctx) meparams := mekeeper.GetParams() - meparams.RewardsAuctionFactor = metoken.DefaultParams().RewardsAuctionFactor + meparams.RewardsAuctionFeeFactor = metoken.DefaultParams().RewardsAuctionFeeFactor if err := mekeeper.SetParams(meparams); err != nil { return nil, err } diff --git a/proto/umee/metoken/v1/metoken.proto b/proto/umee/metoken/v1/metoken.proto index e96ebde122..f436ccc30b 100644 --- a/proto/umee/metoken/v1/metoken.proto +++ b/proto/umee/metoken/v1/metoken.proto @@ -19,10 +19,11 @@ message Params { // leverage module int64 claiming_frequency = 2; - // Rewards Auction Factor determines the portion of swap and redeem fee that is sent to the - // auction module for the rewards auction. + // Rewards Auction Fee Factor determines the portion of total fees collected by the metoken + // module that will go for the rewards auction. Note: this is different than x/leverage + // Params.rewards_auction_factor. // Valid values: 0-10000 (in basis points, 2000 = 20%). - uint32 rewards_auction_factor = 3 [ + uint32 rewards_auction_fee_factor = 3 [ (gogoproto.customtype) = "github.com/umee-network/umee/v6/util/bpmath.FixedBP", (gogoproto.nullable) = false ]; diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index f2461760e1..ab0d230611 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -5870,14 +5870,17 @@ paths: often metoken module will claim accrued interest from leverage module - rewards_auction_factor: + rewards_auction_fee_factor: type: integer format: int64 description: >- - Rewards Auction Factor determines the portion of swap and - redeem fee that is sent to the + Rewards Auction Fee Factor determines the portion of total + fees collected by the metoken + + module that will go for the rewards auction. Note: this is + different than x/leverage - auction module for the rewards auction. + Params.rewards_auction_factor. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. @@ -10548,14 +10551,17 @@ definitions: module will claim accrued interest from leverage module - rewards_auction_factor: + rewards_auction_fee_factor: type: integer format: int64 description: >- - Rewards Auction Factor determines the portion of swap and redeem fee - that is sent to the + Rewards Auction Fee Factor determines the portion of total fees + collected by the metoken - auction module for the rewards auction. + module that will go for the rewards auction. Note: this is different + than x/leverage + + Params.rewards_auction_factor. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. @@ -10895,14 +10901,17 @@ definitions: metoken module will claim accrued interest from leverage module - rewards_auction_factor: + rewards_auction_fee_factor: type: integer format: int64 description: >- - Rewards Auction Factor determines the portion of swap and redeem - fee that is sent to the + Rewards Auction Fee Factor determines the portion of total fees + collected by the metoken + + module that will go for the rewards auction. Note: this is + different than x/leverage - auction module for the rewards auction. + Params.rewards_auction_factor. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. diff --git a/x/metoken/keeper/intest/msg_server_test.go b/x/metoken/keeper/intest/msg_server_test.go index 120b1ae804..4ae71e28bc 100644 --- a/x/metoken/keeper/intest/msg_server_test.go +++ b/x/metoken/keeper/intest/msg_server_test.go @@ -896,7 +896,7 @@ func verifySwap( // totalfee = feeRate * amount totalFee := sdk.NewCoin(denom, feeRate.MulInt(tc.asset.Amount).TruncateInt()) - feeToAuction := params.RewardsAuctionFactor.Mul(totalFee.Amount) + feeToAuction := params.RewardsAuctionFeeFactor.Mul(totalFee.Amount) feeToReserve := totalFee.Amount.Sub(feeToAuction) // amount_to_swap = swap_amount - fee @@ -1718,7 +1718,7 @@ func verifyRedeem( // totalfee = feeRate * amount_to_redeem totalFee := sdk.NewCoin(tc.denom, feeRate.MulInt(amountToWithdraw).TruncateInt()) - feeToAuction := params.RewardsAuctionFactor.Mul(totalFee.Amount) + feeToAuction := params.RewardsAuctionFeeFactor.Mul(totalFee.Amount) feeToReserve := totalFee.Amount.Sub(feeToAuction) amountToRedeem := amountToWithdraw.Sub(totalFee.Amount) diff --git a/x/metoken/keeper/swap.go b/x/metoken/keeper/swap.go index 10784efbb7..37bdabc037 100644 --- a/x/metoken/keeper/swap.go +++ b/x/metoken/keeper/swap.go @@ -185,7 +185,7 @@ func (k Keeper) availableToSupply(denom string) (bool, sdkmath.Int, error) { // breakFee calculates the protocol fee for the burn auction and the reminder func (k Keeper) breakFee(fee sdkmath.Int) (sdkmath.Int, sdkmath.Int) { p := k.GetParams() - toAuction := p.RewardsAuctionFactor.Mul(fee) + toAuction := p.RewardsAuctionFeeFactor.Mul(fee) return toAuction, fee.Sub(toAuction) } diff --git a/x/metoken/keeper/swap_test.go b/x/metoken/keeper/swap_test.go index 087ebd3bd3..ada315213d 100644 --- a/x/metoken/keeper/swap_test.go +++ b/x/metoken/keeper/swap_test.go @@ -41,7 +41,7 @@ func TestSwap_Valid(t *testing.T) { usdBal2, n := indexBal2.AssetBalance(tenUSDT.Denom) assert.GreaterOrEqual(n, 0) usdBal1, _ := indexBal1.AssetBalance(tenUSDT.Denom) - toAuction := params.RewardsAuctionFactor.Mul(resp.fee.Amount) + toAuction := params.RewardsAuctionFeeFactor.Mul(resp.fee.Amount) assert.Equal(usdBal2.Fees.Sub(usdBal1.Fees), resp.fee.Amount.Sub(toAuction)) // exchange_rate = coin_price / metoken_price @@ -88,7 +88,7 @@ func TestBreakFees(t *testing.T) { assert := assert.New(t) k := initMeUSDNoopKeper(t) p := k.GetParams() - assert.EqualValues(p.RewardsAuctionFactor, 1000) + assert.EqualValues(p.RewardsAuctionFeeFactor, 1000) amount := sdkmath.NewInt(2_000) toAuction, toRevenue := k.breakFee(amount) diff --git a/x/metoken/metoken.pb.go b/x/metoken/metoken.pb.go index b8daf5a481..9ce34dd16e 100644 --- a/x/metoken/metoken.pb.go +++ b/x/metoken/metoken.pb.go @@ -34,10 +34,11 @@ type Params struct { // Interest claiming frequency in seconds, determines how often metoken module will claim accrued interest from // leverage module ClaimingFrequency int64 `protobuf:"varint,2,opt,name=claiming_frequency,json=claimingFrequency,proto3" json:"claiming_frequency,omitempty"` - // Rewards Auction Factor determines the portion of swap and redeem fee that is sent to the - // auction module for the rewards auction. + // Rewards Auction Fee Factor determines the portion of total fees collected by the metoken + // module that will go for the rewards auction. Note: this is different than x/leverage + // Params.rewards_auction_factor. // Valid values: 0-10000 (in basis points, 2000 = 20%). - RewardsAuctionFactor github_com_umee_network_umee_v6_util_bpmath.FixedBP `protobuf:"varint,3,opt,name=rewards_auction_factor,json=rewardsAuctionFactor,proto3,customtype=github.com/umee-network/umee/v6/util/bpmath.FixedBP" json:"rewards_auction_factor"` + RewardsAuctionFeeFactor github_com_umee_network_umee_v6_util_bpmath.FixedBP `protobuf:"varint,3,opt,name=rewards_auction_fee_factor,json=rewardsAuctionFeeFactor,proto3,customtype=github.com/umee-network/umee/v6/util/bpmath.FixedBP" json:"rewards_auction_fee_factor"` } func (m *Params) Reset() { *m = Params{} } @@ -341,53 +342,53 @@ func init() { func init() { proto.RegisterFile("umee/metoken/v1/metoken.proto", fileDescriptor_dda977db8ad52437) } var fileDescriptor_dda977db8ad52437 = []byte{ - // 721 bytes of a gzipped FileDescriptorProto + // 723 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x95, 0x4f, 0x6b, 0xdb, 0x48, - 0x14, 0xc0, 0xad, 0xc8, 0x76, 0xe2, 0xe7, 0xfc, 0xd9, 0x08, 0x67, 0x31, 0x59, 0xa2, 0x78, 0x73, - 0x58, 0xbc, 0xb0, 0x91, 0x48, 0x02, 0x0b, 0xfb, 0xe7, 0x62, 0x63, 0x1c, 0xc2, 0xb2, 0xd4, 0x55, - 0x0f, 0x85, 0xf6, 0x20, 0xc6, 0xd2, 0x8b, 0x23, 0x6c, 0x69, 0x14, 0xcd, 0xd8, 0x51, 0xbe, 0x45, - 0x3f, 0x42, 0x3f, 0x4d, 0xc9, 0x31, 0xc7, 0xd2, 0x43, 0x68, 0x12, 0x0a, 0x3d, 0x95, 0x9e, 0x7b, - 0x2a, 0x33, 0x1a, 0x27, 0x4e, 0x42, 0x5a, 0x10, 0x3d, 0xd9, 0x33, 0xef, 0xbd, 0xdf, 0xbc, 0x9f, - 0xf4, 0x24, 0xc1, 0xc6, 0x38, 0x44, 0xb4, 0x43, 0xe4, 0x74, 0x88, 0x91, 0x3d, 0xd9, 0x99, 0xfe, - 0xb5, 0xe2, 0x84, 0x72, 0x6a, 0xac, 0x88, 0xb0, 0x35, 0xdd, 0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, 0x57, 0xda, 0x1b, 0xaa, 0x99, 0x35, 0x8f, 0xb2, 0x90, 0x32, 0xe6, 0x0f, 0xad, 0x80, 0xda, - 0xf2, 0xc8, 0x83, 0x88, 0x3b, 0x95, 0x90, 0xa4, 0xcf, 0x64, 0xbe, 0xb1, 0x0e, 0x0b, 0x98, 0xc6, - 0x34, 0xc2, 0x88, 0x67, 0x22, 0xce, 0xcd, 0xda, 0xf8, 0x03, 0xf4, 0x43, 0xc4, 0x7a, 0xb1, 0xa1, - 0x35, 0xab, 0xbb, 0x35, 0xeb, 0xde, 0x6d, 0xb1, 0xba, 0x88, 0xed, 0xa2, 0x38, 0xc8, 0x11, 0x69, - 0xc6, 0xff, 0xb0, 0x42, 0x3c, 0x0f, 0x63, 0x8e, 0xbe, 0x4b, 0x18, 0x43, 0xce, 0xea, 0xa5, 0x86, - 0xde, 0xac, 0xee, 0x9a, 0x0f, 0x2a, 0x5b, 0x2a, 0xaf, 0x25, 0xd2, 0x14, 0x63, 0x99, 0xcc, 0x6e, - 0x32, 0x25, 0xff, 0x59, 0x03, 0xbd, 0x8b, 0x68, 0xec, 0xc3, 0x7c, 0x18, 0x44, 0xae, 0x68, 0x47, - 0xca, 0xb7, 0x2d, 0x65, 0xf8, 0xdb, 0xcc, 0xe5, 0xce, 0x64, 0xd5, 0xcf, 0x36, 0xf3, 0x87, 0x36, - 0x3f, 0x8d, 0x91, 0x59, 0x1d, 0xf4, 0x9c, 0x72, 0x18, 0x44, 0x02, 0xf4, 0x14, 0x16, 0xb3, 0x59, - 0x40, 0x5f, 0xd2, 0xe6, 0x72, 0xd1, 0xaa, 0x53, 0xc6, 0xb4, 0x37, 0x92, 0x4a, 0x9a, 0x9e, 0xb3, - 0x37, 0x92, 0x76, 0x11, 0x95, 0xf2, 0xa5, 0x06, 0x4b, 0x77, 0x2e, 0xd0, 0x23, 0xf7, 0xfd, 0x39, - 0xac, 0x24, 0xc8, 0x30, 0x99, 0xa0, 0x1b, 0xd3, 0x44, 0x8c, 0x4d, 0x4e, 0x99, 0x65, 0x85, 0xe9, - 0x65, 0x14, 0xe3, 0x25, 0xac, 0x72, 0x92, 0x0c, 0x90, 0xbb, 0x64, 0x34, 0xa2, 0x1e, 0x91, 0xe8, - 0x7c, 0x66, 0x3f, 0x65, 0xa0, 0xd6, 0x0d, 0x47, 0x39, 0xbe, 0xd1, 0xa0, 0x2a, 0x67, 0xba, 0x97, - 0x04, 0x1e, 0xb2, 0x47, 0x0c, 0x3b, 0x50, 0x8a, 0x45, 0x3c, 0xa7, 0x57, 0x56, 0xfc, 0xcd, 0x09, - 0xff, 0x0b, 0xca, 0x6a, 0x54, 0x8b, 0x72, 0x54, 0x7f, 0x79, 0x38, 0xaa, 0x22, 0x2c, 0xbb, 0x54, - 0x73, 0xaa, 0x0a, 0x94, 0xc8, 0x27, 0x1d, 0xe0, 0x36, 0xc5, 0xd8, 0x00, 0xe8, 0x13, 0x86, 0xee, - 0xac, 0x4c, 0x45, 0xec, 0x74, 0xa4, 0xd0, 0xaf, 0xb0, 0xc8, 0x4e, 0xc3, 0x3e, 0x1d, 0xa9, 0x04, - 0xe9, 0xe5, 0x54, 0xb3, 0xbd, 0xce, 0x5d, 0x67, 0xfd, 0x47, 0x39, 0x17, 0xef, 0x39, 0xff, 0x07, - 0x15, 0x76, 0x42, 0x62, 0x37, 0x21, 0x1c, 0xeb, 0xa5, 0x5c, 0xa7, 0x2c, 0x08, 0x80, 0x43, 0x38, - 0x1a, 0x4f, 0xa0, 0x9a, 0xa0, 0x8f, 0x18, 0x66, 0xb8, 0x72, 0x2e, 0x1c, 0x64, 0x08, 0x09, 0x3c, - 0x00, 0x09, 0x97, 0x4f, 0xd3, 0x7c, 0x2e, 0xda, 0xbc, 0xa8, 0xef, 0xca, 0x17, 0x92, 0x02, 0x4b, - 0xd8, 0x42, 0x2e, 0x58, 0x25, 0x23, 0xdc, 0x3c, 0x9d, 0xed, 0xfd, 0xb3, 0x4b, 0xb3, 0x70, 0x76, - 0x65, 0x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 0x44, 0xbe, 0xb6, 0x0e, + 0x0b, 0x98, 0x44, 0x34, 0xc4, 0x90, 0x67, 0x2e, 0xf6, 0xd5, 0x58, 0xfb, 0x0f, 0xd4, 0x3e, 0x62, + 0xbd, 0xd8, 0x50, 0x9a, 0xd5, 0xdd, 0x9a, 0x71, 0xeb, 0xe9, 0x18, 0x16, 0x62, 0xbb, 0x98, 0x2e, + 0x64, 0xa7, 0x69, 0xda, 0x53, 0x58, 0x21, 0xae, 0x8b, 0x11, 0x47, 0xcf, 0x21, 0x8c, 0x21, 0x67, + 0xf5, 0x52, 0x43, 0x6d, 0x56, 0x77, 0xf5, 0x3b, 0x95, 0x2d, 0x99, 0xd7, 0x4a, 0xd3, 0x24, 0x63, + 0x99, 0xcc, 0x4e, 0x32, 0x29, 0xff, 0x4d, 0x01, 0xd5, 0x42, 0xd4, 0xf6, 0x61, 0x3e, 0xf0, 0xc5, + 0xc1, 0x67, 0xf2, 0x6d, 0x43, 0x1a, 0xfe, 0x33, 0x73, 0xe2, 0x99, 0xac, 0xbc, 0x6c, 0x33, 0x6f, + 0x68, 0xf2, 0xe3, 0x08, 0x99, 0xd1, 0x41, 0xd7, 0x2e, 0x07, 0x7e, 0x7a, 0xb2, 0xda, 0x73, 0x58, + 0xcc, 0x5a, 0x02, 0x3d, 0x41, 0x9b, 0xcb, 0x45, 0xab, 0x4e, 0x19, 0xd3, 0xbd, 0x91, 0x44, 0xd0, + 0xd4, 0x9c, 0x7b, 0x23, 0x89, 0x85, 0x28, 0x95, 0xcf, 0x15, 0x58, 0xba, 0x71, 0x40, 0xf7, 0x3c, + 0xf7, 0x97, 0xb0, 0x12, 0x23, 0xc3, 0x78, 0x82, 0x4e, 0x44, 0xe3, 0xb4, 0x73, 0x72, 0xca, 0x2c, + 0x4b, 0x4c, 0x37, 0xa3, 0x68, 0xaf, 0x61, 0x95, 0x93, 0x78, 0x80, 0xdc, 0x21, 0xa3, 0x11, 0x75, + 0x89, 0x40, 0xe7, 0x33, 0x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0xf7, 0x3f, 0x99, 0xfe, 0xf2, + 0x7a, 0x65, 0xf1, 0x33, 0xdb, 0xfb, 0x11, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xff, 0x31, 0x27, 0x14, + 0x07, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -415,7 +416,7 @@ func (this *Params) Equal(that interface{}) bool { if this.ClaimingFrequency != that1.ClaimingFrequency { return false } - if !this.RewardsAuctionFactor.Equal(that1.RewardsAuctionFactor) { + if !this.RewardsAuctionFeeFactor.Equal(that1.RewardsAuctionFeeFactor) { return false } return true @@ -624,8 +625,8 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.RewardsAuctionFactor != 0 { - i = encodeVarintMetoken(dAtA, i, uint64(m.RewardsAuctionFactor)) + if m.RewardsAuctionFeeFactor != 0 { + i = encodeVarintMetoken(dAtA, i, uint64(m.RewardsAuctionFeeFactor)) i-- dAtA[i] = 0x18 } @@ -988,8 +989,8 @@ func (m *Params) Size() (n int) { if m.ClaimingFrequency != 0 { n += 1 + sovMetoken(uint64(m.ClaimingFrequency)) } - if m.RewardsAuctionFactor != 0 { - n += 1 + sovMetoken(uint64(m.RewardsAuctionFactor)) + if m.RewardsAuctionFeeFactor != 0 { + n += 1 + sovMetoken(uint64(m.RewardsAuctionFeeFactor)) } return n } @@ -1181,9 +1182,9 @@ func (m *Params) Unmarshal(dAtA []byte) error { } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardsAuctionFactor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardsAuctionFeeFactor", wireType) } - m.RewardsAuctionFactor = 0 + m.RewardsAuctionFeeFactor = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowMetoken @@ -1193,7 +1194,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.RewardsAuctionFactor |= github_com_umee_network_umee_v6_util_bpmath.FixedBP(b&0x7F) << shift + m.RewardsAuctionFeeFactor |= github_com_umee_network_umee_v6_util_bpmath.FixedBP(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/metoken/params.go b/x/metoken/params.go index 87ebcb4c2f..1e55a62b24 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: 2000, // 20% of fees goes to rewards auction + RewardsAuctionFeeFactor: 2000, // 20% of fees goes to rewards auction } } From fbad2f0addd7fc2119f8164fde989330e0e09e84 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 15 May 2024 17:37:41 +0200 Subject: [PATCH 4/8] update leverage params name and docs --- app/upgrades.go | 2 +- proto/umee/leverage/v1/leverage.proto | 5 +- proto/umee/metoken/v1/metoken.proto | 4 +- swagger/swagger.yaml | 49 +++++---- x/leverage/fixtures/params.go | 2 +- x/leverage/keeper/interest.go | 4 +- x/leverage/keeper/interest_test.go | 2 +- x/leverage/types/leverage.pb.go | 149 +++++++++++++------------- x/leverage/types/params.go | 2 +- x/metoken/metoken.pb.go | 4 +- 10 files changed, 119 insertions(+), 104 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 0964f363ac..42100b1d69 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -66,7 +66,7 @@ func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { // update leverage and metoken params to include burn auction fee share. lparams := app.LeverageKeeper.GetParams(ctx) - lparams.RewardsAuctionFactor = leveragetypes.DefaultParams().RewardsAuctionFactor + lparams.RewardsAuctionFee = leveragetypes.DefaultParams().RewardsAuctionFee if err := app.LeverageKeeper.SetParams(ctx, lparams); err != nil { return nil, err } diff --git a/proto/umee/leverage/v1/leverage.proto b/proto/umee/leverage/v1/leverage.proto index e6ed882146..a3ef61fe92 100644 --- a/proto/umee/leverage/v1/leverage.proto +++ b/proto/umee/leverage/v1/leverage.proto @@ -70,10 +70,11 @@ message Params { (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"direct_liquidation_fee\"" ]; - // Rewards Auction Factor determines the portion of interest accrued on + // Rewards Auction Fee determines the interest increase that will be accrued on // borrows that is sent to the auction module for the rewards auction. + // So, 2% means, that there is additional 2% per year fee collected. // Valid values: 0-1. - string rewards_auction_factor = 7 [ + string rewards_auction_fee = 7 [ (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"oracle_reward_factor\"" diff --git a/proto/umee/metoken/v1/metoken.proto b/proto/umee/metoken/v1/metoken.proto index f436ccc30b..73b9ec905e 100644 --- a/proto/umee/metoken/v1/metoken.proto +++ b/proto/umee/metoken/v1/metoken.proto @@ -20,8 +20,8 @@ message Params { int64 claiming_frequency = 2; // Rewards Auction Fee Factor determines the portion of total fees collected by the metoken - // module that will go for the rewards auction. Note: this is different than x/leverage - // Params.rewards_auction_factor. + // module that will go for the rewards auction. 2% means that 2% of collected fees will go to + // the rewards auction. Note: this is different than x/leverage Params.rewards_auction_fee. // Valid values: 0-10000 (in basis points, 2000 = 20%). uint32 rewards_auction_fee_factor = 3 [ (gogoproto.customtype) = "github.com/umee-network/umee/v6/util/bpmath.FixedBP", diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index ab0d230611..d73ab3669d 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -1111,15 +1111,18 @@ paths: uTokens as liquidation rewards. Valid values: 0-1. - rewards_auction_factor: + rewards_auction_fee: type: string description: >- - Rewards Auction Factor determines the portion of interest - accrued on + Rewards Auction Fee determines the interest increase that + will be accrued on borrows that is sent to the auction module for the rewards auction. + So, 2% means, that there is additional 2% per year fee + collected. + Valid values: 0-1. description: Params defines the parameters for the leverage module. description: >- @@ -5877,10 +5880,11 @@ paths: Rewards Auction Fee Factor determines the portion of total fees collected by the metoken - module that will go for the rewards auction. Note: this is - different than x/leverage + module that will go for the rewards auction. 2% means that + 2% of collected fees will go to - Params.rewards_auction_factor. + the rewards auction. Note: this is different than + x/leverage Params.rewards_auction_fee. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. @@ -6602,11 +6606,16 @@ definitions: uTokens as liquidation rewards. Valid values: 0-1. - rewards_auction_factor: + rewards_auction_fee: type: string - description: |- - Rewards Auction Factor determines the portion of interest accrued on + description: >- + Rewards Auction Fee determines the interest increase that will be + accrued on + borrows that is sent to the auction module for the rewards auction. + + So, 2% means, that there is additional 2% per year fee collected. + Valid values: 0-1. description: Params defines the parameters for the leverage module. umee.leverage.v1.QueryAccountBalancesResponse: @@ -7268,15 +7277,17 @@ definitions: uTokens as liquidation rewards. Valid values: 0-1. - rewards_auction_factor: + rewards_auction_fee: type: string description: >- - Rewards Auction Factor determines the portion of interest accrued - on + Rewards Auction Fee determines the interest increase that will be + accrued on borrows that is sent to the auction module for the rewards auction. + So, 2% means, that there is additional 2% per year fee collected. + Valid values: 0-1. description: Params defines the parameters for the leverage module. description: |- @@ -10558,10 +10569,11 @@ definitions: Rewards Auction Fee Factor determines the portion of total fees collected by the metoken - module that will go for the rewards auction. Note: this is different - than x/leverage + module that will go for the rewards auction. 2% means that 2% of + collected fees will go to - Params.rewards_auction_factor. + the rewards auction. Note: this is different than x/leverage + Params.rewards_auction_fee. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. @@ -10908,10 +10920,11 @@ definitions: Rewards Auction Fee Factor determines the portion of total fees collected by the metoken - module that will go for the rewards auction. Note: this is - different than x/leverage + module that will go for the rewards auction. 2% means that 2% of + collected fees will go to - Params.rewards_auction_factor. + the rewards auction. Note: this is different than x/leverage + Params.rewards_auction_fee. Valid values: 0-10000 (in basis points, 2000 = 20%). description: Params defines the parameters for the metoken module. diff --git a/x/leverage/fixtures/params.go b/x/leverage/fixtures/params.go index 6f808f3546..a9b4d0c215 100644 --- a/x/leverage/fixtures/params.go +++ b/x/leverage/fixtures/params.go @@ -12,7 +12,7 @@ func Params() types.Params { CompleteLiquidationThreshold: sdk.MustNewDecFromStr("0.1"), MinimumCloseFactor: sdk.MustNewDecFromStr("0.01"), OracleRewardFactor: sdk.MustNewDecFromStr("0.01"), - RewardsAuctionFactor: sdk.MustNewDecFromStr("0.02"), + RewardsAuctionFee: sdk.MustNewDecFromStr("0.02"), SmallLiquidationSize: sdk.MustNewDecFromStr("100.00"), DirectLiquidationFee: sdk.MustNewDecFromStr("0.1"), } diff --git a/x/leverage/keeper/interest.go b/x/leverage/keeper/interest.go index 2134c0db38..f601af9777 100644 --- a/x/leverage/keeper/interest.go +++ b/x/leverage/keeper/interest.go @@ -62,7 +62,7 @@ func (k Keeper) DeriveSupplyAPY(ctx sdk.Context, denom string) sdk.Dec { borrowRate := k.DeriveBorrowAPY(ctx, denom) utilization := k.SupplyUtilization(ctx, denom) params := k.GetParams(ctx) - reduction := params.OracleRewardFactor.Add(params.RewardsAuctionFactor).Add(token.ReserveFactor) + reduction := params.OracleRewardFactor.Add(params.RewardsAuctionFee).Add(token.ReserveFactor) // supply APY = borrow APY * utilization, reduced by reserve factor and oracle reward factor return borrowRate.Mul(utilization).Mul(sdk.OneDec().Sub(reduction)) @@ -156,7 +156,7 @@ func (k Keeper) AccrueAllInterest(ctx sdk.Context) error { )) auctionRewards = auctionRewards.Add(sdk.NewCoin( token.BaseDenom, - interestAccrued.Mul(params.RewardsAuctionFactor).TruncateInt(), + interestAccrued.Mul(params.RewardsAuctionFee).TruncateInt(), )) } diff --git a/x/leverage/keeper/interest_test.go b/x/leverage/keeper/interest_test.go index 8762eadc38..b54bb2bfd0 100644 --- a/x/leverage/keeper/interest_test.go +++ b/x/leverage/keeper/interest_test.go @@ -37,7 +37,7 @@ func (s *IntegrationTestSuite) TestAccrueZeroInterest() { require.Equal(sdk.MustNewDecFromStr("0.03"), borrowAPY) // supply APY when borrow APY is 3% - // and utilization is 4%, and reserve factor=20%, OracleRewardFactor=1% RewardsAuctionFactor=2% + // and utilization is 4%, and reserve factor=20%, OracleRewardFactor=1% RewardsAuctionFee=2% // 0.03 * 0.04 * (1 - 0.2 - 0.01 - 0.02) supplyAPY := app.LeverageKeeper.DeriveSupplyAPY(ctx, appparams.BondDenom) require.Equal(sdk.MustNewDecFromStr("0.000924"), supplyAPY) diff --git a/x/leverage/types/leverage.pb.go b/x/leverage/types/leverage.pb.go index 79d4f87ada..66fa297a0c 100644 --- a/x/leverage/types/leverage.pb.go +++ b/x/leverage/types/leverage.pb.go @@ -66,10 +66,11 @@ type Params struct { // uTokens as liquidation rewards. // Valid values: 0-1. DirectLiquidationFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=direct_liquidation_fee,json=directLiquidationFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"direct_liquidation_fee" yaml:"direct_liquidation_fee"` - // Rewards Auction Factor determines the portion of interest accrued on + // Rewards Auction Fee determines the interest increase that will be accrued on // borrows that is sent to the auction module for the rewards auction. + // So, 2% means, that there is additional 2% per year fee collected. // Valid values: 0-1. - RewardsAuctionFactor github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=rewards_auction_factor,json=rewardsAuctionFactor,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rewards_auction_factor" yaml:"oracle_reward_factor"` + RewardsAuctionFee github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,7,opt,name=rewards_auction_fee,json=rewardsAuctionFee,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"rewards_auction_fee" yaml:"oracle_reward_factor"` } func (m *Params) Reset() { *m = Params{} } @@ -358,72 +359,72 @@ func init() { func init() { proto.RegisterFile("umee/leverage/v1/leverage.proto", fileDescriptor_8cb1bf9ea641ecc6) } var fileDescriptor_8cb1bf9ea641ecc6 = []byte{ - // 1038 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 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1d, 0xd5, 0x67, 0xfe, 0x1c, 0xd5, 0x3f, - 0x6a, 0x33, 0xd5, 0xe9, 0x37, 0xb7, 0x02, 0x11, 0x36, 0x02, 0x21, 0x43, 0x21, 0x93, 0x3f, 0x0f, - 0x64, 0xab, 0xdb, 0x50, 0xc7, 0x3d, 0x90, 0x5b, 0x8f, 0x21, 0xb8, 0x18, 0xd5, 0x3f, 0x3c, 0xa6, - 0x21, 0xdf, 0xc6, 0x57, 0xb3, 0x63, 0xb2, 0x3e, 0xde, 0xf0, 0x34, 0x5d, 0x7f, 0x31, 0x5e, 0x76, - 0xbf, 0x47, 0xd5, 0x90, 0x45, 0x2c, 0xec, 0x87, 0x7e, 0xc0, 0x85, 0x04, 0xff, 0x15, 0x0d, 0x94, - 0x88, 0xbd, 0x39, 0x63, 0xea, 0xa0, 0xb0, 0xa9, 0xfb, 0xd6, 0x54, 0x1e, 0x27, 0x26, 0x6e, 0x02, - 0xef, 0x6a, 0x74, 0xcf, 0x80, 0xda, 0x80, 0x88, 0x69, 0xc0, 0xc1, 0x8f, 0xe1, 0x88, 0xc6, 0xad, - 0xb1, 0x81, 0x5b, 0xd7, 0x33, 0x90, 0xc7, 0x89, 0x89, 0x6b, 0x61, 0x62, 0xd0, 0xc4, 0xc0, 0x8f, - 0x0e, 0x5a, 0x93, 0x21, 0xe5, 0x7c, 0xea, 0x00, 0x25, 0x3b, 0x01, 0xef, 0xb6, 0xf1, 0xf0, 0x65, - 0x61, 0x0f, 0x1f, 0x58, 0x0f, 0xf9, 0xac, 0x98, 0x54, 0xcd, 0x42, 0x26, 0x1d, 0x87, 0xec, 0x04, - 0x8c, 0x8f, 0x16, 0x8b, 0x21, 0x50, 0x53, 0x3f, 0x79, 0x05, 0xe0, 0x95, 0xae, 0xe7, 0x23, 0x9f, - 0x15, 0x93, 0xaa, 0x5d, 0xc8, 0x18, 0xd9, 0x03, 0x70, 0x7f, 0x70, 0xd0, 0x9a, 0x3d, 0x36, 0xe9, - 0xd3, 0x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9f, 0x85, 0x5b, 0xc5, 0x92, 0x90, 0x33, 0xef, 0x82, 0xab, 0xc7, 0x5d, - 0x51, 0x81, 0xdc, 0x71, 0x96, 0x1c, 0xca, 0x7f, 0x0e, 0x2a, 0x67, 0x0f, 0xe5, 0x10, 0x94, 0x8e, - 0x99, 0xea, 0x67, 0xe9, 0x39, 0x1b, 0x73, 0x3a, 0x66, 0xfb, 0x96, 0x1f, 0xf3, 0xec, 0xbb, 0x8e, - 0x79, 0xee, 0xa6, 0x63, 0xde, 0x79, 0x76, 0xfa, 0x77, 0x6d, 0xe6, 0xf4, 0xac, 0xe6, 0xbc, 0x3e, - 0xab, 0x39, 0x7f, 0x9d, 0xd5, 0x9c, 0x9f, 0xcf, 0x6b, 0x33, 0xaf, 0xcf, 0x6b, 0x33, 0x7f, 0x9c, - 0xd7, 0x66, 0xbe, 0xf9, 0x38, 0xa3, 0xa0, 0xbf, 0x88, 0x1e, 0x44, 0xa0, 0x8e, 0x44, 0xdc, 0x35, - 0x2f, 0x8d, 0xc1, 0x67, 0x8d, 0x61, 0xfa, 0x11, 0x65, 0xf4, 0x9a, 0x25, 0xf3, 0x5d, 0xf4, 0xc9, - 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xab, 0x43, 0x11, 0x62, 0x0d, 0x00, 0x00, + // 1039 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0x26, 0xad, 0xbf, 0xc9, 0xb4, 0x89, 0x9d, 0xcd, 0x8f, 0xae, 0xbe, 0x0d, 0x76, 0x34, + 0x12, 0x28, 0x97, 0xc6, 0x54, 0x20, 0x0e, 0xb9, 0xd5, 0xa9, 0x42, 0x83, 0x9a, 0x52, 0xc6, 0x45, + 0x95, 0xe0, 0xb0, 0x1a, 0xaf, 0x5f, 0xed, 0x91, 0x67, 0x77,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b3, 0xb3, 0xbf, 0xca, 0x0b, 0x67, 0xe7, 0x65, 0xeb, + 0xf5, 0x79, 0xd9, 0xfa, 0xf3, 0xbc, 0x6c, 0xfd, 0x74, 0x51, 0x5e, 0x78, 0x7d, 0x51, 0x5e, 0xf8, + 0xfd, 0xa2, 0xbc, 0xf0, 0xd5, 0x87, 0x29, 0x85, 0xe8, 0x53, 0xe8, 0x41, 0x00, 0x6a, 0x20, 0xc2, + 0x8e, 0x7e, 0xa9, 0xf6, 0x3f, 0xa9, 0x0e, 0x93, 0xaf, 0x27, 0xad, 0xd7, 0x28, 0xe8, 0x0f, 0xa2, + 0x8f, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x07, 0xe0, 0xb9, 0xa9, 0x5b, 0x0d, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -460,7 +461,7 @@ func (this *Params) Equal(that interface{}) bool { if !this.DirectLiquidationFee.Equal(that1.DirectLiquidationFee) { return false } - if !this.RewardsAuctionFactor.Equal(that1.RewardsAuctionFactor) { + if !this.RewardsAuctionFee.Equal(that1.RewardsAuctionFee) { return false } return true @@ -632,9 +633,9 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l { - size := m.RewardsAuctionFactor.Size() + size := m.RewardsAuctionFee.Size() i -= size - if _, err := m.RewardsAuctionFactor.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.RewardsAuctionFee.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintLeverage(dAtA, i, uint64(size)) @@ -1035,7 +1036,7 @@ func (m *Params) Size() (n int) { n += 1 + l + sovLeverage(uint64(l)) l = m.DirectLiquidationFee.Size() n += 1 + l + sovLeverage(uint64(l)) - l = m.RewardsAuctionFactor.Size() + l = m.RewardsAuctionFee.Size() n += 1 + l + sovLeverage(uint64(l)) return n } @@ -1343,7 +1344,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardsAuctionFactor", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardsAuctionFee", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1371,7 +1372,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.RewardsAuctionFactor.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RewardsAuctionFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/leverage/types/params.go b/x/leverage/types/params.go index 690120ab04..578b448fce 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.20"), + RewardsAuctionFee: sdk.MustNewDecFromStr("0.20"), SmallLiquidationSize: sdk.MustNewDecFromStr("500.00"), DirectLiquidationFee: sdk.MustNewDecFromStr("0.05"), } diff --git a/x/metoken/metoken.pb.go b/x/metoken/metoken.pb.go index 9ce34dd16e..18efa06ba4 100644 --- a/x/metoken/metoken.pb.go +++ b/x/metoken/metoken.pb.go @@ -35,8 +35,8 @@ type Params struct { // leverage module ClaimingFrequency int64 `protobuf:"varint,2,opt,name=claiming_frequency,json=claimingFrequency,proto3" json:"claiming_frequency,omitempty"` // Rewards Auction Fee Factor determines the portion of total fees collected by the metoken - // module that will go for the rewards auction. Note: this is different than x/leverage - // Params.rewards_auction_factor. + // module that will go for the rewards auction. 2% means that 2% of collected fees will go to + // the rewards auction. Note: this is different than x/leverage Params.rewards_auction_fee. // Valid values: 0-10000 (in basis points, 2000 = 20%). RewardsAuctionFeeFactor github_com_umee_network_umee_v6_util_bpmath.FixedBP `protobuf:"varint,3,opt,name=rewards_auction_fee_factor,json=rewardsAuctionFeeFactor,proto3,customtype=github.com/umee-network/umee/v6/util/bpmath.FixedBP" json:"rewards_auction_fee_factor"` } From da0ae9179037ae68c2715ae5b4a0b4c81f6aa135 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 15 May 2024 17:44:35 +0200 Subject: [PATCH 5/8] lint --- x/leverage/fixtures/params.go | 2 +- x/leverage/types/params.go | 2 +- x/metoken/params.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/leverage/fixtures/params.go b/x/leverage/fixtures/params.go index a9b4d0c215..cc158b20e9 100644 --- a/x/leverage/fixtures/params.go +++ b/x/leverage/fixtures/params.go @@ -12,7 +12,7 @@ func Params() types.Params { CompleteLiquidationThreshold: sdk.MustNewDecFromStr("0.1"), MinimumCloseFactor: sdk.MustNewDecFromStr("0.01"), OracleRewardFactor: sdk.MustNewDecFromStr("0.01"), - RewardsAuctionFee: sdk.MustNewDecFromStr("0.02"), + RewardsAuctionFee: sdk.MustNewDecFromStr("0.02"), SmallLiquidationSize: sdk.MustNewDecFromStr("100.00"), DirectLiquidationFee: sdk.MustNewDecFromStr("0.1"), } diff --git a/x/leverage/types/params.go b/x/leverage/types/params.go index 578b448fce..d02f2e4947 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"), - RewardsAuctionFee: sdk.MustNewDecFromStr("0.20"), + RewardsAuctionFee: 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 1e55a62b24..65731846ae 100644 --- a/x/metoken/params.go +++ b/x/metoken/params.go @@ -3,8 +3,8 @@ package metoken // DefaultParams returns default genesis params func DefaultParams() Params { return Params{ - RebalancingFrequency: 60 * 60 * 12, // 12h - ClaimingFrequency: 60 * 60 * 24 * 7, // 7d + RebalancingFrequency: 60 * 60 * 12, // 12h + ClaimingFrequency: 60 * 60 * 24 * 7, // 7d RewardsAuctionFeeFactor: 2000, // 20% of fees goes to rewards auction } } From e4d44277cbcc36860acaef53a38a5be4faf2682f Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 16 May 2024 10:06:07 +0200 Subject: [PATCH 6/8] update params value --- app/upgrades.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades.go b/app/upgrades.go index 42100b1d69..348954f558 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -66,14 +66,14 @@ func (app *UmeeApp) registerUpgrade6_5(upgradeInfo upgradetypes.Plan) { // update leverage and metoken params to include burn auction fee share. lparams := app.LeverageKeeper.GetParams(ctx) - lparams.RewardsAuctionFee = leveragetypes.DefaultParams().RewardsAuctionFee + lparams.RewardsAuctionFee = sdk.MustNewDecFromStr("0.01") if err := app.LeverageKeeper.SetParams(ctx, lparams); err != nil { return nil, err } mekeeper := app.MetokenKeeperB.Keeper(&ctx) meparams := mekeeper.GetParams() - meparams.RewardsAuctionFeeFactor = metoken.DefaultParams().RewardsAuctionFeeFactor + meparams.RewardsAuctionFeeFactor = 10000 // 100% of fees goes to rewards auction if err := mekeeper.SetParams(meparams); err != nil { return nil, err } From 1d0b9d49f9f040f0c1b1da0eaadd21c19e8aa85e Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 16 May 2024 10:37:06 +0200 Subject: [PATCH 7/8] lint --- app/upgrades.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/upgrades.go b/app/upgrades.go index 348954f558..47f312cf8d 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -24,7 +24,6 @@ import ( "github.com/umee-network/umee/v6/util" "github.com/umee-network/umee/v6/x/auction" leveragetypes "github.com/umee-network/umee/v6/x/leverage/types" - "github.com/umee-network/umee/v6/x/metoken" ) // RegisterUpgradeHandlersregisters upgrade handlers. From f60a9ce5f4b2b9008bf5754f7ab483b1de0d4667 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Thu, 16 May 2024 10:57:59 +0200 Subject: [PATCH 8/8] fix default params --- x/leverage/types/params.go | 2 +- x/metoken/params.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/x/leverage/types/params.go b/x/leverage/types/params.go index d02f2e4947..4425e355d5 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"), - RewardsAuctionFee: sdk.MustNewDecFromStr("0.20"), + RewardsAuctionFee: sdk.MustNewDecFromStr("0.02"), SmallLiquidationSize: sdk.MustNewDecFromStr("500.00"), DirectLiquidationFee: sdk.MustNewDecFromStr("0.05"), } diff --git a/x/metoken/params.go b/x/metoken/params.go index 65731846ae..e5493fae41 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 - RewardsAuctionFeeFactor: 2000, // 20% of fees goes to rewards auction + RewardsAuctionFeeFactor: 1000, // 10% of fees goes to rewards auction } }