From e5d66c74f74218d5274bdb25d6caa12d018a382a Mon Sep 17 00:00:00 2001 From: Pratik Date: Mon, 30 Jan 2023 09:33:02 +0530 Subject: [PATCH 1/5] updating auction params and added apr query --- app/app.go | 2 +- app/upgrades/mainnet/v8/upgrades.go | 141 ++++++ proto/comdex/rewards/v1beta1/query.proto | 15 + x/rewards/client/cli/query.go | 44 ++ x/rewards/keeper/grpc_query.go | 14 + x/rewards/keeper/keeper.go | 36 ++ x/rewards/types/query.pb.go | 585 +++++++++++++++++++---- x/rewards/types/query.pb.gw.go | 83 ++++ 8 files changed, 827 insertions(+), 93 deletions(-) diff --git a/app/app.go b/app/app.go index 7ad01bf3c..431f6c362 100644 --- a/app/app.go +++ b/app/app.go @@ -1212,7 +1212,7 @@ func (a *App) ModuleAccountsPermissions() map[string][]string { func (a *App) registerUpgradeHandlers() { a.UpgradeKeeper.SetUpgradeHandler( mv8.UpgradeName800, - mv8.CreateUpgradeHandler800(a.mm, a.configurator), + mv8.CreateUpgradeHandler800(a.mm, a.configurator, a.AssetKeeper, a.LendKeeper, a.AuctionKeeper), ) // When a planned update height is reached, the old binary will panic // writing on disk the height and name of the update that triggered it diff --git a/app/upgrades/mainnet/v8/upgrades.go b/app/upgrades/mainnet/v8/upgrades.go index 51b3efc99..04f30f236 100644 --- a/app/upgrades/mainnet/v8/upgrades.go +++ b/app/upgrades/mainnet/v8/upgrades.go @@ -1,17 +1,158 @@ package v8 import ( + "github.com/comdex-official/comdex/app/wasm/bindings" + assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" + assettypes "github.com/comdex-official/comdex/x/asset/types" + auctionkeeper "github.com/comdex-official/comdex/x/auction/keeper" + lendkeeper "github.com/comdex-official/comdex/x/lend/keeper" + "github.com/comdex-official/comdex/x/lend/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) +func Dec(s string) sdk.Dec { + dec, err := sdk.NewDecFromStr(s) + if err != nil { + panic(err) + } + return dec +} + +func UpdateAuctionParams( + ctx sdk.Context, + assetKeeper assetkeeper.Keeper, + lendKeeper lendkeeper.Keeper, + auctionKeeper auctionkeeper.Keeper, +) { + // Add cAssets for USDC and stATOM + // Add Asset Rates for OSMO, USDC, stATOM + // Update auction params for lend module and Harbor app + + // Adding cAssets + cUSDC := assettypes.Asset{ + Name: "CAXLUSDC", + Denom: "ucaxlusdc", + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: false, + IsCdpMintable: true, + } + err := assetKeeper.AddAssetRecords(ctx, cUSDC) + if err != nil { + return + } + + cstATOM := assettypes.Asset{ + Name: "CSTATOM", + Denom: "ucstatom", + Decimals: sdk.NewInt(1000000), + IsOnChain: true, + IsOraclePriceRequired: false, + IsCdpMintable: true, + } + err = assetKeeper.AddAssetRecords(ctx, cstATOM) + if err != nil { + return + } + // Adding Asset Rates + OSMORatesParams := types.AssetRatesParams{ + AssetID: 4, + UOptimal: Dec("0.65"), + Base: Dec("0.002"), + Slope1: Dec("0.08"), + Slope2: Dec("1.5"), + EnableStableBorrow: false, + StableBase: Dec("0.0"), + StableSlope1: Dec("0.0"), + StableSlope2: Dec("0.0"), + Ltv: Dec("0.65"), + LiquidationThreshold: Dec("0.70"), + LiquidationPenalty: Dec("0.075"), + LiquidationBonus: Dec("0.075"), + ReserveFactor: Dec("0.2"), + CAssetID: 8, + } + lendKeeper.SetAssetRatesParams(ctx, OSMORatesParams) + axlUSDCRatesParams := types.AssetRatesParams{ + AssetID: 10, + UOptimal: Dec("0.80"), + Base: Dec("0.002"), + Slope1: Dec("0.06"), + Slope2: Dec("0.6"), + EnableStableBorrow: false, + StableBase: Dec("0.0"), + StableSlope1: Dec("0.0"), + StableSlope2: Dec("0.0"), + Ltv: Dec("0.80"), + LiquidationThreshold: Dec("0.85"), + LiquidationPenalty: Dec("0.05"), + LiquidationBonus: Dec("0.05"), + ReserveFactor: Dec("0.2"), + CAssetID: 21, + } + lendKeeper.SetAssetRatesParams(ctx, axlUSDCRatesParams) + + stATOMRatesParams := types.AssetRatesParams{ + AssetID: 14, + UOptimal: Dec("0.60"), + Base: Dec("0.002"), + Slope1: Dec("0.08"), + Slope2: Dec("1.60"), + EnableStableBorrow: false, + StableBase: Dec("0.0"), + StableSlope1: Dec("0.0"), + StableSlope2: Dec("0.0"), + Ltv: Dec("0.6"), + LiquidationThreshold: Dec("0.65"), + LiquidationPenalty: Dec("0.075"), + LiquidationBonus: Dec("0.075"), + ReserveFactor: Dec("0.2"), + CAssetID: 22, + } + lendKeeper.SetAssetRatesParams(ctx, stATOMRatesParams) + + auctionParamsLend := types.AuctionParams{ + AppId: 3, + AuctionDurationSeconds: 18000, + Buffer: Dec("1.15"), + Cusp: Dec("0.7"), + Step: sdk.NewInt(360), + PriceFunctionType: 1, + DutchId: 3, + BidDurationSeconds: 3600, + } + err = lendKeeper.AddAuctionParamsData(ctx, auctionParamsLend) + if err != nil { + return + } + + auctionParams := bindings.MsgAddAuctionParams{ + AppID: 2, + AuctionDurationSeconds: 18000, + Buffer: Dec("1.15"), + Cusp: Dec("0.75"), + Step: 360, + PriceFunctionType: 1, + SurplusID: 1, + DebtID: 2, + DutchID: 3, + BidDurationSeconds: 3600, + } + err = auctionKeeper.AddAuctionParams(ctx, &auctionParams) +} + func CreateUpgradeHandler800( mm *module.Manager, configurator module.Configurator, + assetKeeper assetkeeper.Keeper, + lendKeeper lendkeeper.Keeper, + auctionKeeper auctionkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) + UpdateAuctionParams(ctx, assetKeeper, lendKeeper, auctionKeeper) return newVM, err } } diff --git a/proto/comdex/rewards/v1beta1/query.proto b/proto/comdex/rewards/v1beta1/query.proto index eb5911c6a..eec8b7920 100644 --- a/proto/comdex/rewards/v1beta1/query.proto +++ b/proto/comdex/rewards/v1beta1/query.proto @@ -57,6 +57,9 @@ service Query { rpc QueryEpochTime(QueryEpochTimeRequest) returns (QueryEpochTimeResponse) { option (google.api.http).get = "/comdex/rewards/v1beta1/epoch_time"; } + rpc QueryExtLendRewardsAPR(QueryExtLendRewardsAPRRequest) returns (QueryExtLendRewardsAPRResponse) { + option (google.api.http).get = "/comdex/rewards/v1beta1/ext_rewards_lend_apr"; + } } @@ -224,3 +227,15 @@ message QueryEpochTimeResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2 [(gogoproto.moretags) = "yaml:\"pagination\""]; } + +message QueryExtLendRewardsAPRRequest { + uint64 asset_id = 1; + uint64 c_pool_id = 2; +} +message QueryExtLendRewardsAPRResponse { + string apr = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false, + (gogoproto.moretags) = "yaml:\"ext_rewards_lend_apr\"" + ]; +} \ No newline at end of file diff --git a/x/rewards/client/cli/query.go b/x/rewards/client/cli/query.go index 4e00a0fa4..91c576421 100644 --- a/x/rewards/client/cli/query.go +++ b/x/rewards/client/cli/query.go @@ -42,6 +42,7 @@ func GetQueryCmd() *cobra.Command { queryExternalRewardLends(), queryExternalRewardStableMint(), queryEpochTime(), + queryExtLendRewardsAPR(), ) return cmd @@ -583,3 +584,46 @@ func queryEpochTime() *cobra.Command { return cmd } + +func queryExtLendRewardsAPR() *cobra.Command { + cmd := &cobra.Command{ + Use: "ext_rewards_lend_apr [asset-id] [cpool-id]", + Short: "Query ext rewards lend apr", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + ctx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + assetID, err := strconv.ParseUint(args[0], 10, 64) + if err != nil { + return err + } + cPoolID, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(ctx) + + res, err := queryClient.QueryExtLendRewardsAPR( + context.Background(), + &types.QueryExtLendRewardsAPRRequest{ + AssetId: assetID, + CPoolId: cPoolID, + }, + ) + if err != nil { + return err + } + + return ctx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + flags.AddPaginationFlagsToCmd(cmd, "ext_rewards_lend_apr") + + return cmd +} diff --git a/x/rewards/keeper/grpc_query.go b/x/rewards/keeper/grpc_query.go index 592d3bbd9..1e063502d 100644 --- a/x/rewards/keeper/grpc_query.go +++ b/x/rewards/keeper/grpc_query.go @@ -317,3 +317,17 @@ func (k Keeper) QueryEpochTime(c context.Context, req *types.QueryEpochTimeReque Pagination: pagination, }, nil } + +func (k Keeper) QueryExtLendRewardsAPR(c context.Context, req *types.QueryExtLendRewardsAPRRequest) (*types.QueryExtLendRewardsAPRResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "request cannot be empty") + } + var ( + ctx = sdk.UnwrapSDKContext(c) + ) + apr := k.ExtLendRewardsAPR(ctx, req) + + return &types.QueryExtLendRewardsAPRResponse{ + Apr: apr, + }, nil +} diff --git a/x/rewards/keeper/keeper.go b/x/rewards/keeper/keeper.go index 5eae9b1d4..505466258 100644 --- a/x/rewards/keeper/keeper.go +++ b/x/rewards/keeper/keeper.go @@ -391,3 +391,39 @@ func (k Keeper) ActExternalRewardsStableVaults( k.SetEpochTime(ctx, epoch) return nil } + +func (k Keeper) ExtLendRewardsAPR(ctx sdk.Context, request *types.QueryExtLendRewardsAPRRequest) sdk.Dec { + extRewards := k.GetExternalRewardLends(ctx) + totalAPR := sdk.NewDec(0) + for _, v := range extRewards { + if v.IsActive && request.CPoolId == v.RewardsAssetPoolData.CPoolId && uint64InSlice(request.AssetId, v.RewardsAssetPoolData.AssetId) { + epoch, _ := k.GetEpochTime(ctx, v.EpochId) + totalBorrowedAmt := sdk.ZeroInt() + rewardsAssetPoolData := v.RewardsAssetPoolData + for _, assetID := range rewardsAssetPoolData.AssetId { + amt, _ := k.CalculateTotalBorrowedAmtByFarmers(ctx, assetID, rewardsAssetPoolData.CPoolId, rewardsAssetPoolData.CSwapAppId, v.MasterPoolId) + totalBorrowedAmt = totalBorrowedAmt.Add(amt.TruncateInt()) // in $USD + } + // calculating totalAPR + rewardAsset, found := k.asset.GetAssetForDenom(ctx, v.TotalRewards.Denom) + if !found { + continue + } + totalRewardAmt, found := k.OraclePriceForRewards(ctx, rewardAsset.Id, v.AvailableRewards.Amount) + if !found { + continue + } + if totalBorrowedAmt.LTE(sdk.ZeroInt()) { + continue + } + str, err := sdk.NewDecFromStr(types.DaysInYear) + if err != nil { + continue + } + dailyRewardAmt := totalRewardAmt.Quo(sdk.NewDec(v.DurationDays - int64(epoch.Count))) + APR := dailyRewardAmt.Quo(sdk.NewDecFromInt(totalBorrowedAmt)) + totalAPR = APR.Mul(str) + } + } + return totalAPR +} diff --git a/x/rewards/types/query.pb.go b/x/rewards/types/query.pb.go index 49e0578ec..7c99520bb 100644 --- a/x/rewards/types/query.pb.go +++ b/x/rewards/types/query.pb.go @@ -6,6 +6,7 @@ package types import ( context "context" fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" query "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -1332,6 +1333,95 @@ func (m *QueryEpochTimeResponse) GetPagination() *query.PageResponse { return nil } +type QueryExtLendRewardsAPRRequest struct { + AssetId uint64 `protobuf:"varint,1,opt,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` + CPoolId uint64 `protobuf:"varint,2,opt,name=c_pool_id,json=cPoolId,proto3" json:"c_pool_id,omitempty"` +} + +func (m *QueryExtLendRewardsAPRRequest) Reset() { *m = QueryExtLendRewardsAPRRequest{} } +func (m *QueryExtLendRewardsAPRRequest) String() string { return proto.CompactTextString(m) } +func (*QueryExtLendRewardsAPRRequest) ProtoMessage() {} +func (*QueryExtLendRewardsAPRRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e41ca79380357ae5, []int{28} +} +func (m *QueryExtLendRewardsAPRRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtLendRewardsAPRRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtLendRewardsAPRRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtLendRewardsAPRRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtLendRewardsAPRRequest.Merge(m, src) +} +func (m *QueryExtLendRewardsAPRRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryExtLendRewardsAPRRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtLendRewardsAPRRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtLendRewardsAPRRequest proto.InternalMessageInfo + +func (m *QueryExtLendRewardsAPRRequest) GetAssetId() uint64 { + if m != nil { + return m.AssetId + } + return 0 +} + +func (m *QueryExtLendRewardsAPRRequest) GetCPoolId() uint64 { + if m != nil { + return m.CPoolId + } + return 0 +} + +type QueryExtLendRewardsAPRResponse struct { + Apr github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=apr,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"apr" yaml:"ext_rewards_lend_apr"` +} + +func (m *QueryExtLendRewardsAPRResponse) Reset() { *m = QueryExtLendRewardsAPRResponse{} } +func (m *QueryExtLendRewardsAPRResponse) String() string { return proto.CompactTextString(m) } +func (*QueryExtLendRewardsAPRResponse) ProtoMessage() {} +func (*QueryExtLendRewardsAPRResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e41ca79380357ae5, []int{29} +} +func (m *QueryExtLendRewardsAPRResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryExtLendRewardsAPRResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryExtLendRewardsAPRResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryExtLendRewardsAPRResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryExtLendRewardsAPRResponse.Merge(m, src) +} +func (m *QueryExtLendRewardsAPRResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryExtLendRewardsAPRResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryExtLendRewardsAPRResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryExtLendRewardsAPRResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "comdex.rewards.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "comdex.rewards.v1beta1.QueryParamsResponse") @@ -1361,6 +1451,8 @@ func init() { proto.RegisterType((*QueryExternalRewardStableMintResponse)(nil), "comdex.rewards.v1beta1.QueryExternalRewardStableMintResponse") proto.RegisterType((*QueryEpochTimeRequest)(nil), "comdex.rewards.v1beta1.QueryEpochTimeRequest") proto.RegisterType((*QueryEpochTimeResponse)(nil), "comdex.rewards.v1beta1.QueryEpochTimeResponse") + proto.RegisterType((*QueryExtLendRewardsAPRRequest)(nil), "comdex.rewards.v1beta1.QueryExtLendRewardsAPRRequest") + proto.RegisterType((*QueryExtLendRewardsAPRResponse)(nil), "comdex.rewards.v1beta1.QueryExtLendRewardsAPRResponse") } func init() { @@ -1368,98 +1460,107 @@ func init() { } var fileDescriptor_e41ca79380357ae5 = []byte{ - // 1444 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x98, 0xd6, 0x85, 0x69, 0x29, 0x74, 0x9a, 0x84, 0x66, 0x9b, 0x3a, 0xc9, 0x24, 0xfd, - 0x20, 0x69, 0xbc, 0x8d, 0x29, 0x6d, 0xfa, 0xc1, 0xa1, 0x56, 0x11, 0xb2, 0x48, 0xa5, 0xb2, 0x45, - 0x45, 0x80, 0xc0, 0xda, 0x78, 0xa7, 0xce, 0x8a, 0xf5, 0xae, 0xe3, 0x5d, 0xa7, 0x0d, 0x51, 0x25, - 0x3e, 0xd4, 0x03, 0x48, 0x08, 0x44, 0x85, 0x38, 0x70, 0x01, 0x71, 0xe3, 0xef, 0x00, 0x94, 0x13, - 0x04, 0x21, 0x24, 0xc4, 0x21, 0xaa, 0x12, 0xee, 0x48, 0xfd, 0x0b, 0xd0, 0xce, 0xbc, 0xb5, 0xbd, - 0xf6, 0xce, 0xae, 0x1d, 0xb0, 0x6f, 0xed, 0xf8, 0x7d, 0xfc, 0x7e, 0xef, 0xbd, 0x9d, 0x99, 0xdf, - 0x04, 0xd3, 0x92, 0x53, 0x31, 0xd8, 0x3d, 0xb5, 0xc6, 0xee, 0xea, 0x35, 0xc3, 0x55, 0xd7, 0x16, - 0x96, 0x99, 0xa7, 0x2f, 0xa8, 0xab, 0x75, 0x56, 0x5b, 0xcf, 0x56, 0x6b, 0x8e, 0xe7, 0x90, 0x51, - 0x61, 0x93, 0x05, 0x9b, 0x2c, 0xd8, 0x28, 0xc3, 0x65, 0xa7, 0xec, 0x70, 0x13, 0xd5, 0xff, 0x97, - 0xb0, 0x56, 0xc6, 0xcb, 0x8e, 0x53, 0xb6, 0x98, 0xaa, 0x57, 0x4d, 0x55, 0xb7, 0x6d, 0xc7, 0xd3, - 0x3d, 0xd3, 0xb1, 0x5d, 0xf8, 0x75, 0xb6, 0xe4, 0xb8, 0x15, 0xc7, 0x55, 0x97, 0x75, 0x97, 0x89, - 0x24, 0x8d, 0x94, 0x55, 0xbd, 0x6c, 0xda, 0xdc, 0x18, 0x6c, 0xa7, 0x25, 0xd8, 0xaa, 0x7a, 0x4d, - 0xaf, 0x04, 0x01, 0x67, 0x24, 0x46, 0x01, 0x58, 0x61, 0x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, 0xe3, 0xa6, 0xe0, 0x4b, 0x84, - 0x0f, 0xb5, 0xea, 0x55, 0x12, 0xff, 0x91, 0x87, 0xc5, 0xb4, 0x72, 0xb6, 0x3b, 0x63, 0x80, 0x7b, - 0x9a, 0xc3, 0x9d, 0x22, 0x13, 0x6a, 0xfc, 0xab, 0x28, 0x79, 0x88, 0xf0, 0xc1, 0x96, 0x08, 0x09, - 0x9b, 0x54, 0x48, 0x96, 0x2a, 0x73, 0x5d, 0xd9, 0x02, 0xa2, 0x39, 0x8e, 0xe8, 0x24, 0x99, 0x8e, - 0x47, 0xa4, 0x6e, 0xf8, 0x2d, 0xff, 0x15, 0xe1, 0xe3, 0x31, 0x5a, 0x8f, 0x5c, 0x8e, 0xff, 0x9a, - 0xe3, 0x64, 0xaa, 0x72, 0x65, 0x4f, 0xbe, 0xc0, 0xe2, 0x22, 0x67, 0xb1, 0x40, 0x54, 0x19, 0x0b, - 0x89, 0x3a, 0x24, 0x9b, 0x08, 0x1e, 0x71, 0xa3, 0x14, 0x12, 0x59, 0xec, 0x01, 0x53, 0x48, 0xd8, - 0x29, 0x97, 0xf6, 0xe0, 0x09, 0x5c, 0x2e, 0x70, 0x2e, 0xe7, 0x48, 0x56, 0xc6, 0x25, 0x5a, 0x51, - 0xf9, 0x1b, 0xf4, 0xf1, 0x18, 0x51, 0x91, 0xd0, 0x9c, 0x58, 0x3d, 0x94, 0xd0, 0x9c, 0x78, 0x15, - 0x43, 0x17, 0x39, 0xa1, 0x1c, 0x39, 0x27, 0x23, 0xd4, 0x22, 0x51, 0x8a, 0x7a, 0xb5, 0x6a, 0x1a, - 0x6e, 0x51, 0x40, 0xfe, 0xb1, 0x71, 0xe6, 0x74, 0xde, 0xe0, 0x93, 0xce, 0x1c, 0xa9, 0xec, 0x50, - 0x16, 0x7b, 0x77, 0x04, 0x26, 0x2f, 0x72, 0x26, 0x2a, 0x99, 0x97, 0x8e, 0x59, 0xd4, 0x8d, 0x9f, - 0xfc, 0x85, 0xf0, 0x89, 0xd8, 0x3b, 0x2f, 0xb9, 0xda, 0x03, 0xa4, 0x8e, 0x2b, 0xbb, 0xf2, 0xd2, - 0x1e, 0xbd, 0x81, 0xd5, 0x55, 0xce, 0xea, 0x02, 0x39, 0x2f, 0x63, 0x15, 0x77, 0x3f, 0x26, 0xdf, - 0x04, 0x47, 0x55, 0xe3, 0xb2, 0x97, 0x70, 0x54, 0xb5, 0x5f, 0x66, 0x13, 0x8e, 0xaa, 0x8e, 0x2b, - 0x28, 0x9d, 0xe5, 0x78, 0x67, 0x08, 0x8d, 0x3f, 0xf9, 0xfd, 0xdb, 0x65, 0xfe, 0xd5, 0xcd, 0x9d, - 0x0c, 0xda, 0xda, 0xc9, 0xa0, 0x47, 0x3b, 0x19, 0xf4, 0xc5, 0x6e, 0x66, 0x68, 0x6b, 0x37, 0x33, - 0xf4, 0xe7, 0x6e, 0x66, 0xe8, 0xad, 0x85, 0xb2, 0xe9, 0xad, 0xd4, 0x97, 0xfd, 0xdc, 0x10, 0x67, - 0xde, 0xb9, 0x73, 0xc7, 0x2c, 0x99, 0xba, 0x15, 0xc4, 0x6d, 0x46, 0xf6, 0xd6, 0xab, 0xcc, 0x5d, - 0x4e, 0xf3, 0x3f, 0x31, 0xbd, 0xf0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0x8a, 0xf8, 0xdc, - 0x94, 0x1b, 0x00, 0x00, + // 1589 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0xdf, 0x6f, 0x14, 0xd5, + 0x17, 0xef, 0x5d, 0xa0, 0x7c, 0xb9, 0xf0, 0xe5, 0xfb, 0xe5, 0xd2, 0x56, 0x3a, 0x94, 0xdd, 0xf6, + 0xb6, 0x14, 0x6c, 0xe9, 0x0e, 0x5d, 0x0b, 0x94, 0x1f, 0x3e, 0x74, 0x83, 0x31, 0x1b, 0x4b, 0x52, + 0x07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0, 0x51, + 0xd9, 0x63, 0x15, 0xc7, 0x36, 0x44, 0xde, 0x76, 0x6a, 0xff, 0x0b, 0x9f, 0x5f, 0x16, 0x8f, 0xe9, + 0x0d, 0x3c, 0x29, 0xb7, 0x06, 0x31, 0xba, 0x84, 0x77, 0x71, 0x6e, 0x90, 0x9c, 0x2e, 0x42, 0x34, + 0x02, 0x21, 0xda, 0xd7, 0x12, 0x22, 0xaa, 0x09, 0x2b, 0x74, 0x13, 0x8f, 0x86, 0x09, 0x79, 0x39, + 0x28, 0x5a, 0x6f, 0x40, 0x95, 0xf0, 0x33, 0xc2, 0x63, 0xed, 0x8e, 0x81, 0xe1, 0x2a, 0x1e, 0xe6, + 0xdf, 0x4f, 0x58, 0x05, 0x47, 0x64, 0x14, 0xb9, 0x5e, 0x7b, 0x05, 0x08, 0x55, 0xaa, 0x81, 0x8d, + 0xbe, 0x57, 0x40, 0x01, 0x02, 0x28, 0xc0, 0x6c, 0x95, 0x8c, 0x30, 0x80, 0xe3, 0xf8, 0x3f, 0x1c, + 0x42, 0xd9, 0x34, 0x20, 0xdf, 0xbb, 0xf9, 0xef, 0x92, 0x41, 0x2b, 0xc0, 0xbd, 0x45, 0x07, 0xb8, + 0x97, 0xf0, 0x2e, 0x2e, 0x04, 0x01, 0x4f, 0xa1, 0xde, 0x96, 0x59, 0xae, 0x49, 0x35, 0x61, 0x81, + 0x96, 0xf0, 0x44, 0xd3, 0x89, 0xf7, 0x8f, 0xea, 0xd2, 0x6a, 0x35, 0x15, 0x53, 0x93, 0xff, 0x6a, + 0xc6, 0xa8, 0x0f, 0xa7, 0x9e, 0x26, 0x94, 0x07, 0x54, 0x90, 0xbf, 0x21, 0x3c, 0x12, 0x75, 0x0b, + 0xe4, 0xde, 0xc0, 0xbb, 0x81, 0x06, 0xb0, 0x3b, 0x26, 0x63, 0x57, 0xb2, 0x7d, 0x56, 0xb7, 0x75, + 0x0b, 0x2c, 0x14, 0xc7, 0x80, 0xe7, 0x7e, 0xe1, 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x38, 0xc3, 0x59, 0x2c, 0x12, 0x55, 0xc6, 0x42, 0x32, 0xf9, 0x92, 0xfb, 0x08, 0x16, 0xd4, 0x71, + 0xd3, 0x1f, 0x59, 0xee, 0x01, 0x53, 0x64, 0x68, 0x55, 0xce, 0x3e, 0x83, 0x26, 0x70, 0x39, 0xcd, + 0xb9, 0x9c, 0x24, 0x79, 0x19, 0x97, 0xf8, 0x69, 0x31, 0x38, 0xa0, 0x0f, 0x27, 0x0c, 0x4c, 0x29, + 0xc9, 0x49, 0x9c, 0xf5, 0x52, 0x92, 0x93, 0x3c, 0xa1, 0xd1, 0x65, 0x4e, 0xa8, 0x40, 0x4e, 0xca, + 0x08, 0xb5, 0x8c, 0x5f, 0x65, 0xdd, 0x75, 0x4d, 0xc3, 0x2b, 0x0b, 0xc8, 0x3f, 0x36, 0xee, 0x9c, + 0xce, 0xe9, 0x24, 0xed, 0xce, 0x91, 0x8e, 0x54, 0xca, 0x72, 0xef, 0x8a, 0xc0, 0xe4, 0x14, 0x67, + 0xa2, 0x92, 0x05, 0x69, 0x99, 0xc5, 0x4d, 0x33, 0xe4, 0x21, 0x6a, 0xf6, 0x54, 0xb1, 0xfd, 0x3c, + 0xb9, 0xd0, 0x03, 0xa4, 0x8e, 0x71, 0x44, 0x79, 0xf1, 0x19, 0xb5, 0x81, 0xd5, 0x05, 0xce, 0xea, + 0x34, 0x59, 0x92, 0xb1, 0x4a, 0xea, 0xfd, 0xc9, 0x57, 0xe1, 0x55, 0xd5, 0x68, 0x64, 0x53, 0xae, + 0xaa, 0xf6, 0x46, 0x3d, 0xe5, 0xaa, 0xea, 0x68, 0xaf, 0xe9, 0x1c, 0xc7, 0x3b, 0x43, 0x68, 0xf2, + 0xcd, 0x1f, 0x74, 0xce, 0xe4, 0x87, 0x46, 0x97, 0xde, 0xde, 0x75, 0x92, 0x53, 0x69, 0x51, 0x8b, + 0x6d, 0x7f, 0x95, 0xd3, 0xbd, 0xaa, 0x01, 0xea, 0x25, 0x8e, 0x3a, 0x4f, 0x4e, 0x48, 0x51, 0xc7, + 0xf4, 0xad, 0xc5, 0x57, 0xee, 0x3f, 0xce, 0xa2, 0x07, 0x8f, 0xb3, 0xe8, 0xd1, 0xe3, 0x2c, 0xfa, + 0xec, 0x49, 0x76, 0xe8, 0xc1, 0x93, 0xec, 0xd0, 0x9f, 0x4f, 0xb2, 0x43, 0x6f, 0x2e, 0x46, 0xfa, + 0xe2, 0xc0, 0xe2, 0x82, 0x73, 0xf5, 0xaa, 0x59, 0x31, 0x75, 0x2b, 0xf4, 0xd0, 0xf4, 0xc1, 0xdb, + 0xe4, 0xf5, 0x61, 0xfe, 0xe7, 0xbf, 0x17, 0xfe, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x87, 0xfe, + 0xab, 0x30, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1488,6 +1589,7 @@ type QueryClient interface { QueryExternalRewardLends(ctx context.Context, in *QueryExternalRewardLendsRequest, opts ...grpc.CallOption) (*QueryExternalRewardLendsResponse, error) QueryExternalRewardStableMint(ctx context.Context, in *QueryExternalRewardStableMintRequest, opts ...grpc.CallOption) (*QueryExternalRewardStableMintResponse, error) QueryEpochTime(ctx context.Context, in *QueryEpochTimeRequest, opts ...grpc.CallOption) (*QueryEpochTimeResponse, error) + QueryExtLendRewardsAPR(ctx context.Context, in *QueryExtLendRewardsAPRRequest, opts ...grpc.CallOption) (*QueryExtLendRewardsAPRResponse, error) } type queryClient struct { @@ -1624,6 +1726,15 @@ func (c *queryClient) QueryEpochTime(ctx context.Context, in *QueryEpochTimeRequ return out, nil } +func (c *queryClient) QueryExtLendRewardsAPR(ctx context.Context, in *QueryExtLendRewardsAPRRequest, opts ...grpc.CallOption) (*QueryExtLendRewardsAPRResponse, error) { + out := new(QueryExtLendRewardsAPRResponse) + err := c.cc.Invoke(ctx, "/comdex.rewards.v1beta1.Query/QueryExtLendRewardsAPR", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) @@ -1640,6 +1751,7 @@ type QueryServer interface { QueryExternalRewardLends(context.Context, *QueryExternalRewardLendsRequest) (*QueryExternalRewardLendsResponse, error) QueryExternalRewardStableMint(context.Context, *QueryExternalRewardStableMintRequest) (*QueryExternalRewardStableMintResponse, error) QueryEpochTime(context.Context, *QueryEpochTimeRequest) (*QueryEpochTimeResponse, error) + QueryExtLendRewardsAPR(context.Context, *QueryExtLendRewardsAPRRequest) (*QueryExtLendRewardsAPRResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1688,6 +1800,9 @@ func (*UnimplementedQueryServer) QueryExternalRewardStableMint(ctx context.Conte func (*UnimplementedQueryServer) QueryEpochTime(ctx context.Context, req *QueryEpochTimeRequest) (*QueryEpochTimeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryEpochTime not implemented") } +func (*UnimplementedQueryServer) QueryExtLendRewardsAPR(ctx context.Context, req *QueryExtLendRewardsAPRRequest) (*QueryExtLendRewardsAPRResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryExtLendRewardsAPR not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1945,6 +2060,24 @@ func _Query_QueryEpochTime_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Query_QueryExtLendRewardsAPR_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryExtLendRewardsAPRRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryExtLendRewardsAPR(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/comdex.rewards.v1beta1.Query/QueryExtLendRewardsAPR", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryExtLendRewardsAPR(ctx, req.(*QueryExtLendRewardsAPRRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "comdex.rewards.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -2005,6 +2138,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryEpochTime", Handler: _Query_QueryEpochTime_Handler, }, + { + MethodName: "QueryExtLendRewardsAPR", + Handler: _Query_QueryExtLendRewardsAPR_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "comdex/rewards/v1beta1/query.proto", @@ -3078,6 +3215,72 @@ func (m *QueryEpochTimeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryExtLendRewardsAPRRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtLendRewardsAPRRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtLendRewardsAPRRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CPoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.CPoolId)) + i-- + dAtA[i] = 0x10 + } + if m.AssetId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.AssetId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryExtLendRewardsAPRResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryExtLendRewardsAPRResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExtLendRewardsAPRResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Apr.Size() + i -= size + if _, err := m.Apr.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -3498,6 +3701,32 @@ func (m *QueryEpochTimeResponse) Size() (n int) { return n } +func (m *QueryExtLendRewardsAPRRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.AssetId != 0 { + n += 1 + sovQuery(uint64(m.AssetId)) + } + if m.CPoolId != 0 { + n += 1 + sovQuery(uint64(m.CPoolId)) + } + return n +} + +func (m *QueryExtLendRewardsAPRResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Apr.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -6143,6 +6372,178 @@ func (m *QueryEpochTimeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryExtLendRewardsAPRRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtLendRewardsAPRRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtLendRewardsAPRRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) + } + m.AssetId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.AssetId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CPoolId", wireType) + } + m.CPoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CPoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryExtLendRewardsAPRResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryExtLendRewardsAPRResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryExtLendRewardsAPRResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Apr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Apr.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/rewards/types/query.pb.gw.go b/x/rewards/types/query.pb.gw.go index 14cf3e316..735421ce8 100644 --- a/x/rewards/types/query.pb.gw.go +++ b/x/rewards/types/query.pb.gw.go @@ -591,6 +591,42 @@ func local_request_Query_QueryEpochTime_0(ctx context.Context, marshaler runtime } +var ( + filter_Query_QueryExtLendRewardsAPR_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryExtLendRewardsAPR_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtLendRewardsAPRRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtLendRewardsAPR_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryExtLendRewardsAPR(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryExtLendRewardsAPR_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryExtLendRewardsAPRRequest + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryExtLendRewardsAPR_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryExtLendRewardsAPR(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -919,6 +955,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryExtLendRewardsAPR_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryExtLendRewardsAPR_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtLendRewardsAPR_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1240,6 +1299,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryExtLendRewardsAPR_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryExtLendRewardsAPR_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryExtLendRewardsAPR_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1271,6 +1350,8 @@ var ( pattern_Query_QueryExternalRewardStableMint_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "rewards", "v1beta1", "stable_mint_external_rewards"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryEpochTime_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "rewards", "v1beta1", "epoch_time"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryExtLendRewardsAPR_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"comdex", "rewards", "v1beta1", "ext_rewards_lend_apr"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1301,4 +1382,6 @@ var ( forward_Query_QueryExternalRewardStableMint_0 = runtime.ForwardResponseMessage forward_Query_QueryEpochTime_0 = runtime.ForwardResponseMessage + + forward_Query_QueryExtLendRewardsAPR_0 = runtime.ForwardResponseMessage ) From 07a83363b49a9e95dc611ba37a25ae3d24c95f5e Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Mon, 30 Jan 2023 15:10:49 +0530 Subject: [PATCH 2/5] updating extended pairs --- app/upgrades/mainnet/v8/upgrades.go | 47 +++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/app/upgrades/mainnet/v8/upgrades.go b/app/upgrades/mainnet/v8/upgrades.go index 04f30f236..704cbbcf1 100644 --- a/app/upgrades/mainnet/v8/upgrades.go +++ b/app/upgrades/mainnet/v8/upgrades.go @@ -1,6 +1,8 @@ package v8 import ( + "fmt" + "github.com/comdex-official/comdex/app/wasm/bindings" assetkeeper "github.com/comdex-official/comdex/x/asset/keeper" assettypes "github.com/comdex-official/comdex/x/asset/types" @@ -12,6 +14,47 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) +func UpdateExtendedPairVaults(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { + extPairs := []*bindings.MsgUpdatePairsVault{ + { + AppID: 2, ExtPairID: 2, StabilityFee: sdk.MustNewDecFromStr("1"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(250000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.4"), + MinUsdValueLeft: 100000, + }, + { + AppID: 2, ExtPairID: 3, StabilityFee: sdk.MustNewDecFromStr("0.5"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(350000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.7"), + MinUsdValueLeft: 100000, + }, + { + AppID: 2, ExtPairID: 4, StabilityFee: sdk.MustNewDecFromStr("0.25"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(400000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("2"), + MinUsdValueLeft: 100000, + }, + { + AppID: 2, ExtPairID: 5, StabilityFee: sdk.MustNewDecFromStr("1"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(250000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.5"), + MinUsdValueLeft: 100000, + }, + { + AppID: 2, ExtPairID: 6, StabilityFee: sdk.MustNewDecFromStr("0.5"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(350000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("1.8"), + MinUsdValueLeft: 100000, + }, + { + AppID: 2, ExtPairID: 7, StabilityFee: sdk.MustNewDecFromStr("0.35"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(400000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("2.1"), + MinUsdValueLeft: 100000, + }, + } + for _, extPair := range extPairs { + err := assetKeeper.WasmUpdatePairsVault(ctx, extPair) + if err != nil { + fmt.Println("err in updating extended pair ", extPair.ExtPairID) + } + } +} + func Dec(s string) sdk.Dec { dec, err := sdk.NewDecFromStr(s) if err != nil { @@ -141,6 +184,9 @@ func UpdateAuctionParams( BidDurationSeconds: 3600, } err = auctionKeeper.AddAuctionParams(ctx, &auctionParams) + if err != nil { + return + } } func CreateUpgradeHandler800( @@ -153,6 +199,7 @@ func CreateUpgradeHandler800( return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { newVM, err := mm.RunMigrations(ctx, configurator, fromVM) UpdateAuctionParams(ctx, assetKeeper, lendKeeper, auctionKeeper) + UpdateExtendedPairVaults(ctx, assetKeeper) return newVM, err } } From 92000c3acd033f0887972548d79666773b4d729d Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Mon, 30 Jan 2023 15:33:27 +0530 Subject: [PATCH 3/5] cusp changed --- app/upgrades/mainnet/v8/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/mainnet/v8/upgrades.go b/app/upgrades/mainnet/v8/upgrades.go index 704cbbcf1..756fd6a2f 100644 --- a/app/upgrades/mainnet/v8/upgrades.go +++ b/app/upgrades/mainnet/v8/upgrades.go @@ -175,7 +175,7 @@ func UpdateAuctionParams( AppID: 2, AuctionDurationSeconds: 18000, Buffer: Dec("1.15"), - Cusp: Dec("0.75"), + Cusp: Dec("0.70"), Step: 360, PriceFunctionType: 1, SurplusID: 1, From 53b11d0054a13e07fe9440dad47aa20dfd159bc3 Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Tue, 31 Jan 2023 01:11:20 +0530 Subject: [PATCH 4/5] stability fee value corrected --- app/upgrades/mainnet/v8/upgrades.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/mainnet/v8/upgrades.go b/app/upgrades/mainnet/v8/upgrades.go index 756fd6a2f..12e6aec19 100644 --- a/app/upgrades/mainnet/v8/upgrades.go +++ b/app/upgrades/mainnet/v8/upgrades.go @@ -42,7 +42,7 @@ func UpdateExtendedPairVaults(ctx sdk.Context, assetKeeper assetkeeper.Keeper) { MinUsdValueLeft: 100000, }, { - AppID: 2, ExtPairID: 7, StabilityFee: sdk.MustNewDecFromStr("0.35"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), + AppID: 2, ExtPairID: 7, StabilityFee: sdk.MustNewDecFromStr("0.25"), ClosingFee: sdk.ZeroDec(), LiquidationPenalty: sdk.MustNewDecFromStr("0.15"), DrawDownFee: sdk.MustNewDecFromStr("0.005"), IsVaultActive: true, DebtCeiling: sdk.NewInt(400000000000), DebtFloor: sdk.NewInt(50000000), MinCr: sdk.MustNewDecFromStr("2.1"), MinUsdValueLeft: 100000, }, From 3fe5e4c1ca72fa1cf777a22dde524b964045549d Mon Sep 17 00:00:00 2001 From: Chandragupta Singh Date: Tue, 31 Jan 2023 12:54:35 +0530 Subject: [PATCH 5/5] upgrade name changed for mainnet --- app/upgrades/mainnet/v8/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/mainnet/v8/constants.go b/app/upgrades/mainnet/v8/constants.go index 277df0592..02b9f50b5 100644 --- a/app/upgrades/mainnet/v8/constants.go +++ b/app/upgrades/mainnet/v8/constants.go @@ -1,7 +1,7 @@ package v8 const ( - UpgradeName800 = "v8.0.0" + UpgradeName800 = "v8.1.0" UpgradeHeight800 = "" UpgradeInfo800 = `'{ "binaries": {