From ea52e222bae78c4eeb147f9c52325ed8b976db7e Mon Sep 17 00:00:00 2001 From: Adam Moser <63419657+toteki@users.noreply.github.com> Date: Mon, 31 Jul 2023 21:41:06 -0600 Subject: [PATCH] feat: add special asset pairs (#2150) * feat: add special asset pairs * Update proto/umee/leverage/v1/leverage.proto * line length lint * Update x/leverage/keeper/token.go Co-authored-by: Robert Zaremba * Update x/leverage/keeper/token.go Co-authored-by: Robert Zaremba * Update proto/umee/leverage/v1/leverage.proto Co-authored-by: Robert Zaremba * Update proto/umee/leverage/v1/leverage.proto Co-authored-by: Robert Zaremba * make proto-all * make proto-all * fix * remove title + description * group legacy msg interface * proposal.go * legacy++ * special asset sets in gov message * pair deletion logic * can query for specific asset * Update proto/umee/leverage/v1/tx.proto * make proto-all * changelog * lint * Update proto/umee/leverage/v1/tx.proto Co-authored-by: kosegor <30661385+kosegor@users.noreply.github.com> * Update proto/umee/leverage/v1/tx.proto Co-authored-by: kosegor <30661385+kosegor@users.noreply.github.com> * proto changes * collateral weight zero deletes sets ad pairs * fix CLI * test++ * combine validate functions in genesis * fix * fix * proto changes * fix names * fix names * validation allows empty pairs if sets present instead * optional arg doc * Add liquidation threshold to pairs * revert proposal.go * change stringer --------- Co-authored-by: Robert Zaremba Co-authored-by: kosegor <30661385+kosegor@users.noreply.github.com> --- CHANGELOG.md | 1 + proto/umee/leverage/v1/genesis.proto | 1 + proto/umee/leverage/v1/leverage.proto | 55 ++ proto/umee/leverage/v1/query.proto | 19 + proto/umee/leverage/v1/tx.proto | 33 ++ swagger/swagger.yaml | 192 ++++++- x/leverage/client/cli/query.go | 29 + x/leverage/client/tests/tests.go | 10 + x/leverage/keeper/genesis.go | 5 + x/leverage/keeper/grpc_query.go | 23 + x/leverage/keeper/iter.go | 13 + x/leverage/keeper/msg_server.go | 39 ++ x/leverage/keeper/token.go | 24 + x/leverage/simulation/genesis.go | 1 + x/leverage/types/errors.go | 7 +- x/leverage/types/genesis.go | 9 + x/leverage/types/genesis.pb.go | 135 +++-- x/leverage/types/genesis_test.go | 2 +- x/leverage/types/keys.go | 16 +- x/leverage/types/leverage.pb.go | 775 ++++++++++++++++++++++++-- x/leverage/types/msgs.go | 118 +++- x/leverage/types/msgs_test.go | 4 +- x/leverage/types/query.pb.go | 638 ++++++++++++++++----- x/leverage/types/query.pb.gw.go | 83 +++ x/leverage/types/token.go | 70 ++- x/leverage/types/tx.pb.go | 633 ++++++++++++++++++--- 26 files changed, 2598 insertions(+), 337 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f10c2f590..9667f7d7ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - [2129](https://github.com/umee-network/umee/pull/2129) Emergency Group x/ugov proto. - [2146](https://github.com/umee-network/umee/pull/2146) Add store `GetTimeMs` and `SetTimeMs`. - [2157](https://github.com/umee-network/umee/pull/2157) Add `x/metoken` module. +- [2150](https://github.com/umee-network/umee/pull/2150) Add gov message to create Special Asset Pairs - [2145](https://github.com/umee-network/umee/pull/2145) Add New `Inflation Parms` to x/ugov proto and added `inflation rate` change logic to umint - [2159](https://github.com/umee-network/umee/pull/2159) Add hard market cap for token emission. - [2155](https://github.com/umee-network/umee/pull/2155) `bpmath`: basis points math package. diff --git a/proto/umee/leverage/v1/genesis.proto b/proto/umee/leverage/v1/genesis.proto index e80b66543d..3267f51514 100644 --- a/proto/umee/leverage/v1/genesis.proto +++ b/proto/umee/leverage/v1/genesis.proto @@ -26,6 +26,7 @@ message GenesisState { (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; + repeated SpecialAssetPair special_pairs = 10 [(gogoproto.nullable) = false]; } // AdjustedBorrow is a borrow struct used in the leverage module's genesis diff --git a/proto/umee/leverage/v1/leverage.proto b/proto/umee/leverage/v1/leverage.proto index d659e0e431..615f5e14eb 100644 --- a/proto/umee/leverage/v1/leverage.proto +++ b/proto/umee/leverage/v1/leverage.proto @@ -249,3 +249,58 @@ message Token { (gogoproto.moretags) = "yaml:\"historic_medians\"" ]; } + +// SpecialAssetPair defines a special (increased) CollateralWeight used when a specified Collateral is used +// to collateralize a specified Borrow. This association is one-way (so it does not work in reverse). +message SpecialAssetPair { + option (gogoproto.equal) = true; + + // Collateral base token denom. + string collateral = 1; + + // Borrow base token denom. + string borrow = 2; + + // Collateral Weight defines what portion of the total value of the asset + // can contribute to a users borrowing power. For special asset pairs, this + // also overrides the borrowed asset's collateral weight when evaluating borrow + // factor. Valid values: 0-1. + string collateral_weight = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Liquidation threshold defines what portion of the total value of the assets + // can contribute to a users liquidation threshold, when borrowing within the pair. + // Valid values in range [collateral_weight,1] + string liquidation_threshold = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + +// SpecialAssetSet defines a special (increased) CollateralWeight used when any of a set +// of assets are used to borrow each other (except for looping). It is used in gov proposals +// to create all the pairs that make up a set at once. +message SpecialAssetSet { + option (gogoproto.equal) = true; + + // Collateral or borrowed base token denoms. + repeated string assets = 1; + + // Collateral Weight defines what portion of the total value of the assets + // can contribute to a users borrowing power, when borrowing within the set. + // Valid values: 0-1. + string collateral_weight = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; + + // Liquidation threshold defines what portion of the total value of the assets + // can contribute to a users liquidation threshold, when borrowing within the set. + // Valid values in range [collateral_weight,1] + string liquidation_threshold = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} diff --git a/proto/umee/leverage/v1/query.proto b/proto/umee/leverage/v1/query.proto index 995cdafd33..7db30c134b 100644 --- a/proto/umee/leverage/v1/query.proto +++ b/proto/umee/leverage/v1/query.proto @@ -24,6 +24,12 @@ service Query { option (google.api.http).get = "/umee/leverage/v1/registered_tokens"; } + // SpecialAssets queries for all special asset pairs. + rpc SpecialAssets(QuerySpecialAssets) + returns (QuerySpecialAssetsResponse) { + option (google.api.http).get = "/umee/leverage/v1/special_assets"; + } + // MarketSummary queries a base asset's current borrowing and supplying conditions. rpc MarketSummary(QueryMarketSummary) returns (QueryMarketSummaryResponse) { @@ -100,6 +106,19 @@ message QueryRegisteredTokensResponse { repeated Token registry = 1 [(gogoproto.nullable) = false]; } +// QuerySpecialAssets defines the request structure for the SpecialAssets +// gRPC service handler. +message QuerySpecialAssets { + // denom can be used to query only pairs affecting a specific asset + string denom = 1; +} + +// QuerySpecialAssetsResponse defines the response structure for the +// SpecialAssets gRPC service handler. +message QuerySpecialAssetsResponse { + repeated SpecialAssetPair pairs = 1 [(gogoproto.nullable) = false]; +} + // QueryMarketSummary defines the request structure for the MarketSummary gRPC service handler. message QueryMarketSummary { string denom = 1; diff --git a/proto/umee/leverage/v1/tx.proto b/proto/umee/leverage/v1/tx.proto index 698c9ac873..7c1f10cce4 100644 --- a/proto/umee/leverage/v1/tx.proto +++ b/proto/umee/leverage/v1/tx.proto @@ -66,6 +66,11 @@ service Msg { // GovUpdateRegistry adds new tokens to the token registry or // updates existing tokens with new settings. rpc GovUpdateRegistry(MsgGovUpdateRegistry) returns (MsgGovUpdateRegistryResponse); + + // GovUpdateSpecialAssets adds, updates, or removes special asset pairs. Note that a special asset + // pair can be removed by setting its special collateral weight to negative one. Also allows for the creation + // of sets of assets, where each asset in the set forms a special asset pair with all of the others. + rpc GovUpdateSpecialAssets(MsgGovUpdateSpecialAssets) returns (MsgGovUpdateSpecialAssetsResponse); } // MsgSupply represents a user's request to supply assets to the module. @@ -266,3 +271,31 @@ message MsgGovUpdateRegistry { // MsgGovUpdateRegistryResponse defines the Msg/GovUpdateRegistry response type. message MsgGovUpdateRegistryResponse {} + +// MsgGovUpdateSpecialAssets defines the Msg/GovUpdateSpecialAssets request type. +message MsgGovUpdateSpecialAssets { + option (gogoproto.equal) = true; + option (gogoproto.goproto_getters) = false; + option (gogoproto.goproto_stringer) = false; + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address of the governance account. + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // sets are bidirectional groups of special asset pairs. Creating a special asset + // set causes all assets in the set to have a certain collateral weight when borrowing + // against each other (but not looping with themselves). Overrides any existing + // special asset pairs between assets in the set. Using both collateral weight + // and liquidation theshold of zero will clear all existing special pairs in the set instead. + repeated SpecialAssetSet sets = 2 [(gogoproto.nullable) = false]; + + // pairs are new or updated special asset pairs. Updating both a special asset pair's + // collateral weight and liquidation threshold to zero deletes the pair instead. + // These pairs will be applied after any sets above when passing a proposal, + // so they can be used to override certain set elements, set directional relationships, + // or set an asset's relation to itself (looping). + repeated SpecialAssetPair pairs = 3 [(gogoproto.nullable) = false]; +} + +// MsgGovUpdateSpecialAssetsResponse defines the Msg/GovUpdateSpecialAssets response type. +message MsgGovUpdateSpecialAssetsResponse {} diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 253cab5b5b..c7fe548f49 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -1281,6 +1281,89 @@ paths: type: string tags: - Query + /umee/leverage/v1/special_assets: + get: + summary: SpecialAssets queries for all special asset pairs. + operationId: SpecialAssets + responses: + '200': + description: A successful response. + schema: + type: object + properties: + pairs: + type: array + items: + type: object + properties: + collateral: + type: string + description: Collateral base token denom. + borrow: + type: string + description: Borrow base token denom. + collateral_weight: + type: string + description: >- + Collateral Weight defines what portion of the total + value of the asset + + can contribute to a users borrowing power. For special + asset pairs, this + + also overrides the borrowed asset's collateral weight + when evaluating borrow + + factor. Valid values: 0-1. + liquidation_threshold: + type: string + title: >- + Liquidation threshold defines what portion of the total + value of the assets + + can contribute to a users liquidation threshold, when + borrowing within the pair. + + Valid values in range [collateral_weight,1] + description: >- + SpecialAssetPair defines a special (increased) + CollateralWeight used when a specified Collateral is used + + to collateralize a specified Borrow. This association is + one-way (so it does not work in reverse). + description: |- + QuerySpecialAssetsResponse defines the response structure for the + SpecialAssets gRPC service handler. + default: + description: An unexpected error response. + schema: + type: object + properties: + error: + type: string + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + type_url: + type: string + value: + type: string + format: byte + parameters: + - name: denom + description: denom can be used to query only pairs affecting a specific asset. + in: query + required: false + type: string + tags: + - Query /umee/historacle/v1/avg_price/{denom}: get: summary: QueryAvgPrice returns avg price of a given denom (required). @@ -5098,6 +5181,52 @@ definitions: description: |- QueryRegisteredTokensResponse defines the response structure for the RegisteredTokens gRPC service handler. + umee.leverage.v1.QuerySpecialAssetsResponse: + type: object + properties: + pairs: + type: array + items: + type: object + properties: + collateral: + type: string + description: Collateral base token denom. + borrow: + type: string + description: Borrow base token denom. + collateral_weight: + type: string + description: >- + Collateral Weight defines what portion of the total value of the + asset + + can contribute to a users borrowing power. For special asset + pairs, this + + also overrides the borrowed asset's collateral weight when + evaluating borrow + + factor. Valid values: 0-1. + liquidation_threshold: + type: string + title: >- + Liquidation threshold defines what portion of the total value of + the assets + + can contribute to a users liquidation threshold, when borrowing + within the pair. + + Valid values in range [collateral_weight,1] + description: >- + SpecialAssetPair defines a special (increased) CollateralWeight used + when a specified Collateral is used + + to collateralize a specified Borrow. This association is one-way (so + it does not work in reverse). + description: |- + QuerySpecialAssetsResponse defines the response structure for the + SpecialAssets gRPC service handler. umee.leverage.v1.RiskInfo: type: object properties: @@ -5116,6 +5245,43 @@ definitions: description: >- RiskInfo defines a borrower's account health without requiring sdk.Dec formatting. + umee.leverage.v1.SpecialAssetPair: + type: object + properties: + collateral: + type: string + description: Collateral base token denom. + borrow: + type: string + description: Borrow base token denom. + collateral_weight: + type: string + description: >- + Collateral Weight defines what portion of the total value of the asset + + can contribute to a users borrowing power. For special asset pairs, + this + + also overrides the borrowed asset's collateral weight when evaluating + borrow + + factor. Valid values: 0-1. + liquidation_threshold: + type: string + title: >- + Liquidation threshold defines what portion of the total value of the + assets + + can contribute to a users liquidation threshold, when borrowing within + the pair. + + Valid values in range [collateral_weight,1] + description: >- + SpecialAssetPair defines a special (increased) CollateralWeight used when + a specified Collateral is used + + to collateralize a specified Borrow. This association is one-way (so it + does not work in reverse). umee.leverage.v1.Token: type: object properties: @@ -6721,7 +6887,7 @@ definitions: It tracks both its start time and end time, so that if the module's unbonding time changes, the unbonding can complete at the earlier of its original end time or its new one based on the new parameter. - umeenetwork.umee.metoken.v1.AcceptedAsset: + umee.metoken.v1.AcceptedAsset: type: object properties: denom: @@ -6756,7 +6922,7 @@ definitions: swaps and redemptions, along with its metadata and parameters - umeenetwork.umee.metoken.v1.AssetBalance: + umee.metoken.v1.AssetBalance: type: object properties: denom: @@ -6772,7 +6938,7 @@ definitions: description: >- AssetBalance tracks how much of a single asset is held in leverage, reserves, fees and interest account. - umeenetwork.umee.metoken.v1.Fee: + umee.metoken.v1.Fee: type: object properties: min_fee: @@ -6811,7 +6977,7 @@ definitions: the user. The usage of these parameters is explained here: https://github.com/umee-network/umee/tree/main/x/metoken#dynamic-fee - umeenetwork.umee.metoken.v1.Index: + umee.metoken.v1.Index: type: object properties: denom: @@ -6931,7 +7097,7 @@ definitions: the Index's meToken, along with its metadata and parameters. - umeenetwork.umee.metoken.v1.IndexBalances: + umee.metoken.v1.IndexBalances: type: object properties: metoken_supply: @@ -6967,7 +7133,7 @@ definitions: description: >- IndexBalances is the state of an Index, containing its meToken supply and all underlying asset balances. - umeenetwork.umee.metoken.v1.Params: + umee.metoken.v1.Params: type: object properties: rebalancing_frequency: @@ -6987,7 +7153,7 @@ definitions: leverage module description: Params defines the parameters for the metoken module. - umeenetwork.umee.metoken.v1.Price: + umee.metoken.v1.Price: type: object properties: denom: @@ -7003,7 +7169,7 @@ definitions: Exponent is the power of ten by which to multiply, in order to convert an amount of the meToken for the exchange operations. description: Price is used to inform meToken price and exponent. - umeenetwork.umee.metoken.v1.QueryIndexBalancesResponse: + umee.metoken.v1.QueryIndexBalancesResponse: type: object properties: index_balances: @@ -7050,7 +7216,7 @@ definitions: description: >- QueryIndexBalanceResponse defines the response structure for the IndexBalances gRPC service handler. - umeenetwork.umee.metoken.v1.QueryIndexPriceResponse: + umee.metoken.v1.QueryIndexPriceResponse: type: object properties: prices: @@ -7076,7 +7242,7 @@ definitions: description: >- QueryIndexPriceResponse defines the response structure for the IndexPrice gRPC service handler. - umeenetwork.umee.metoken.v1.QueryIndexesResponse: + umee.metoken.v1.QueryIndexesResponse: type: object properties: registry: @@ -7208,7 +7374,7 @@ definitions: description: >- QueryIndexesResponse defines the response structure for the Indexes gRPC service handler. - umeenetwork.umee.metoken.v1.QueryParamsResponse: + umee.metoken.v1.QueryParamsResponse: type: object properties: params: @@ -7234,7 +7400,7 @@ definitions: description: |- QueryParamsResponse defines the response structure for the Params gRPC service handler. - umeenetwork.umee.metoken.v1.QueryRedeemFeeResponse: + umee.metoken.v1.QueryRedeemFeeResponse: type: object properties: asset: @@ -7252,7 +7418,7 @@ definitions: description: >- QueryRedeemFeeResponse defines the response structure for the RedeemFee gRPC service handler. - umeenetwork.umee.metoken.v1.QuerySwapFeeResponse: + umee.metoken.v1.QuerySwapFeeResponse: type: object properties: asset: diff --git a/x/leverage/client/cli/query.go b/x/leverage/client/cli/query.go index 2ecc148e24..308b801941 100644 --- a/x/leverage/client/cli/query.go +++ b/x/leverage/client/cli/query.go @@ -30,6 +30,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand( GetCmdQueryParams(), GetCmdQueryRegisteredTokens(), + GetCmdQuerySpecialAssets(), GetCmdQueryMarketSummary(), GetCmdQueryAccountBalances(), GetCmdQueryAccountSummary(), @@ -95,6 +96,34 @@ func GetCmdQueryRegisteredTokens() *cobra.Command { return cmd } +// GetCmdQuerySpecialAssets creates a Cobra command to query for all +// the special asset pairs in the x/leverage module. +func GetCmdQuerySpecialAssets() *cobra.Command { + cmd := &cobra.Command{ + Use: "special-assets", + Args: cobra.RangeArgs(0, 1), + Short: "Query for all special asset pairs, or only those affecting a single collateral token.", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + req := &types.QuerySpecialAssets{} + if len(args) > 0 { + req.Denom = args[0] + } + resp, err := queryClient.SpecialAssets(cmd.Context(), req) + return cli.PrintOrErr(resp, err, clientCtx) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // GetCmdQueryMarketSummary creates a Cobra command to query for the // Market Summary of a specific token. func GetCmdQueryMarketSummary() *cobra.Command { diff --git a/x/leverage/client/tests/tests.go b/x/leverage/client/tests/tests.go index 36e2a52447..1aaec36437 100644 --- a/x/leverage/client/tests/tests.go +++ b/x/leverage/client/tests/tests.go @@ -94,6 +94,16 @@ func (s *IntegrationTests) TestLeverageScenario() { }, ErrMsg: "", }, + { + Name: "query special assets", + Command: cli.GetCmdQuerySpecialAssets(), + Args: []string{"uumee"}, + Response: &types.QuerySpecialAssetsResponse{}, + ExpectedResponse: &types.QuerySpecialAssetsResponse{ + Pairs: []types.SpecialAssetPair{}, + }, + ErrMsg: "", + }, { Name: "query registered token info by base_denom", Command: cli.GetCmdQueryRegisteredTokens(), diff --git a/x/leverage/keeper/genesis.go b/x/leverage/keeper/genesis.go index 18c1626769..2b0d03d0a7 100644 --- a/x/leverage/keeper/genesis.go +++ b/x/leverage/keeper/genesis.go @@ -43,6 +43,10 @@ func (k Keeper) InitGenesis(ctx sdk.Context, genState types.GenesisState) { for _, rate := range genState.InterestScalars { util.Panic(k.setInterestScalar(ctx, rate.Denom, rate.Scalar)) } + + for _, pair := range genState.SpecialPairs { + util.Panic(k.SetSpecialAssetPair(ctx, pair)) + } } // ExportGenesis returns the x/leverage module's exported genesis state. @@ -57,6 +61,7 @@ func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { k.getAllBadDebts(ctx), k.getAllInterestScalars(ctx), k.GetAllUTokenSupply(ctx), + k.GetAllSpecialAssetPairs(ctx), ) } diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index 16ad0d4621..45cd997bde 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -61,6 +61,29 @@ func (q Querier) RegisteredTokens( }, nil } +func (q Querier) SpecialAssets( + goCtx context.Context, + req *types.QuerySpecialAssets, +) (*types.QuerySpecialAssetsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + var pairs []types.SpecialAssetPair + if req.Denom == "" { + // all pairs + pairs = q.Keeper.GetAllSpecialAssetPairs(ctx) + } else { + // only pairs affecting one asset + pairs = q.Keeper.GetSpecialAssetPairs(ctx, req.Denom) + } + + return &types.QuerySpecialAssetsResponse{ + Pairs: pairs, + }, nil +} + func (q Querier) MarketSummary( goCtx context.Context, req *types.QueryMarketSummary, diff --git a/x/leverage/keeper/iter.go b/x/leverage/keeper/iter.go index 0795a3b0d1..a2fdd6d3df 100644 --- a/x/leverage/keeper/iter.go +++ b/x/leverage/keeper/iter.go @@ -42,6 +42,19 @@ func (k Keeper) GetAllRegisteredTokens(ctx sdk.Context) []types.Token { return store.MustLoadAll[*types.Token](ctx.KVStore(k.storeKey), types.KeyPrefixRegisteredToken) } +// GetAllSpecialAssetPairs returns all the special asset pairs from the x/leverage +// module's KVStore. +func (k Keeper) GetAllSpecialAssetPairs(ctx sdk.Context) []types.SpecialAssetPair { + return store.MustLoadAll[*types.SpecialAssetPair](ctx.KVStore(k.storeKey), types.KeyPrefixSpecialAssetPair) +} + +// GetSpecialAssetPairs returns all the special asset pairs from the x/leverage +// module's KVStore which match a single asset. +func (k Keeper) GetSpecialAssetPairs(ctx sdk.Context, denom string) []types.SpecialAssetPair { + prefix := types.KeySpecialAssetPairOneDenom(denom) + return store.MustLoadAll[*types.SpecialAssetPair](ctx.KVStore(k.storeKey), prefix) +} + // GetBorrowerBorrows returns an sdk.Coins object containing all open borrows // associated with an address. func (k Keeper) GetBorrowerBorrows(ctx sdk.Context, borrowerAddr sdk.AccAddress) sdk.Coins { diff --git a/x/leverage/keeper/msg_server.go b/x/leverage/keeper/msg_server.go index c4d982e732..ead00decda 100644 --- a/x/leverage/keeper/msg_server.go +++ b/x/leverage/keeper/msg_server.go @@ -569,3 +569,42 @@ func (s msgServer) GovUpdateRegistry( return &types.MsgGovUpdateRegistryResponse{}, nil } + +// GovUpdateSpecialAssets adds, updates, or deletes special asset pairs. +func (s msgServer) GovUpdateSpecialAssets( + goCtx context.Context, + msg *types.MsgGovUpdateSpecialAssets, +) (*types.MsgGovUpdateSpecialAssetsResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + for _, set := range msg.Sets { + // each special asset set is decomposed into its component pairs and stored in state. + // overrides existing pairs between assets in the new set. + for _, a := range set.Assets { + for _, b := range set.Assets { + if a != b { + pair := types.SpecialAssetPair{ + Collateral: a, + Borrow: b, + CollateralWeight: set.CollateralWeight, + } + // sets or overrides (or deletes on zero collateral weight) each pair + if err := s.keeper.SetSpecialAssetPair(ctx, pair); err != nil { + return nil, err + } + } + } + } + } + + // individual pairs are applied after sets, so they can override specific relationships + // between assets. + for _, pair := range msg.Pairs { + // sets or overrides (or deletes on zero collateral weight) each pair + if err := s.keeper.SetSpecialAssetPair(ctx, pair); err != nil { + return nil, err + } + } + + return &types.MsgGovUpdateSpecialAssetsResponse{}, nil +} diff --git a/x/leverage/keeper/token.go b/x/leverage/keeper/token.go index c83be27106..c04b2150cc 100644 --- a/x/leverage/keeper/token.go +++ b/x/leverage/keeper/token.go @@ -4,6 +4,8 @@ import ( "strings" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/umee-network/umee/v5/util/store" "github.com/umee-network/umee/v5/x/leverage/types" ) @@ -71,6 +73,28 @@ func (k Keeper) GetTokenSettings(ctx sdk.Context, denom string) (types.Token, er return token, err } +// SetSpecialAssetPair stores a SpecialAssetPair into the x/leverage module's KVStore. +// Deletes any existing special pairs between the assets instead if given zero +// collateral weight and zero liquidation threshold. +func (k Keeper) SetSpecialAssetPair(ctx sdk.Context, pair types.SpecialAssetPair) error { + if err := pair.Validate(); err != nil { + return err + } + if !pair.CollateralWeight.IsPositive() && !pair.LiquidationThreshold.IsPositive() { + k.deleteSpecialAssetPair(ctx, pair.Collateral, pair.Borrow) + return nil + } + + key := types.KeySpecialAssetPair(pair.Collateral, pair.Borrow) + return store.SetValue(ctx.KVStore(k.storeKey), key, &pair, "leverage-special-asset") +} + +// deleteSpecialAssetPair removes a SpecialAssetPair from the x/leverage module's KVStore. +func (k Keeper) deleteSpecialAssetPair(ctx sdk.Context, collateralDenom, borrowDenom string) { + key := types.KeySpecialAssetPair(collateralDenom, borrowDenom) + ctx.KVStore(k.storeKey).Delete(key) +} + // SaveOrUpdateTokenSettingsToRegistry adds new tokens or updates the new tokens settings to registry. // It requires maps of the currently registered base and symbol denoms, so it can prevent duplicates of either. func (k Keeper) SaveOrUpdateTokenSettingsToRegistry( diff --git a/x/leverage/simulation/genesis.go b/x/leverage/simulation/genesis.go index 1d56177a07..2bfc962822 100644 --- a/x/leverage/simulation/genesis.go +++ b/x/leverage/simulation/genesis.go @@ -92,6 +92,7 @@ func RandomizedGenState(simState *module.SimulationState) { []types.BadDebt{}, []types.InterestScalar{}, sdk.Coins{}, + []types.SpecialAssetPair{}, ) bz, err := json.MarshalIndent(&leverageGenesis.Params, "", " ") diff --git a/x/leverage/types/errors.go b/x/leverage/types/errors.go index 231c317670..dca2fa08b2 100644 --- a/x/leverage/types/errors.go +++ b/x/leverage/types/errors.go @@ -25,8 +25,11 @@ var ( ModuleName, 206, "collateral weight of Token is zero: can't be used as a collateral", ) - ErrDuplicateToken = errors.Register(ModuleName, 207, "duplicate token") - ErrEmptyAddAndUpdateTokens = errors.Register(ModuleName, 208, "empty add and update tokens") + ErrDuplicateToken = errors.Register(ModuleName, 207, "duplicate token") + ErrEmptyAddAndUpdateTokens = errors.Register(ModuleName, 208, "empty add and update tokens") + ErrEmptyUpdateSpecialAssets = errors.Register(ModuleName, 209, "empty update special asset pairs") + ErrDuplicatePair = errors.Register(ModuleName, 210, "duplicate special asset pair") + ErrProposedSetOrder = errors.Register(ModuleName, 211, "asset sets not in ascending (weight) order") // 3XX = User Positions ErrInsufficientBalance = errors.Register(ModuleName, 300, "insufficient balance") diff --git a/x/leverage/types/genesis.go b/x/leverage/types/genesis.go index e884600ceb..5a1d56edfe 100644 --- a/x/leverage/types/genesis.go +++ b/x/leverage/types/genesis.go @@ -18,6 +18,7 @@ func NewGenesisState( badDebts []BadDebt, interestScalars []InterestScalar, uTokenSupply sdk.Coins, + specialPairs []SpecialAssetPair, ) *GenesisState { return &GenesisState{ Params: params, @@ -29,6 +30,7 @@ func NewGenesisState( BadDebts: badDebts, InterestScalars: interestScalars, UtokenSupply: uTokenSupply, + SpecialPairs: specialPairs, } } @@ -48,6 +50,9 @@ func (gs GenesisState) Validate() error { return err } + if err := validateRegistryTokenDenoms(gs.Registry); err != nil { + return err + } for _, token := range gs.Registry { if err := token.Validate(); err != nil { return err @@ -98,6 +103,10 @@ func (gs GenesisState) Validate() error { } } + if err := validateSpecialAssetPairs(gs.SpecialPairs); err != nil { + return err + } + return gs.UtokenSupply.Validate() } diff --git a/x/leverage/types/genesis.pb.go b/x/leverage/types/genesis.pb.go index 080a14a31c..52acb6f17c 100644 --- a/x/leverage/types/genesis.pb.go +++ b/x/leverage/types/genesis.pb.go @@ -36,6 +36,7 @@ type GenesisState struct { BadDebts []BadDebt `protobuf:"bytes,7,rep,name=bad_debts,json=badDebts,proto3" json:"bad_debts"` InterestScalars []InterestScalar `protobuf:"bytes,8,rep,name=interest_scalars,json=interestScalars,proto3" json:"interest_scalars"` UtokenSupply github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,9,rep,name=utoken_supply,json=utokenSupply,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"utoken_supply"` + SpecialPairs []SpecialAssetPair `protobuf:"bytes,10,rep,name=special_pairs,json=specialPairs,proto3" json:"special_pairs"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -241,45 +242,47 @@ func init() { func init() { proto.RegisterFile("umee/leverage/v1/genesis.proto", fileDescriptor_a51f71666aa8f549) } var fileDescriptor_a51f71666aa8f549 = []byte{ - // 601 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0x8e, 0xfb, 0x27, 0x6d, 0xb6, 0xfd, 0xf5, 0x57, 0xad, 0x2a, 0xb1, 0x54, 0x95, 0x13, 0xe5, - 0x80, 0x72, 0xa0, 0x76, 0x5b, 0x04, 0xa8, 0x88, 0x0b, 0x6e, 0x05, 0xe2, 0x82, 0x20, 0xed, 0x89, - 0x4b, 0xb4, 0xb6, 0x07, 0x63, 0x6a, 0x7b, 0xad, 0x9d, 0x75, 0x4a, 0xdf, 0x82, 0xe7, 0xe0, 0xc8, - 0x53, 0xf4, 0xd8, 0x23, 0xe2, 0x50, 0xa0, 0x7d, 0x11, 0xe4, 0xdd, 0x4d, 0xda, 0x34, 0x50, 0x71, - 0xe0, 0x64, 0xcf, 0xce, 0xf7, 0x7d, 0x33, 0x3b, 0xdf, 0x68, 0x89, 0x5b, 0xe5, 0x00, 0x7e, 0x06, - 0x43, 0x90, 0x3c, 0x01, 0x7f, 0xb8, 0xed, 0x27, 0x50, 0x00, 0xa6, 0xe8, 0x95, 0x52, 0x28, 0x41, - 0x57, 0xeb, 0xbc, 0x37, 0xca, 0x7b, 0xc3, 0xed, 0x75, 0x37, 0x12, 0x98, 0x0b, 0xf4, 0x43, 0x8e, - 0x35, 0x3e, 0x04, 0xc5, 0xb7, 0xfd, 0x48, 0xa4, 0x85, 0x61, 0xac, 0xb7, 0xa7, 0x14, 0xc7, 0x6c, - 0x03, 0x58, 0x4b, 0x44, 0x22, 0xf4, 0xaf, 0x5f, 0xff, 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d5, 0x0d, 0x7c, 0x3b, 0x6f, 0xdf, 0xfb, 0x8b, 0xd9, 0xef, - 0x43, 0xd4, 0xb7, 0xec, 0xe0, 0xd5, 0xe9, 0x4f, 0xb7, 0x71, 0x7a, 0xe1, 0x3a, 0x67, 0x17, 0xae, - 0xf3, 0xe3, 0xc2, 0x75, 0x3e, 0x5d, 0xba, 0x8d, 0xb3, 0x4b, 0xb7, 0xf1, 0xf5, 0xd2, 0x6d, 0xbc, - 0xdd, 0xba, 0xa6, 0x56, 0xaf, 0xd1, 0x66, 0x01, 0xea, 0x58, 0xc8, 0x23, 0x1d, 0xf8, 0xc3, 0x87, - 0xfe, 0xc7, 0xab, 0xa7, 0x49, 0x6b, 0x87, 0x4d, 0xfd, 0xfe, 0x3c, 0xf8, 0x15, 0x00, 0x00, 0xff, - 0xff, 0xcd, 0x8e, 0xd7, 0xd1, 0x0a, 0x05, 0x00, 0x00, + // 635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x8e, 0x7b, 0x49, 0x9b, 0xe9, 0xe5, 0xaf, 0x46, 0x95, 0x7e, 0x53, 0x55, 0x4e, 0x94, 0x05, + 0xca, 0x82, 0xda, 0x6d, 0x11, 0xa0, 0x22, 0x36, 0x75, 0x2b, 0x10, 0x0b, 0x50, 0x49, 0xba, 0x62, + 0x63, 0x8d, 0xed, 0x83, 0x31, 0xb5, 0x3d, 0xd6, 0x9c, 0x49, 0x4a, 0x97, 0xbc, 0x01, 0xcf, 0xc1, + 0x93, 0x74, 0xd9, 0x25, 0x62, 0x51, 0xa0, 0x7d, 0x11, 0xe4, 0x99, 0x49, 0xda, 0x34, 0x10, 0xb1, + 0x60, 0x95, 0xcc, 0x9c, 0xef, 0x32, 0xe7, 0x7c, 0x33, 0x26, 0x4e, 0x3f, 0x07, 0xf0, 0x32, 0x18, + 0x80, 0x60, 0x09, 0x78, 0x83, 0x1d, 0x2f, 0x81, 0x02, 0x30, 0x45, 0xb7, 0x14, 0x5c, 0x72, 0xba, + 0x56, 0xd5, 0xdd, 0x61, 0xdd, 0x1d, 0xec, 0x6c, 0x38, 0x11, 0xc7, 0x9c, 0xa3, 0x17, 0x32, 0xac, + 0xf0, 0x21, 0x48, 0xb6, 0xe3, 0x45, 0x3c, 0x2d, 0x34, 0x63, 0xa3, 0x39, 0xa1, 0x38, 0x62, 0x6b, + 0xc0, 0x7a, 0xc2, 0x13, 0xae, 0xfe, 0x7a, 0xd5, 0x3f, 0xbd, 0xdb, 0xfe, 0x54, 0x27, 0xcb, 0x2f, + 0xb4, 0x75, 0x4f, 0x32, 0x09, 0xf4, 0x31, 0xa9, 0x97, 0x4c, 0xb0, 0x1c, 0x6d, 0xab, 0x65, 0x75, + 0x96, 0x76, 0x6d, 0xf7, 0xee, 0x51, 0xdc, 0x23, 0x55, 0xf7, 0xe7, 0xce, 0x2f, 0x9b, 0xb5, 0xae, + 0x41, 0xd3, 0x3d, 0xb2, 0x28, 0x20, 0x49, 0x51, 0x8a, 0x33, 0x7b, 0xa6, 0x35, 0xdb, 0x59, 0xda, + 0xfd, 0x7f, 0x92, 0x79, 0xcc, 0x4f, 0xa0, 0x30, 0xc4, 0x11, 0x9c, 0xbe, 0x21, 0x6b, 0x2c, 0xfe, + 0xd0, 0x47, 0x09, 0x71, 0x10, 0x72, 0x21, 0xf8, 0x29, 0xda, 0xb3, 0x4a, 0xa2, 0x35, 0x29, 0xb1, + 0x6f, 0x90, 0xbe, 0x02, 0x1a, 0xad, 0xff, 0xd8, 0xd8, 0x2e, 0x52, 0x9f, 0x90, 0x88, 0x67, 0x19, + 0x93, 0x20, 0x58, 0x66, 0xcf, 0x29, 0xb1, 0xcd, 0x49, 0xb1, 0x83, 0x11, 0xc6, 0x08, 0xdd, 0x62, + 0xd1, 0xa4, 0xea, 0x08, 0x41, 0x0c, 0x00, 0xed, 0x79, 0xa5, 0x70, 0xcf, 0xd5, 0x21, 0xb8, 0x55, + 0x08, 0xae, 0x09, 0xc1, 0x3d, 0xe0, 0x69, 0xe1, 0x6f, 0x57, 0xf4, 0x2f, 0xdf, 0x9b, 0x9d, 0x24, + 0x95, 0xef, 0xfb, 0xa1, 0x1b, 0xf1, 0xdc, 0x33, 0x89, 0xe9, 0x9f, 0x2d, 0x8c, 0x4f, 0x3c, 0x79, + 0x56, 0x02, 0x2a, 0x02, 0x76, 0x47, 0xe2, 0xf4, 0x01, 0xa1, 0x19, 0x43, 0x19, 0xa4, 0x85, 0x04, + 0x01, 0x28, 0x03, 0x99, 0xe6, 0x60, 0xd7, 0x5b, 0x56, 0x67, 0xb6, 0xbb, 0x56, 0x55, 0x5e, 0x9a, + 0xc2, 0x71, 0x9a, 0x03, 0x7d, 0x46, 0x1a, 0x21, 0x8b, 0x83, 0x18, 0x42, 0x89, 0xf6, 0x82, 0x39, + 0xd7, 0x44, 0x67, 0x3e, 0x8b, 0x0f, 0x21, 0x94, 0xc3, 0x59, 0x87, 0x7a, 0x89, 0xd5, 0xac, 0x47, + 0x36, 0x18, 0xb1, 0x8c, 0x09, 0xb4, 0x17, 0xff, 0x34, 0xeb, 0xa1, 0x6f, 0x4f, 0x01, 0x87, 0xb3, + 0x4e, 0xc7, 0x76, 0x91, 0x96, 0x64, 0xa5, 0x2f, 0xab, 0x60, 0x03, 0xec, 0x97, 0x65, 0x76, 0x66, + 0x37, 0xfe, 0xfd, 0xb0, 0x96, 0xb5, 0x43, 0x4f, 0x19, 0xd0, 0x57, 0x64, 0x05, 0x4b, 0x88, 0x52, + 0x96, 0x05, 0x25, 0x4b, 0x05, 0xda, 0x44, 0x39, 0xb6, 0x27, 0x3b, 0xe8, 0x69, 0xd8, 0x3e, 0x22, + 0xc8, 0x23, 0x96, 0x0e, 0x7b, 0x58, 0x36, 0xf4, 0x6a, 0x0b, 0xdb, 0xef, 0xc8, 0xea, 0xf8, 0xad, + 0xa2, 0x36, 0x59, 0x60, 0x71, 0x2c, 0x00, 0xf5, 0x2b, 0x68, 0x74, 0x87, 0x4b, 0xfa, 0x94, 0xd4, + 0x59, 0xce, 0xfb, 0x85, 0xb4, 0x67, 0xd4, 0xf3, 0xd8, 0xfc, 0x6d, 0x97, 0x87, 0x10, 0xa9, 0x46, + 0xcd, 0x13, 0xd1, 0x8c, 0x76, 0x40, 0xc8, 0xcd, 0x85, 0x9b, 0xe2, 0xf1, 0xe4, 0x8e, 0xc7, 0x94, + 0x49, 0x8e, 0x1b, 0xec, 0x91, 0x05, 0x93, 0xfb, 0x14, 0xf5, 0x75, 0x32, 0x1f, 0x43, 0xc1, 0x73, + 0x25, 0xde, 0xe8, 0xea, 0x45, 0xbb, 0x20, 0xab, 0xe3, 0x69, 0xdf, 0xe0, 0xac, 0x5b, 0x38, 0xfa, + 0x9c, 0xd4, 0xf5, 0xb5, 0xd1, 0x74, 0xdf, 0xad, 0x0e, 0xf0, 0xed, 0xb2, 0x79, 0xff, 0x2f, 0xa2, + 0x3c, 0x84, 0xa8, 0x6b, 0xd8, 0xfe, 0xeb, 0xf3, 0x9f, 0x4e, 0xed, 0xfc, 0xca, 0xb1, 0x2e, 0xae, + 0x1c, 0xeb, 0xc7, 0x95, 0x63, 0x7d, 0xbe, 0x76, 0x6a, 0x17, 0xd7, 0x4e, 0xed, 0xeb, 0xb5, 0x53, + 0x7b, 0xbb, 0x7d, 0x4b, 0xad, 0xca, 0x74, 0xab, 0x00, 0x79, 0xca, 0xc5, 0x89, 0x5a, 0x78, 0x83, + 0x47, 0xde, 0xc7, 0x9b, 0x2f, 0x9d, 0xd2, 0x0e, 0xeb, 0xea, 0x73, 0xf6, 0xf0, 0x57, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x42, 0xd6, 0xc6, 0x01, 0x59, 0x05, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -302,6 +305,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.SpecialPairs) > 0 { + for iNdEx := len(m.SpecialPairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SpecialPairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + } if len(m.UtokenSupply) > 0 { for iNdEx := len(m.UtokenSupply) - 1; iNdEx >= 0; iNdEx-- { { @@ -639,6 +656,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.SpecialPairs) > 0 { + for _, e := range m.SpecialPairs { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -1029,6 +1052,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpecialPairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpecialPairs = append(m.SpecialPairs, SpecialAssetPair{}) + if err := m.SpecialPairs[len(m.SpecialPairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/leverage/types/genesis_test.go b/x/leverage/types/genesis_test.go index 4333c0678d..7e8a7d9e2f 100644 --- a/x/leverage/types/genesis_test.go +++ b/x/leverage/types/genesis_test.go @@ -24,7 +24,7 @@ func TestGenesisValidation(t *testing.T) { *NewGenesisState( Params{ CompleteLiquidationThreshold: sdk.MustNewDecFromStr("-0.4"), - }, nil, nil, nil, nil, 0, nil, nil, nil, + }, nil, nil, nil, nil, 0, nil, nil, nil, nil, ), true, "complete liquidation threshold must be positive", diff --git a/x/leverage/types/keys.go b/x/leverage/types/keys.go index 5b159d447c..be0bbec367 100644 --- a/x/leverage/types/keys.go +++ b/x/leverage/types/keys.go @@ -25,6 +25,7 @@ var ( KeyPrefixInterestScalar = []byte{0x08} KeyPrefixAdjustedTotalBorrow = []byte{0x09} KeyPrefixUtokenSupply = []byte{0x0A} + KeyPrefixSpecialAssetPair = []byte{0x0B} ) // KeyRegisteredToken returns a KVStore key for getting and setting a Token. @@ -33,6 +34,19 @@ func KeyRegisteredToken(baseTokenDenom string) []byte { return util.ConcatBytes(1, KeyPrefixRegisteredToken, []byte(baseTokenDenom)) } +// KeySpecialAssetPair returns a KVStore key for getting and setting a SpecialAssetPair. +func KeySpecialAssetPair(collateral, borrow string) []byte { + // pairprefix | collateralDenom | 0x00 | borrowDenom | 0x00 for null-termination + return util.ConcatBytes(1, KeySpecialAssetPairOneDenom(collateral), []byte(borrow)) +} + +// KeySpecialAssetPairOneDenom returns the shared prefix for all special asset pairs affecting a +// single denom. +func KeySpecialAssetPairOneDenom(denom string) []byte { + // pairprefix | collateralDenom | 0x00 + return util.ConcatBytes(1, KeyPrefixSpecialAssetPair, []byte(denom)) +} + // KeyAdjustedBorrow returns a KVStore key for getting and setting an // adjusted borrow for a denom and borrower address. func KeyAdjustedBorrow(borrowerAddr sdk.AccAddress, tokenDenom string) []byte { @@ -80,7 +94,7 @@ func KeyInterestScalar(tokenDenom string) []byte { return util.ConcatBytes(1, KeyPrefixInterestScalar, []byte(tokenDenom)) } -// KeyAdjustedTotalBorrow returns a KVStore key for getting and setting the total ajdusted borrows for +// KeyAdjustedTotalBorrow returns a KVStore key for getting and setting the total adjusted borrows for // a given token. func KeyAdjustedTotalBorrow(tokenDenom string) []byte { // totalBorrowedPrefix | denom | 0x00 for null-termination diff --git a/x/leverage/types/leverage.pb.go b/x/leverage/types/leverage.pb.go index 36686319c5..297db8a306 100644 --- a/x/leverage/types/leverage.pb.go +++ b/x/leverage/types/leverage.pb.go @@ -239,73 +239,181 @@ func (m *Token) XXX_DiscardUnknown() { var xxx_messageInfo_Token proto.InternalMessageInfo +// SpecialAssetPair defines a special (increased) CollateralWeight used when a specified Collateral is used +// to collateralize a specified Borrow. This association is one-way (so it does not work in reverse). +type SpecialAssetPair struct { + // Collateral base token denom. + Collateral string `protobuf:"bytes,1,opt,name=collateral,proto3" json:"collateral,omitempty"` + // Borrow base token denom. + Borrow string `protobuf:"bytes,2,opt,name=borrow,proto3" json:"borrow,omitempty"` + // Collateral Weight defines what portion of the total value of the asset + // can contribute to a users borrowing power. For special asset pairs, this + // also overrides the borrowed asset's collateral weight when evaluating borrow + // factor. Valid values: 0-1. + CollateralWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=collateral_weight,json=collateralWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_weight"` + // Liquidation threshold defines what portion of the total value of the assets + // can contribute to a users liquidation threshold, when borrowing within the pair. + // Valid values in range [collateral_weight,1] + LiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_threshold"` +} + +func (m *SpecialAssetPair) Reset() { *m = SpecialAssetPair{} } +func (m *SpecialAssetPair) String() string { return proto.CompactTextString(m) } +func (*SpecialAssetPair) ProtoMessage() {} +func (*SpecialAssetPair) Descriptor() ([]byte, []int) { + return fileDescriptor_8cb1bf9ea641ecc6, []int{2} +} +func (m *SpecialAssetPair) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpecialAssetPair) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpecialAssetPair.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 *SpecialAssetPair) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpecialAssetPair.Merge(m, src) +} +func (m *SpecialAssetPair) XXX_Size() int { + return m.Size() +} +func (m *SpecialAssetPair) XXX_DiscardUnknown() { + xxx_messageInfo_SpecialAssetPair.DiscardUnknown(m) +} + +var xxx_messageInfo_SpecialAssetPair proto.InternalMessageInfo + +// SpecialAssetSet defines a special (increased) CollateralWeight used when any of a set +// of assets are used to borrow each other (except for looping). It is used in gov proposals +// to create all the pairs that make up a set at once. +type SpecialAssetSet struct { + // Collateral or borrowed base token denoms. + Assets []string `protobuf:"bytes,1,rep,name=assets,proto3" json:"assets,omitempty"` + // Collateral Weight defines what portion of the total value of the assets + // can contribute to a users borrowing power, when borrowing within the set. + // Valid values: 0-1. + CollateralWeight github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=collateral_weight,json=collateralWeight,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"collateral_weight"` + // Liquidation threshold defines what portion of the total value of the assets + // can contribute to a users liquidation threshold, when borrowing within the set. + // Valid values in range [collateral_weight,1] + LiquidationThreshold github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,3,opt,name=liquidation_threshold,json=liquidationThreshold,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liquidation_threshold"` +} + +func (m *SpecialAssetSet) Reset() { *m = SpecialAssetSet{} } +func (m *SpecialAssetSet) String() string { return proto.CompactTextString(m) } +func (*SpecialAssetSet) ProtoMessage() {} +func (*SpecialAssetSet) Descriptor() ([]byte, []int) { + return fileDescriptor_8cb1bf9ea641ecc6, []int{3} +} +func (m *SpecialAssetSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SpecialAssetSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SpecialAssetSet.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 *SpecialAssetSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpecialAssetSet.Merge(m, src) +} +func (m *SpecialAssetSet) XXX_Size() int { + return m.Size() +} +func (m *SpecialAssetSet) XXX_DiscardUnknown() { + xxx_messageInfo_SpecialAssetSet.DiscardUnknown(m) +} + +var xxx_messageInfo_SpecialAssetSet proto.InternalMessageInfo + func init() { proto.RegisterType((*Params)(nil), "umee.leverage.v1.Params") proto.RegisterType((*Token)(nil), "umee.leverage.v1.Token") + proto.RegisterType((*SpecialAssetPair)(nil), "umee.leverage.v1.SpecialAssetPair") + proto.RegisterType((*SpecialAssetSet)(nil), "umee.leverage.v1.SpecialAssetSet") } func init() { proto.RegisterFile("umee/leverage/v1/leverage.proto", fileDescriptor_8cb1bf9ea641ecc6) } var fileDescriptor_8cb1bf9ea641ecc6 = []byte{ - // 926 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xbf, 0x6f, 0x1b, 0x37, - 0x14, 0xd6, 0xb5, 0xb6, 0x6b, 0x33, 0xb1, 0x24, 0x9f, 0x65, 0xe7, 0xd0, 0xb8, 0x3a, 0x83, 0x40, - 0x0b, 0x2f, 0xb1, 0x1a, 0xb4, 0x5d, 0x3c, 0xca, 0x81, 0x1b, 0x17, 0x71, 0xda, 0xd2, 0x29, 0x02, - 0x74, 0x39, 0x50, 0xa7, 0x17, 0x89, 0x10, 0xef, 0xa8, 0x92, 0xd4, 0x2f, 0x2f, 0x1d, 0x8a, 0x4e, - 0x5d, 0x3a, 0x76, 0x29, 0x90, 0x3f, 0xa5, 0xa3, 0xc7, 0x8c, 0x45, 0x07, 0xa1, 0xb5, 0x97, 0x0e, - 0x9d, 0xfc, 0x17, 0x14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 0x4e, 0x4c, 0xdc, 0x14, 0x3e, 0x4e, 0xd0, - 0x13, 0x03, 0x26, 0x06, 0x84, 0xa4, 0x21, 0x87, 0x40, 0xc2, 0x80, 0xca, 0xe6, 0xc4, 0xc0, 0xca, - 0x72, 0x06, 0xe6, 0x71, 0x62, 0xe2, 0x5a, 0x98, 0x18, 0x34, 0x35, 0xf0, 0xb3, 0x83, 0x76, 0x55, - 0x44, 0x39, 0x9f, 0x59, 0x40, 0xc5, 0x2e, 0xc0, 0x5b, 0x35, 0x1e, 0xbe, 0x5e, 0xd8, 0xc3, 0x47, - 0xd6, 0xc3, 0x7c, 0x56, 0x4c, 0x2a, 0x26, 0x90, 0xdb, 0x8e, 0x73, 0x76, 0x01, 0xc6, 0x47, 0x93, - 0x49, 0x08, 0xf5, 0xcc, 0x5f, 0x5e, 0x00, 0x78, 0x6b, 0xcb, 0xf9, 0x98, 0xcf, 0x8a, 0x49, 0xc5, - 0x06, 0x72, 0x46, 0x4e, 0x00, 0x8e, 0x56, 0x7e, 0x7b, 0xe9, 0x17, 0xf0, 0x7f, 0x45, 0xb4, 0xfa, - 0x4c, 0x74, 0x20, 0x76, 0x3f, 0x47, 0xa8, 0x41, 0x15, 0x04, 0x4d, 0x88, 0x45, 0xe4, 0x39, 0xc6, - 0xca, 0xce, 0xcd, 0xd8, 0xdf, 0xb2, 0xe4, 0x59, 0x0c, 0x93, 0x8d, 0x64, 0xf0, 0x28, 0xf9, 0x76, - 0x63, 0x54, 0x94, 0xa0, 0x40, 0xf6, 0xa7, 0x15, 0x65, 0xcb, 0xfc, 0xcb, 0x85, 0x27, 0xb1, 0x63, - 0x75, 0x66, 0xd9, 0x30, 0xd9, 0x4c, 0x81, 0x74, 0x17, 0x07, 0x68, 0x2b, 0x14, 0x9c, 0x53, 0x0d, - 0x92, 0xf2, 0x60, 0x00, 0xac, 0xd5, 0xd6, 0x69, 0x11, 0x7f, 0xb5, 0xb0, 0xa4, 0x37, 0xe9, 0xac, - 0x5b, 0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x8c, 0x09, 0x93, 0x8d, - 0xe9, 0xe4, 0xdd, 0x13, 0x54, 0x6e, 0x33, 0xa5, 0x85, 0x64, 0x61, 0x10, 0x41, 0x93, 0xd1, 0x58, - 0x79, 0xdb, 0xa6, 0xca, 0xef, 0x67, 0x7d, 0x7e, 0x3b, 0x03, 0x93, 0xd2, 0x04, 0x3a, 0xb3, 0xc8, - 0xd1, 0xca, 0xbf, 0x2f, 0x7d, 0xa7, 0xfe, 0xf4, 0xf2, 0x9f, 0x6a, 0xe1, 0xf2, 0xaa, 0xea, 0xbc, - 0xba, 0xaa, 0x3a, 0x7f, 0x5f, 0x55, 0x9d, 0x5f, 0xaf, 0xab, 0x85, 0x57, 0xd7, 0xd5, 0xc2, 0x9f, - 0xd7, 0xd5, 0xc2, 0xf7, 0x9f, 0xe6, 0x3c, 0x27, 0x4f, 0xd0, 0x07, 0x31, 0xe8, 0x81, 0x90, 0x1d, - 0x33, 0xa8, 0xf5, 0xbf, 0xa8, 0x0d, 0xb3, 0x57, 0xab, 0x99, 0x41, 0x63, 0xcd, 0x3c, 0x44, 0x3f, - 0xfb, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x8b, 0xcb, 0x95, 0xa4, 0xd3, 0x0a, 0x00, 0x00, + // 1019 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0xbf, 0x6f, 0x23, 0x45, + 0x14, 0xf6, 0xe6, 0x17, 0xc9, 0xdc, 0x25, 0x76, 0x36, 0x3f, 0x6e, 0xc5, 0x05, 0x6f, 0x34, 0x12, + 0x28, 0xcd, 0xc5, 0x9c, 0x80, 0x26, 0x1d, 0xc9, 0x29, 0x5c, 0xd0, 0xe5, 0x38, 0x26, 0x87, 0x4e, + 0x82, 0x62, 0x35, 0x5e, 0xbf, 0xb3, 0x47, 0x9e, 0xdd, 0x31, 0x3b, 0x63, 0xc7, 0x4e, 0x43, 0x81, + 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0x41, 0x37, 0xf0, 0x7c, 0x2e, 0x24, 0x78, 0x2f, 0xa9, 0xaf, + 0x44, 0xe4, 0xcc, 0x6a, 0x53, 0xc7, 0x85, 0x4d, 0xdd, 0x37, 0xa6, 0xf2, 0x38, 0x31, 0xb1, 0x13, + 0xf8, 0x20, 0x46, 0x0f, 0x35, 0x18, 0x1b, 0x10, 0x11, 0xf5, 0x39, 0x78, 0x11, 0x9c, 0xd2, 0xa8, + 0x31, 0x32, 0x30, 0x37, 0x9d, 0x81, 0x3c, 0x4e, 0x4c, 0x6c, 0x03, 0x13, 0x8d, 0x26, 0x06, 0x7e, + 0xb0, 0xd0, 0xa6, 0x0c, 0x28, 0xe7, 0x13, 0x1b, 0x28, 0xd9, 0x19, 0x38, 0xf3, 0xda, 0xc3, 0x17, + 0x85, 0x3d, 0xbc, 0x67, 0x3c, 0xe4, 0xb3, 0x62, 0xb2, 0xae, 0x03, 0x99, 0xe3, 0x38, 0x61, 0x67, + 0xa0, 0x7d, 0x34, 0x58, 0x04, 0xbe, 0x9a, 0xf8, 0xc9, 0x4b, 0x00, 0x67, 0x61, 0x3a, 0x1f, 0xf9, + 0xac, 0x98, 0xac, 0x9b, 0x40, 0xc6, 0xc8, 0x21, 0xc0, 0xde, 0xdc, 0x2f, 0xaf, 0xdc, 0x12, 0xfe, + 0x67, 0x05, 0xcd, 0x3f, 0x17, 0x6d, 0x08, 0xed, 0x8f, 0x11, 0xaa, 0x53, 0x09, 0x5e, 0x03, 0x42, + 0x11, 0x38, 0x96, 0xb6, 0xb2, 0x71, 0x35, 0x74, 0x57, 0x0d, 0x79, 0x1a, 0xc3, 0x64, 0x29, 0x5e, + 0x3c, 0x8a, 0x9f, 0xed, 0x10, 0xad, 0x44, 0x20, 0x21, 0xea, 0x8d, 0x3b, 0xca, 0xb4, 0xf9, 0x67, + 0x85, 0x8b, 0xd8, 0x30, 0x3a, 0x93, 0x6c, 0x98, 0x2c, 0x27, 0x40, 0x72, 0x8a, 0xa7, 0x68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, 0x51, 0x88, 0xbf, 0x45, 0x1e, 0x84, 0xa0, 0x4e, 0x45, 0xd4, 0xd6, 0x8b, 0x5a, 0xef, + 0x93, 0x5a, 0x3f, 0xfd, 0x7c, 0xd1, 0x7a, 0xf5, 0x05, 0xfd, 0x45, 0xf2, 0xd1, 0x7f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0x8c, 0xd9, 0x5c, 0x30, 0xdc, 0x0c, 0x00, 0x00, } func (this *Token) Equal(that interface{}) bool { @@ -386,6 +494,74 @@ func (this *Token) Equal(that interface{}) bool { } return true } +func (this *SpecialAssetPair) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SpecialAssetPair) + if !ok { + that2, ok := that.(SpecialAssetPair) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Collateral != that1.Collateral { + return false + } + if this.Borrow != that1.Borrow { + return false + } + if !this.CollateralWeight.Equal(that1.CollateralWeight) { + return false + } + if !this.LiquidationThreshold.Equal(that1.LiquidationThreshold) { + return false + } + return true +} +func (this *SpecialAssetSet) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*SpecialAssetSet) + if !ok { + that2, ok := that.(SpecialAssetSet) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.Assets) != len(that1.Assets) { + return false + } + for i := range this.Assets { + if this.Assets[i] != that1.Assets[i] { + return false + } + } + if !this.CollateralWeight.Equal(that1.CollateralWeight) { + return false + } + if !this.LiquidationThreshold.Equal(that1.LiquidationThreshold) { + return false + } + return true +} func (m *Params) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -664,6 +840,115 @@ func (m *Token) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *SpecialAssetPair) 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 *SpecialAssetPair) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpecialAssetPair) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.LiquidationThreshold.Size() + i -= size + if _, err := m.LiquidationThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLeverage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size := m.CollateralWeight.Size() + i -= size + if _, err := m.CollateralWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLeverage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Borrow) > 0 { + i -= len(m.Borrow) + copy(dAtA[i:], m.Borrow) + i = encodeVarintLeverage(dAtA, i, uint64(len(m.Borrow))) + i-- + dAtA[i] = 0x12 + } + if len(m.Collateral) > 0 { + i -= len(m.Collateral) + copy(dAtA[i:], m.Collateral) + i = encodeVarintLeverage(dAtA, i, uint64(len(m.Collateral))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SpecialAssetSet) 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 *SpecialAssetSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SpecialAssetSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.LiquidationThreshold.Size() + i -= size + if _, err := m.LiquidationThreshold.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLeverage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + { + size := m.CollateralWeight.Size() + i -= size + if _, err := m.CollateralWeight.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintLeverage(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Assets) > 0 { + for iNdEx := len(m.Assets) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Assets[iNdEx]) + copy(dAtA[i:], m.Assets[iNdEx]) + i = encodeVarintLeverage(dAtA, i, uint64(len(m.Assets[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintLeverage(dAtA []byte, offset int, v uint64) int { offset -= sovLeverage(v) base := offset @@ -750,6 +1035,46 @@ func (m *Token) Size() (n int) { return n } +func (m *SpecialAssetPair) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Collateral) + if l > 0 { + n += 1 + l + sovLeverage(uint64(l)) + } + l = len(m.Borrow) + if l > 0 { + n += 1 + l + sovLeverage(uint64(l)) + } + l = m.CollateralWeight.Size() + n += 1 + l + sovLeverage(uint64(l)) + l = m.LiquidationThreshold.Size() + n += 1 + l + sovLeverage(uint64(l)) + return n +} + +func (m *SpecialAssetSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Assets) > 0 { + for _, s := range m.Assets { + l = len(s) + n += 1 + l + sovLeverage(uint64(l)) + } + } + l = m.CollateralWeight.Size() + n += 1 + l + sovLeverage(uint64(l)) + l = m.LiquidationThreshold.Size() + n += 1 + l + sovLeverage(uint64(l)) + return n +} + func sovLeverage(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1596,6 +1921,338 @@ func (m *Token) Unmarshal(dAtA []byte) error { } return nil } +func (m *SpecialAssetPair) 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 ErrIntOverflowLeverage + } + 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: SpecialAssetPair: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpecialAssetPair: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Collateral", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Collateral = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Borrow", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Borrow = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLeverage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLeverage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SpecialAssetSet) 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 ErrIntOverflowLeverage + } + 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: SpecialAssetSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SpecialAssetSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Assets", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Assets = append(m.Assets, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CollateralWeight", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.CollateralWeight.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationThreshold", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLeverage + } + 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 ErrInvalidLengthLeverage + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLeverage + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LiquidationThreshold.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipLeverage(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLeverage + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipLeverage(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/leverage/types/msgs.go b/x/leverage/types/msgs.go index 67f931fcff..3346c89d13 100644 --- a/x/leverage/types/msgs.go +++ b/x/leverage/types/msgs.go @@ -1,29 +1,32 @@ package types import ( + "fmt" + "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/umee-network/umee/v5/util/checkers" "gopkg.in/yaml.v3" ) -var _ sdk.Msg = &MsgGovUpdateRegistry{} +var ( + _, _ sdk.Msg = &MsgGovUpdateRegistry{}, &MsgGovUpdateSpecialAssets{} + _, _ legacytx.LegacyMsg = &MsgGovUpdateRegistry{}, &MsgGovUpdateSpecialAssets{} +) -// NewMsgUpdateRegistry will create a new MsgUpdateRegistry instance -func NewMsgUpdateRegistry(authority, title, description string, updateTokens, addTokens []Token) *MsgGovUpdateRegistry { +// NewMsgGovUpdateRegistry will create a new MsgUpdateRegistry instance +func NewMsgGovUpdateRegistry(authority, title, description string, update, add []Token) *MsgGovUpdateRegistry { return &MsgGovUpdateRegistry{ Title: title, Description: description, - UpdateTokens: updateTokens, - AddTokens: addTokens, + UpdateTokens: update, + AddTokens: add, Authority: authority, } } -// Type implements Msg interface -func (msg MsgGovUpdateRegistry) Type() string { return sdk.MsgTypeURL(&msg) } - // String implements the Stringer interface. func (msg MsgGovUpdateRegistry) String() string { out, _ := yaml.Marshal(msg) @@ -63,12 +66,6 @@ func (msg MsgGovUpdateRegistry) ValidateBasic() error { return nil } -// GetSignBytes implements Msg -func (msg MsgGovUpdateRegistry) GetSignBytes() []byte { - bz := ModuleCdc.MustMarshalJSON(&msg) - return sdk.MustSortJSON(bz) -} - // GetSigners implements Msg func (msg MsgGovUpdateRegistry) GetSigners() []sdk.AccAddress { return checkers.Signers(msg.Authority) @@ -85,3 +82,96 @@ func validateRegistryTokenDenoms(tokens []Token) error { } return nil } + +// NewMsgGovUpdateSpecialAssets will create a new MsgGovUpdateSpecialAssets instance +func NewMsgGovUpdateSpecialAssets(authority string, sets []SpecialAssetSet, pairs []SpecialAssetPair, +) *MsgGovUpdateSpecialAssets { + return &MsgGovUpdateSpecialAssets{ + Authority: authority, + Sets: sets, + Pairs: pairs, + } +} + +// GetSigners implements Msg +func (msg MsgGovUpdateSpecialAssets) GetSigners() []sdk.AccAddress { + return checkers.Signers(msg.Authority) +} + +// String implements the Stringer interface. +func (msg MsgGovUpdateSpecialAssets) String() string { + // return fmt.Sprintf("", msg.Authority, msg.MinGasPrice.String()) + return fmt.Sprintf( + "authority: %s, sets: %s, pairs: %s", + msg.Authority, + msg.Sets, + msg.Pairs, + ) +} + +// ValidateBasic implements Msg +func (msg MsgGovUpdateSpecialAssets) ValidateBasic() error { + if err := checkers.IsGovAuthority(msg.Authority); err != nil { + return err + } + + if len(msg.Pairs) == 0 && len(msg.Sets) == 0 { + return ErrEmptyUpdateSpecialAssets + } + + if err := validateSpecialAssetPairs(msg.Pairs); err != nil { + return err + } + + ascendingWeight := sdk.ZeroDec() + for _, set := range msg.Sets { + // ensures sets are sorted from lowest to highest collateral weight + // to ensure overlapping sets cause the higher collateral weight to + // be stored in state + if set.CollateralWeight.IsPositive() { + if set.CollateralWeight.LT(ascendingWeight) { + return ErrProposedSetOrder + } + ascendingWeight = set.CollateralWeight + } + if err := set.Validate(); err != nil { + return errors.Wrapf(err, "special asset set [%s]", set.String()) + } + } + + return nil +} + +// validateSpecialAssetPairs returns error if duplicate special asset pairs exist or +// if any individual pairs are invalid. +func validateSpecialAssetPairs(pairs []SpecialAssetPair) error { + for _, pair := range pairs { + if err := pair.Validate(); err != nil { + return err + } + } + assetPairs := map[string]bool{} + for _, pair := range pairs { + s := pair.Collateral + "," + pair.Borrow + if _, ok := assetPairs[s]; ok { + return ErrDuplicatePair.Wrapf("[%s, %s]", pair.Collateral, pair.Borrow) + } + assetPairs[s] = true + } + return nil +} + +// LegacyMsg.Type implementations + +func (msg MsgGovUpdateRegistry) Type() string { return sdk.MsgTypeURL(&msg) } +func (msg MsgGovUpdateSpecialAssets) Type() string { return sdk.MsgTypeURL(&msg) } +func (msg MsgGovUpdateRegistry) Route() string { return "" } +func (msg MsgGovUpdateSpecialAssets) Route() string { return "" } + +func (msg MsgGovUpdateSpecialAssets) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} + +func (msg MsgGovUpdateRegistry) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&msg)) +} diff --git a/x/leverage/types/msgs_test.go b/x/leverage/types/msgs_test.go index 181bf7e906..49b30f39f7 100644 --- a/x/leverage/types/msgs_test.go +++ b/x/leverage/types/msgs_test.go @@ -138,7 +138,7 @@ func TestMsgGovUpdateRegistryOtherFunctionality(t *testing.T) { MaxSupply: sdk.NewInt(100_000_000000), HistoricMedians: 24, } - msg := types.NewMsgUpdateRegistry( + msg := types.NewMsgGovUpdateRegistry( authtypes.NewModuleAddress(govtypes.ModuleName).String(), "title", "description", []types.Token{umee}, []types.Token{}, ) @@ -172,3 +172,5 @@ updatetokens: tassert.NotNil(t, msg.GetSignBytes(), "sign byte shouldn't be nil") tassert.NotEmpty(t, msg.GetSigners(), "signers shouldn't be empty") } + +// TODO : tests for MsgGovUpdateSpecialAssets diff --git a/x/leverage/types/query.pb.go b/x/leverage/types/query.pb.go index 15648bad23..8dacf15efa 100644 --- a/x/leverage/types/query.pb.go +++ b/x/leverage/types/query.pb.go @@ -187,6 +187,85 @@ func (m *QueryRegisteredTokensResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryRegisteredTokensResponse proto.InternalMessageInfo +// QuerySpecialAssets defines the request structure for the SpecialAssets +// gRPC service handler. +type QuerySpecialAssets struct { + // denom can be used to query only pairs affecting a specific asset + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QuerySpecialAssets) Reset() { *m = QuerySpecialAssets{} } +func (m *QuerySpecialAssets) String() string { return proto.CompactTextString(m) } +func (*QuerySpecialAssets) ProtoMessage() {} +func (*QuerySpecialAssets) Descriptor() ([]byte, []int) { + return fileDescriptor_1e8137dcabb0ccc7, []int{4} +} +func (m *QuerySpecialAssets) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpecialAssets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpecialAssets.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 *QuerySpecialAssets) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpecialAssets.Merge(m, src) +} +func (m *QuerySpecialAssets) XXX_Size() int { + return m.Size() +} +func (m *QuerySpecialAssets) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpecialAssets.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpecialAssets proto.InternalMessageInfo + +// QuerySpecialAssetsResponse defines the response structure for the +// SpecialAssets gRPC service handler. +type QuerySpecialAssetsResponse struct { + Pairs []SpecialAssetPair `protobuf:"bytes,1,rep,name=pairs,proto3" json:"pairs"` +} + +func (m *QuerySpecialAssetsResponse) Reset() { *m = QuerySpecialAssetsResponse{} } +func (m *QuerySpecialAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySpecialAssetsResponse) ProtoMessage() {} +func (*QuerySpecialAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1e8137dcabb0ccc7, []int{5} +} +func (m *QuerySpecialAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySpecialAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySpecialAssetsResponse.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 *QuerySpecialAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySpecialAssetsResponse.Merge(m, src) +} +func (m *QuerySpecialAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySpecialAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySpecialAssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySpecialAssetsResponse proto.InternalMessageInfo + // QueryMarketSummary defines the request structure for the MarketSummary gRPC service handler. type QueryMarketSummary struct { Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` @@ -196,7 +275,7 @@ func (m *QueryMarketSummary) Reset() { *m = QueryMarketSummary{} } func (m *QueryMarketSummary) String() string { return proto.CompactTextString(m) } func (*QueryMarketSummary) ProtoMessage() {} func (*QueryMarketSummary) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{4} + return fileDescriptor_1e8137dcabb0ccc7, []int{6} } func (m *QueryMarketSummary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -272,7 +351,7 @@ func (m *QueryMarketSummaryResponse) Reset() { *m = QueryMarketSummaryRe func (m *QueryMarketSummaryResponse) String() string { return proto.CompactTextString(m) } func (*QueryMarketSummaryResponse) ProtoMessage() {} func (*QueryMarketSummaryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{5} + return fileDescriptor_1e8137dcabb0ccc7, []int{7} } func (m *QueryMarketSummaryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -310,7 +389,7 @@ func (m *QueryAccountBalances) Reset() { *m = QueryAccountBalances{} } func (m *QueryAccountBalances) String() string { return proto.CompactTextString(m) } func (*QueryAccountBalances) ProtoMessage() {} func (*QueryAccountBalances) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{6} + return fileDescriptor_1e8137dcabb0ccc7, []int{8} } func (m *QueryAccountBalances) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -353,7 +432,7 @@ func (m *QueryAccountBalancesResponse) Reset() { *m = QueryAccountBalanc func (m *QueryAccountBalancesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAccountBalancesResponse) ProtoMessage() {} func (*QueryAccountBalancesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{7} + return fileDescriptor_1e8137dcabb0ccc7, []int{9} } func (m *QueryAccountBalancesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -391,7 +470,7 @@ func (m *QueryAccountSummary) Reset() { *m = QueryAccountSummary{} } func (m *QueryAccountSummary) String() string { return proto.CompactTextString(m) } func (*QueryAccountSummary) ProtoMessage() {} func (*QueryAccountSummary) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{8} + return fileDescriptor_1e8137dcabb0ccc7, []int{10} } func (m *QueryAccountSummary) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -449,7 +528,7 @@ func (m *QueryAccountSummaryResponse) Reset() { *m = QueryAccountSummary func (m *QueryAccountSummaryResponse) String() string { return proto.CompactTextString(m) } func (*QueryAccountSummaryResponse) ProtoMessage() {} func (*QueryAccountSummaryResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{9} + return fileDescriptor_1e8137dcabb0ccc7, []int{11} } func (m *QueryAccountSummaryResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,7 +565,7 @@ func (m *QueryLiquidationTargets) Reset() { *m = QueryLiquidationTargets func (m *QueryLiquidationTargets) String() string { return proto.CompactTextString(m) } func (*QueryLiquidationTargets) ProtoMessage() {} func (*QueryLiquidationTargets) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{10} + return fileDescriptor_1e8137dcabb0ccc7, []int{12} } func (m *QueryLiquidationTargets) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -525,7 +604,7 @@ func (m *QueryLiquidationTargetsResponse) Reset() { *m = QueryLiquidatio func (m *QueryLiquidationTargetsResponse) String() string { return proto.CompactTextString(m) } func (*QueryLiquidationTargetsResponse) ProtoMessage() {} func (*QueryLiquidationTargetsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{11} + return fileDescriptor_1e8137dcabb0ccc7, []int{13} } func (m *QueryLiquidationTargetsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -563,7 +642,7 @@ func (m *QueryBadDebts) Reset() { *m = QueryBadDebts{} } func (m *QueryBadDebts) String() string { return proto.CompactTextString(m) } func (*QueryBadDebts) ProtoMessage() {} func (*QueryBadDebts) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{12} + return fileDescriptor_1e8137dcabb0ccc7, []int{14} } func (m *QueryBadDebts) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -602,7 +681,7 @@ func (m *QueryBadDebtsResponse) Reset() { *m = QueryBadDebtsResponse{} } func (m *QueryBadDebtsResponse) String() string { return proto.CompactTextString(m) } func (*QueryBadDebtsResponse) ProtoMessage() {} func (*QueryBadDebtsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{13} + return fileDescriptor_1e8137dcabb0ccc7, []int{15} } func (m *QueryBadDebtsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -643,7 +722,7 @@ func (m *QueryMaxWithdraw) Reset() { *m = QueryMaxWithdraw{} } func (m *QueryMaxWithdraw) String() string { return proto.CompactTextString(m) } func (*QueryMaxWithdraw) ProtoMessage() {} func (*QueryMaxWithdraw) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{14} + return fileDescriptor_1e8137dcabb0ccc7, []int{16} } func (m *QueryMaxWithdraw) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -684,7 +763,7 @@ func (m *QueryMaxWithdrawResponse) Reset() { *m = QueryMaxWithdrawRespon func (m *QueryMaxWithdrawResponse) String() string { return proto.CompactTextString(m) } func (*QueryMaxWithdrawResponse) ProtoMessage() {} func (*QueryMaxWithdrawResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{15} + return fileDescriptor_1e8137dcabb0ccc7, []int{17} } func (m *QueryMaxWithdrawResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +804,7 @@ func (m *QueryMaxBorrow) Reset() { *m = QueryMaxBorrow{} } func (m *QueryMaxBorrow) String() string { return proto.CompactTextString(m) } func (*QueryMaxBorrow) ProtoMessage() {} func (*QueryMaxBorrow) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{16} + return fileDescriptor_1e8137dcabb0ccc7, []int{18} } func (m *QueryMaxBorrow) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -764,7 +843,7 @@ func (m *QueryMaxBorrowResponse) Reset() { *m = QueryMaxBorrowResponse{} func (m *QueryMaxBorrowResponse) String() string { return proto.CompactTextString(m) } func (*QueryMaxBorrowResponse) ProtoMessage() {} func (*QueryMaxBorrowResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{17} + return fileDescriptor_1e8137dcabb0ccc7, []int{19} } func (m *QueryMaxBorrowResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -812,7 +891,7 @@ func (m *QueryInspect) Reset() { *m = QueryInspect{} } func (m *QueryInspect) String() string { return proto.CompactTextString(m) } func (*QueryInspect) ProtoMessage() {} func (*QueryInspect) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{18} + return fileDescriptor_1e8137dcabb0ccc7, []int{20} } func (m *QueryInspect) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -850,7 +929,7 @@ func (m *QueryInspectResponse) Reset() { *m = QueryInspectResponse{} } func (m *QueryInspectResponse) String() string { return proto.CompactTextString(m) } func (*QueryInspectResponse) ProtoMessage() {} func (*QueryInspectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{19} + return fileDescriptor_1e8137dcabb0ccc7, []int{21} } func (m *QueryInspectResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -893,7 +972,7 @@ func (m *InspectAccount) Reset() { *m = InspectAccount{} } func (m *InspectAccount) String() string { return proto.CompactTextString(m) } func (*InspectAccount) ProtoMessage() {} func (*InspectAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{20} + return fileDescriptor_1e8137dcabb0ccc7, []int{22} } func (m *InspectAccount) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -936,7 +1015,7 @@ func (m *RiskInfo) Reset() { *m = RiskInfo{} } func (m *RiskInfo) String() string { return proto.CompactTextString(m) } func (*RiskInfo) ProtoMessage() {} func (*RiskInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{21} + return fileDescriptor_1e8137dcabb0ccc7, []int{23} } func (m *RiskInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -977,7 +1056,7 @@ func (m *DecBalances) Reset() { *m = DecBalances{} } func (m *DecBalances) String() string { return proto.CompactTextString(m) } func (*DecBalances) ProtoMessage() {} func (*DecBalances) Descriptor() ([]byte, []int) { - return fileDescriptor_1e8137dcabb0ccc7, []int{22} + return fileDescriptor_1e8137dcabb0ccc7, []int{24} } func (m *DecBalances) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1011,6 +1090,8 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "umee.leverage.v1.QueryParamsResponse") proto.RegisterType((*QueryRegisteredTokens)(nil), "umee.leverage.v1.QueryRegisteredTokens") proto.RegisterType((*QueryRegisteredTokensResponse)(nil), "umee.leverage.v1.QueryRegisteredTokensResponse") + proto.RegisterType((*QuerySpecialAssets)(nil), "umee.leverage.v1.QuerySpecialAssets") + proto.RegisterType((*QuerySpecialAssetsResponse)(nil), "umee.leverage.v1.QuerySpecialAssetsResponse") proto.RegisterType((*QueryMarketSummary)(nil), "umee.leverage.v1.QueryMarketSummary") proto.RegisterType((*QueryMarketSummaryResponse)(nil), "umee.leverage.v1.QueryMarketSummaryResponse") proto.RegisterType((*QueryAccountBalances)(nil), "umee.leverage.v1.QueryAccountBalances") @@ -1035,114 +1116,118 @@ func init() { func init() { proto.RegisterFile("umee/leverage/v1/query.proto", fileDescriptor_1e8137dcabb0ccc7) } var fileDescriptor_1e8137dcabb0ccc7 = []byte{ - // 1700 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xdf, 0x6f, 0x1b, 0xc5, - 0x16, 0xc7, 0xb3, 0x49, 0x9b, 0x1f, 0xc7, 0x71, 0x92, 0x4e, 0xd3, 0x74, 0xeb, 0x26, 0xb6, 0xbb, - 0x6d, 0xd2, 0xb4, 0xbd, 0xb1, 0x9b, 0x54, 0xb7, 0xd2, 0xd5, 0xbd, 0xd2, 0xa5, 0x6e, 0x40, 0x14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 0xb3, 0x42, 0xbb, 0x1c, 0x6d, 0x04, 0x24, 0xdc, 0xf0, 0x5d, 0x5b, 0x54, 0x27, 0x87, 0x3d, 0xba, - 0xd3, 0x31, 0xd8, 0x7d, 0xc9, 0x32, 0xce, 0xc0, 0x69, 0xb6, 0xbe, 0x6b, 0xb1, 0x4e, 0x1c, 0x54, - 0x49, 0x14, 0x1a, 0xff, 0x85, 0x5c, 0x97, 0x2e, 0xb5, 0xfc, 0x3a, 0x8c, 0x44, 0xfc, 0x11, 0x3b, - 0x8d, 0x63, 0xa6, 0x6c, 0x1a, 0x93, 0x90, 0x66, 0x83, 0x4b, 0xd8, 0x5e, 0x25, 0x95, 0x28, 0x34, - 0x4c, 0x51, 0x4b, 0xcb, 0x07, 0xb1, 0x5a, 0xb8, 0x83, 0x41, 0xf7, 0x7e, 0xa2, 0x14, 0x16, 0x83, - 0x44, 0x31, 0xac, 0x9c, 0x94, 0x60, 0x4a, 0x94, 0xb7, 0xdb, 0x2a, 0xb3, 0x76, 0xdd, 0xcb, 0xed, - 0x1a, 0x79, 0x30, 0x5e, 0x23, 0xff, 0xae, 0x81, 0xbe, 0x17, 0xa2, 0xb4, 0x11, 0x18, 0xe1, 0x17, - 0x4e, 0x78, 0x14, 0xd9, 0x46, 0xb2, 0x91, 0x05, 0xc3, 0x11, 0xf7, 0x72, 0x04, 0x89, 0x46, 0xa0, - 0x8d, 0x37, 0x60, 0x42, 0xce, 0x53, 0xdc, 0x71, 0x87, 0x0d, 0xd5, 0x33, 0x98, 0xe9, 0x24, 0xa8, - 0x38, 0xb5, 0x27, 0xa0, 0x1d, 0xdd, 0x04, 0x3e, 0xd5, 0x60, 0x9c, 0xf9, 0xbf, 0xe5, 0x85, 0x75, - 0x62, 0x45, 0xf4, 0xde, 0xe1, 0xef, 0x2a, 0x42, 0xbe, 0x68, 0xd1, 0x97, 0x16, 0x95, 0x4e, 0xe9, - 0x04, 0xb4, 0x58, 0xe5, 0x97, 0xed, 0xc8, 0xeb, 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d, 0x00, 0x00, 0xff, 0xff, 0x15, 0xc0, 0x9e, 0x39, - 0x58, 0x17, 0x00, 0x00, + // 1766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0xdb, 0xc8, + 0x15, 0xc7, 0x4d, 0x3b, 0xfe, 0xf5, 0x64, 0xd9, 0xce, 0xc4, 0x71, 0x18, 0xc5, 0x96, 0x14, 0x26, + 0x76, 0x9c, 0xa4, 0x96, 0x62, 0x07, 0x0d, 0x50, 0xb4, 0x68, 0x6b, 0xc5, 0x2d, 0x9a, 0xc2, 0x09, + 0x1c, 0xe6, 0x47, 0x91, 0x1f, 0xad, 0x30, 0x22, 0xa7, 0x32, 0x61, 0x8a, 0x54, 0x38, 0x94, 0x6c, + 0x15, 0xc8, 0xa5, 0x40, 0x6f, 0x2d, 0xd0, 0xa2, 0xe8, 0xa1, 0x87, 0x3d, 0xec, 0x75, 0xff, 0x12, + 0x1f, 0x03, 0xec, 0x65, 0xb1, 0xc0, 0x7a, 0x77, 0x93, 0xc5, 0x1e, 0x72, 0xd9, 0x7f, 0x60, 0x17, + 0x58, 0xcc, 0x0f, 0x8e, 0x28, 0x53, 0x72, 0x64, 0x61, 0x7d, 0x92, 0x86, 0xf3, 0xde, 0xe7, 0x7d, + 0xf9, 0x66, 0xf8, 0xe6, 0x91, 0xb0, 0xd0, 0xa8, 0x11, 0x52, 0x74, 0x49, 0x93, 0x04, 0xb8, 0x4a, + 0x8a, 0xcd, 0xb5, 0xe2, 0xab, 0x06, 0x09, 0x5a, 0x85, 0x7a, 0xe0, 0x87, 0x3e, 0x9a, 0x65, 0xb3, + 0x85, 0x68, 0xb6, 0xd0, 0x5c, 0xcb, 0x2c, 0x54, 0x7d, 0xbf, 0xea, 0x92, 0x22, 0xae, 0x3b, 0x45, + 0xec, 0x79, 0x7e, 0x88, 0x43, 0xc7, 0xf7, 0xa8,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x1a, + 0xfe, 0xe9, 0x43, 0xc5, 0x4b, 0x5b, 0x35, 0x56, 0xda, 0x46, 0x4e, 0xe1, 0xae, 0x22, 0xb8, 0x51, + 0x94, 0x9d, 0x9a, 0x4c, 0x6f, 0xd4, 0x3d, 0xf4, 0x5e, 0x90, 0xc3, 0x11, 0xb8, 0xd4, 0xc5, 0x43, + 0xad, 0xc7, 0x13, 0x98, 0x8e, 0x52, 0x56, 0x6e, 0x62, 0xb7, 0x41, 0x04, 0xe0, 0x44, 0xdb, 0x97, + 0xed, 0xab, 0x74, 0x44, 0x79, 0xca, 0x20, 0xec, 0xc1, 0x6e, 0xa7, 0x47, 0x82, 0x87, 0x07, 0x02, + 0xcf, 0xb4, 0x39, 0x02, 0xfd, 0x04, 0xa6, 0xa3, 0x74, 0x48, 0xf0, 0xc8, 0x60, 0x8a, 0x23, 0x8a, + 0xc0, 0x3e, 0x84, 0x29, 0x79, 0x3c, 0xbb, 0x4e, 0xcd, 0x09, 0x65, 0xc7, 0x72, 0x52, 0x68, 0x4a, + 0x30, 0xb6, 0x18, 0x02, 0x59, 0x70, 0x5e, 0x14, 0x66, 0xde, 0xf2, 0x97, 0xc3, 0x9d, 0x80, 0xd0, + 0x1d, 0xdf, 0xb5, 0x65, 0x77, 0x72, 0xd2, 0x47, 0x77, 0x2e, 0x06, 0x7b, 0x1c, 0xb1, 0x8c, 0x8b, + 0x70, 0x81, 0xaf, 0xef, 0x56, 0x6c, 0x12, 0x07, 0x55, 0x12, 0x52, 0xe3, 0x97, 0x90, 0xeb, 0x31, + 0xa5, 0x96, 0x5f, 0x87, 0xf1, 0x50, 0x5c, 0xe2, 0x4f, 0xe3, 0xa4, 0x19, 0x0d, 0x8d, 0x19, 0x48, + 0x73, 0xe7, 0x12, 0xb6, 0x37, 0x49, 0x25, 0xa4, 0x86, 0x29, 0xbb, 0xfa, 0xe8, 0x42, 0xac, 0x2b, + 0xef, 0x60, 0xb0, 0xbd, 0x9f, 0x68, 0x89, 0xa5, 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87, 0x6d, 0x94, 0x88, 0x65, 0x2e, 0x22, + 0x8f, 0xb2, 0xdd, 0x36, 0xf5, 0xbe, 0x7a, 0xcd, 0x46, 0xaf, 0x61, 0xb2, 0xdd, 0xa5, 0xe4, 0x7b, + 0x07, 0x10, 0x16, 0x99, 0x95, 0x0f, 0x59, 0x28, 0x01, 0x57, 0xb9, 0x80, 0x2c, 0x5a, 0xe8, 0x2e, + 0x40, 0xd4, 0x62, 0x14, 0xc2, 0x78, 0xd4, 0x62, 0x64, 0x7b, 0xa0, 0xe5, 0x7c, 0x66, 0xf9, 0xf8, + 0x79, 0x15, 0xf8, 0x32, 0x0f, 0x7c, 0x09, 0x5d, 0x4c, 0x06, 0x76, 0x84, 0x69, 0xe9, 0xc1, 0xc1, + 0xd7, 0xd9, 0xa1, 0x83, 0xb7, 0x59, 0xed, 0xcd, 0xdb, 0xac, 0xf6, 0xd5, 0xdb, 0xac, 0xf6, 0xef, + 0x77, 0xd9, 0xa1, 0x37, 0xef, 0xb2, 0x43, 0x9f, 0xbd, 0xcb, 0x0e, 0x3d, 0xbf, 0x15, 0x3b, 0x54, + 0x18, 0x62, 0xd5, 0x23, 0xe1, 0x9e, 0x1f, 0xec, 0x0a, 0x5e, 0xf3, 0xe7, 0xc5, 0xfd, 0x36, 0x94, + 0x1f, 0x31, 0x95, 0x31, 0xfe, 0xad, 0xfe, 0xf6, 0x8f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xbf, + 0xda, 0x3f, 0x72, 0x18, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1161,6 +1246,8 @@ type QueryClient interface { Params(ctx context.Context, in *QueryParams, opts ...grpc.CallOption) (*QueryParamsResponse, error) // RegisteredTokens queries for all the registered tokens. RegisteredTokens(ctx context.Context, in *QueryRegisteredTokens, opts ...grpc.CallOption) (*QueryRegisteredTokensResponse, error) + // SpecialAssets queries for all special asset pairs. + SpecialAssets(ctx context.Context, in *QuerySpecialAssets, opts ...grpc.CallOption) (*QuerySpecialAssetsResponse, error) // MarketSummary queries a base asset's current borrowing and supplying conditions. MarketSummary(ctx context.Context, in *QueryMarketSummary, opts ...grpc.CallOption) (*QueryMarketSummaryResponse, error) // AccountBalances queries an account's current supply, collateral, and borrow positions. @@ -1210,6 +1297,15 @@ func (c *queryClient) RegisteredTokens(ctx context.Context, in *QueryRegisteredT return out, nil } +func (c *queryClient) SpecialAssets(ctx context.Context, in *QuerySpecialAssets, opts ...grpc.CallOption) (*QuerySpecialAssetsResponse, error) { + out := new(QuerySpecialAssetsResponse) + err := c.cc.Invoke(ctx, "/umee.leverage.v1.Query/SpecialAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) MarketSummary(ctx context.Context, in *QueryMarketSummary, opts ...grpc.CallOption) (*QueryMarketSummaryResponse, error) { out := new(QueryMarketSummaryResponse) err := c.cc.Invoke(ctx, "/umee.leverage.v1.Query/MarketSummary", in, out, opts...) @@ -1288,6 +1384,8 @@ type QueryServer interface { Params(context.Context, *QueryParams) (*QueryParamsResponse, error) // RegisteredTokens queries for all the registered tokens. RegisteredTokens(context.Context, *QueryRegisteredTokens) (*QueryRegisteredTokensResponse, error) + // SpecialAssets queries for all special asset pairs. + SpecialAssets(context.Context, *QuerySpecialAssets) (*QuerySpecialAssetsResponse, error) // MarketSummary queries a base asset's current borrowing and supplying conditions. MarketSummary(context.Context, *QueryMarketSummary) (*QueryMarketSummaryResponse, error) // AccountBalances queries an account's current supply, collateral, and borrow positions. @@ -1321,6 +1419,9 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParams) ( func (*UnimplementedQueryServer) RegisteredTokens(ctx context.Context, req *QueryRegisteredTokens) (*QueryRegisteredTokensResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisteredTokens not implemented") } +func (*UnimplementedQueryServer) SpecialAssets(ctx context.Context, req *QuerySpecialAssets) (*QuerySpecialAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SpecialAssets not implemented") +} func (*UnimplementedQueryServer) MarketSummary(ctx context.Context, req *QueryMarketSummary) (*QueryMarketSummaryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketSummary not implemented") } @@ -1386,6 +1487,24 @@ func _Query_RegisteredTokens_Handler(srv interface{}, ctx context.Context, dec f return interceptor(ctx, in, info, handler) } +func _Query_SpecialAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySpecialAssets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SpecialAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.leverage.v1.Query/SpecialAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SpecialAssets(ctx, req.(*QuerySpecialAssets)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_MarketSummary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryMarketSummary) if err := dec(in); err != nil { @@ -1542,6 +1661,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisteredTokens", Handler: _Query_RegisteredTokens_Handler, }, + { + MethodName: "SpecialAssets", + Handler: _Query_SpecialAssets_Handler, + }, { MethodName: "MarketSummary", Handler: _Query_MarketSummary_Handler, @@ -1702,6 +1825,73 @@ func (m *QueryRegisteredTokensResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } +func (m *QuerySpecialAssets) 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 *QuerySpecialAssets) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpecialAssets) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Denom) > 0 { + i -= len(m.Denom) + copy(dAtA[i:], m.Denom) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySpecialAssetsResponse) 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 *QuerySpecialAssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySpecialAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *QueryMarketSummary) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2731,6 +2921,34 @@ func (m *QueryRegisteredTokensResponse) Size() (n int) { return n } +func (m *QuerySpecialAssets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySpecialAssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *QueryMarketSummary) Size() (n int) { if m == nil { return 0 @@ -3399,6 +3617,172 @@ func (m *QueryRegisteredTokensResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QuerySpecialAssets) 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: QuerySpecialAssets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpecialAssets: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", 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 + } + m.Denom = string(dAtA[iNdEx:postIndex]) + 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 (m *QuerySpecialAssetsResponse) 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: QuerySpecialAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySpecialAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, SpecialAssetPair{}) + if err := m.Pairs[len(m.Pairs)-1].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 (m *QueryMarketSummary) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/leverage/types/query.pb.gw.go b/x/leverage/types/query.pb.gw.go index c9ead1b7ce..fbd8829b8c 100644 --- a/x/leverage/types/query.pb.gw.go +++ b/x/leverage/types/query.pb.gw.go @@ -87,6 +87,42 @@ func local_request_Query_RegisteredTokens_0(ctx context.Context, marshaler runti } +var ( + filter_Query_SpecialAssets_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_SpecialAssets_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpecialAssets + 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_SpecialAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.SpecialAssets(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SpecialAssets_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySpecialAssets + 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_SpecialAssets_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.SpecialAssets(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_MarketSummary_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -391,6 +427,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_SpecialAssets_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_SpecialAssets_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_SpecialAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MarketSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -656,6 +715,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_SpecialAssets_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_SpecialAssets_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_SpecialAssets_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_MarketSummary_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -824,6 +903,8 @@ var ( pattern_Query_RegisteredTokens_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "registered_tokens"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_SpecialAssets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "special_assets"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_MarketSummary_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "market_summary"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_AccountBalances_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1", "account_balances"}, "", runtime.AssumeColonVerbOpt(false))) @@ -846,6 +927,8 @@ var ( forward_Query_RegisteredTokens_0 = runtime.ForwardResponseMessage + forward_Query_SpecialAssets_0 = runtime.ForwardResponseMessage + forward_Query_MarketSummary_0 = runtime.ForwardResponseMessage forward_Query_AccountBalances_0 = runtime.ForwardResponseMessage diff --git a/x/leverage/types/token.go b/x/leverage/types/token.go index 8020ab7f61..011d2f0207 100644 --- a/x/leverage/types/token.go +++ b/x/leverage/types/token.go @@ -60,21 +60,9 @@ func ToTokenDenom(denom string) string { // Validate performs validation on an Token type returning an error if the Token // is invalid. func (t Token) Validate() error { - if err := sdk.ValidateDenom(t.BaseDenom); err != nil { + if err := validateBaseDenoms(t.BaseDenom, t.SymbolDenom); err != nil { return err } - if HasUTokenPrefix(t.BaseDenom) { - // prevent base asset denoms that start with "u/" - return ErrUToken.Wrap(t.BaseDenom) - } - - if err := sdk.ValidateDenom(t.SymbolDenom); err != nil { - return err - } - if HasUTokenPrefix(t.SymbolDenom) { - // prevent symbol denoms that start with "u/" - return ErrUToken.Wrap(t.SymbolDenom) - } one := sdk.OneDec() @@ -210,3 +198,59 @@ func DefaultRegistry() []Token { defaultUmeeToken(), } } + +// Validate performs validation on an SpecialAssetPair type +func (p SpecialAssetPair) Validate() error { + if err := validateBaseDenoms(p.Collateral, p.Borrow); err != nil { + return err + } + + // Collateral Weight is non-negative and less than 1. + if p.CollateralWeight.IsNegative() || p.CollateralWeight.GTE(sdk.OneDec()) { + return fmt.Errorf("invalid collateral rate: %s", p.CollateralWeight) + } + + // Liquidation Threshold ranges between collateral weight and 1. + if p.LiquidationThreshold.LT(p.CollateralWeight) || p.LiquidationThreshold.GTE(sdk.OneDec()) { + return fmt.Errorf("invalid liquidation threshold: %s", p.LiquidationThreshold) + } + + return nil +} + +// Validate performs validation on an SpecialAssetSet type +func (s SpecialAssetSet) Validate() error { + if err := validateBaseDenoms(s.Assets...); err != nil { + return err + } + + denoms := map[string]bool{} + for _, a := range s.Assets { + if _, ok := denoms[a]; ok { + return ErrDuplicatePair + } + denoms[a] = true + } + + // Collateral Weight is non-negative and less than 1. + if s.CollateralWeight.IsNegative() || s.CollateralWeight.GTE(sdk.OneDec()) { + return fmt.Errorf("invalid collateral rate: %s", s.CollateralWeight) + } + + // Liquidation Threshold ranges between collateral weight and 1. + if s.LiquidationThreshold.LT(s.CollateralWeight) || s.LiquidationThreshold.GTE(sdk.OneDec()) { + return fmt.Errorf("invalid liquidation threshold: %s", s.LiquidationThreshold) + } + + return nil +} + +// validateBaseDenoms ensures that one or more strings are valid token denoms without the uToken prefix +func validateBaseDenoms(denoms ...string) error { + for _, s := range denoms { + if err := ValidateBaseDenom(s); err != nil { + return err + } + } + return nil +} diff --git a/x/leverage/types/tx.pb.go b/x/leverage/types/tx.pb.go index eccf513b0f..9951a596bb 100644 --- a/x/leverage/types/tx.pb.go +++ b/x/leverage/types/tx.pb.go @@ -1115,6 +1115,101 @@ var xxx_messageInfo_MsgGovUpdateRegistryResponse proto.InternalMessageInfo func (*MsgGovUpdateRegistryResponse) XXX_MessageName() string { return "umee.leverage.v1.MsgGovUpdateRegistryResponse" } + +// MsgGovUpdateSpecialAssets defines the Msg/GovUpdateSpecialAssets request type. +type MsgGovUpdateSpecialAssets struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // sets are bidirectional groups of special asset pairs. Creating a special asset + // set causes all assets in the set to have a certain collateral weight when borrowing + // against each other (but not looping with themselves). Overrides any existing + // special asset pairs between assets in the set. Using both collateral weight + // and liquidation theshold of zero will clear all existing special pairs in the set instead. + Sets []SpecialAssetSet `protobuf:"bytes,2,rep,name=sets,proto3" json:"sets"` + // pairs are new or updated special asset pairs. Updating both a special asset pair's + // collateral weight and liquidation threshold to zero deletes the pair instead. + // These pairs will be applied after any sets above when passing a proposal, + // so they can be used to override certain set elements, set directional relationships, + // or set an asset's relation to itself (looping). + Pairs []SpecialAssetPair `protobuf:"bytes,3,rep,name=pairs,proto3" json:"pairs"` +} + +func (m *MsgGovUpdateSpecialAssets) Reset() { *m = MsgGovUpdateSpecialAssets{} } +func (*MsgGovUpdateSpecialAssets) ProtoMessage() {} +func (*MsgGovUpdateSpecialAssets) Descriptor() ([]byte, []int) { + return fileDescriptor_72683128ee6e8843, []int{24} +} +func (m *MsgGovUpdateSpecialAssets) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovUpdateSpecialAssets) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovUpdateSpecialAssets.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 *MsgGovUpdateSpecialAssets) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovUpdateSpecialAssets.Merge(m, src) +} +func (m *MsgGovUpdateSpecialAssets) XXX_Size() int { + return m.Size() +} +func (m *MsgGovUpdateSpecialAssets) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovUpdateSpecialAssets.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovUpdateSpecialAssets proto.InternalMessageInfo + +func (*MsgGovUpdateSpecialAssets) XXX_MessageName() string { + return "umee.leverage.v1.MsgGovUpdateSpecialAssets" +} + +// MsgGovUpdateSpecialAssetsResponse defines the Msg/GovUpdateSpecialAssets response type. +type MsgGovUpdateSpecialAssetsResponse struct { +} + +func (m *MsgGovUpdateSpecialAssetsResponse) Reset() { *m = MsgGovUpdateSpecialAssetsResponse{} } +func (m *MsgGovUpdateSpecialAssetsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgGovUpdateSpecialAssetsResponse) ProtoMessage() {} +func (*MsgGovUpdateSpecialAssetsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_72683128ee6e8843, []int{25} +} +func (m *MsgGovUpdateSpecialAssetsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgGovUpdateSpecialAssetsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgGovUpdateSpecialAssetsResponse.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 *MsgGovUpdateSpecialAssetsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgGovUpdateSpecialAssetsResponse.Merge(m, src) +} +func (m *MsgGovUpdateSpecialAssetsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgGovUpdateSpecialAssetsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgGovUpdateSpecialAssetsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgGovUpdateSpecialAssetsResponse proto.InternalMessageInfo + +func (*MsgGovUpdateSpecialAssetsResponse) XXX_MessageName() string { + return "umee.leverage.v1.MsgGovUpdateSpecialAssetsResponse" +} func init() { proto.RegisterType((*MsgSupply)(nil), "umee.leverage.v1.MsgSupply") proto.RegisterType((*MsgWithdraw)(nil), "umee.leverage.v1.MsgWithdraw") @@ -1140,78 +1235,85 @@ func init() { proto.RegisterType((*MsgSupplyCollateralResponse)(nil), "umee.leverage.v1.MsgSupplyCollateralResponse") proto.RegisterType((*MsgGovUpdateRegistry)(nil), "umee.leverage.v1.MsgGovUpdateRegistry") proto.RegisterType((*MsgGovUpdateRegistryResponse)(nil), "umee.leverage.v1.MsgGovUpdateRegistryResponse") + proto.RegisterType((*MsgGovUpdateSpecialAssets)(nil), "umee.leverage.v1.MsgGovUpdateSpecialAssets") + proto.RegisterType((*MsgGovUpdateSpecialAssetsResponse)(nil), "umee.leverage.v1.MsgGovUpdateSpecialAssetsResponse") } func init() { proto.RegisterFile("umee/leverage/v1/tx.proto", fileDescriptor_72683128ee6e8843) } var fileDescriptor_72683128ee6e8843 = []byte{ - // 1047 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x3a, 0x75, 0x64, 0x3f, 0xa7, 0x25, 0xdd, 0x06, 0xea, 0x6c, 0xdb, 0x75, 0x58, 0x5a, - 0x88, 0x2a, 0xb2, 0x4b, 0x02, 0x05, 0x04, 0x54, 0x80, 0x5b, 0xa9, 0x52, 0xc1, 0x52, 0xe5, 0x80, - 0x10, 0x48, 0x10, 0xd6, 0xde, 0x61, 0xbd, 0x8a, 0xbd, 0x63, 0x76, 0xc6, 0x76, 0xcc, 0x91, 0x13, - 0x47, 0x90, 0x38, 0x70, 0xcc, 0x0f, 0xe8, 0x81, 0x03, 0x3f, 0x22, 0x08, 0x0e, 0x15, 0x27, 0x4e, - 0x08, 0x92, 0x03, 0xfc, 0x0c, 0xb4, 0x33, 0xb3, 0xb3, 0x6b, 0xef, 0xc6, 0xd9, 0x52, 0x7c, 0xf3, - 0xcc, 0xfb, 0xde, 0xf7, 0xbe, 0xf7, 0x66, 0xdf, 0xd3, 0x33, 0xac, 0x0f, 0xfb, 0x08, 0x59, 0x3d, - 0x34, 0x42, 0x81, 0xed, 0x22, 0x6b, 0xb4, 0x6d, 0xd1, 0x03, 0x73, 0x10, 0x60, 0x8a, 0xd5, 0xd5, - 0xd0, 0x64, 0x46, 0x26, 0x73, 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00, 0x00, + // 1135 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0x5e, 0x6f, 0xb2, 0x51, 0xf6, 0x6d, 0x5b, 0x52, 0x37, 0xb4, 0x8e, 0xdb, 0x7a, 0x13, 0xb7, + 0x85, 0xa8, 0x10, 0x9b, 0xa4, 0x14, 0x10, 0xa5, 0x40, 0xb7, 0x95, 0x2a, 0x15, 0x56, 0x8a, 0x76, + 0x41, 0x08, 0x24, 0x08, 0xce, 0x7a, 0x70, 0xac, 0xec, 0x7a, 0x8c, 0x67, 0x76, 0x93, 0xf4, 0xc8, + 0x89, 0x23, 0x48, 0x1c, 0x38, 0xe6, 0x07, 0xf4, 0xc0, 0x81, 0x1f, 0x11, 0xc4, 0xa5, 0xe2, 0xc4, + 0x09, 0x41, 0x72, 0x80, 0x03, 0x3f, 0x02, 0x79, 0x3c, 0x1e, 0x7b, 0xd7, 0xde, 0x8d, 0xd3, 0x92, + 0xdb, 0xce, 0xbc, 0xef, 0x7b, 0xef, 0x7b, 0xcf, 0x7e, 0xcf, 0x4f, 0x0b, 0x0b, 0xfd, 0x1e, 0x42, + 0x66, 0x17, 0x0d, 0x50, 0x60, 0x39, 0xc8, 0x1c, 0xac, 0x9a, 0x74, 0xd7, 0xf0, 0x03, 0x4c, 0xb1, + 0x3c, 0x17, 0x9a, 0x8c, 0xd8, 0x64, 0x0c, 0x56, 0x55, 0xad, 0x83, 0x49, 0x0f, 0x13, 0x73, 0xd3, + 0x22, 0x21, 0x74, 0x13, 0x51, 0x6b, 0xd5, 0xec, 0x60, 0xd7, 0x8b, 0x18, 0xea, 0x25, 0x6e, 0xef, + 0x11, 0x27, 0xf4, 0xd4, 0x23, 0x0e, 0x37, 0x2c, 0x44, 0x86, 0x0d, 0x76, 0x32, 0xa3, 0x03, 0x37, + 0xcd, 0x3b, 0xd8, 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 0x5b, 0x14, 0xc9, 0x1a, 0x40, 0x97, + 0x1f, 0x70, 0x1c, 0x25, 0x75, 0x33, 0xa4, 0xa1, 0x3c, 0xa2, 0xe1, 0x2e, 0x54, 0x83, 0x50, 0x68, + 0x0f, 0x79, 0x54, 0x99, 0x2a, 0xa6, 0x23, 0x61, 0xc8, 0x4b, 0x70, 0x26, 0x40, 0x3b, 0x56, 0x60, + 0x6f, 0x44, 0x75, 0x98, 0x66, 0xee, 0x6b, 0xd1, 0xdd, 0x03, 0x56, 0x8d, 0x5f, 0x25, 0x78, 0x31, + 0x94, 0xcb, 0x7b, 0xd3, 0x4e, 0x74, 0xbf, 0x95, 0xd5, 0xdd, 0x50, 0x7e, 0xfb, 0x79, 0x65, 0x9e, + 0xc7, 0xbf, 0x67, 0xdb, 0x01, 0x22, 0xa4, 0x4d, 0x03, 0xd7, 0x73, 0x86, 0x32, 0x7a, 0x7d, 0x34, + 0xa3, 0x09, 0xbc, 0x24, 0xd7, 0x3a, 0xd4, 0x98, 0x72, 0xae, 0x75, 0x2a, 0x2a, 0x14, 0xbb, 0x62, + 0x52, 0x8b, 0x64, 0xb3, 0x05, 0x17, 0xc4, 0x4c, 0x49, 0x7a, 0xea, 0x34, 0x7a, 0x7f, 0x1d, 0xce, + 0x8b, 0x48, 0x2d, 0x44, 0x7c, 0xec, 0x11, 0x24, 0xdf, 0x81, 0xd9, 0x00, 0x75, 0x90, 0x3b, 0x40, + 0x36, 0x8b, 0x53, 0xc0, 0x9d, 0x20, 0xe8, 0x2d, 0xa6, 0x3d, 0x1e, 0x25, 0xff, 0x8f, 0xcf, 0x1f, + 0x24, 0xb8, 0x38, 0x3c, 0xa2, 0x84, 0xdf, 0xbb, 0x50, 0xdd, 0xe1, 0x77, 0x5e, 0x51, 0xc7, 0x09, + 0x63, 0x48, 0x56, 0xf9, 0xa4, 0xb2, 0x54, 0x50, 0x46, 0x87, 0x5e, 0xac, 0x4b, 0xbf, 0x02, 0x6a, + 0x76, 0x52, 0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, 0x61, 0x80, 0x15, 0x0f, 0xd1, 0x1d, 0x1c, 0x6c, 0xb3, 0x83, + 0x39, 0xb8, 0x6d, 0xee, 0x26, 0xff, 0x20, 0xd0, 0x3d, 0x1f, 0x91, 0xcd, 0x19, 0xf6, 0xe7, 0xc1, + 0xad, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x33, 0xbb, 0xeb, 0x7c, 0xf6, 0x10, 0x00, 0x00, } func (this *MsgGovUpdateRegistry) Equal(that interface{}) bool { @@ -1260,6 +1362,46 @@ func (this *MsgGovUpdateRegistry) Equal(that interface{}) bool { } return true } +func (this *MsgGovUpdateSpecialAssets) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*MsgGovUpdateSpecialAssets) + if !ok { + that2, ok := that.(MsgGovUpdateSpecialAssets) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Authority != that1.Authority { + return false + } + if len(this.Sets) != len(that1.Sets) { + return false + } + for i := range this.Sets { + if !this.Sets[i].Equal(&that1.Sets[i]) { + return false + } + } + if len(this.Pairs) != len(that1.Pairs) { + return false + } + for i := range this.Pairs { + if !this.Pairs[i].Equal(&that1.Pairs[i]) { + return false + } + } + return true +} // Reference imports to suppress errors if they are not otherwise used. var _ context.Context @@ -1314,6 +1456,10 @@ type MsgClient interface { // GovUpdateRegistry adds new tokens to the token registry or // updates existing tokens with new settings. GovUpdateRegistry(ctx context.Context, in *MsgGovUpdateRegistry, opts ...grpc.CallOption) (*MsgGovUpdateRegistryResponse, error) + // GovUpdateSpecialAssets adds, updates, or removes special asset pairs. Note that a special asset + // pair can be removed by setting its special collateral weight to negative one. Also allows for the creation + // of sets of assets, where each asset in the set forms a special asset pair with all of the others. + GovUpdateSpecialAssets(ctx context.Context, in *MsgGovUpdateSpecialAssets, opts ...grpc.CallOption) (*MsgGovUpdateSpecialAssetsResponse, error) } type msgClient struct { @@ -1432,6 +1578,15 @@ func (c *msgClient) GovUpdateRegistry(ctx context.Context, in *MsgGovUpdateRegis return out, nil } +func (c *msgClient) GovUpdateSpecialAssets(ctx context.Context, in *MsgGovUpdateSpecialAssets, opts ...grpc.CallOption) (*MsgGovUpdateSpecialAssetsResponse, error) { + out := new(MsgGovUpdateSpecialAssetsResponse) + err := c.cc.Invoke(ctx, "/umee.leverage.v1.Msg/GovUpdateSpecialAssets", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // Supply moves tokens from user balance to the module for lending or collateral. @@ -1475,6 +1630,10 @@ type MsgServer interface { // GovUpdateRegistry adds new tokens to the token registry or // updates existing tokens with new settings. GovUpdateRegistry(context.Context, *MsgGovUpdateRegistry) (*MsgGovUpdateRegistryResponse, error) + // GovUpdateSpecialAssets adds, updates, or removes special asset pairs. Note that a special asset + // pair can be removed by setting its special collateral weight to negative one. Also allows for the creation + // of sets of assets, where each asset in the set forms a special asset pair with all of the others. + GovUpdateSpecialAssets(context.Context, *MsgGovUpdateSpecialAssets) (*MsgGovUpdateSpecialAssetsResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1517,6 +1676,9 @@ func (*UnimplementedMsgServer) SupplyCollateral(ctx context.Context, req *MsgSup func (*UnimplementedMsgServer) GovUpdateRegistry(ctx context.Context, req *MsgGovUpdateRegistry) (*MsgGovUpdateRegistryResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GovUpdateRegistry not implemented") } +func (*UnimplementedMsgServer) GovUpdateSpecialAssets(ctx context.Context, req *MsgGovUpdateSpecialAssets) (*MsgGovUpdateSpecialAssetsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GovUpdateSpecialAssets not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1738,6 +1900,24 @@ func _Msg_GovUpdateRegistry_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Msg_GovUpdateSpecialAssets_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgGovUpdateSpecialAssets) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).GovUpdateSpecialAssets(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umee.leverage.v1.Msg/GovUpdateSpecialAssets", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).GovUpdateSpecialAssets(ctx, req.(*MsgGovUpdateSpecialAssets)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "umee.leverage.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1790,6 +1970,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "GovUpdateRegistry", Handler: _Msg_GovUpdateRegistry_Handler, }, + { + MethodName: "GovUpdateSpecialAssets", + Handler: _Msg_GovUpdateSpecialAssets_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "umee/leverage/v1/tx.proto", @@ -2722,6 +2906,87 @@ func (m *MsgGovUpdateRegistryResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *MsgGovUpdateSpecialAssets) 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 *MsgGovUpdateSpecialAssets) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovUpdateSpecialAssets) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Pairs) > 0 { + for iNdEx := len(m.Pairs) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Pairs[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Sets) > 0 { + for iNdEx := len(m.Sets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgGovUpdateSpecialAssetsResponse) 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 *MsgGovUpdateSpecialAssetsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgGovUpdateSpecialAssetsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -3085,6 +3350,40 @@ func (m *MsgGovUpdateRegistryResponse) Size() (n int) { return n } +func (m *MsgGovUpdateSpecialAssets) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Sets) > 0 { + for _, e := range m.Sets { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + if len(m.Pairs) > 0 { + for _, e := range m.Pairs { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgGovUpdateSpecialAssetsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5691,6 +5990,206 @@ func (m *MsgGovUpdateRegistryResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgGovUpdateSpecialAssets) 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 ErrIntOverflowTx + } + 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: MsgGovUpdateSpecialAssets: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovUpdateSpecialAssets: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sets = append(m.Sets, SpecialAssetSet{}) + if err := m.Sets[len(m.Sets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pairs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Pairs = append(m.Pairs, SpecialAssetPair{}) + if err := m.Pairs[len(m.Pairs)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgGovUpdateSpecialAssetsResponse) 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 ErrIntOverflowTx + } + 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: MsgGovUpdateSpecialAssetsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgGovUpdateSpecialAssetsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0