From d0a9ff7e57ac490b98b2a25497d1c8ef4a0a86dc Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 7 Mar 2022 17:16:12 -0500 Subject: [PATCH] feat: additional leverage queries (#617) (#620) (cherry picked from commit c0935d005b5129c3bf9e1e2fffc0038e1d407d1d) Co-authored-by: Adam Moser <63419657+toteki@users.noreply.github.com> --- proto/umee/leverage/v1beta1/query.proto | 92 +- proto/umee/leverage/v1beta1/tx.proto | 4 +- x/leverage/client/cli/query.go | 148 ++ x/leverage/client/tests/suite.go | 407 +++- x/leverage/keeper/borrows_test.go | 6 +- x/leverage/keeper/exchange_rate.go | 19 + x/leverage/keeper/grpc_query.go | 150 +- x/leverage/keeper/keeper.go | 2 +- x/leverage/keeper/keeper_test.go | 2 +- x/leverage/keeper/loaned.go | 55 + x/leverage/keeper/oracle.go | 2 +- x/leverage/simulation/operations.go | 2 +- x/leverage/spec/01_concepts.md | 4 +- x/leverage/spec/03_queries.md | 14 +- x/leverage/types/expected_types.go | 1 + x/leverage/types/query.pb.go | 2396 +++++++++++++++++++---- x/leverage/types/query.pb.gw.go | 320 +++ x/leverage/types/tx.pb.go | 6 +- 18 files changed, 3249 insertions(+), 381 deletions(-) create mode 100644 x/leverage/keeper/loaned.go diff --git a/proto/umee/leverage/v1beta1/query.proto b/proto/umee/leverage/v1beta1/query.proto index 639b5ba9d8..64d21472f5 100644 --- a/proto/umee/leverage/v1beta1/query.proto +++ b/proto/umee/leverage/v1beta1/query.proto @@ -27,6 +27,27 @@ service Query { option (google.api.http).get = "/umee/leverage/v1beta1/borrowed"; } + // BorrowedValue queries for the usd value of the borrowed amount of a user + // by token denomination. If the denomination is not supplied, the sum across + // all borrowed tokens is returned. + rpc BorrowedValue(QueryBorrowedValueRequest) returns (QueryBorrowedValueResponse) { + option (google.api.http).get = "/umee/leverage/v1beta1/borrowed_value"; + } + + // Loaned queries for the amount of tokens loaned by a user by denomination. + // If the denomination is not supplied, the total for each loaned token is + // returned. + rpc Loaned(QueryLoanedRequest) returns (QueryLoanedResponse) { + option (google.api.http).get = "/umee/leverage/v1beta1/loaned"; + } + + // LoanedValue queries for the USD value loaned by a user by token + // denomination. If the denomination is not supplied, the sum across all + // loaned tokens is returned. + rpc LoanedValue(QueryLoanedValueRequest) returns (QueryLoanedValueResponse) { + option (google.api.http).get = "/umee/leverage/v1beta1/loaned_value"; + } + // AvailableBorrow queries for the available amount to borrow of a specified denomination. rpc AvailableBorrow(QueryAvailableBorrowRequest) returns (QueryAvailableBorrowResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/available_borrow"; @@ -42,26 +63,34 @@ service Query { option (google.api.http).get = "/umee/leverage/v1beta1/lend_apy"; } - // MarketSize queries for the Market Size in USD of a specified denomination. + // MarketSize queries for the Market Size in USD of a specified denomination, which + // is the USD value of total tokens loaned by all users plus borrow interest owed + // by all users. rpc MarketSize(QueryMarketSizeRequest) returns (QueryMarketSizeResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/market_size"; } + // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, + // which is the total tokens loaned by all users plus borrow interest owed by all users. + rpc TokenMarketSize(QueryTokenMarketSizeRequest) returns (QueryTokenMarketSizeResponse) { + option (google.api.http).get = "/umee/leverage/v1beta1/token_market_size"; + } + // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. rpc ReserveAmount(QueryReserveAmountRequest) returns (QueryReserveAmountResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/reserve_amount"; } - // CollateralSetting queries a borrower's collateral setting of a specified - // uToken denomination. + // CollateralSetting queries a borrower's collateral setting (enabled or disabled) + // for a specified uToken denomination. rpc CollateralSetting(QueryCollateralSettingRequest) returns (QueryCollateralSettingResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/collateral_setting"; } // Collateral queries the collateral amount of a user by token denomination. - // If the denomination is not supplied, the total for each collateral token is - // returned. + // If the denomination is not supplied, all of the user's collateral tokens + // are returned. rpc Collateral(QueryCollateralRequest) returns (QueryCollateralResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/collateral"; } @@ -71,12 +100,12 @@ service Query { option (google.api.http).get = "/umee/leverage/v1beta1/exchange_rate"; } - // BorrowLimit queries the borrow limit in USD of a given borrower + // BorrowLimit queries the borrow limit in USD of a given borrower. rpc BorrowLimit(QueryBorrowLimitRequest) returns (QueryBorrowLimitResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/borrow_limit"; } - // LiquidationTargets queries a list of all borrowers eligible for liquidation + // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. rpc LiquidationTargets(QueryLiquidationTargetsRequest) returns (QueryLiquidationTargetsResponse) { option (google.api.http).get = "/umee/leverage/v1beta1/liquidation_targets"; } @@ -138,6 +167,19 @@ message QueryMarketSizeResponse { [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; } +// QueryTokenMarketSizeRequest defines the request structure for the Token Market Size +// gRPC service handler. +message QueryTokenMarketSizeRequest { + string denom = 1; +} + +// QueryTokenMarketSizeResponse defines the response structure for the Token Market Size +// gRPC service handler. +message QueryTokenMarketSizeResponse { + string market_size = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", (gogoproto.nullable) = false]; +} + // QueryRegisteredTokensResponse defines the response structure for the // RegisteredTokens gRPC service handler. message QueryRegisteredTokensResponse { @@ -168,6 +210,42 @@ message QueryBorrowedResponse { [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; } +// QueryBorrowedValueRequest defines the request structure for the BorrowedValue gRPC service handler. +message QueryBorrowedValueRequest { + string address = 1; + string denom = 2; +} + +// QueryBorrowedValueResponse defines the response structure for the BorrowedValue gRPC service handler. +message QueryBorrowedValueResponse { + string borrowed_value = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + +// QueryLoanedRequest defines the request structure for the Loaned gRPC service handler. +message QueryLoanedRequest { + string address = 1; + string denom = 2; +} + +// QueryLoanedResponse defines the response structure for the Loaned gRPC service handler. +message QueryLoanedResponse { + repeated cosmos.base.v1beta1.Coin loaned = 1 + [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +// QueryLoanedValueRequest defines the request structure for the LoanedValue gRPC service handler. +message QueryLoanedValueRequest { + string address = 1; + string denom = 2; +} + +// QueryLoanedValueResponse defines the response structure for the LoanedValue gRPC service handler. +message QueryLoanedValueResponse { + string loaned_value = 1 + [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", (gogoproto.nullable) = false]; +} + // QueryReserveAmountRequest defines the request structure for the ReserveAmount // gRPC service handler. message QueryReserveAmountRequest { diff --git a/proto/umee/leverage/v1beta1/tx.proto b/proto/umee/leverage/v1beta1/tx.proto index c83fd38154..7c0955ce25 100644 --- a/proto/umee/leverage/v1beta1/tx.proto +++ b/proto/umee/leverage/v1beta1/tx.proto @@ -11,7 +11,7 @@ service Msg { // LendAsset defines a method for lending coins to the capital facility. rpc LendAsset(MsgLendAsset) returns (MsgLendAssetResponse); - // WithdrawAsset defines a method for withdrawing previously lent coins from + // WithdrawAsset defines a method for withdrawing previously loaned coins from // the capital facility. rpc WithdrawAsset(MsgWithdrawAsset) returns (MsgWithdrawAssetResponse); @@ -37,7 +37,7 @@ message MsgLendAsset { cosmos.base.v1beta1.Coin amount = 2 [(gogoproto.nullable) = false]; } -// MsgWithdrawAsset represents a lender's request to withdraw a previously lent +// MsgWithdrawAsset represents a lender's request to withdraw a previously loaned // base asset type from the module message MsgWithdrawAsset { string lender = 1; diff --git a/x/leverage/client/cli/query.go b/x/leverage/client/cli/query.go index 30cdee38eb..ec4de0fca7 100644 --- a/x/leverage/client/cli/query.go +++ b/x/leverage/client/cli/query.go @@ -29,6 +29,9 @@ func GetQueryCmd(queryRoute string) *cobra.Command { GetCmdQueryAllRegisteredTokens(), GetCmdQueryParams(), GetCmdQueryBorrowed(), + GetCmdQueryBorrowedValue(), + GetCmdQueryLoaned(), + GetCmdQueryLoanedValue(), GetCmdQueryReserveAmount(), GetCmdQueryCollateral(), GetCmdQueryCollateralSetting(), @@ -36,6 +39,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { GetCmdQueryLendAPY(), GetCmdQueryBorrowAPY(), GetCmdQueryMarketSize(), + GetCmdQueryTokenMarketSize(), GetCmdQueryBorrowLimit(), GetCmdQueryLiquidationTargets(), ) @@ -138,6 +142,117 @@ func GetCmdQueryBorrowed() *cobra.Command { return cmd } +// GetCmdQueryBorrowedValue returns a CLI command handler to query for the USD +// value of total borrowed tokens for a given address. +func GetCmdQueryBorrowedValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "borrowed-value [addr]", + Args: cobra.ExactArgs(1), + Short: "Query for the total USD value of borrowed tokens for an address", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryBorrowedValueRequest{ + Address: args[0], + } + if d, err := cmd.Flags().GetString(FlagDenom); len(d) > 0 && err == nil { + req.Denom = d + } + + resp, err := queryClient.BorrowedValue(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + cmd.Flags().String(FlagDenom, "", "Query for value of only a specific denomination") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryLoaned returns a CLI command handler to query for the amount of +// tokens loaned by a given address. +func GetCmdQueryLoaned() *cobra.Command { + cmd := &cobra.Command{ + Use: "loaned [addr]", + Args: cobra.ExactArgs(1), + Short: "Query for the total amount of tokens loaned by an address", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryLoanedRequest{ + Address: args[0], + } + if d, err := cmd.Flags().GetString(FlagDenom); len(d) > 0 && err == nil { + req.Denom = d + } + + resp, err := queryClient.Loaned(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + cmd.Flags().String(FlagDenom, "", "Query for a specific denomination") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +// GetCmdQueryLoanedValue returns a CLI command handler to query for the USD value of +// total tokens loaned by a given address. +func GetCmdQueryLoanedValue() *cobra.Command { + cmd := &cobra.Command{ + Use: "loaned-value [addr]", + Args: cobra.ExactArgs(1), + Short: "Query for the USD value of tokens loaned by an address", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryLoanedValueRequest{ + Address: args[0], + } + if d, err := cmd.Flags().GetString(FlagDenom); len(d) > 0 && err == nil { + req.Denom = d + } + + resp, err := queryClient.LoanedValue(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + cmd.Flags().String(FlagDenom, "", "Query for value of only a specific denomination") + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // GetCmdQueryReserveAmount returns a CLI command handler to query for the // reserved amount of a specific token. func GetCmdQueryReserveAmount() *cobra.Command { @@ -407,6 +522,39 @@ func GetCmdQueryMarketSize() *cobra.Command { return cmd } +// GetCmdQueryTokenMarketSize returns a CLI command handler to query for the +// Market Size of a specific token, in token denomination instead of USD. +func GetCmdQueryTokenMarketSize() *cobra.Command { + cmd := &cobra.Command{ + Use: "token-market-size [denom]", + Args: cobra.ExactArgs(1), + Short: "Query for the market size of a specified denomination measured in base tokens", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryTokenMarketSizeRequest{ + Denom: args[0], + } + + resp, err := queryClient.TokenMarketSize(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(resp) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + // GetCmdQueryBorrowLimit returns a CLI command handler to query for the // borrow limit of a specific borrower. func GetCmdQueryBorrowLimit() *cobra.Command { diff --git a/x/leverage/client/tests/suite.go b/x/leverage/client/tests/suite.go index 7da6a512f1..60aab6653e 100644 --- a/x/leverage/client/tests/suite.go +++ b/x/leverage/client/tests/suite.go @@ -293,6 +293,321 @@ func (s *IntegrationTestSuite) TestQueryBorrowed() { runTestTransactions(s, cleanupCommands) } +func (s *IntegrationTestSuite) TestQueryBorrowedValue() { + val := s.network.Validators[0] + + simpleCases := []testQuery{ + { + "invalid address", + cli.GetCmdQueryBorrowedValue(), + []string{ + "xyz", + }, + true, + nil, + nil, + }, + { + "query zero borrowed value", + cli.GetCmdQueryBorrowedValue(), + []string{ + val.Address.String(), + }, + false, + &types.QueryBorrowedValueResponse{}, + &types.QueryBorrowedValueResponse{ + BorrowedValue: sdk.ZeroDec(), + }, + }, + } + + setupCommands := []testTransaction{ + { + "lend", + cli.GetCmdLendAsset(), + []string{ + val.Address.String(), + "1000uumee", + }, + nil, + }, + { + "set collateral", + cli.GetCmdSetCollateral(), + []string{ + val.Address.String(), + "u/uumee", + "true", + }, + nil, + }, + { + "borrow", + cli.GetCmdBorrowAsset(), + []string{ + val.Address.String(), + "49uumee", // will round up to 50 due to adjusted borrow value + }, + nil, + }, + } + + nonzeroCase := []testQuery{ + { + "query nonzero borrowed value", + cli.GetCmdQueryBorrowedValue(), + []string{ + val.Address.String(), + }, + false, + &types.QueryBorrowedValueResponse{}, + &types.QueryBorrowedValueResponse{ + // From app/beta/test_helpers.go/IntegrationTestNetworkConfig + BorrowedValue: sdk.MustNewDecFromStr("0.0017105"), + // (50 / 1000000) umee * 34.21 = 0.0017105 + }, + }, + { + "query nonzero borrowed value of denom", + cli.GetCmdQueryBorrowedValue(), + []string{ + val.Address.String(), + fmt.Sprintf("--%s=uumee", cli.FlagDenom), + }, + false, + &types.QueryBorrowedValueResponse{}, + &types.QueryBorrowedValueResponse{ + // From app/beta/test_helpers.go/IntegrationTestNetworkConfig + BorrowedValue: sdk.MustNewDecFromStr("0.0017105"), + // (50 / 1000000) umee * 34.21 = 0.0017105 + }, + }, + } + + cleanupCommands := []testTransaction{ + { + "repay", + cli.GetCmdRepayAsset(), + []string{ + val.Address.String(), + "50uumee", + }, + nil, + }, + { + "unset collateral", + cli.GetCmdSetCollateral(), + []string{ + val.Address.String(), + "u/uumee", + "false", + }, + nil, + }, + { + "withdraw", + cli.GetCmdWithdrawAsset(), + []string{ + val.Address.String(), + "1000u/uumee", + }, + nil, + }, + } + + runTestQueries(s, simpleCases) + runTestTransactions(s, setupCommands) + runTestQueries(s, nonzeroCase) + runTestTransactions(s, cleanupCommands) +} + +func (s *IntegrationTestSuite) TestQueryLoaned() { + val := s.network.Validators[0] + + setupCommands := []testTransaction{ + { + "lend", + cli.GetCmdLendAsset(), + []string{ + val.Address.String(), + "1000uumee", + }, + nil, + }, + } + + testCases := []testQuery{ + { + "invalid address", + cli.GetCmdQueryLoaned(), + []string{ + "xyz", + }, + true, + nil, + nil, + }, + { + "query all loaned", + cli.GetCmdQueryLoaned(), + []string{ + val.Address.String(), + }, + false, + &types.QueryLoanedResponse{}, + &types.QueryLoanedResponse{ + Loaned: sdk.NewCoins( + sdk.NewInt64Coin(app.BondDenom, 1000), + ), + }, + }, + { + "invalid denom", + cli.GetCmdQueryLoaned(), + []string{ + val.Address.String(), + fmt.Sprintf("--%s=abcd", cli.FlagDenom), + }, + true, + nil, + nil, + }, + { + "query denom loaned", + cli.GetCmdQueryLoaned(), + []string{ + val.Address.String(), + fmt.Sprintf("--%s=uumee", cli.FlagDenom), + }, + false, + &types.QueryLoanedResponse{}, + &types.QueryLoanedResponse{ + Loaned: sdk.NewCoins( + sdk.NewInt64Coin(app.BondDenom, 1000), + ), + }, + }, + } + + cleanupCommands := []testTransaction{ + { + "withdraw", + cli.GetCmdWithdrawAsset(), + []string{ + val.Address.String(), + "1000u/uumee", + }, + nil, + }, + } + + runTestTransactions(s, setupCommands) + runTestQueries(s, testCases) + runTestTransactions(s, cleanupCommands) +} + +func (s *IntegrationTestSuite) TestQueryLoanedValue() { + val := s.network.Validators[0] + + simpleCases := []testQuery{ + { + "invalid address", + cli.GetCmdQueryLoanedValue(), + []string{ + "xyz", + }, + true, + nil, + nil, + }, + { + "query zero loaned value", + cli.GetCmdQueryLoanedValue(), + []string{ + val.Address.String(), + }, + false, + &types.QueryLoanedValueResponse{}, + &types.QueryLoanedValueResponse{ + LoanedValue: sdk.ZeroDec(), + }, + }, + } + + setupCommands := []testTransaction{ + { + "lend", + cli.GetCmdLendAsset(), + []string{ + val.Address.String(), + "1000000uumee", + }, + nil, + }, + } + + testCases := []testQuery{ + { + "invalid address", + cli.GetCmdQueryLoanedValue(), + []string{ + "xyz", + }, + true, + nil, + nil, + }, + { + "query all loaned value", + cli.GetCmdQueryLoanedValue(), + []string{ + val.Address.String(), + }, + false, + &types.QueryLoanedValueResponse{}, + &types.QueryLoanedValueResponse{ + // From app/beta/test_helpers.go/IntegrationTestNetworkConfig + // This result is umee's collateral weight times the collateral + // amount loaned, times its initial oracle exchange rate. + LoanedValue: sdk.MustNewDecFromStr("34.21"), + // 1 umee * 34.21 = 34.21 + }, + }, + { + "query denom loaned", + cli.GetCmdQueryLoanedValue(), + []string{ + val.Address.String(), + fmt.Sprintf("--%s=uumee", cli.FlagDenom), + }, + false, + &types.QueryLoanedValueResponse{}, + &types.QueryLoanedValueResponse{ + // From app/beta/test_helpers.go/IntegrationTestNetworkConfig + LoanedValue: sdk.MustNewDecFromStr("34.21"), + // 1 umee * 34.21 = 34.21 + }, + }, + } + + cleanupCommands := []testTransaction{ + { + "withdraw", + cli.GetCmdWithdrawAsset(), + []string{ + val.Address.String(), + "1000000u/uumee", + }, + nil, + }, + } + + runTestQueries(s, simpleCases) + runTestTransactions(s, setupCommands) + runTestQueries(s, testCases) + runTestTransactions(s, cleanupCommands) +} + func (s *IntegrationTestSuite) TestQueryReserveAmount() { testCases := []testQuery{ { @@ -590,7 +905,7 @@ func (s *IntegrationTestSuite) TestQueryBorrowLimit() { &types.QueryBorrowLimitResponse{ // From app/beta/test_helpers.go/IntegrationTestNetworkConfig // This result is umee's collateral weight times the collateral - // amount lent, times its initial oracle exchange rate. + // amount loaned, times its initial oracle exchange rate. BorrowLimit: sdk.MustNewDecFromStr("34.21"), // 0.05 * 20 * 34.21 = 34.21 }, @@ -703,7 +1018,7 @@ func (s *IntegrationTestSuite) TestQueryBorrowAPY() { } func (s *IntegrationTestSuite) TestQueryMarketSize() { - testCasesMarketSizeBeforeLend := []testQuery{ + simpleCases := []testQuery{ { "not accepted Token denom", cli.GetCmdQueryMarketSize(), @@ -737,7 +1052,7 @@ func (s *IntegrationTestSuite) TestQueryMarketSize() { } val := s.network.Validators[0] - lendCommands := []testTransaction{ + setupCommands := []testTransaction{ { "lend", cli.GetCmdLendAsset(), @@ -749,7 +1064,7 @@ func (s *IntegrationTestSuite) TestQueryMarketSize() { }, } - testCasesMarketSizeAfterLend := []testQuery{ + testCases := []testQuery{ { "valid asset", cli.GetCmdQueryMarketSize(), @@ -774,9 +1089,87 @@ func (s *IntegrationTestSuite) TestQueryMarketSize() { }, } - runTestQueries(s, testCasesMarketSizeBeforeLend) - runTestTransactions(s, lendCommands) - runTestQueries(s, testCasesMarketSizeAfterLend) + runTestQueries(s, simpleCases) + runTestTransactions(s, setupCommands) + runTestQueries(s, testCases) + runTestTransactions(s, cleanupCommands) +} + +func (s *IntegrationTestSuite) TestQueryTokenMarketSize() { + simpleCases := []testQuery{ + { + "not accepted Token denom", + cli.GetCmdQueryTokenMarketSize(), + []string{ + "invalidToken", + }, + true, + nil, + nil, + }, + { + "invalid denom", + cli.GetCmdQueryTokenMarketSize(), + []string{ + "", + }, + true, + nil, + nil, + }, + { + "valid asset", + cli.GetCmdQueryTokenMarketSize(), + []string{ + app.BondDenom, + }, + false, + &types.QueryTokenMarketSizeResponse{}, + &types.QueryTokenMarketSizeResponse{MarketSize: sdk.ZeroInt()}, + }, + } + + val := s.network.Validators[0] + setupCommands := []testTransaction{ + { + "lend", + cli.GetCmdLendAsset(), + []string{ + val.Address.String(), + "1000000uumee", + }, + nil, + }, + } + + testCases := []testQuery{ + { + "valid asset", + cli.GetCmdQueryTokenMarketSize(), + []string{ + app.BondDenom, + }, + false, + &types.QueryTokenMarketSizeResponse{}, + &types.QueryTokenMarketSizeResponse{MarketSize: sdk.NewInt(1000000)}, + }, + } + + cleanupCommands := []testTransaction{ + { + "withdraw", + cli.GetCmdWithdrawAsset(), + []string{ + val.Address.String(), + "1000000u/uumee", + }, + nil, + }, + } + + runTestQueries(s, simpleCases) + runTestTransactions(s, setupCommands) + runTestQueries(s, testCases) runTestTransactions(s, cleanupCommands) } diff --git a/x/leverage/keeper/borrows_test.go b/x/leverage/keeper/borrows_test.go index 5998b31306..c9dcc18ca6 100644 --- a/x/leverage/keeper/borrows_test.go +++ b/x/leverage/keeper/borrows_test.go @@ -98,14 +98,14 @@ func (s *IntegrationTestSuite) TestGetAvailableToBorrow() { available := s.tk.GetAvailableToBorrow(s.ctx, "abcd") s.Require().Equal(sdk.ZeroInt(), available) - // creates account which has lent 1000 uumee, and borrowed 0 uumee + // creates account which has loaned 1000 uumee, and borrowed 0 uumee _ = s.setupAccount(umeeDenom, 1000, 1000, 0, true) // confirm lending pool is 1000 uumee available = s.tk.GetAvailableToBorrow(s.ctx, umeeDenom) s.Require().Equal(sdk.NewInt(1000), available) - // creates account which has lent 1000 uumee, and borrowed 123 uumee + // creates account which has loaned 1000 uumee, and borrowed 123 uumee _ = s.setupAccount(umeeDenom, 1000, 1000, 123, true) // confirm lending pool is 1877 uumee @@ -125,7 +125,7 @@ func (s *IntegrationTestSuite) TestDeriveBorrowUtilization() { utilization := s.tk.DeriveBorrowUtilization(s.ctx, "abcd") s.Require().Equal(sdk.OneDec(), utilization) - // creates account which has lent 1000 uumee, and borrowed 0 uumee + // creates account which has loaned 1000 uumee, and borrowed 0 uumee addr := s.setupAccount(umeeDenom, 1000, 1000, 0, true) // All tests below are commented with the following equation in mind: diff --git a/x/leverage/keeper/exchange_rate.go b/x/leverage/keeper/exchange_rate.go index c06632bded..f8086a4eeb 100644 --- a/x/leverage/keeper/exchange_rate.go +++ b/x/leverage/keeper/exchange_rate.go @@ -43,6 +43,25 @@ func (k Keeper) ExchangeUToken(ctx sdk.Context, uToken sdk.Coin) (sdk.Coin, erro return sdk.NewCoin(tokenDenom, tokenAmount), nil } +// ExchangeUTokens converts an sdk.Coins containing uTokens to their values in base +// tokens. +func (k Keeper) ExchangeUTokens(ctx sdk.Context, uTokens sdk.Coins) (sdk.Coins, error) { + if !uTokens.IsValid() { + return sdk.Coins{}, sdkerrors.Wrap(types.ErrInvalidAsset, uTokens.String()) + } + + tokens := sdk.Coins{} + for _, coin := range uTokens { + token, err := k.ExchangeUToken(ctx, coin) + if err != nil { + return sdk.Coins{}, err + } + tokens = tokens.Add(token) + } + + return tokens, nil +} + // DeriveExchangeRate calculated the token:uToken exchange rate of a base token denom. func (k Keeper) DeriveExchangeRate(ctx sdk.Context, denom string) sdk.Dec { // uToken exchange rate is equal to the token supply (including borrowed diff --git a/x/leverage/keeper/grpc_query.go b/x/leverage/keeper/grpc_query.go index c256610158..5d3a3911a1 100644 --- a/x/leverage/keeper/grpc_query.go +++ b/x/leverage/keeper/grpc_query.go @@ -91,6 +91,129 @@ func (q Querier) Borrowed( return &types.QueryBorrowedResponse{Borrowed: sdk.NewCoins(token)}, nil } +func (q Querier) BorrowedValue( + goCtx context.Context, + req *types.QueryBorrowedValueRequest, +) (*types.QueryBorrowedValueResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Address == "" { + return nil, status.Error(codes.InvalidArgument, "invalid address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + borrower, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err + } + + var tokens sdk.Coins + + if len(req.Denom) == 0 { + tokens = q.Keeper.GetBorrowerBorrows(ctx, borrower) + } else { + if !q.Keeper.IsAcceptedToken(ctx, req.Denom) { + return nil, status.Error(codes.InvalidArgument, "not accepted Token denom") + } + + tokens = sdk.NewCoins(q.Keeper.GetBorrow(ctx, borrower, req.Denom)) + } + + value, err := q.Keeper.TotalTokenValue(ctx, tokens) + if err != nil { + return nil, err + } + + return &types.QueryBorrowedValueResponse{BorrowedValue: value}, nil +} + +func (q Querier) Loaned( + goCtx context.Context, + req *types.QueryLoanedRequest, +) (*types.QueryLoanedResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Address == "" { + return nil, status.Error(codes.InvalidArgument, "invalid address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + lender, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err + } + + if len(req.Denom) == 0 { + tokens, err := q.Keeper.GetLenderLoaned(ctx, lender) + if err != nil { + return nil, err + } + + return &types.QueryLoanedResponse{Loaned: tokens}, nil + } + + if !q.Keeper.IsAcceptedToken(ctx, req.Denom) { + return nil, status.Error(codes.InvalidArgument, "not accepted Token denom") + } + + token, err := q.Keeper.GetLoaned(ctx, lender, req.Denom) + if err != nil { + return nil, err + } + + return &types.QueryLoanedResponse{Loaned: sdk.NewCoins(token)}, nil +} + +func (q Querier) LoanedValue( + goCtx context.Context, + req *types.QueryLoanedValueRequest, +) (*types.QueryLoanedValueResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Address == "" { + return nil, status.Error(codes.InvalidArgument, "invalid address") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + lender, err := sdk.AccAddressFromBech32(req.Address) + if err != nil { + return nil, err + } + + var tokens sdk.Coins + + if len(req.Denom) == 0 { + tokens, err = q.Keeper.GetLenderLoaned(ctx, lender) + if err != nil { + return nil, err + } + } else { + if !q.Keeper.IsAcceptedToken(ctx, req.Denom) { + return nil, status.Error(codes.InvalidArgument, "not accepted Token denom") + } + + loaned, err := q.Keeper.GetLoaned(ctx, lender, req.Denom) + if err != nil { + return nil, err + } + + tokens = sdk.NewCoins(loaned) + } + + value, err := q.Keeper.TotalTokenValue(ctx, tokens) + if err != nil { + return nil, err + } + + return &types.QueryLoanedValueResponse{LoanedValue: value}, nil +} + func (q Querier) AvailableBorrow( goCtx context.Context, req *types.QueryAvailableBorrowRequest, @@ -170,8 +293,7 @@ func (q Querier) MarketSize( return nil, status.Error(codes.InvalidArgument, "not accepted Token denom") } - uTokenDenom := q.Keeper.FromTokenToUTokenDenom(ctx, req.Denom) - marketSizeCoin, err := q.Keeper.ExchangeUToken(ctx, q.Keeper.GetUTokenSupply(ctx, uTokenDenom)) + marketSizeCoin, err := q.Keeper.GetTotalLoaned(ctx, req.Denom) if err != nil { return nil, err } @@ -184,6 +306,30 @@ func (q Querier) MarketSize( return &types.QueryMarketSizeResponse{MarketSizeUsd: marketSizeUSD}, nil } +func (q Querier) TokenMarketSize( + goCtx context.Context, + req *types.QueryTokenMarketSizeRequest, +) (*types.QueryTokenMarketSizeResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + if req.Denom == "" { + return nil, status.Error(codes.InvalidArgument, "invalid denom") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + if !q.Keeper.IsAcceptedToken(ctx, req.Denom) { + return nil, status.Error(codes.InvalidArgument, "not accepted Token denom") + } + + marketSizeCoin, err := q.Keeper.GetTotalLoaned(ctx, req.Denom) + if err != nil { + return nil, err + } + + return &types.QueryTokenMarketSizeResponse{MarketSize: marketSizeCoin.Amount}, nil +} + func (q Querier) ReserveAmount( goCtx context.Context, req *types.QueryReserveAmountRequest, diff --git a/x/leverage/keeper/keeper.go b/x/leverage/keeper/keeper.go index 21d0ed1b4e..3911163095 100644 --- a/x/leverage/keeper/keeper.go +++ b/x/leverage/keeper/keeper.go @@ -109,7 +109,7 @@ func (k Keeper) LendAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, loan sdk.C } // WithdrawAsset attempts to deposit uTokens into the leverage module in exchange -// for the original tokens lent. If the uToken type is invalid or account balance +// for the original tokens loaned. If the uToken type is invalid or account balance // insufficient on either side, we return an error. func (k Keeper) WithdrawAsset(ctx sdk.Context, lenderAddr sdk.AccAddress, uToken sdk.Coin) error { if !k.IsAcceptedUToken(ctx, uToken.Denom) { diff --git a/x/leverage/keeper/keeper_test.go b/x/leverage/keeper/keeper_test.go index 9a1ab42430..dcc41fda09 100644 --- a/x/leverage/keeper/keeper_test.go +++ b/x/leverage/keeper/keeper_test.go @@ -206,7 +206,7 @@ func (s *IntegrationTestSuite) TestWithdrawAsset_Valid() { expected := sdk.NewInt64Coin(uTokenDenom, 1000000000) // 1k u/umee s.Require().Equal(expected, supply) - // withdraw the total amount of assets lent + // withdraw the total amount of assets loaned uToken := expected err = s.app.LeverageKeeper.WithdrawAsset(ctx, lenderAddr, uToken) s.Require().NoError(err) diff --git a/x/leverage/keeper/loaned.go b/x/leverage/keeper/loaned.go new file mode 100644 index 0000000000..29abafd01b --- /dev/null +++ b/x/leverage/keeper/loaned.go @@ -0,0 +1,55 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/umee-network/umee/x/leverage/types" +) + +// GetLoaned returns an sdk.Coin representing how much of a given denom a +// lender has loaned, including interest accrued. +func (k Keeper) GetLoaned(ctx sdk.Context, lenderAddr sdk.AccAddress, denom string) (sdk.Coin, error) { + if !k.IsAcceptedToken(ctx, denom) { + return sdk.Coin{}, sdkerrors.Wrap(types.ErrInvalidAsset, denom) + } + + // sum wallet-held and collateral-enabled uTokens in the associated uToken denom + uDenom := k.FromTokenToUTokenDenom(ctx, denom) + balance := k.bankKeeper.GetBalance(ctx, lenderAddr, uDenom) + collateral := k.GetCollateralAmount(ctx, lenderAddr, uDenom) + + // convert uTokens to tokens + return k.ExchangeUToken(ctx, balance.Add(collateral)) +} + +// GetLenderLoaned returns the total tokens loaned by a lender across all denoms, +// including any interest accrued. +func (k Keeper) GetLenderLoaned(ctx sdk.Context, lenderAddr sdk.AccAddress) (sdk.Coins, error) { + // get all uTokens set as collateral + collateral := k.GetBorrowerCollateral(ctx, lenderAddr) + + // get all uTokens not set as collateral by filtering non-uTokens from lender balance + uTokens := sdk.Coins{} + balance := k.bankKeeper.GetAllBalances(ctx, lenderAddr) + for _, coin := range balance { + if k.IsAcceptedUToken(ctx, coin.Denom) { + uTokens = uTokens.Add(coin) + } + } + + // convert the sum of found uTokens to base tokens + return k.ExchangeUTokens(ctx, collateral.Add(uTokens...)) +} + +// GetTotalLoaned returns the total loaned by all lenders in a given denom, +// including any interest accrued. +func (k Keeper) GetTotalLoaned(ctx sdk.Context, denom string) (sdk.Coin, error) { + if !k.IsAcceptedToken(ctx, denom) { + return sdk.Coin{}, sdkerrors.Wrap(types.ErrInvalidAsset, denom) + } + + // convert associated uToken's total supply to base tokens + uTokenDenom := k.FromTokenToUTokenDenom(ctx, denom) + return k.ExchangeUToken(ctx, k.GetUTokenSupply(ctx, uTokenDenom)) +} diff --git a/x/leverage/keeper/oracle.go b/x/leverage/keeper/oracle.go index f19f43115e..b7e7908993 100644 --- a/x/leverage/keeper/oracle.go +++ b/x/leverage/keeper/oracle.go @@ -23,7 +23,7 @@ func (k Keeper) TokenPrice(ctx sdk.Context, denom string) (sdk.Dec, error) { price, err := k.oracleKeeper.GetExchangeRateBase(ctx, denom) if err != nil { - return sdk.ZeroDec(), err + return sdk.ZeroDec(), sdkerrors.Wrap(err, "oracle") } if price.IsNil() || !price.IsPositive() { diff --git a/x/leverage/simulation/operations.go b/x/leverage/simulation/operations.go index 3f1a153e53..42b0d79970 100644 --- a/x/leverage/simulation/operations.go +++ b/x/leverage/simulation/operations.go @@ -137,7 +137,7 @@ func SimulateMsgLendAsset(ak simulation.AccountKeeper, bk types.BankKeeper) simt } // SimulateMsgWithdrawAsset tests and runs a single msg withdraw where -// an account attempts to withdraw some lent assets. +// an account attempts to withdraw some loaned assets. func SimulateMsgWithdrawAsset(ak simulation.AccountKeeper, bk types.BankKeeper, lk keeper.Keeper) simtypes.Operation { return func( r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, diff --git a/x/leverage/spec/01_concepts.md b/x/leverage/spec/01_concepts.md index bcef7a6df9..1e5994a21e 100644 --- a/x/leverage/spec/01_concepts.md +++ b/x/leverage/spec/01_concepts.md @@ -24,7 +24,7 @@ Users have the following actions available to them: Additionally, for assets denominations already enabled as collateral, the lent assets immediately become collateral as well, causing their borrow limit to increase. - If a lender is undercollateralized (borrowed value > borrow limit), lent assets are eligible for liquidation and cannot be withdrawn until the user's borrows are healthy again. + If a lender is undercollateralized (borrowed value > borrow limit), collateral is eligible for liquidation and cannot be withdrawn until the user's borrows are healthy again. Care should be taken by undercollateralized users when lending token amounts too small to restore the health of their borrows, as the newly lent assets will be eligible for liquidation immediately. @@ -170,6 +170,6 @@ if portionOverLimit > params.CompleteLiquidationThreshold { ### Market Size -The `MarketSize` of a token denom is the USD value of all tokens lent to the asset facility, including those that have been borrowed out and any interest accrued, minus reserves. +The `MarketSize` of a token denom is the USD value of all tokens loaned to the asset facility, including those that have been borrowed out and any interest accrued, minus reserves. `MarketSize(denom) = oracle.Price(denom) * [ ModuleBalance(denom) - ReservedAmount(denom) + TotalBorrowed(denom) ]` \ No newline at end of file diff --git a/x/leverage/spec/03_queries.md b/x/leverage/spec/03_queries.md index f55d8c295f..447197924f 100644 --- a/x/leverage/spec/03_queries.md +++ b/x/leverage/spec/03_queries.md @@ -12,10 +12,14 @@ Queries on accepted asset types: - **Lend APY** queries for the [Lending APY](01_concepts.md#Lending-APY) of a specified denomination. - **Reserve Amount** queries for the amount reserved of a specified denomination. - **Exchange Rate** queries the [uToken Exchange Rate](01_concepts.md#uToken-Exchange-Rate) of a given uToken denomination. -- **Market Size** queries the [Market Size](01_concepts.md#Market-Size) of a specified denomination +- **Market Size** queries the [Market Size](01_concepts.md#Market-Size) of a specified denomination. +- **Token Market Size** queries the [Market Size](01_concepts.md#Market-Size) of a specified denomination, but denominated in base tokens instead of USD. This amounts to _total loaned by all lenders + interest accrued._ Queries on account addresses: -- **Borrowed** queries for the borrowed amount of a user by token denomination. If the denomination is not supplied, the total for each borrowed token is returned. -- **Collateral Setting** queries a borrower's collateral setting of a specified uToken denomination. -- **Collateral** queries the collateral amount of a user by token denomination. If the denomination is not supplied, the total for each collateral token is returned. -- **Borrow Limit** queries the [Borrow Limit](01_concepts.md#Borrow-Limit) in USD of a given borrower. \ No newline at end of file +- **Borrowed** queries for the amount of a given token denomination borrowed by a user. If a denomination is not supplied, the total for each borrowed token is returned. +- **BorrowedValue** queries for the USD value of the amount of a given token denomination borrowed by a user. If a denomination is not supplied, the total across all of that user's borrowed tokens is returned. +- **Loaned** queries for the amount of a given token denomination loaned by a user. If a denomination is not supplied, the total sum of all of that user's loaned tokens is returned. +- **LoanedValue** queries for the USD value of the amount of a given token denomination loaned by a user. If a denomination is not supplied, the total across all of that user's loaned tokens is returned. +- **Collateral Setting** queries a borrower's collateral setting (enabled or disabled) of a specified uToken denomination. +- **Collateral** queries a user's collateral amount by token denomination. If a denomination is not supplied, the total for each collateral token is returned. +- **Borrow Limit** queries the [Borrow Limit](01_concepts.md#Borrow-Limit) in USD of a given user. \ No newline at end of file diff --git a/x/leverage/types/expected_types.go b/x/leverage/types/expected_types.go index 45dc4f3c00..b5e25e12ad 100644 --- a/x/leverage/types/expected_types.go +++ b/x/leverage/types/expected_types.go @@ -25,6 +25,7 @@ type BankKeeper interface { ) error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin + GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins } diff --git a/x/leverage/types/query.pb.go b/x/leverage/types/query.pb.go index 90add1e823..9b7e5f21b9 100644 --- a/x/leverage/types/query.pb.go +++ b/x/leverage/types/query.pb.go @@ -409,6 +409,91 @@ func (m *QueryMarketSizeResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryMarketSizeResponse proto.InternalMessageInfo +// QueryTokenMarketSizeRequest defines the request structure for the Token Market Size +// gRPC service handler. +type QueryTokenMarketSizeRequest struct { + Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryTokenMarketSizeRequest) Reset() { *m = QueryTokenMarketSizeRequest{} } +func (m *QueryTokenMarketSizeRequest) String() string { return proto.CompactTextString(m) } +func (*QueryTokenMarketSizeRequest) ProtoMessage() {} +func (*QueryTokenMarketSizeRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{9} +} +func (m *QueryTokenMarketSizeRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenMarketSizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenMarketSizeRequest.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 *QueryTokenMarketSizeRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenMarketSizeRequest.Merge(m, src) +} +func (m *QueryTokenMarketSizeRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenMarketSizeRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenMarketSizeRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenMarketSizeRequest proto.InternalMessageInfo + +func (m *QueryTokenMarketSizeRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryTokenMarketSizeResponse defines the response structure for the Token Market Size +// gRPC service handler. +type QueryTokenMarketSizeResponse struct { + MarketSize github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,1,opt,name=market_size,json=marketSize,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"market_size"` +} + +func (m *QueryTokenMarketSizeResponse) Reset() { *m = QueryTokenMarketSizeResponse{} } +func (m *QueryTokenMarketSizeResponse) String() string { return proto.CompactTextString(m) } +func (*QueryTokenMarketSizeResponse) ProtoMessage() {} +func (*QueryTokenMarketSizeResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{10} +} +func (m *QueryTokenMarketSizeResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryTokenMarketSizeResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryTokenMarketSizeResponse.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 *QueryTokenMarketSizeResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryTokenMarketSizeResponse.Merge(m, src) +} +func (m *QueryTokenMarketSizeResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryTokenMarketSizeResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryTokenMarketSizeResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryTokenMarketSizeResponse proto.InternalMessageInfo + // QueryRegisteredTokensResponse defines the response structure for the // RegisteredTokens gRPC service handler. type QueryRegisteredTokensResponse struct { @@ -419,7 +504,7 @@ func (m *QueryRegisteredTokensResponse) Reset() { *m = QueryRegisteredTo func (m *QueryRegisteredTokensResponse) String() string { return proto.CompactTextString(m) } func (*QueryRegisteredTokensResponse) ProtoMessage() {} func (*QueryRegisteredTokensResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{9} + return fileDescriptor_32bddfd5abbfa4dc, []int{11} } func (m *QueryRegisteredTokensResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -464,7 +549,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{10} + return fileDescriptor_32bddfd5abbfa4dc, []int{12} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -503,7 +588,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{11} + return fileDescriptor_32bddfd5abbfa4dc, []int{13} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -550,7 +635,7 @@ func (m *QueryBorrowedRequest) Reset() { *m = QueryBorrowedRequest{} } func (m *QueryBorrowedRequest) String() string { return proto.CompactTextString(m) } func (*QueryBorrowedRequest) ProtoMessage() {} func (*QueryBorrowedRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{12} + return fileDescriptor_32bddfd5abbfa4dc, []int{14} } func (m *QueryBorrowedRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -603,7 +688,7 @@ func (m *QueryBorrowedResponse) Reset() { *m = QueryBorrowedResponse{} } func (m *QueryBorrowedResponse) String() string { return proto.CompactTextString(m) } func (*QueryBorrowedResponse) ProtoMessage() {} func (*QueryBorrowedResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{13} + return fileDescriptor_32bddfd5abbfa4dc, []int{15} } func (m *QueryBorrowedResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -639,6 +724,286 @@ func (m *QueryBorrowedResponse) GetBorrowed() github_com_cosmos_cosmos_sdk_types return nil } +// QueryBorrowedValueRequest defines the request structure for the BorrowedValue gRPC service handler. +type QueryBorrowedValueRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryBorrowedValueRequest) Reset() { *m = QueryBorrowedValueRequest{} } +func (m *QueryBorrowedValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryBorrowedValueRequest) ProtoMessage() {} +func (*QueryBorrowedValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{16} +} +func (m *QueryBorrowedValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBorrowedValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBorrowedValueRequest.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 *QueryBorrowedValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBorrowedValueRequest.Merge(m, src) +} +func (m *QueryBorrowedValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryBorrowedValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBorrowedValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBorrowedValueRequest proto.InternalMessageInfo + +func (m *QueryBorrowedValueRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryBorrowedValueRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryBorrowedValueResponse defines the response structure for the BorrowedValue gRPC service handler. +type QueryBorrowedValueResponse struct { + BorrowedValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=borrowed_value,json=borrowedValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"borrowed_value"` +} + +func (m *QueryBorrowedValueResponse) Reset() { *m = QueryBorrowedValueResponse{} } +func (m *QueryBorrowedValueResponse) String() string { return proto.CompactTextString(m) } +func (*QueryBorrowedValueResponse) ProtoMessage() {} +func (*QueryBorrowedValueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{17} +} +func (m *QueryBorrowedValueResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryBorrowedValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryBorrowedValueResponse.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 *QueryBorrowedValueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryBorrowedValueResponse.Merge(m, src) +} +func (m *QueryBorrowedValueResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryBorrowedValueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryBorrowedValueResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryBorrowedValueResponse proto.InternalMessageInfo + +// QueryLoanedRequest defines the request structure for the Loaned gRPC service handler. +type QueryLoanedRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryLoanedRequest) Reset() { *m = QueryLoanedRequest{} } +func (m *QueryLoanedRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLoanedRequest) ProtoMessage() {} +func (*QueryLoanedRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{18} +} +func (m *QueryLoanedRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLoanedRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLoanedRequest.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 *QueryLoanedRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLoanedRequest.Merge(m, src) +} +func (m *QueryLoanedRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLoanedRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLoanedRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLoanedRequest proto.InternalMessageInfo + +func (m *QueryLoanedRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryLoanedRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryLoanedResponse defines the response structure for the Loaned gRPC service handler. +type QueryLoanedResponse struct { + Loaned github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=loaned,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"loaned"` +} + +func (m *QueryLoanedResponse) Reset() { *m = QueryLoanedResponse{} } +func (m *QueryLoanedResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLoanedResponse) ProtoMessage() {} +func (*QueryLoanedResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{19} +} +func (m *QueryLoanedResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLoanedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLoanedResponse.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 *QueryLoanedResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLoanedResponse.Merge(m, src) +} +func (m *QueryLoanedResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLoanedResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLoanedResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLoanedResponse proto.InternalMessageInfo + +func (m *QueryLoanedResponse) GetLoaned() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Loaned + } + return nil +} + +// QueryLoanedValueRequest defines the request structure for the LoanedValue gRPC service handler. +type QueryLoanedValueRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` +} + +func (m *QueryLoanedValueRequest) Reset() { *m = QueryLoanedValueRequest{} } +func (m *QueryLoanedValueRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLoanedValueRequest) ProtoMessage() {} +func (*QueryLoanedValueRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{20} +} +func (m *QueryLoanedValueRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLoanedValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLoanedValueRequest.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 *QueryLoanedValueRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLoanedValueRequest.Merge(m, src) +} +func (m *QueryLoanedValueRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLoanedValueRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLoanedValueRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLoanedValueRequest proto.InternalMessageInfo + +func (m *QueryLoanedValueRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryLoanedValueRequest) GetDenom() string { + if m != nil { + return m.Denom + } + return "" +} + +// QueryLoanedValueResponse defines the response structure for the LoanedValue gRPC service handler. +type QueryLoanedValueResponse struct { + LoanedValue github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=loaned_value,json=loanedValue,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"loaned_value"` +} + +func (m *QueryLoanedValueResponse) Reset() { *m = QueryLoanedValueResponse{} } +func (m *QueryLoanedValueResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLoanedValueResponse) ProtoMessage() {} +func (*QueryLoanedValueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_32bddfd5abbfa4dc, []int{21} +} +func (m *QueryLoanedValueResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLoanedValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLoanedValueResponse.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 *QueryLoanedValueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLoanedValueResponse.Merge(m, src) +} +func (m *QueryLoanedValueResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLoanedValueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLoanedValueResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLoanedValueResponse proto.InternalMessageInfo + // QueryReserveAmountRequest defines the request structure for the ReserveAmount // gRPC service handler. type QueryReserveAmountRequest struct { @@ -649,7 +1014,7 @@ func (m *QueryReserveAmountRequest) Reset() { *m = QueryReserveAmountReq func (m *QueryReserveAmountRequest) String() string { return proto.CompactTextString(m) } func (*QueryReserveAmountRequest) ProtoMessage() {} func (*QueryReserveAmountRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{14} + return fileDescriptor_32bddfd5abbfa4dc, []int{22} } func (m *QueryReserveAmountRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -695,7 +1060,7 @@ func (m *QueryReserveAmountResponse) Reset() { *m = QueryReserveAmountRe func (m *QueryReserveAmountResponse) String() string { return proto.CompactTextString(m) } func (*QueryReserveAmountResponse) ProtoMessage() {} func (*QueryReserveAmountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{15} + return fileDescriptor_32bddfd5abbfa4dc, []int{23} } func (m *QueryReserveAmountResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -735,7 +1100,7 @@ func (m *QueryCollateralSettingRequest) Reset() { *m = QueryCollateralSe func (m *QueryCollateralSettingRequest) String() string { return proto.CompactTextString(m) } func (*QueryCollateralSettingRequest) ProtoMessage() {} func (*QueryCollateralSettingRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{16} + return fileDescriptor_32bddfd5abbfa4dc, []int{24} } func (m *QueryCollateralSettingRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -788,7 +1153,7 @@ func (m *QueryCollateralSettingResponse) Reset() { *m = QueryCollateralS func (m *QueryCollateralSettingResponse) String() string { return proto.CompactTextString(m) } func (*QueryCollateralSettingResponse) ProtoMessage() {} func (*QueryCollateralSettingResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{17} + return fileDescriptor_32bddfd5abbfa4dc, []int{25} } func (m *QueryCollateralSettingResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -835,7 +1200,7 @@ func (m *QueryCollateralRequest) Reset() { *m = QueryCollateralRequest{} func (m *QueryCollateralRequest) String() string { return proto.CompactTextString(m) } func (*QueryCollateralRequest) ProtoMessage() {} func (*QueryCollateralRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{18} + return fileDescriptor_32bddfd5abbfa4dc, []int{26} } func (m *QueryCollateralRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -888,7 +1253,7 @@ func (m *QueryCollateralResponse) Reset() { *m = QueryCollateralResponse func (m *QueryCollateralResponse) String() string { return proto.CompactTextString(m) } func (*QueryCollateralResponse) ProtoMessage() {} func (*QueryCollateralResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{19} + return fileDescriptor_32bddfd5abbfa4dc, []int{27} } func (m *QueryCollateralResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -934,7 +1299,7 @@ func (m *QueryExchangeRateRequest) Reset() { *m = QueryExchangeRateReque func (m *QueryExchangeRateRequest) String() string { return proto.CompactTextString(m) } func (*QueryExchangeRateRequest) ProtoMessage() {} func (*QueryExchangeRateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{20} + return fileDescriptor_32bddfd5abbfa4dc, []int{28} } func (m *QueryExchangeRateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -980,7 +1345,7 @@ func (m *QueryExchangeRateResponse) Reset() { *m = QueryExchangeRateResp func (m *QueryExchangeRateResponse) String() string { return proto.CompactTextString(m) } func (*QueryExchangeRateResponse) ProtoMessage() {} func (*QueryExchangeRateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{21} + return fileDescriptor_32bddfd5abbfa4dc, []int{29} } func (m *QueryExchangeRateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1019,7 +1384,7 @@ func (m *QueryBorrowLimitRequest) Reset() { *m = QueryBorrowLimitRequest func (m *QueryBorrowLimitRequest) String() string { return proto.CompactTextString(m) } func (*QueryBorrowLimitRequest) ProtoMessage() {} func (*QueryBorrowLimitRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{22} + return fileDescriptor_32bddfd5abbfa4dc, []int{30} } func (m *QueryBorrowLimitRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1065,7 +1430,7 @@ func (m *QueryBorrowLimitResponse) Reset() { *m = QueryBorrowLimitRespon func (m *QueryBorrowLimitResponse) String() string { return proto.CompactTextString(m) } func (*QueryBorrowLimitResponse) ProtoMessage() {} func (*QueryBorrowLimitResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{23} + return fileDescriptor_32bddfd5abbfa4dc, []int{31} } func (m *QueryBorrowLimitResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1103,7 +1468,7 @@ func (m *QueryLiquidationTargetsRequest) Reset() { *m = QueryLiquidation func (m *QueryLiquidationTargetsRequest) String() string { return proto.CompactTextString(m) } func (*QueryLiquidationTargetsRequest) ProtoMessage() {} func (*QueryLiquidationTargetsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_32bddfd5abbfa4dc, []int{24} + return fileDescriptor_32bddfd5abbfa4dc, []int{32} } func (m *QueryLiquidationTargetsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1142,7 +1507,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_32bddfd5abbfa4dc, []int{25} + return fileDescriptor_32bddfd5abbfa4dc, []int{33} } func (m *QueryLiquidationTargetsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1188,11 +1553,19 @@ func init() { proto.RegisterType((*QueryLendAPYResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryLendAPYResponse") proto.RegisterType((*QueryMarketSizeRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryMarketSizeRequest") proto.RegisterType((*QueryMarketSizeResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryMarketSizeResponse") + proto.RegisterType((*QueryTokenMarketSizeRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryTokenMarketSizeRequest") + proto.RegisterType((*QueryTokenMarketSizeResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryTokenMarketSizeResponse") proto.RegisterType((*QueryRegisteredTokensResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryRegisteredTokensResponse") proto.RegisterType((*QueryParamsRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryParamsResponse") proto.RegisterType((*QueryBorrowedRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryBorrowedRequest") proto.RegisterType((*QueryBorrowedResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryBorrowedResponse") + proto.RegisterType((*QueryBorrowedValueRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryBorrowedValueRequest") + proto.RegisterType((*QueryBorrowedValueResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryBorrowedValueResponse") + proto.RegisterType((*QueryLoanedRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryLoanedRequest") + proto.RegisterType((*QueryLoanedResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryLoanedResponse") + proto.RegisterType((*QueryLoanedValueRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryLoanedValueRequest") + proto.RegisterType((*QueryLoanedValueResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryLoanedValueResponse") proto.RegisterType((*QueryReserveAmountRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryReserveAmountRequest") proto.RegisterType((*QueryReserveAmountResponse)(nil), "umeenetwork.umee.leverage.v1beta1.QueryReserveAmountResponse") proto.RegisterType((*QueryCollateralSettingRequest)(nil), "umeenetwork.umee.leverage.v1beta1.QueryCollateralSettingRequest") @@ -1210,82 +1583,94 @@ func init() { func init() { proto.RegisterFile("umee/leverage/v1beta1/query.proto", fileDescriptor_32bddfd5abbfa4dc) } var fileDescriptor_32bddfd5abbfa4dc = []byte{ - // 1186 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0x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xb5, - 0x49, 0x5a, 0xee, 0x49, 0x42, 0xe0, 0x52, 0x96, 0xd4, 0x52, 0x2e, 0xd0, 0xd9, 0xb8, 0x2e, 0x19, - 0x49, 0x0b, 0xe8, 0xb0, 0x72, 0xd7, 0x1f, 0xec, 0x66, 0xc8, 0xc3, 0xdd, 0x0c, 0xf9, 0x77, 0x37, - 0x43, 0xbe, 0xda, 0xcb, 0xf4, 0x3c, 0xdc, 0xcb, 0xf4, 0xfc, 0xbd, 0x97, 0xe9, 0xb9, 0x3d, 0xdf, - 0xe2, 0x07, 0x83, 0x78, 0xf3, 0x08, 0x17, 0x06, 0xbf, 0x17, 0x85, 0x57, 0xd6, 0xb0, 0xd8, 0xab, - 0xfe, 0xd5, 0xb2, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0a, 0x8c, 0xf1, 0x9b, 0x2c, 0x12, - 0x00, 0x00, + // 1380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x73, 0x14, 0x45, + 0x14, 0xcf, 0x80, 0x84, 0xf0, 0x02, 0xa2, 0x6d, 0x94, 0x65, 0x84, 0x5d, 0x18, 0xbe, 0xf2, 0x41, + 0x66, 0xf3, 0x51, 0x0a, 0x06, 0x54, 0xb2, 0x20, 0x88, 0xc6, 0x22, 0x6c, 0x80, 0x12, 0x0e, 0x4e, + 0xcd, 0xee, 0xb4, 0xcb, 0xd4, 0xce, 0xce, 0x6c, 0x66, 0x66, 0x03, 0xc9, 0xc9, 0xf2, 0xe0, 0xd9, + 0x2a, 0xef, 0x5e, 0xac, 0xf2, 0xa0, 0x55, 0x7a, 0xf0, 0xe0, 0x81, 0x8b, 0x55, 0x7a, 0xa0, 0xca, + 0x83, 0x54, 0x79, 0xb1, 0x3c, 0xa0, 0x95, 0xf8, 0x87, 0x58, 0xd3, 0xfd, 0xe6, 0x6b, 0x77, 0x26, +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0x1f, 0x00, 0x00, 0xff, 0xff, 0xc1, 0x71, 0xdf, 0x41, + 0xec, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1308,29 +1693,46 @@ type QueryClient interface { // If the denomination is not supplied, the total for each borrowed token is // returned. Borrowed(ctx context.Context, in *QueryBorrowedRequest, opts ...grpc.CallOption) (*QueryBorrowedResponse, error) + // BorrowedValue queries for the usd value of the borrowed amount of a user + // by token denomination. If the denomination is not supplied, the sum across + // all borrowed tokens isreturned. + BorrowedValue(ctx context.Context, in *QueryBorrowedValueRequest, opts ...grpc.CallOption) (*QueryBorrowedValueResponse, error) + // Loaned queries for the amount of tokens loaned by a user by denomination. + // If the denomination is not supplied, the total for each loaned token is + // returned. + Loaned(ctx context.Context, in *QueryLoanedRequest, opts ...grpc.CallOption) (*QueryLoanedResponse, error) + // LoanedValue queries for the USD value loaned by a user by token + // denomination. If the denomination is not supplied, the sum across all + // loaned tokens is returned. + LoanedValue(ctx context.Context, in *QueryLoanedValueRequest, opts ...grpc.CallOption) (*QueryLoanedValueResponse, error) // AvailableBorrow queries for the available amount to borrow of a specified denomination. AvailableBorrow(ctx context.Context, in *QueryAvailableBorrowRequest, opts ...grpc.CallOption) (*QueryAvailableBorrowResponse, error) // BorrowAPY queries for the borrow APY of a specified denomination. BorrowAPY(ctx context.Context, in *QueryBorrowAPYRequest, opts ...grpc.CallOption) (*QueryBorrowAPYResponse, error) // LendAPY queries for the lend APY of a specified denomination. LendAPY(ctx context.Context, in *QueryLendAPYRequest, opts ...grpc.CallOption) (*QueryLendAPYResponse, error) - // MarketSize queries for the Market Size in USD of a specified denomination. + // MarketSize queries for the Market Size in USD of a specified denomination, which + // is the USD value of total tokens loaned by all users plus borrow interest owed + // by all users. MarketSize(ctx context.Context, in *QueryMarketSizeRequest, opts ...grpc.CallOption) (*QueryMarketSizeResponse, error) + // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, + // which is the total tokens loaned by all users plus borrow interest owed by all users. + TokenMarketSize(ctx context.Context, in *QueryTokenMarketSizeRequest, opts ...grpc.CallOption) (*QueryTokenMarketSizeResponse, error) // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. ReserveAmount(ctx context.Context, in *QueryReserveAmountRequest, opts ...grpc.CallOption) (*QueryReserveAmountResponse, error) - // CollateralSetting queries a borrower's collateral setting of a specified - // uToken denomination. + // CollateralSetting queries a borrower's collateral setting (enabled or disabled) + // for a specified uToken denomination. CollateralSetting(ctx context.Context, in *QueryCollateralSettingRequest, opts ...grpc.CallOption) (*QueryCollateralSettingResponse, error) // Collateral queries the collateral amount of a user by token denomination. - // If the denomination is not supplied, the total for each collateral token is - // returned. + // If the denomination is not supplied, all of the user's collateral tokens + // are returned. Collateral(ctx context.Context, in *QueryCollateralRequest, opts ...grpc.CallOption) (*QueryCollateralResponse, error) // ExchangeRate queries the uToken exchange rate of a given uToken denomination. ExchangeRate(ctx context.Context, in *QueryExchangeRateRequest, opts ...grpc.CallOption) (*QueryExchangeRateResponse, error) - // BorrowLimit queries the borrow limit in USD of a given borrower + // BorrowLimit queries the borrow limit in USD of a given borrower. BorrowLimit(ctx context.Context, in *QueryBorrowLimitRequest, opts ...grpc.CallOption) (*QueryBorrowLimitResponse, error) - // LiquidationTargets queries a list of all borrowers eligible for liquidation + // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. LiquidationTargets(ctx context.Context, in *QueryLiquidationTargetsRequest, opts ...grpc.CallOption) (*QueryLiquidationTargetsResponse, error) } @@ -1369,6 +1771,33 @@ func (c *queryClient) Borrowed(ctx context.Context, in *QueryBorrowedRequest, op return out, nil } +func (c *queryClient) BorrowedValue(ctx context.Context, in *QueryBorrowedValueRequest, opts ...grpc.CallOption) (*QueryBorrowedValueResponse, error) { + out := new(QueryBorrowedValueResponse) + err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/BorrowedValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Loaned(ctx context.Context, in *QueryLoanedRequest, opts ...grpc.CallOption) (*QueryLoanedResponse, error) { + out := new(QueryLoanedResponse) + err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/Loaned", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LoanedValue(ctx context.Context, in *QueryLoanedValueRequest, opts ...grpc.CallOption) (*QueryLoanedValueResponse, error) { + out := new(QueryLoanedValueResponse) + err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/LoanedValue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) AvailableBorrow(ctx context.Context, in *QueryAvailableBorrowRequest, opts ...grpc.CallOption) (*QueryAvailableBorrowResponse, error) { out := new(QueryAvailableBorrowResponse) err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/AvailableBorrow", in, out, opts...) @@ -1405,6 +1834,15 @@ func (c *queryClient) MarketSize(ctx context.Context, in *QueryMarketSizeRequest return out, nil } +func (c *queryClient) TokenMarketSize(ctx context.Context, in *QueryTokenMarketSizeRequest, opts ...grpc.CallOption) (*QueryTokenMarketSizeResponse, error) { + out := new(QueryTokenMarketSizeResponse) + err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/TokenMarketSize", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) ReserveAmount(ctx context.Context, in *QueryReserveAmountRequest, opts ...grpc.CallOption) (*QueryReserveAmountResponse, error) { out := new(QueryReserveAmountResponse) err := c.cc.Invoke(ctx, "/umeenetwork.umee.leverage.v1beta1.Query/ReserveAmount", in, out, opts...) @@ -1469,29 +1907,46 @@ type QueryServer interface { // If the denomination is not supplied, the total for each borrowed token is // returned. Borrowed(context.Context, *QueryBorrowedRequest) (*QueryBorrowedResponse, error) + // BorrowedValue queries for the usd value of the borrowed amount of a user + // by token denomination. If the denomination is not supplied, the sum across + // all borrowed tokens isreturned. + BorrowedValue(context.Context, *QueryBorrowedValueRequest) (*QueryBorrowedValueResponse, error) + // Loaned queries for the amount of tokens loaned by a user by denomination. + // If the denomination is not supplied, the total for each loaned token is + // returned. + Loaned(context.Context, *QueryLoanedRequest) (*QueryLoanedResponse, error) + // LoanedValue queries for the USD value loaned by a user by token + // denomination. If the denomination is not supplied, the sum across all + // loaned tokens is returned. + LoanedValue(context.Context, *QueryLoanedValueRequest) (*QueryLoanedValueResponse, error) // AvailableBorrow queries for the available amount to borrow of a specified denomination. AvailableBorrow(context.Context, *QueryAvailableBorrowRequest) (*QueryAvailableBorrowResponse, error) // BorrowAPY queries for the borrow APY of a specified denomination. BorrowAPY(context.Context, *QueryBorrowAPYRequest) (*QueryBorrowAPYResponse, error) // LendAPY queries for the lend APY of a specified denomination. LendAPY(context.Context, *QueryLendAPYRequest) (*QueryLendAPYResponse, error) - // MarketSize queries for the Market Size in USD of a specified denomination. + // MarketSize queries for the Market Size in USD of a specified denomination, which + // is the USD value of total tokens loaned by all users plus borrow interest owed + // by all users. MarketSize(context.Context, *QueryMarketSizeRequest) (*QueryMarketSizeResponse, error) + // TokenMarketSize queries for the Market Size in base tokens of a specified denomination, + // which is the total tokens loaned by all users plus borrow interest owed by all users. + TokenMarketSize(context.Context, *QueryTokenMarketSizeRequest) (*QueryTokenMarketSizeResponse, error) // ReserveAmount queries for the amount reserved of a specified denomination. // If the token is not valid, the reserved amount is zero. ReserveAmount(context.Context, *QueryReserveAmountRequest) (*QueryReserveAmountResponse, error) - // CollateralSetting queries a borrower's collateral setting of a specified - // uToken denomination. + // CollateralSetting queries a borrower's collateral setting (enabled or disabled) + // for a specified uToken denomination. CollateralSetting(context.Context, *QueryCollateralSettingRequest) (*QueryCollateralSettingResponse, error) // Collateral queries the collateral amount of a user by token denomination. - // If the denomination is not supplied, the total for each collateral token is - // returned. + // If the denomination is not supplied, all of the user's collateral tokens + // are returned. Collateral(context.Context, *QueryCollateralRequest) (*QueryCollateralResponse, error) // ExchangeRate queries the uToken exchange rate of a given uToken denomination. ExchangeRate(context.Context, *QueryExchangeRateRequest) (*QueryExchangeRateResponse, error) - // BorrowLimit queries the borrow limit in USD of a given borrower + // BorrowLimit queries the borrow limit in USD of a given borrower. BorrowLimit(context.Context, *QueryBorrowLimitRequest) (*QueryBorrowLimitResponse, error) - // LiquidationTargets queries a list of all borrowers eligible for liquidation + // LiquidationTargets queries a list of all borrower addresses eligible for liquidation. LiquidationTargets(context.Context, *QueryLiquidationTargetsRequest) (*QueryLiquidationTargetsResponse, error) } @@ -1508,6 +1963,15 @@ func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsReq func (*UnimplementedQueryServer) Borrowed(ctx context.Context, req *QueryBorrowedRequest) (*QueryBorrowedResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Borrowed not implemented") } +func (*UnimplementedQueryServer) BorrowedValue(ctx context.Context, req *QueryBorrowedValueRequest) (*QueryBorrowedValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method BorrowedValue not implemented") +} +func (*UnimplementedQueryServer) Loaned(ctx context.Context, req *QueryLoanedRequest) (*QueryLoanedResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Loaned not implemented") +} +func (*UnimplementedQueryServer) LoanedValue(ctx context.Context, req *QueryLoanedValueRequest) (*QueryLoanedValueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoanedValue not implemented") +} func (*UnimplementedQueryServer) AvailableBorrow(ctx context.Context, req *QueryAvailableBorrowRequest) (*QueryAvailableBorrowResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AvailableBorrow not implemented") } @@ -1520,6 +1984,9 @@ func (*UnimplementedQueryServer) LendAPY(ctx context.Context, req *QueryLendAPYR func (*UnimplementedQueryServer) MarketSize(ctx context.Context, req *QueryMarketSizeRequest) (*QueryMarketSizeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method MarketSize not implemented") } +func (*UnimplementedQueryServer) TokenMarketSize(ctx context.Context, req *QueryTokenMarketSizeRequest) (*QueryTokenMarketSizeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TokenMarketSize not implemented") +} func (*UnimplementedQueryServer) ReserveAmount(ctx context.Context, req *QueryReserveAmountRequest) (*QueryReserveAmountResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ReserveAmount not implemented") } @@ -1597,6 +2064,60 @@ func _Query_Borrowed_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Query_BorrowedValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryBorrowedValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).BorrowedValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umeenetwork.umee.leverage.v1beta1.Query/BorrowedValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).BorrowedValue(ctx, req.(*QueryBorrowedValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Loaned_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLoanedRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Loaned(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umeenetwork.umee.leverage.v1beta1.Query/Loaned", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Loaned(ctx, req.(*QueryLoanedRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_LoanedValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLoanedValueRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LoanedValue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umeenetwork.umee.leverage.v1beta1.Query/LoanedValue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LoanedValue(ctx, req.(*QueryLoanedValueRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_AvailableBorrow_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryAvailableBorrowRequest) if err := dec(in); err != nil { @@ -1669,6 +2190,24 @@ func _Query_MarketSize_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Query_TokenMarketSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryTokenMarketSizeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TokenMarketSize(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/umeenetwork.umee.leverage.v1beta1.Query/TokenMarketSize", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TokenMarketSize(ctx, req.(*QueryTokenMarketSizeRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ReserveAmount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryReserveAmountRequest) if err := dec(in); err != nil { @@ -1793,6 +2332,18 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Borrowed", Handler: _Query_Borrowed_Handler, }, + { + MethodName: "BorrowedValue", + Handler: _Query_BorrowedValue_Handler, + }, + { + MethodName: "Loaned", + Handler: _Query_Loaned_Handler, + }, + { + MethodName: "LoanedValue", + Handler: _Query_LoanedValue_Handler, + }, { MethodName: "AvailableBorrow", Handler: _Query_AvailableBorrow_Handler, @@ -1809,6 +2360,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "MarketSize", Handler: _Query_MarketSize_Handler, }, + { + MethodName: "TokenMarketSize", + Handler: _Query_TokenMarketSize_Handler, + }, { MethodName: "ReserveAmount", Handler: _Query_ReserveAmount_Handler, @@ -2113,6 +2668,69 @@ func (m *QueryMarketSizeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryTokenMarketSizeRequest) 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 *QueryTokenMarketSizeRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenMarketSizeRequest) 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 *QueryTokenMarketSizeResponse) 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 *QueryTokenMarketSizeResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryTokenMarketSizeResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.MarketSize.Size() + i -= size + if _, err := m.MarketSize.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryRegisteredTokensResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2280,7 +2898,7 @@ func (m *QueryBorrowedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryReserveAmountRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryBorrowedValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2290,12 +2908,12 @@ func (m *QueryReserveAmountRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryReserveAmountRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryBorrowedValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryReserveAmountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryBorrowedValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2305,12 +2923,19 @@ func (m *QueryReserveAmountRequest) MarshalToSizedBuffer(dAtA []byte) (int, erro copy(dAtA[i:], m.Denom) i = encodeVarintQuery(dAtA, i, uint64(len(m.Denom))) i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryReserveAmountResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryBorrowedValueResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2320,20 +2945,20 @@ func (m *QueryReserveAmountResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryReserveAmountResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryBorrowedValueResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryReserveAmountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryBorrowedValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size := m.Amount.Size() + size := m.BorrowedValue.Size() i -= size - if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.BorrowedValue.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintQuery(dAtA, i, uint64(size)) @@ -2343,7 +2968,7 @@ func (m *QueryReserveAmountResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryCollateralSettingRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryLoanedRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2353,12 +2978,12 @@ func (m *QueryCollateralSettingRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryCollateralSettingRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLoanedRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryCollateralSettingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLoanedRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2380,7 +3005,7 @@ func (m *QueryCollateralSettingRequest) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func (m *QueryCollateralSettingResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryLoanedResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2390,30 +3015,34 @@ func (m *QueryCollateralSettingResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryCollateralSettingResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLoanedResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryCollateralSettingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLoanedResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.Enabled { - i-- - if m.Enabled { - dAtA[i] = 1 - } else { - dAtA[i] = 0 + if len(m.Loaned) > 0 { + for iNdEx := len(m.Loaned) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Loaned[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *QueryCollateralRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryLoanedValueRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2423,12 +3052,12 @@ func (m *QueryCollateralRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryCollateralRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLoanedValueRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryCollateralRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLoanedValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2450,7 +3079,7 @@ func (m *QueryCollateralRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryCollateralResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryLoanedValueResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2460,34 +3089,30 @@ func (m *QueryCollateralResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryCollateralResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLoanedValueResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryCollateralResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLoanedValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Collateral) > 0 { - for iNdEx := len(m.Collateral) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Collateral[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + { + size := m.LoanedValue.Size() + i -= size + if _, err := m.LoanedValue.MarshalTo(dAtA[i:]); err != nil { + return 0, err } + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } -func (m *QueryExchangeRateRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryReserveAmountRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2497,12 +3122,12 @@ func (m *QueryExchangeRateRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryExchangeRateRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryReserveAmountRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryExchangeRateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryReserveAmountRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2517,7 +3142,7 @@ func (m *QueryExchangeRateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } -func (m *QueryExchangeRateResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryReserveAmountResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2527,20 +3152,20 @@ func (m *QueryExchangeRateResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryExchangeRateResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryReserveAmountResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryExchangeRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryReserveAmountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l { - size := m.ExchangeRate.Size() + size := m.Amount.Size() i -= size - if _, err := m.ExchangeRate.MarshalTo(dAtA[i:]); err != nil { + if _, err := m.Amount.MarshalTo(dAtA[i:]); err != nil { return 0, err } i = encodeVarintQuery(dAtA, i, uint64(size)) @@ -2550,7 +3175,7 @@ func (m *QueryExchangeRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } -func (m *QueryBorrowLimitRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryCollateralSettingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2560,16 +3185,23 @@ func (m *QueryBorrowLimitRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBorrowLimitRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollateralSettingRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBorrowLimitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollateralSettingRequest) 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] = 0x12 + } if len(m.Address) > 0 { i -= len(m.Address) copy(dAtA[i:], m.Address) @@ -2580,7 +3212,7 @@ func (m *QueryBorrowLimitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryBorrowLimitResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryCollateralSettingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2590,26 +3222,226 @@ func (m *QueryBorrowLimitResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryBorrowLimitResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryCollateralSettingResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryBorrowLimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryCollateralSettingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size := m.BorrowLimit.Size() - i -= size - if _, err := m.BorrowLimit.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa + if m.Enabled { + i-- + if m.Enabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryCollateralRequest) 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 *QueryCollateralRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollateralRequest) 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] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryCollateralResponse) 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 *QueryCollateralResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryCollateralResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Collateral) > 0 { + for iNdEx := len(m.Collateral) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Collateral[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 *QueryExchangeRateRequest) 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 *QueryExchangeRateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExchangeRateRequest) 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 *QueryExchangeRateResponse) 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 *QueryExchangeRateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryExchangeRateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ExchangeRate.Size() + i -= size + if _, err := m.ExchangeRate.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryBorrowLimitRequest) 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 *QueryBorrowLimitRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBorrowLimitRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryBorrowLimitResponse) 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 *QueryBorrowLimitResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryBorrowLimitResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.BorrowLimit.Size() + i -= size + if _, err := m.BorrowLimit.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -2784,6 +3616,30 @@ func (m *QueryMarketSizeResponse) Size() (n int) { return n } +func (m *QueryTokenMarketSizeRequest) 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 *QueryTokenMarketSizeResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MarketSize.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryRegisteredTokensResponse) Size() (n int) { if m == nil { return 0 @@ -2851,12 +3707,16 @@ func (m *QueryBorrowedResponse) Size() (n int) { return n } -func (m *QueryReserveAmountRequest) Size() (n int) { +func (m *QueryBorrowedValueRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } l = len(m.Denom) if l > 0 { n += 1 + l + sovQuery(uint64(l)) @@ -2864,18 +3724,18 @@ func (m *QueryReserveAmountRequest) Size() (n int) { return n } -func (m *QueryReserveAmountResponse) Size() (n int) { +func (m *QueryBorrowedValueResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Amount.Size() + l = m.BorrowedValue.Size() n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryCollateralSettingRequest) Size() (n int) { +func (m *QueryLoanedRequest) Size() (n int) { if m == nil { return 0 } @@ -2892,19 +3752,22 @@ func (m *QueryCollateralSettingRequest) Size() (n int) { return n } -func (m *QueryCollateralSettingResponse) Size() (n int) { +func (m *QueryLoanedResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Enabled { - n += 2 + if len(m.Loaned) > 0 { + for _, e := range m.Loaned { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } } return n } -func (m *QueryCollateralRequest) Size() (n int) { +func (m *QueryLoanedValueRequest) Size() (n int) { if m == nil { return 0 } @@ -2921,22 +3784,103 @@ func (m *QueryCollateralRequest) Size() (n int) { return n } -func (m *QueryCollateralResponse) Size() (n int) { +func (m *QueryLoanedValueResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.Collateral) > 0 { - for _, e := range m.Collateral { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } + l = m.LoanedValue.Size() + n += 1 + l + sovQuery(uint64(l)) return n } -func (m *QueryExchangeRateRequest) Size() (n int) { +func (m *QueryReserveAmountRequest) 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 *QueryReserveAmountResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Amount.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryCollateralSettingRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCollateralSettingResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Enabled { + n += 2 + } + return n +} + +func (m *QueryCollateralRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.Denom) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryCollateralResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Collateral) > 0 { + for _, e := range m.Collateral { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryExchangeRateRequest) Size() (n int) { if m == nil { return 0 } @@ -3253,17 +4197,815 @@ func (m *QueryBorrowAPYRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBorrowAPYRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBorrowAPYRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBorrowAPYRequest: 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 *QueryBorrowAPYResponse) 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: QueryBorrowAPYResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryBorrowAPYResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APY", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.APY.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 *QueryLendAPYRequest) 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: QueryLendAPYRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLendAPYRequest: 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 *QueryLendAPYResponse) 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: QueryLendAPYResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLendAPYResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field APY", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.APY.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 *QueryMarketSizeRequest) 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: QueryMarketSizeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMarketSizeRequest: 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 *QueryMarketSizeResponse) 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: QueryMarketSizeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryMarketSizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketSizeUsd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MarketSizeUsd.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 *QueryTokenMarketSizeRequest) 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: QueryTokenMarketSizeRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenMarketSizeRequest: 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 *QueryTokenMarketSizeResponse) 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: QueryTokenMarketSizeResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryTokenMarketSizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MarketSize", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MarketSize.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 *QueryRegisteredTokensResponse) 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: QueryRegisteredTokensResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRegisteredTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Registry", 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.Registry = append(m.Registry, Token{}) + if err := m.Registry[len(m.Registry)-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 *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBorrowAPYRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryParamsResponse: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3273,23 +5015,24 @@ func (m *QueryBorrowAPYRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Denom = string(dAtA[iNdEx:postIndex]) + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -3312,7 +5055,7 @@ func (m *QueryBorrowAPYRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBorrowAPYResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBorrowedRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3335,15 +5078,15 @@ func (m *QueryBorrowAPYResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBorrowAPYResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBorrowedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBorrowAPYResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBorrowedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APY", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3371,61 +5114,9 @@ func (m *QueryBorrowAPYResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.APY.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = 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 *QueryLendAPYRequest) 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: QueryLendAPYRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLendAPYRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } @@ -3478,7 +5169,7 @@ func (m *QueryLendAPYRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLendAPYResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBorrowedResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3501,17 +5192,17 @@ func (m *QueryLendAPYResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLendAPYResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBorrowedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLendAPYResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBorrowedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field APY", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Borrowed", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3521,23 +5212,23 @@ func (m *QueryLendAPYResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.APY.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Borrowed = append(m.Borrowed, types.Coin{}) + if err := m.Borrowed[len(m.Borrowed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3562,7 +5253,7 @@ func (m *QueryLendAPYResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMarketSizeRequest) Unmarshal(dAtA []byte) error { +func (m *QueryBorrowedValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3585,13 +5276,45 @@ func (m *QueryMarketSizeRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMarketSizeRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBorrowedValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMarketSizeRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBorrowedValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", 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.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } @@ -3644,7 +5367,7 @@ func (m *QueryMarketSizeRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryMarketSizeResponse) Unmarshal(dAtA []byte) error { +func (m *QueryBorrowedValueResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3667,15 +5390,15 @@ func (m *QueryMarketSizeResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryMarketSizeResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryBorrowedValueResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryMarketSizeResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryBorrowedValueResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MarketSizeUsd", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field BorrowedValue", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3703,7 +5426,7 @@ func (m *QueryMarketSizeResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.MarketSizeUsd.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.BorrowedValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3728,7 +5451,7 @@ func (m *QueryMarketSizeResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryRegisteredTokensResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLoanedRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3751,17 +5474,17 @@ func (m *QueryRegisteredTokensResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryRegisteredTokensResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLoanedRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryRegisteredTokensResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLoanedRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Registry", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -3771,76 +5494,56 @@ func (m *QueryRegisteredTokensResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Registry = append(m.Registry, Token{}) - if err := m.Registry[len(m.Registry)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Address = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Denom", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery + 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 + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsRequest) 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 + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery } - if iNdEx >= l { + if postIndex > 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { + m.Denom = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -3862,7 +5565,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLoanedResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3885,15 +5588,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLoanedResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLoanedResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Loaned", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3920,7 +5623,8 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Loaned = append(m.Loaned, types.Coin{}) + if err := m.Loaned[len(m.Loaned)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3945,7 +5649,7 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBorrowedRequest) Unmarshal(dAtA []byte) error { +func (m *QueryLoanedValueRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3968,10 +5672,10 @@ func (m *QueryBorrowedRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBorrowedRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLoanedValueRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBorrowedRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLoanedValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4059,7 +5763,7 @@ func (m *QueryBorrowedRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryBorrowedResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLoanedValueResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4082,17 +5786,17 @@ func (m *QueryBorrowedResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryBorrowedResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLoanedValueResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryBorrowedResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLoanedValueResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Borrowed", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field LoanedValue", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowQuery @@ -4102,23 +5806,23 @@ func (m *QueryBorrowedResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthQuery } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthQuery } if postIndex > l { return io.ErrUnexpectedEOF } - m.Borrowed = append(m.Borrowed, types.Coin{}) - if err := m.Borrowed[len(m.Borrowed)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.LoanedValue.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/leverage/types/query.pb.gw.go b/x/leverage/types/query.pb.gw.go index 9e207553d0..9cf841dd2a 100644 --- a/x/leverage/types/query.pb.gw.go +++ b/x/leverage/types/query.pb.gw.go @@ -103,6 +103,114 @@ func local_request_Query_Borrowed_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_Query_BorrowedValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_BorrowedValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBorrowedValueRequest + 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_BorrowedValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.BorrowedValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_BorrowedValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryBorrowedValueRequest + 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_BorrowedValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.BorrowedValue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Loaned_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_Loaned_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLoanedRequest + 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_Loaned_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Loaned(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Loaned_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLoanedRequest + 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_Loaned_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Loaned(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_LoanedValue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_LoanedValue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLoanedValueRequest + 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_LoanedValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LoanedValue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LoanedValue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLoanedValueRequest + 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_LoanedValue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LoanedValue(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_AvailableBorrow_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -247,6 +355,42 @@ func local_request_Query_MarketSize_0(ctx context.Context, marshaler runtime.Mar } +var ( + filter_Query_TokenMarketSize_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_TokenMarketSize_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenMarketSizeRequest + 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_TokenMarketSize_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.TokenMarketSize(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TokenMarketSize_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryTokenMarketSizeRequest + 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_TokenMarketSize_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.TokenMarketSize(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_ReserveAmount_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -511,6 +655,66 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_BorrowedValue_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_BorrowedValue_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_BorrowedValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Loaned_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Loaned_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Loaned_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LoanedValue_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LoanedValue_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LoanedValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AvailableBorrow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -591,6 +795,26 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TokenMarketSize_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TokenMarketSize_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TokenMarketSize_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ReserveAmount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -812,6 +1036,66 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_BorrowedValue_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_BorrowedValue_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_BorrowedValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Loaned_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_Loaned_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_Loaned_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LoanedValue_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_LoanedValue_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_LoanedValue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_AvailableBorrow_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -892,6 +1176,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TokenMarketSize_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_TokenMarketSize_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_TokenMarketSize_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ReserveAmount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1022,6 +1326,12 @@ var ( pattern_Query_Borrowed_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "borrowed"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_BorrowedValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "borrowed_value"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Loaned_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "loaned"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_LoanedValue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "loaned_value"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_AvailableBorrow_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "available_borrow"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_BorrowAPY_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "borrow_apy"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1030,6 +1340,8 @@ var ( pattern_Query_MarketSize_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "market_size"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_TokenMarketSize_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "token_market_size"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ReserveAmount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "reserve_amount"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_CollateralSetting_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"umee", "leverage", "v1beta1", "collateral_setting"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1050,6 +1362,12 @@ var ( forward_Query_Borrowed_0 = runtime.ForwardResponseMessage + forward_Query_BorrowedValue_0 = runtime.ForwardResponseMessage + + forward_Query_Loaned_0 = runtime.ForwardResponseMessage + + forward_Query_LoanedValue_0 = runtime.ForwardResponseMessage + forward_Query_AvailableBorrow_0 = runtime.ForwardResponseMessage forward_Query_BorrowAPY_0 = runtime.ForwardResponseMessage @@ -1058,6 +1376,8 @@ var ( forward_Query_MarketSize_0 = runtime.ForwardResponseMessage + forward_Query_TokenMarketSize_0 = runtime.ForwardResponseMessage + forward_Query_ReserveAmount_0 = runtime.ForwardResponseMessage forward_Query_CollateralSetting_0 = runtime.ForwardResponseMessage diff --git a/x/leverage/types/tx.pb.go b/x/leverage/types/tx.pb.go index e20a9805a6..f9ff2328d0 100644 --- a/x/leverage/types/tx.pb.go +++ b/x/leverage/types/tx.pb.go @@ -83,7 +83,7 @@ func (m *MsgLendAsset) GetAmount() types.Coin { return types.Coin{} } -// MsgWithdrawAsset represents a lender's request to withdraw a previously lent +// MsgWithdrawAsset represents a lender's request to withdraw a previously loaned // base asset type from the module type MsgWithdrawAsset struct { Lender string `protobuf:"bytes,1,opt,name=lender,proto3" json:"lender,omitempty"` @@ -695,7 +695,7 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { // LendAsset defines a method for lending coins to the capital facility. LendAsset(ctx context.Context, in *MsgLendAsset, opts ...grpc.CallOption) (*MsgLendAssetResponse, error) - // WithdrawAsset defines a method for withdrawing previously lent coins from + // WithdrawAsset defines a method for withdrawing previously loaned coins from // the capital facility. WithdrawAsset(ctx context.Context, in *MsgWithdrawAsset, opts ...grpc.CallOption) (*MsgWithdrawAssetResponse, error) // SetCollateral defines a method for users to enable or disable a uToken @@ -776,7 +776,7 @@ func (c *msgClient) Liquidate(ctx context.Context, in *MsgLiquidate, opts ...grp type MsgServer interface { // LendAsset defines a method for lending coins to the capital facility. LendAsset(context.Context, *MsgLendAsset) (*MsgLendAssetResponse, error) - // WithdrawAsset defines a method for withdrawing previously lent coins from + // WithdrawAsset defines a method for withdrawing previously loaned coins from // the capital facility. WithdrawAsset(context.Context, *MsgWithdrawAsset) (*MsgWithdrawAssetResponse, error) // SetCollateral defines a method for users to enable or disable a uToken