From 3022bd3203b9329e4529f7979b9cd72c5879802e Mon Sep 17 00:00:00 2001 From: Sishir Giri Date: Tue, 25 Apr 2023 16:28:13 -0700 Subject: [PATCH] feat: implement pool liquidity query in pool manager, deprecate the one in gamm (#4951) * sis/01-total-liq-query * setup gamm * added fix * added changelog * linter * nit * pass lint * roman and matts comments * linter * added balancer pool type * rebuild proto --- CHANGELOG.md | 2 +- proto/osmosis/gamm/v1beta1/query.proto | 6 + proto/osmosis/poolmanager/v1beta1/query.proto | 19 + proto/osmosis/poolmanager/v1beta1/query.yml | 7 +- x/concentrated-liquidity/pool_test.go | 151 +++-- x/gamm/client/cli/query.go | 27 +- x/gamm/keeper/grpc_query.go | 2 + x/gamm/types/query.pb.go | 255 +++++---- x/poolmanager/client/cli/query.go | 10 + x/poolmanager/client/grpc/grpc_query.go | 10 + x/poolmanager/client/query_proto_wrap.go | 21 + x/poolmanager/client/queryproto/query.pb.go | 537 +++++++++++++++--- .../client/queryproto/query.pb.gw.go | 101 ++++ x/poolmanager/router.go | 14 + x/poolmanager/router_test.go | 83 +++ x/twap/client/cli/query.go | 6 +- 16 files changed, 956 insertions(+), 295 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d1232a773..6ae734de525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,7 +68,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#4682](https://github.com/osmosis-labs/osmosis/pull/4682) Deprecate x/gamm SpotPrice v2 query. The new one is located in x/poolmanager. * [#4801](https://github.com/osmosis-labs/osmosis/pull/4801) remove GetTotalShares, GetTotalLiquidity and GetExitFee from PoolI. Define all on CFMMPoolI, define GetTotalLiquidity on PoolModuleI only. * [#4868](https://github.com/osmosis-labs/osmosis/pull/4868) Remove wasmEnabledProposals []wasm.ProposalType from NewOsmosisApp - +* [#4951](https://github.com/osmosis-labs/osmosis/pull/4951) Implement pool liquidity query in pool manager, deprecate the one in gamm ## v15.1.0 diff --git a/proto/osmosis/gamm/v1beta1/query.proto b/proto/osmosis/gamm/v1beta1/query.proto index 146c6a13c2d..c196efd0038 100644 --- a/proto/osmosis/gamm/v1beta1/query.proto +++ b/proto/osmosis/gamm/v1beta1/query.proto @@ -70,8 +70,10 @@ service Query { "/osmosis/gamm/v1beta1/pools/{pool_id}/params"; } + // Deprecated: please use the alternative in x/poolmanager rpc TotalPoolLiquidity(QueryTotalPoolLiquidityRequest) returns (QueryTotalPoolLiquidityResponse) { + option deprecated = true; option (google.api.http).get = "/osmosis/gamm/v1beta1/pools/{pool_id}/total_pool_liquidity"; } @@ -197,11 +199,15 @@ message QueryPoolParamsRequest { message QueryPoolParamsResponse { google.protobuf.Any params = 1; } //=============================== PoolLiquidity +// Deprecated: please use the alternative in x/poolmanager message QueryTotalPoolLiquidityRequest { + option deprecated = true; uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; } +// Deprecated: please use the alternative in x/poolmanager message QueryTotalPoolLiquidityResponse { + option deprecated = true; repeated cosmos.base.v1beta1.Coin liquidity = 1 [ (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.moretags) = "yaml:\"liquidity\"", diff --git a/proto/osmosis/poolmanager/v1beta1/query.proto b/proto/osmosis/poolmanager/v1beta1/query.proto index 3c445c47dbb..0eda70e5a35 100644 --- a/proto/osmosis/poolmanager/v1beta1/query.proto +++ b/proto/osmosis/poolmanager/v1beta1/query.proto @@ -71,6 +71,12 @@ service Query { option (google.api.http).get = "/osmosis/poolmanager/pools/{pool_id}/prices"; } + + rpc TotalPoolLiquidity(TotalPoolLiquidityRequest) + returns (TotalPoolLiquidityResponse) { + option (google.api.http).get = + "/osmosis/poolmanager/v1beta1/pools/{pool_id}/total_pool_liquidity"; + } } //=============================== Params @@ -170,3 +176,16 @@ message SpotPriceResponse { // String of the Dec. Ex) 10.203uatom string spot_price = 1 [ (gogoproto.moretags) = "yaml:\"spot_price\"" ]; } + +//=============================== PoolLiquidity +message TotalPoolLiquidityRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; +} + +message TotalPoolLiquidityResponse { + repeated cosmos.base.v1beta1.Coin liquidity = 1 [ + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "yaml:\"liquidity\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/osmosis/poolmanager/v1beta1/query.yml b/proto/osmosis/poolmanager/v1beta1/query.yml index 4321837be25..f77acd1618d 100644 --- a/proto/osmosis/poolmanager/v1beta1/query.yml +++ b/proto/osmosis/poolmanager/v1beta1/query.yml @@ -1,4 +1,4 @@ -keeper: +keeper: path: "github.com/osmosis-labs/osmosis/v15/x/poolmanager" struct: "Keeper" client_path: "github.com/osmosis-labs/osmosis/v15/x/poolmanager/client" @@ -50,3 +50,8 @@ queries: query_func: "k.RouteCalculateSpotPrice" cli: cmd: "SpotPrice" + TotalPoolLiquidity: + proto_wrapper: + query_func: "k.TotalPoolLiquidity" + cli: + cmd: "TotalPoolLiquidity" diff --git a/x/concentrated-liquidity/pool_test.go b/x/concentrated-liquidity/pool_test.go index 120cab2eaad..4e00ceb618f 100644 --- a/x/concentrated-liquidity/pool_test.go +++ b/x/concentrated-liquidity/pool_test.go @@ -266,82 +266,6 @@ func (s *KeeperTestSuite) TestCalculateSpotPrice() { s.Require().True(spotPrice.IsNil()) } -func (s *KeeperTestSuite) TestGetTotalPoolLiquidity() { - var ( - defaultPoolCoinOne = sdk.NewCoin(USDC, sdk.OneInt()) - defaultPoolCoinTwo = sdk.NewCoin(ETH, sdk.NewInt(2)) - nonPoolCool = sdk.NewCoin("uosmo", sdk.NewInt(3)) - - defaultCoins = sdk.NewCoins(defaultPoolCoinOne, defaultPoolCoinTwo) - ) - - tests := []struct { - name string - poolId uint64 - poolLiquidity sdk.Coins - expectedResult sdk.Coins - expectedErr error - }{ - { - name: "valid with 2 coins", - poolId: defaultPoolId, - poolLiquidity: defaultCoins, - expectedResult: defaultCoins, - }, - { - name: "valid with 1 coin", - poolId: defaultPoolId, - poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo), - expectedResult: sdk.NewCoins(defaultPoolCoinTwo), - }, - { - // can only happen if someone sends extra tokens to pool - // address. Should not occur in practice. - name: "valid with 3 coins", - poolId: defaultPoolId, - poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo, defaultPoolCoinOne, nonPoolCool), - expectedResult: defaultCoins, - }, - { - // this can happen if someone sends random dust to pool address. - name: "only non-pool coin - does not show up in result", - poolId: defaultPoolId, - poolLiquidity: sdk.NewCoins(nonPoolCool), - expectedResult: sdk.Coins(nil), - }, - { - name: "invalid pool id", - poolId: defaultPoolId + 1, - expectedErr: types.PoolNotFoundError{PoolId: defaultPoolId + 1}, - }, - } - - for _, tc := range tests { - tc := tc - s.Run(tc.name, func() { - s.SetupTest() - - // Create default CL pool - pool := s.PrepareConcentratedPool() - - s.FundAcc(pool.GetAddress(), tc.poolLiquidity) - - // Get pool defined in test case - actual, err := s.App.ConcentratedLiquidityKeeper.GetTotalPoolLiquidity(s.Ctx, tc.poolId) - - if tc.expectedErr != nil { - s.Require().Error(err) - s.Require().ErrorIs(err, tc.expectedErr) - s.Require().Nil(actual) - return - } - - s.Require().NoError(err) - s.Require().Equal(tc.expectedResult, actual) - }) - } -} - func (s *KeeperTestSuite) TestValidateSwapFee() { tests := []struct { name string @@ -487,7 +411,82 @@ func (s *KeeperTestSuite) TestDecreaseConcentratedPoolTickSpacing() { return } s.Require().NoError(err) + }) + } +} + +func (s *KeeperTestSuite) TestGetTotalPoolLiquidity() { + var ( + defaultPoolCoinOne = sdk.NewCoin(USDC, sdk.OneInt()) + defaultPoolCoinTwo = sdk.NewCoin(ETH, sdk.NewInt(2)) + nonPoolCool = sdk.NewCoin("uosmo", sdk.NewInt(3)) + defaultCoins = sdk.NewCoins(defaultPoolCoinOne, defaultPoolCoinTwo) + ) + + tests := []struct { + name string + poolId uint64 + poolLiquidity sdk.Coins + expectedResult sdk.Coins + expectedErr error + }{ + { + name: "valid with 2 coins", + poolId: defaultPoolId, + poolLiquidity: defaultCoins, + expectedResult: defaultCoins, + }, + { + name: "valid with 1 coin", + poolId: defaultPoolId, + poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo), + expectedResult: sdk.NewCoins(defaultPoolCoinTwo), + }, + { + // can only happen if someone sends extra tokens to pool + // address. Should not occur in practice. + name: "valid with 3 coins", + poolId: defaultPoolId, + poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo, defaultPoolCoinOne, nonPoolCool), + expectedResult: defaultCoins, + }, + { + // this can happen if someone sends random dust to pool address. + name: "only non-pool coin - does not show up in result", + poolId: defaultPoolId, + poolLiquidity: sdk.NewCoins(nonPoolCool), + expectedResult: sdk.Coins(nil), + }, + { + name: "invalid pool id", + poolId: defaultPoolId + 1, + expectedErr: types.PoolNotFoundError{PoolId: defaultPoolId + 1}, + }, + } + + for _, tc := range tests { + tc := tc + s.Run(tc.name, func() { + s.SetupTest() + + // Create default CL pool + pool := s.PrepareConcentratedPool() + + s.FundAcc(pool.GetAddress(), tc.poolLiquidity) + + // Get pool defined in test case + actual, err := s.App.ConcentratedLiquidityKeeper.GetTotalPoolLiquidity(s.Ctx, tc.poolId) + + if tc.expectedErr != nil { + s.Require().Error(err) + s.Require().ErrorIs(err, tc.expectedErr) + s.Require().Nil(actual) + return + } + + s.Require().NoError(err) + s.Require().Equal(tc.expectedResult, actual) }) } } diff --git a/x/gamm/client/cli/query.go b/x/gamm/client/cli/query.go index 0273eed2d55..c7595a8a5dc 100644 --- a/x/gamm/client/cli/query.go +++ b/x/gamm/client/cli/query.go @@ -158,18 +158,6 @@ $ %s query gamm pool-params 1 return cmd } -func GetCmdTotalPoolLiquidity() *cobra.Command { - return osmocli.SimpleQueryCmd[*types.QueryTotalPoolLiquidityRequest]( - "total-pool-liquidity [poolID]", - "Query total-pool-liquidity", - `Query total-pool-liquidity. -Example: -{{.CommandPrefix}} total-pool-liquidity 1 -`, - types.ModuleName, types.NewQueryClient, - ) -} - func GetCmdTotalShares() *cobra.Command { return osmocli.SimpleQueryCmd[*types.QueryTotalSharesRequest]( "total-share [poolID]", @@ -333,3 +321,18 @@ Example: types.ModuleName, types.NewQueryClient, ) } + +// GetCmdTotalPoolLiquidity returns total liquidity in pool. +// Deprecated: please use the alternative in x/poolmanager +// nolint: staticcheck +func GetCmdTotalPoolLiquidity() *cobra.Command { + return osmocli.SimpleQueryCmd[*types.QueryTotalPoolLiquidityRequest]( + "total-pool-liquidity [poolID]", + "Query total-pool-liquidity", + `Query total-pool-liquidity. +Example: +{{.CommandPrefix}} total-pool-liquidity 1 +`, + types.ModuleName, types.NewQueryClient, + ) +} diff --git a/x/gamm/keeper/grpc_query.go b/x/gamm/keeper/grpc_query.go index 3184316f559..86e2e833d46 100644 --- a/x/gamm/keeper/grpc_query.go +++ b/x/gamm/keeper/grpc_query.go @@ -316,6 +316,8 @@ func (q Querier) PoolParams(ctx context.Context, req *types.QueryPoolParamsReque } // TotalPoolLiquidity returns total liquidity in pool. +// Deprecated: please use the alternative in x/poolmanager +// nolint: staticcheck func (q Querier) TotalPoolLiquidity(ctx context.Context, req *types.QueryTotalPoolLiquidityRequest) (*types.QueryTotalPoolLiquidityResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") diff --git a/x/gamm/types/query.pb.go b/x/gamm/types/query.pb.go index 9496169128d..ed1c5d9a4fd 100644 --- a/x/gamm/types/query.pb.go +++ b/x/gamm/types/query.pb.go @@ -684,6 +684,9 @@ func (m *QueryPoolParamsResponse) GetParams() *types.Any { } // =============================== PoolLiquidity +// Deprecated: please use the alternative in x/poolmanager +// +// Deprecated: Do not use. type QueryTotalPoolLiquidityRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` } @@ -728,6 +731,9 @@ func (m *QueryTotalPoolLiquidityRequest) GetPoolId() uint64 { return 0 } +// Deprecated: please use the alternative in x/poolmanager +// +// Deprecated: Do not use. type QueryTotalPoolLiquidityResponse struct { Liquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=liquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"liquidity" yaml:"liquidity"` } @@ -1620,130 +1626,130 @@ func init() { func init() { proto.RegisterFile("osmosis/gamm/v1beta1/query.proto", fileDescriptor_d9a717df9ca609ef) } var fileDescriptor_d9a717df9ca609ef = []byte{ - // 1964 bytes of a gzipped FileDescriptorProto + // 1966 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0x4d, 0x6c, 0x1c, 0x49, - 0xf5, 0x77, 0x4f, 0x1c, 0xaf, 0xfd, 0x92, 0xd8, 0x4e, 0xad, 0x93, 0x4c, 0xc6, 0xc9, 0x4c, 0xfe, - 0xf5, 0xdf, 0x8d, 0xb3, 0x89, 0xdd, 0x63, 0x27, 0x8e, 0x00, 0x43, 0x76, 0x63, 0x7b, 0xed, 0x64, - 0xac, 0x24, 0x36, 0x9d, 0x15, 0x08, 0x10, 0xb4, 0xda, 0xe3, 0xce, 0xb8, 0x37, 0xd3, 0x5d, 0x93, - 0xe9, 0xea, 0x8d, 0xad, 0x55, 0xb4, 0xd2, 0x9e, 0x80, 0xcb, 0x22, 0x01, 0x8b, 0x40, 0x08, 0x38, - 0x20, 0x84, 0x38, 0x71, 0x40, 0xe2, 0xc4, 0x01, 0x21, 0xa4, 0x15, 0xa7, 0x48, 0x70, 0x40, 0x1c, - 0x06, 0x94, 0xc0, 0x8d, 0x93, 0x2f, 0x7b, 0x45, 0x55, 0xf5, 0xfa, 0x63, 0x3e, 0xdc, 0xf3, 0xb1, - 0x44, 0x5a, 0x4e, 0x33, 0x5d, 0xf5, 0x3e, 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, 0x49, 0x14, 0x26, 0xfd, 0x4d, 0x83, 0xdc, 0x01, 0x26, 0x6d, 0x04, + 0x9c, 0xf4, 0x01, 0x2f, 0x7e, 0xc9, 0xa4, 0xa6, 0xfc, 0xc1, 0xdd, 0x3e, 0x2d, 0x49, 0xab, 0x6e, + 0x90, 0xd7, 0x3f, 0x85, 0x55, 0x2c, 0xe0, 0xc2, 0xac, 0x4f, 0x34, 0xc8, 0xa7, 0x37, 0xa6, 0xe4, + 0x46, 0x5a, 0x3d, 0xec, 0xa5, 0x79, 0xce, 0x2d, 0x7d, 0x0a, 0x09, 0x68, 0xf2, 0xa6, 0x34, 0x79, + 0x9d, 0xdc, 0xea, 0x6c, 0x72, 0xa7, 0x8e, 0xd9, 0xac, 0x3a, 0xde, 0x03, 0xf3, 0x7e, 0x9d, 0xb9, + 0xa6, 0xe8, 0xc6, 0x8b, 0xef, 0x25, 0x5b, 0xf4, 0xc7, 0xcb, 0xeb, 0x4f, 0x9e, 0xe5, 0xb5, 0xa7, + 0xcf, 0xf2, 0xda, 0xbf, 0x9e, 0xe5, 0xb5, 0x1f, 0x3e, 0xcf, 0x1f, 0x7a, 0xfa, 0x3c, 0x7f, 0xe8, + 0xef, 0xcf, 0xf3, 0x87, 0xbe, 0x35, 0x97, 0x78, 0x4e, 0xa0, 0xb6, 0xd9, 0xaa, 0xb5, 0xe5, 0x47, + 0xaa, 0xdf, 0x9d, 0xbf, 0x56, 0xdc, 0x55, 0x00, 0xe4, 0xe3, 0x62, 0x6b, 0x58, 0x8e, 0x46, 0xae, + 0xfe, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xaf, 0xd8, 0xf4, 0xc5, 0x1d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1777,6 +1783,7 @@ type QueryClient interface { CalcJoinPoolShares(ctx context.Context, in *QueryCalcJoinPoolSharesRequest, opts ...grpc.CallOption) (*QueryCalcJoinPoolSharesResponse, error) CalcExitPoolCoinsFromShares(ctx context.Context, in *QueryCalcExitPoolCoinsFromSharesRequest, opts ...grpc.CallOption) (*QueryCalcExitPoolCoinsFromSharesResponse, error) PoolParams(ctx context.Context, in *QueryPoolParamsRequest, opts ...grpc.CallOption) (*QueryPoolParamsResponse, error) + // Deprecated: please use the alternative in x/poolmanager TotalPoolLiquidity(ctx context.Context, in *QueryTotalPoolLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalPoolLiquidityResponse, error) TotalShares(ctx context.Context, in *QueryTotalSharesRequest, opts ...grpc.CallOption) (*QueryTotalSharesResponse, error) // SpotPrice defines a gRPC query handler that returns the spot price given @@ -1891,6 +1898,7 @@ func (c *queryClient) PoolParams(ctx context.Context, in *QueryPoolParamsRequest return out, nil } +// Deprecated: Do not use. func (c *queryClient) TotalPoolLiquidity(ctx context.Context, in *QueryTotalPoolLiquidityRequest, opts ...grpc.CallOption) (*QueryTotalPoolLiquidityResponse, error) { out := new(QueryTotalPoolLiquidityResponse) err := c.cc.Invoke(ctx, "/osmosis.gamm.v1beta1.Query/TotalPoolLiquidity", in, out, opts...) @@ -1969,6 +1977,7 @@ type QueryServer interface { CalcJoinPoolShares(context.Context, *QueryCalcJoinPoolSharesRequest) (*QueryCalcJoinPoolSharesResponse, error) CalcExitPoolCoinsFromShares(context.Context, *QueryCalcExitPoolCoinsFromSharesRequest) (*QueryCalcExitPoolCoinsFromSharesResponse, error) PoolParams(context.Context, *QueryPoolParamsRequest) (*QueryPoolParamsResponse, error) + // Deprecated: please use the alternative in x/poolmanager TotalPoolLiquidity(context.Context, *QueryTotalPoolLiquidityRequest) (*QueryTotalPoolLiquidityResponse, error) TotalShares(context.Context, *QueryTotalSharesRequest) (*QueryTotalSharesResponse, error) // SpotPrice defines a gRPC query handler that returns the spot price given diff --git a/x/poolmanager/client/cli/query.go b/x/poolmanager/client/cli/query.go index 387f6406b0f..31d9171bd4c 100644 --- a/x/poolmanager/client/cli/query.go +++ b/x/poolmanager/client/cli/query.go @@ -26,6 +26,7 @@ func GetQueryCmd() *cobra.Command { osmocli.AddQueryCmd(cmd, queryproto.NewQueryClient, GetCmdEstimateSinglePoolSwapExactAmountIn) osmocli.AddQueryCmd(cmd, queryproto.NewQueryClient, GetCmdEstimateSinglePoolSwapExactAmountOut) osmocli.AddQueryCmd(cmd, queryproto.NewQueryClient, GetCmdSpotPrice) + osmocli.AddQueryCmd(cmd, queryproto.NewQueryClient, GetCmdTotalPoolLiquidity) return cmd } @@ -142,3 +143,12 @@ func GetCmdEstimateSinglePoolSwapExactAmountOut() (*osmocli.QueryDescriptor, *qu QueryFnName: "EstimateSinglePoolSwapExactAmountOut", }, &queryproto.EstimateSinglePoolSwapExactAmountOutRequest{} } + +func GetCmdTotalPoolLiquidity() (*osmocli.QueryDescriptor, *queryproto.TotalPoolLiquidityRequest) { + return &osmocli.QueryDescriptor{ + Use: "total-pool-liquidity [poolID]", + Short: "Query total-pool-liquidity", + Long: `{{.Short}} + {{.CommandPrefix}} total-pool-liquidity 1`, + }, &queryproto.TotalPoolLiquidityRequest{} +} diff --git a/x/poolmanager/client/grpc/grpc_query.go b/x/poolmanager/client/grpc/grpc_query.go index 7aab48c525f..4beabcf36fc 100644 --- a/x/poolmanager/client/grpc/grpc_query.go +++ b/x/poolmanager/client/grpc/grpc_query.go @@ -20,6 +20,16 @@ type Querier struct { var _ queryproto.QueryServer = Querier{} +func (q Querier) TotalPoolLiquidity(grpcCtx context.Context, + req *queryproto.TotalPoolLiquidityRequest, +) (*queryproto.TotalPoolLiquidityResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(grpcCtx) + return q.Q.TotalPoolLiquidity(ctx, *req) +} + func (q Querier) SpotPrice(grpcCtx context.Context, req *queryproto.SpotPriceRequest, ) (*queryproto.SpotPriceResponse, error) { diff --git a/x/poolmanager/client/query_proto_wrap.go b/x/poolmanager/client/query_proto_wrap.go index 290716a53dc..4e83ac16977 100644 --- a/x/poolmanager/client/query_proto_wrap.go +++ b/x/poolmanager/client/query_proto_wrap.go @@ -156,3 +156,24 @@ func (q Querier) SpotPrice(ctx sdk.Context, req queryproto.SpotPriceRequest) (*q SpotPrice: sp.String(), }, err } + +// TotalPoolLiquidity returns the total liquidity of the pool. +func (q Querier) TotalPoolLiquidity(ctx sdk.Context, req queryproto.TotalPoolLiquidityRequest) (*queryproto.TotalPoolLiquidityResponse, error) { + if req.PoolId == 0 { + return nil, status.Error(codes.InvalidArgument, "Invalid Pool Id") + } + + poolI, err := q.K.GetPool(ctx, req.PoolId) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + coins, err := q.K.GetTotalPoolLiquidity(ctx, poolI.GetId()) + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &queryproto.TotalPoolLiquidityResponse{ + Liquidity: coins, + }, nil +} diff --git a/x/poolmanager/client/queryproto/query.pb.go b/x/poolmanager/client/queryproto/query.pb.go index 10abab81dd1..4477b00356b 100644 --- a/x/poolmanager/client/queryproto/query.pb.go +++ b/x/poolmanager/client/queryproto/query.pb.go @@ -8,8 +8,8 @@ import ( fmt "fmt" _ "github.com/cosmos/cosmos-proto" types1 "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types2 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" @@ -809,6 +809,95 @@ func (m *SpotPriceResponse) GetSpotPrice() string { return "" } +// =============================== PoolLiquidity +type TotalPoolLiquidityRequest struct { + PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` +} + +func (m *TotalPoolLiquidityRequest) Reset() { *m = TotalPoolLiquidityRequest{} } +func (m *TotalPoolLiquidityRequest) String() string { return proto.CompactTextString(m) } +func (*TotalPoolLiquidityRequest) ProtoMessage() {} +func (*TotalPoolLiquidityRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6256a4106f701b7d, []int{16} +} +func (m *TotalPoolLiquidityRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TotalPoolLiquidityRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TotalPoolLiquidityRequest.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 *TotalPoolLiquidityRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_TotalPoolLiquidityRequest.Merge(m, src) +} +func (m *TotalPoolLiquidityRequest) XXX_Size() int { + return m.Size() +} +func (m *TotalPoolLiquidityRequest) XXX_DiscardUnknown() { + xxx_messageInfo_TotalPoolLiquidityRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_TotalPoolLiquidityRequest proto.InternalMessageInfo + +func (m *TotalPoolLiquidityRequest) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +type TotalPoolLiquidityResponse struct { + Liquidity github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=liquidity,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"liquidity" yaml:"liquidity"` +} + +func (m *TotalPoolLiquidityResponse) Reset() { *m = TotalPoolLiquidityResponse{} } +func (m *TotalPoolLiquidityResponse) String() string { return proto.CompactTextString(m) } +func (*TotalPoolLiquidityResponse) ProtoMessage() {} +func (*TotalPoolLiquidityResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6256a4106f701b7d, []int{17} +} +func (m *TotalPoolLiquidityResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TotalPoolLiquidityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TotalPoolLiquidityResponse.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 *TotalPoolLiquidityResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_TotalPoolLiquidityResponse.Merge(m, src) +} +func (m *TotalPoolLiquidityResponse) XXX_Size() int { + return m.Size() +} +func (m *TotalPoolLiquidityResponse) XXX_DiscardUnknown() { + xxx_messageInfo_TotalPoolLiquidityResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_TotalPoolLiquidityResponse proto.InternalMessageInfo + +func (m *TotalPoolLiquidityResponse) GetLiquidity() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Liquidity + } + return nil +} + func init() { proto.RegisterType((*ParamsRequest)(nil), "osmosis.poolmanager.v1beta1.ParamsRequest") proto.RegisterType((*ParamsResponse)(nil), "osmosis.poolmanager.v1beta1.ParamsResponse") @@ -826,6 +915,8 @@ func init() { proto.RegisterType((*AllPoolsResponse)(nil), "osmosis.poolmanager.v1beta1.AllPoolsResponse") proto.RegisterType((*SpotPriceRequest)(nil), "osmosis.poolmanager.v1beta1.SpotPriceRequest") proto.RegisterType((*SpotPriceResponse)(nil), "osmosis.poolmanager.v1beta1.SpotPriceResponse") + proto.RegisterType((*TotalPoolLiquidityRequest)(nil), "osmosis.poolmanager.v1beta1.TotalPoolLiquidityRequest") + proto.RegisterType((*TotalPoolLiquidityResponse)(nil), "osmosis.poolmanager.v1beta1.TotalPoolLiquidityResponse") } func init() { @@ -833,84 +924,91 @@ func init() { } var fileDescriptor_6256a4106f701b7d = []byte{ - // 1231 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xce, 0x3a, 0x8e, 0x1b, 0x4f, 0x9a, 0xd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f, 0xbf, - 0x31, 0xbb, 0x65, 0x36, 0x1a, 0x25, 0xd1, 0xad, 0x1f, 0x15, 0x90, 0x0e, 0xc7, 0x14, 0x8c, 0xde, - 0xac, 0x7f, 0x40, 0xe7, 0xb5, 0xb8, 0x70, 0x49, 0x6e, 0x8d, 0x93, 0x2b, 0xc1, 0xa5, 0x53, 0xc9, - 0xf5, 0x35, 0x4d, 0xe7, 0x73, 0x90, 0x96, 0x77, 0x9e, 0x1f, 0x17, 0x94, 0xa3, 0xe3, 0x82, 0xf2, - 0xe7, 0x71, 0x41, 0x79, 0x76, 0x52, 0x18, 0x39, 0x3a, 0x29, 0x8c, 0xfc, 0x7e, 0x52, 0x18, 0xf9, - 0xf8, 0x7e, 0xd7, 0x5b, 0x4f, 0x16, 0x2c, 0x35, 0xcc, 0x5d, 0x1a, 0x56, 0x7f, 0xb2, 0x72, 0x5b, - 0x3f, 0xe8, 0xd9, 0xa3, 0xd6, 0xb0, 0xb0, 0xc3, 0xc4, 0xbf, 0xe1, 0xe2, 0x49, 0x92, 0xe2, 0x7f, - 0xd6, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb7, 0x5a, 0xe7, 0x8d, 0xa2, 0x10, 0x00, 0x00, + // 1338 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x58, 0xcd, 0x6f, 0x1b, 0x45, + 0x1c, 0xcd, 0x26, 0x6e, 0x1a, 0x4f, 0x9b, 0xd8, 0x19, 0xda, 0x92, 0xb8, 0x95, 0x37, 0x4c, 0x4b, + 0x71, 0x9b, 0x66, 0x57, 0xe9, 0x07, 0x48, 0x95, 0x68, 0x15, 0xa7, 0xa1, 0x31, 0x2a, 0x34, 0x6c, + 0x41, 0x20, 0xa4, 0x62, 0x6d, 0x92, 0xc1, 0xac, 0xba, 0x3b, 0xb3, 0xf1, 0xcc, 0xb6, 0x8d, 0x50, + 0x2f, 0x9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x6f, 0xa9, 0x26, 0x75, 0x25, 0x8e, 0xfa, 0xa2, 0xb7, 0xcc, + 0xde, 0x2c, 0xee, 0x05, 0x98, 0x71, 0x37, 0x08, 0x55, 0x00, 0x2a, 0x80, 0xc9, 0x35, 0xb7, 0xe9, + 0x06, 0xcc, 0xc1, 0x5b, 0x11, 0x66, 0x1c, 0xdd, 0x02, 0x53, 0xf1, 0x02, 0x0b, 0x29, 0x61, 0x18, + 0x2e, 0x81, 0xf1, 0x50, 0xae, 0xcc, 0x18, 0x73, 0x46, 0xe5, 0xd0, 0xf9, 0x93, 0x56, 0xca, 0x31, + 0x59, 0x2a, 0xb9, 0x9a, 0x7b, 0xd4, 0x32, 0x47, 0x1c, 0x9d, 0x88, 0x9e, 0x19, 0x60, 0x6e, 0x85, + 0x71, 0x2f, 0x70, 0x39, 0xbe, 0x75, 0xcf, 0x0d, 0x57, 0xee, 0xbb, 0x1b, 0x7c, 0x29, 0xa0, 0x11, + 0xe1, 0x35, 0xa2, 0x3b, 0xc3, 0x79, 0x70, 0x50, 0x14, 0xac, 0x7b, 0x9b, 0x33, 0xa3, 0x73, 0x46, + 0x25, 0x57, 0x85, 0xed, 0x96, 0x39, 0xb5, 0xed, 0x06, 0xfe, 0x65, 0xa4, 0x37, 0x90, 0x33, 0x2e, + 0x3e, 0xd5, 0x36, 0xa1, 0x05, 0x26, 0x38, 0xbd, 0x83, 0x49, 0xdd, 0x23, 0x33, 0x63, 0x73, 0x46, + 0x25, 0x5f, 0x7d, 0xa9, 0xdd, 0x32, 0x0b, 0x2a, 0x3a, 0xde, 0x41, 0xce, 0x41, 0xf9, 0xb1, 0x46, + 0xe0, 0x6d, 0x30, 0x2e, 0xcf, 0x8d, 0xcd, 0xe4, 0xe6, 0xc6, 0x2a, 0x87, 0xce, 0x5b, 0xa9, 0x24, + 0x04, 0xc6, 0x04, 0x9e, 0x48, 0xab, 0x1e, 0x15, 0x7c, 0xda, 0x2d, 0x73, 0x52, 0x75, 0x50, 0xb5,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, 0xcd, 0x45, 0x89, 0xc6, 0x82, + 0xe7, 0x52, 0xd1, 0x48, 0x24, 0x1d, 0x71, 0xa5, 0x5a, 0xf1, 0x48, 0xd0, 0x47, 0xad, 0x9e, 0xc9, + 0xa3, 0x8f, 0x5a, 0xbd, 0x73, 0x46, 0x46, 0xb5, 0x5c, 0xdf, 0x5f, 0x50, 0x6a, 0xfd, 0x68, 0x80, + 0x7c, 0xf2, 0x1c, 0xc3, 0xf4, 0x66, 0xbd, 0x83, 0x48, 0xc9, 0xca, 0x1a, 0xae, 0xc1, 0x5d, 0x90, + 0xe0, 0x16, 0xe0, 0xfc, 0x9e, 0xe0, 0x7a, 0x44, 0xb3, 0xe5, 0x7b, 0xcf, 0xe0, 0x8e, 0x01, 0xe0, + 0xf3, 0x4f, 0x33, 0x7c, 0x3d, 0xb5, 0xf7, 0xbe, 0x63, 0x41, 0xe9, 0x8d, 0x81, 0xf3, 0x34, 0xf8, + 0x9a, 0x04, 0xbf, 0x0c, 0x97, 0x06, 0x39, 0x79, 0x9b, 0x8b, 0x82, 0xea, 0x87, 0x94, 0xbc, 0xe7, + 0xd5, 0xdb, 0x8f, 0x9e, 0x94, 0x8d, 0x9d, 0x27, 0x65, 0xe3, 0xaf, 0x27, 0x65, 0xe3, 0xe1, 0xd3, + 0xf2, 0xc8, 0xce, 0xd3, 0xf2, 0xc8, 0xef, 0x4f, 0xcb, 0x23, 0x1f, 0x2f, 0x77, 0x8d, 0x07, 0xba, + 0xcd, 0x82, 0xef, 0xae, 0xb3, 0xa4, 0xe7, 0xdd, 0xc5, 0x4b, 0xf6, 0xfd, 0x5d, 0x9d, 0x37, 0x7c, + 0x0f, 0x13, 0xae, 0xfe, 0x83, 0xa2, 0xa6, 0xc9, 0x71, 0xf9, 0xe7, 0xc2, 0x7f, 0x01, 0x00, 0x00, + 0xff, 0xff, 0x31, 0x52, 0xaa, 0x15, 0x5d, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -941,6 +1039,7 @@ type QueryClient interface { // SpotPrice defines a gRPC query handler that returns the spot price given // a base denomination and a quote denomination. SpotPrice(ctx context.Context, in *SpotPriceRequest, opts ...grpc.CallOption) (*SpotPriceResponse, error) + TotalPoolLiquidity(ctx context.Context, in *TotalPoolLiquidityRequest, opts ...grpc.CallOption) (*TotalPoolLiquidityResponse, error) } type queryClient struct { @@ -1032,6 +1131,15 @@ func (c *queryClient) SpotPrice(ctx context.Context, in *SpotPriceRequest, opts return out, nil } +func (c *queryClient) TotalPoolLiquidity(ctx context.Context, in *TotalPoolLiquidityRequest, opts ...grpc.CallOption) (*TotalPoolLiquidityResponse, error) { + out := new(TotalPoolLiquidityResponse) + err := c.cc.Invoke(ctx, "/osmosis.poolmanager.v1beta1.Query/TotalPoolLiquidity", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Params(context.Context, *ParamsRequest) (*ParamsResponse, error) @@ -1050,6 +1158,7 @@ type QueryServer interface { // SpotPrice defines a gRPC query handler that returns the spot price given // a base denomination and a quote denomination. SpotPrice(context.Context, *SpotPriceRequest) (*SpotPriceResponse, error) + TotalPoolLiquidity(context.Context, *TotalPoolLiquidityRequest) (*TotalPoolLiquidityResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1083,6 +1192,9 @@ func (*UnimplementedQueryServer) AllPools(ctx context.Context, req *AllPoolsRequ func (*UnimplementedQueryServer) SpotPrice(ctx context.Context, req *SpotPriceRequest) (*SpotPriceResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SpotPrice not implemented") } +func (*UnimplementedQueryServer) TotalPoolLiquidity(ctx context.Context, req *TotalPoolLiquidityRequest) (*TotalPoolLiquidityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TotalPoolLiquidity not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1250,6 +1362,24 @@ func _Query_SpotPrice_Handler(srv interface{}, ctx context.Context, dec func(int return interceptor(ctx, in, info, handler) } +func _Query_TotalPoolLiquidity_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TotalPoolLiquidityRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).TotalPoolLiquidity(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.poolmanager.v1beta1.Query/TotalPoolLiquidity", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).TotalPoolLiquidity(ctx, req.(*TotalPoolLiquidityRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "osmosis.poolmanager.v1beta1.Query", HandlerType: (*QueryServer)(nil), @@ -1290,6 +1420,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "SpotPrice", Handler: _Query_SpotPrice_Handler, }, + { + MethodName: "TotalPoolLiquidity", + Handler: _Query_TotalPoolLiquidity_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "osmosis/poolmanager/v1beta1/query.proto", @@ -1850,6 +1984,71 @@ func (m *SpotPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TotalPoolLiquidityRequest) 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 *TotalPoolLiquidityRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TotalPoolLiquidityRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *TotalPoolLiquidityResponse) 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 *TotalPoolLiquidityResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TotalPoolLiquidityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Liquidity) > 0 { + for iNdEx := len(m.Liquidity) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Liquidity[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 encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2093,6 +2292,33 @@ func (m *SpotPriceResponse) Size() (n int) { return n } +func (m *TotalPoolLiquidityRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovQuery(uint64(m.PoolId)) + } + return n +} + +func (m *TotalPoolLiquidityResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Liquidity) > 0 { + for _, e := range m.Liquidity { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3578,6 +3804,159 @@ func (m *SpotPriceResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *TotalPoolLiquidityRequest) 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: TotalPoolLiquidityRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TotalPoolLiquidityRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PoolId", wireType) + } + m.PoolId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PoolId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TotalPoolLiquidityResponse) 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: TotalPoolLiquidityResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TotalPoolLiquidityResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Liquidity", 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.Liquidity = append(m.Liquidity, types2.Coin{}) + if err := m.Liquidity[len(m.Liquidity)-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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/poolmanager/client/queryproto/query.pb.gw.go b/x/poolmanager/client/queryproto/query.pb.gw.go index 12f69e4355f..8bec1cf7060 100644 --- a/x/poolmanager/client/queryproto/query.pb.gw.go +++ b/x/poolmanager/client/queryproto/query.pb.gw.go @@ -519,6 +519,60 @@ func local_request_Query_SpotPrice_0(ctx context.Context, marshaler runtime.Mars } +func request_Query_TotalPoolLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TotalPoolLiquidityRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pool_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") + } + + protoReq.PoolId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) + } + + msg, err := client.TotalPoolLiquidity(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_TotalPoolLiquidity_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq TotalPoolLiquidityRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["pool_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "pool_id") + } + + protoReq.PoolId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "pool_id", err) + } + + msg, err := server.TotalPoolLiquidity(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -732,6 +786,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_TotalPoolLiquidity_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_TotalPoolLiquidity_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_TotalPoolLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -953,6 +1030,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_TotalPoolLiquidity_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_TotalPoolLiquidity_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_TotalPoolLiquidity_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -974,6 +1071,8 @@ var ( pattern_Query_AllPools_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "poolmanager", "v1beta1", "all-pools"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_SpotPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"osmosis", "poolmanager", "pools", "pool_id", "prices"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_TotalPoolLiquidity_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"osmosis", "poolmanager", "v1beta1", "pools", "pool_id", "total_pool_liquidity"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -994,4 +1093,6 @@ var ( forward_Query_AllPools_0 = runtime.ForwardResponseMessage forward_Query_SpotPrice_0 = runtime.ForwardResponseMessage + + forward_Query_TotalPoolLiquidity_0 = runtime.ForwardResponseMessage ) diff --git a/x/poolmanager/router.go b/x/poolmanager/router.go index 5076ef7297a..aa103f154f6 100644 --- a/x/poolmanager/router.go +++ b/x/poolmanager/router.go @@ -667,3 +667,17 @@ func (k Keeper) createOsmoMultihopExpectedSwapOuts( return insExpected, nil } + +func (k Keeper) GetTotalPoolLiquidity(ctx sdk.Context, poolId uint64) (sdk.Coins, error) { + swapModule, err := k.GetPoolModule(ctx, poolId) + if err != nil { + return nil, err + } + + coins, err := swapModule.GetTotalPoolLiquidity(ctx, poolId) + if err != nil { + return coins, err + } + + return coins, nil +} diff --git a/x/poolmanager/router_test.go b/x/poolmanager/router_test.go index c98931c9470..2118a01abd1 100644 --- a/x/poolmanager/router_test.go +++ b/x/poolmanager/router_test.go @@ -9,6 +9,7 @@ import ( "github.com/golang/mock/gomock" "github.com/osmosis-labs/osmosis/osmomath" + "github.com/osmosis-labs/osmosis/v15/app/apptesting" "github.com/osmosis-labs/osmosis/v15/tests/mocks" cl "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity" cltypes "github.com/osmosis-labs/osmosis/v15/x/concentrated-liquidity/types" @@ -1989,3 +1990,85 @@ func (suite *KeeperTestSuite) TestSplitRouteExactAmountOut() { }) } } + +func (s *KeeperTestSuite) TestGetTotalPoolLiquidity() { + var ( + defaultPoolCoinOne = sdk.NewCoin("usdc", sdk.OneInt()) + defaultPoolCoinTwo = sdk.NewCoin("eth", sdk.NewInt(2)) + nonPoolCool = sdk.NewCoin("uosmo", sdk.NewInt(3)) + + defaultCoins = sdk.NewCoins(defaultPoolCoinOne, defaultPoolCoinTwo) + ) + + tests := []struct { + name string + poolId uint64 + poolLiquidity sdk.Coins + expectedResult sdk.Coins + expectedErr error + }{ + { + name: "CL Pool: valid with 2 coins", + poolId: 1, + poolLiquidity: defaultCoins, + expectedResult: defaultCoins, + }, + { + name: "CL Pool: valid with 1 coin", + poolId: 1, + poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo), + expectedResult: sdk.NewCoins(defaultPoolCoinTwo), + }, + { + // can only happen if someone sends extra tokens to pool + // address. Should not occur in practice. + name: "CL Pool: valid with 3 coins", + poolId: 1, + poolLiquidity: sdk.NewCoins(defaultPoolCoinTwo, defaultPoolCoinOne, nonPoolCool), + expectedResult: defaultCoins, + }, + { + // this can happen if someone sends random dust to pool address. + name: "CL Pool:only non-pool coin - does not show up in result", + poolId: 1, + poolLiquidity: sdk.NewCoins(nonPoolCool), + expectedResult: sdk.Coins(nil), + }, + { + name: "Balancer Pool: with default pool assets", + poolId: 2, + poolLiquidity: sdk.NewCoins(apptesting.DefaultPoolAssets[0].Token, apptesting.DefaultPoolAssets[1].Token, apptesting.DefaultPoolAssets[2].Token, apptesting.DefaultPoolAssets[3].Token), + expectedResult: sdk.NewCoins(apptesting.DefaultPoolAssets[0].Token, apptesting.DefaultPoolAssets[1].Token, apptesting.DefaultPoolAssets[2].Token, apptesting.DefaultPoolAssets[3].Token), + }, + { + name: "round not found because pool id doesnot exist", + poolId: 3, + expectedErr: types.FailedToFindRouteError{PoolId: 3}, + }, + } + + for _, tc := range tests { + tc := tc + s.Run(tc.name, func() { + s.SetupTest() + + // Create default CL pool + clPool := s.PrepareConcentratedPool() + s.PrepareBalancerPool() + + s.FundAcc(clPool.GetAddress(), tc.poolLiquidity) + + // Get pool defined in test case + actual, err := s.App.PoolManagerKeeper.GetTotalPoolLiquidity(s.Ctx, tc.poolId) + if tc.expectedErr != nil { + s.Require().Error(err) + s.Require().ErrorIs(err, tc.expectedErr) + s.Require().Nil(actual) + return + } + + s.Require().NoError(err) + s.Require().Equal(tc.expectedResult, actual) + }) + } +} diff --git a/x/twap/client/cli/query.go b/x/twap/client/cli/query.go index 1670f18dc5c..78479c9d077 100644 --- a/x/twap/client/cli/query.go +++ b/x/twap/client/cli/query.go @@ -11,7 +11,7 @@ import ( "github.com/spf13/cobra" "github.com/osmosis-labs/osmosis/osmoutils/osmocli" - gammtypes "github.com/osmosis-labs/osmosis/v15/x/gamm/types" + poolmanager "github.com/osmosis-labs/osmosis/v15/x/poolmanager/client/queryproto" "github.com/osmosis-labs/osmosis/v15/x/twap/client/queryproto" "github.com/osmosis-labs/osmosis/v15/x/twap/types" ) @@ -130,8 +130,8 @@ Example: // getQuoteDenomFromLiquidity gets the quote liquidity denom from the pool. In addition, validates that base denom // exists in the pool. Fails if not. func getQuoteDenomFromLiquidity(ctx context.Context, clientCtx client.Context, poolId uint64, baseDenom string) (string, error) { - gammClient := gammtypes.NewQueryClient(clientCtx) - liquidity, err := gammClient.TotalPoolLiquidity(ctx, &gammtypes.QueryTotalPoolLiquidityRequest{PoolId: poolId}) + poolmanagerClient := poolmanager.NewQueryClient(clientCtx) + liquidity, err := poolmanagerClient.TotalPoolLiquidity(ctx, &poolmanager.TotalPoolLiquidityRequest{PoolId: poolId}) if err != nil { return "", err }