diff --git a/go.mod b/go.mod index c528c33ec8e..474a9efc836 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.19 require ( github.com/CosmWasm/wasmd v0.30.0 github.com/cosmos/cosmos-proto v1.0.0-alpha8 - github.com/cosmos/cosmos-sdk v0.46.11 + github.com/cosmos/cosmos-sdk v0.47.1 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go/v4 v4.3.0 github.com/gogo/protobuf v1.3.3 diff --git a/proto/osmosis/concentrated-liquidity/pool-model/query.proto b/proto/osmosis/concentrated-liquidity/pool-model/query.proto index 868d6bdb480..9ebc783587b 100644 --- a/proto/osmosis/concentrated-liquidity/pool-model/query.proto +++ b/proto/osmosis/concentrated-liquidity/pool-model/query.proto @@ -49,6 +49,15 @@ service Query { "/osmosis/concentratedliquidity/v1beta1/total_liquidity_for_range"; } + // LiquidityNetInDirection returns liquidity net in the direction given. + // Uses the bound if specified, if not uses either min tick / max tick + // depending on the direction. + rpc LiquidityNetInDirection(QueryLiquidityNetInDirectionRequest) + returns (QueryLiquidityNetInDirectionResponse) { + option (google.api.http).get = "/osmosis/concentratedliquidity/v1beta1/" + "query_liquidity_net_in_direction"; + } + // ClaimableFees returns the amount of fees that can be claimed by a position // with the given id. rpc ClaimableFees(QueryClaimableFeesRequest) @@ -154,7 +163,26 @@ message LiquidityDepthWithRange { ]; } -//=============================== TickLiquidityInBatches +//=============================== LiquidityNetInDirection +message QueryLiquidityNetInDirectionRequest { + uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; + string token_in = 2 [ (gogoproto.moretags) = "yaml:\"token_in\"" ]; + string bound_tick = 3 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int", + (gogoproto.moretags) = "yaml:\"bound_tick\"", + (gogoproto.nullable) = true + ]; +} +message QueryLiquidityNetInDirectionResponse { + repeated LiquidityDepth liquidity_depths = 1 [ (gogoproto.nullable) = false ]; + string current_liquidity = 2 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"current_liquidity\"", + (gogoproto.nullable) = false + ]; +} + +//=============================== TotalLiquidityForRange message QueryTotalLiquidityForRangeRequest { uint64 pool_id = 1 [ (gogoproto.moretags) = "yaml:\"pool_id\"" ]; } diff --git a/proto/osmosis/poolmanager/v1beta1/query.proto b/proto/osmosis/poolmanager/v1beta1/query.proto index a71152f1707..3c445c47dbb 100644 --- a/proto/osmosis/poolmanager/v1beta1/query.proto +++ b/proto/osmosis/poolmanager/v1beta1/query.proto @@ -30,8 +30,8 @@ service Query { rpc EstimateSinglePoolSwapExactAmountIn( EstimateSinglePoolSwapExactAmountInRequest) returns (EstimateSwapExactAmountInResponse) { - option (google.api.http).get = - "/osmosis/poolmanager/v1beta1/{pool_id}/estimate/single_pool_swap_exact_amount_in"; + option (google.api.http).get = "/osmosis/poolmanager/v1beta1/{pool_id}/" + "estimate/single_pool_swap_exact_amount_in"; } // Estimates swap amount in given out. @@ -45,7 +45,8 @@ service Query { EstimateSinglePoolSwapExactAmountOutRequest) returns (EstimateSwapExactAmountOutResponse) { option (google.api.http).get = - "/osmosis/poolmanager/v1beta1/{pool_id}/estimate_out/single_pool_swap_exact_amount_out"; + "/osmosis/poolmanager/v1beta1/{pool_id}/estimate_out/" + "single_pool_swap_exact_amount_out"; } // Returns the total number of pools existing in Osmosis. diff --git a/x/concentrated-liquidity/grpc_query.go b/x/concentrated-liquidity/grpc_query.go index b7ed729b703..0803d9c484d 100644 --- a/x/concentrated-liquidity/grpc_query.go +++ b/x/concentrated-liquidity/grpc_query.go @@ -211,6 +211,39 @@ func (q Querier) TotalLiquidityForRange(goCtx context.Context, req *clquery.Quer return &clquery.QueryTotalLiquidityForRangeResponse{Liquidity: liquidity}, nil } +// LiquidityNetInDirection returns an array of LiquidityDepthWithRange, which contains the range(lower tick and upper tick) and the liquidity amount in the range. +func (q Querier) LiquidityNetInDirection(goCtx context.Context, req *clquery.QueryLiquidityNetInDirectionRequest) (*clquery.QueryLiquidityNetInDirectionResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "empty request") + } + ctx := sdk.UnwrapSDKContext(goCtx) + + // convert values from pointers + var boundTick sdk.Int + if req.BoundTick == nil { + boundTick = sdk.Int{} + } else { + boundTick = *req.BoundTick + } + + liquidityDepths, err := q.Keeper.GetLiquidityNetInDirection( + ctx, + req.PoolId, + req.TokenIn, + boundTick, + ) + if err != nil { + return nil, err + } + + pool, err := q.Keeper.getPoolById(ctx, req.PoolId) + if err != nil { + return nil, err + } + + return &clquery.QueryLiquidityNetInDirectionResponse{LiquidityDepths: liquidityDepths, CurrentLiquidity: pool.GetLiquidity()}, nil +} + func (q Querier) ClaimableFees(ctx context.Context, req *clquery.QueryClaimableFeesRequest) (*clquery.QueryClaimableFeesResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") diff --git a/x/concentrated-liquidity/tick.go b/x/concentrated-liquidity/tick.go index c8d4f0624c6..53e5d9ceffd 100644 --- a/x/concentrated-liquidity/tick.go +++ b/x/concentrated-liquidity/tick.go @@ -253,6 +253,84 @@ func (k Keeper) GetTickLiquidityForRange(ctx sdk.Context, poolId uint64) ([]quer return liquidityDepthsForRange, nil } +// GetLiquidityNetInDirection returns an array of liquidity depth in the given zeroForOne direction. +// Uses boundTick if given, and iterates until we hit bound Tick's index. If not, uses min tick || max tick depending on the direction of zeroForOne. +func (k Keeper) GetLiquidityNetInDirection(ctx sdk.Context, poolId uint64, tokenIn string, boundTick sdk.Int) ([]query.LiquidityDepth, error) { + // check if pool exists + if !k.poolExists(ctx, poolId) { + return []query.LiquidityDepth{}, types.PoolNotFoundError{PoolId: poolId} + } + + // get min and max tick for the pool + p, err := k.getPoolById(ctx, poolId) + if err != nil { + return []query.LiquidityDepth{}, err + } + currentTick := p.GetCurrentTick() + + // sanity check that given tokenIn is an asset in pool. + if tokenIn != p.GetToken0() && tokenIn != p.GetToken1() { + return []query.LiquidityDepth{}, types.TokenInDenomNotInPoolError{TokenInDenom: tokenIn} + } + + // figure out zero for one depending on the token in. + zeroForOne := p.GetToken0() == tokenIn + + // use max or min tick if provided bound is nil + exponentAtPriceOne := p.GetPrecisionFactorAtPriceOne() + minTick, maxTick := math.GetMinAndMaxTicksFromExponentAtPriceOneInternal(exponentAtPriceOne) + if boundTick.IsNil() { + if zeroForOne { + boundTick = sdk.NewInt(minTick) + } else { + boundTick = sdk.NewInt(maxTick) + } + } else { // if bound is not nil, sanity check that given bound is in the direction of swap + if (zeroForOne && boundTick.GT(currentTick)) || (!zeroForOne && boundTick.LT(currentTick)) { + return []query.LiquidityDepth{}, types.InvalidDirectionError{ZeroForOne: zeroForOne, PoolTick: currentTick.Int64(), TargetTick: boundTick.Int64()} + } else if boundTick.GT(sdk.NewInt(maxTick)) || boundTick.LT(sdk.NewInt(minTick)) { + return []query.LiquidityDepth{}, types.InvalidTickError{Tick: boundTick.Int64(), IsLower: false, MinTick: minTick, MaxTick: maxTick} + } + } + + liquidityDepths := []query.LiquidityDepth{} + swapStrategy := swapstrategy.New(zeroForOne, sdk.ZeroDec(), k.storeKey, sdk.ZeroDec()) + + checkTickWithInBoundFn := func(zeroForOne bool, currentTick, boundTick sdk.Int) bool { + return (currentTick.GTE(boundTick) && zeroForOne) || (currentTick.LTE(boundTick) && !zeroForOne) + } + + nextTick, ok := swapStrategy.NextInitializedTick(ctx, poolId, currentTick.Int64()) + if !ok { + return []query.LiquidityDepth{}, nil + } + for checkTickWithInBoundFn(zeroForOne, nextTick, boundTick) { + tick, err := k.getTickByTickIndex(ctx, poolId, nextTick) + if err != nil { + return []query.LiquidityDepth{}, err + } + + liquidityDepth := query.LiquidityDepth{ + LiquidityNet: tick.LiquidityNet, + TickIndex: nextTick, + } + liquidityDepths = append(liquidityDepths, liquidityDepth) + currentTick = nextTick + + nextInitTick, ok := swapStrategy.NextInitializedTick(ctx, poolId, currentTick.Int64()) + // break and return the liquidity as is if + // - there are no more next tick that is initialized, + // - we hit upper limit + + if !ok { + break + } + nextTick = nextInitTick + } + + return liquidityDepths, nil +} + // GetPerTickLiquidityDepthFromRange uses the given lower tick and upper tick, iterates over ticks, creates and returns LiquidityDepth array. // LiquidityNet from the tick is used to indicate liquidity depths. func (k Keeper) GetPerTickLiquidityDepthFromRange(ctx sdk.Context, poolId uint64, lowerTick, upperTick int64) ([]query.LiquidityDepth, error) { diff --git a/x/concentrated-liquidity/tick_test.go b/x/concentrated-liquidity/tick_test.go index 6af21922bed..fb4910cd6f2 100644 --- a/x/concentrated-liquidity/tick_test.go +++ b/x/concentrated-liquidity/tick_test.go @@ -762,6 +762,300 @@ func (s *KeeperTestSuite) TestGetTickLiquidityForRange() { } } +func (s *KeeperTestSuite) TestGetLiquidityNetInDirection() { + defaultTick := withPoolId(defaultTick, defaultPoolId) + + tests := []struct { + name string + presetTicks []genesis.FullTick + + // testing params + poolId uint64 + tokenIn string + boundTick sdk.Int + + // expected values + expectedLiquidityDepths []query.LiquidityDepth + expectedError bool + }{ + { + name: "one full range position, zero for one true", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(10), + TickIndex: sdk.NewInt(DefaultMinTick), + }, + }, + }, + { + name: "one full range position, zero for one false", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(-10), + TickIndex: sdk.NewInt(DefaultMaxTick), + }, + }, + }, + { + name: "one full range position, one range position above current tick, zero for one true", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, 5, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(10), + TickIndex: sdk.NewInt(DefaultMinTick), + }, + }, + }, + { + name: "one full range position, one range position above current tick, zero for one false", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, 5, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(20), + TickIndex: sdk.NewInt(5), + }, + { + LiquidityNet: sdk.NewDec(-20), + TickIndex: sdk.NewInt(10), + }, + { + LiquidityNet: sdk.NewDec(-10), + TickIndex: sdk.NewInt(DefaultMaxTick), + }, + }, + }, + { + name: "one full range position, one range position above current tick, zero for one false, bound tick below with non-empty ticks", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, -10, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.NewInt(-15), + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(20), + TickIndex: sdk.NewInt(-10), + }, + }, + }, + { + name: "one ranged position, returned empty array", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, -10, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.NewInt(-5), + expectedLiquidityDepths: []query.LiquidityDepth{}, + }, + { + name: "one full range position, one range position above current tick, zero for one false, bound tick below with non-empty ticks", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, -10, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.NewInt(10), + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(-20), + TickIndex: sdk.NewInt(10), + }, + }, + }, + { + name: "one full range position, two ranged positions, zero for one true", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, -5, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 5, sdk.NewDec(-20)), + withLiquidityNetandTickIndex(defaultTick, 2, sdk.NewDec(40)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-40)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(20), + TickIndex: sdk.NewInt(-5), + }, + { + LiquidityNet: sdk.NewDec(10), + TickIndex: sdk.NewInt(DefaultMinTick), + }, + }, + }, + { + name: "one full range position, two ranged positions, zero for one false", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, -5, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 5, sdk.NewDec(-20)), + withLiquidityNetandTickIndex(defaultTick, 2, sdk.NewDec(40)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-40)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.Int{}, + expectedLiquidityDepths: []query.LiquidityDepth{ + { + LiquidityNet: sdk.NewDec(40), + TickIndex: sdk.NewInt(2), + }, + { + LiquidityNet: sdk.NewDec(-20), + TickIndex: sdk.NewInt(5), + }, + { + LiquidityNet: sdk.NewDec(-40), + TickIndex: sdk.NewInt(10), + }, + { + LiquidityNet: sdk.NewDec(-10), + TickIndex: sdk.NewInt(DefaultMaxTick), + }, + }, + }, + + // error cases + { + name: "error: invalid pool id", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: 5, + tokenIn: "invalid_token", + boundTick: sdk.NewInt(-5), + expectedError: true, + }, + { + name: "error: invalid token in", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: defaultPoolId, + tokenIn: "invalid_token", + boundTick: sdk.NewInt(-5), + expectedError: true, + }, + { + name: "error: wrong direction of bound ticks", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + withLiquidityNetandTickIndex(defaultTick, -10, sdk.NewDec(20)), + withLiquidityNetandTickIndex(defaultTick, 10, sdk.NewDec(-20)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.NewInt(-5), + expectedError: true, + }, + { + name: "error: bound tick is greater than max tick", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: defaultPoolId, + tokenIn: USDC, + boundTick: sdk.NewInt(DefaultMaxTick + 1), + expectedError: true, + }, + { + name: "error: bound tick is greater than min tick", + presetTicks: []genesis.FullTick{ + withLiquidityNetandTickIndex(defaultTick, DefaultMinTick, sdk.NewDec(10)), + withLiquidityNetandTickIndex(defaultTick, DefaultMaxTick, sdk.NewDec(-10)), + }, + + poolId: defaultPoolId, + tokenIn: ETH, + boundTick: sdk.NewInt(DefaultMinTick - 1), + expectedError: true, + }, + } + + for _, test := range tests { + s.Run(test.name, func() { + // Init suite for each test. + s.Setup() + + // Create a default CL pool + s.PrepareConcentratedPool() + for _, tick := range test.presetTicks { + s.App.ConcentratedLiquidityKeeper.SetTickInfo(s.Ctx, tick.PoolId, tick.TickIndex, tick.Info) + } + + // system under test + liquidityForRange, err := s.App.ConcentratedLiquidityKeeper.GetLiquidityNetInDirection(s.Ctx, test.poolId, test.tokenIn, test.boundTick) + if test.expectedError { + s.Require().Error(err) + return + } + + s.Require().NoError(err) + s.Require().Equal(liquidityForRange, test.expectedLiquidityDepths) + }) + } +} + func (s *KeeperTestSuite) TestGetLiquidityDepthFromIterator() { firstTickLiquidityDepth := query.LiquidityDepth{ TickIndex: sdk.NewInt(-3), diff --git a/x/concentrated-liquidity/types/errors.go b/x/concentrated-liquidity/types/errors.go index 6ab439dd046..1147e21fd90 100644 --- a/x/concentrated-liquidity/types/errors.go +++ b/x/concentrated-liquidity/types/errors.go @@ -23,6 +23,16 @@ func (e InvalidLowerUpperTickError) Error() string { return fmt.Sprintf("Lower tick must be lesser than upper. Got lower: %d, upper: %d", e.LowerTick, e.UpperTick) } +type InvalidDirectionError struct { + PoolTick int64 + TargetTick int64 + ZeroForOne bool +} + +func (e InvalidDirectionError) Error() string { + return fmt.Sprintf("Given zero for one (%t) does not match swap direction. Pool tick at %d, target tick at %d", e.ZeroForOne, e.PoolTick, e.TargetTick) +} + type NotPositiveRequireAmountError struct { Amount string } diff --git a/x/concentrated-liquidity/types/query/query.pb.go b/x/concentrated-liquidity/types/query/query.pb.go index b9f6ec79ab6..b6dad6afe5b 100644 --- a/x/concentrated-liquidity/types/query/query.pb.go +++ b/x/concentrated-liquidity/types/query/query.pb.go @@ -571,7 +571,106 @@ func (m *LiquidityDepthWithRange) XXX_DiscardUnknown() { var xxx_messageInfo_LiquidityDepthWithRange proto.InternalMessageInfo -// =============================== TickLiquidityInBatches +// =============================== LiquidityNetInDirection +type QueryLiquidityNetInDirectionRequest struct { + PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` + TokenIn string `protobuf:"bytes,2,opt,name=token_in,json=tokenIn,proto3" json:"token_in,omitempty" yaml:"token_in"` + BoundTick *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,3,opt,name=bound_tick,json=boundTick,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"bound_tick,omitempty" yaml:"bound_tick"` +} + +func (m *QueryLiquidityNetInDirectionRequest) Reset() { *m = QueryLiquidityNetInDirectionRequest{} } +func (m *QueryLiquidityNetInDirectionRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidityNetInDirectionRequest) ProtoMessage() {} +func (*QueryLiquidityNetInDirectionRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ce34c1e206115391, []int{12} +} +func (m *QueryLiquidityNetInDirectionRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidityNetInDirectionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidityNetInDirectionRequest.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 *QueryLiquidityNetInDirectionRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidityNetInDirectionRequest.Merge(m, src) +} +func (m *QueryLiquidityNetInDirectionRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidityNetInDirectionRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidityNetInDirectionRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLiquidityNetInDirectionRequest proto.InternalMessageInfo + +func (m *QueryLiquidityNetInDirectionRequest) GetPoolId() uint64 { + if m != nil { + return m.PoolId + } + return 0 +} + +func (m *QueryLiquidityNetInDirectionRequest) GetTokenIn() string { + if m != nil { + return m.TokenIn + } + return "" +} + +type QueryLiquidityNetInDirectionResponse struct { + LiquidityDepths []LiquidityDepth `protobuf:"bytes,1,rep,name=liquidity_depths,json=liquidityDepths,proto3" json:"liquidity_depths"` + CurrentLiquidity github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,2,opt,name=current_liquidity,json=currentLiquidity,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"current_liquidity" yaml:"current_liquidity"` +} + +func (m *QueryLiquidityNetInDirectionResponse) Reset() { *m = QueryLiquidityNetInDirectionResponse{} } +func (m *QueryLiquidityNetInDirectionResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidityNetInDirectionResponse) ProtoMessage() {} +func (*QueryLiquidityNetInDirectionResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_ce34c1e206115391, []int{13} +} +func (m *QueryLiquidityNetInDirectionResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidityNetInDirectionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidityNetInDirectionResponse.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 *QueryLiquidityNetInDirectionResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidityNetInDirectionResponse.Merge(m, src) +} +func (m *QueryLiquidityNetInDirectionResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidityNetInDirectionResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidityNetInDirectionResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLiquidityNetInDirectionResponse proto.InternalMessageInfo + +func (m *QueryLiquidityNetInDirectionResponse) GetLiquidityDepths() []LiquidityDepth { + if m != nil { + return m.LiquidityDepths + } + return nil +} + +// =============================== TotalLiquidityForRange type QueryTotalLiquidityForRangeRequest struct { PoolId uint64 `protobuf:"varint,1,opt,name=pool_id,json=poolId,proto3" json:"pool_id,omitempty" yaml:"pool_id"` } @@ -580,7 +679,7 @@ func (m *QueryTotalLiquidityForRangeRequest) Reset() { *m = QueryTotalLi func (m *QueryTotalLiquidityForRangeRequest) String() string { return proto.CompactTextString(m) } func (*QueryTotalLiquidityForRangeRequest) ProtoMessage() {} func (*QueryTotalLiquidityForRangeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce34c1e206115391, []int{12} + return fileDescriptor_ce34c1e206115391, []int{14} } func (m *QueryTotalLiquidityForRangeRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -624,7 +723,7 @@ func (m *QueryTotalLiquidityForRangeResponse) Reset() { *m = QueryTotalL func (m *QueryTotalLiquidityForRangeResponse) String() string { return proto.CompactTextString(m) } func (*QueryTotalLiquidityForRangeResponse) ProtoMessage() {} func (*QueryTotalLiquidityForRangeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce34c1e206115391, []int{13} + return fileDescriptor_ce34c1e206115391, []int{15} } func (m *QueryTotalLiquidityForRangeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -669,7 +768,7 @@ func (m *QueryClaimableFeesRequest) Reset() { *m = QueryClaimableFeesReq func (m *QueryClaimableFeesRequest) String() string { return proto.CompactTextString(m) } func (*QueryClaimableFeesRequest) ProtoMessage() {} func (*QueryClaimableFeesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_ce34c1e206115391, []int{14} + return fileDescriptor_ce34c1e206115391, []int{16} } func (m *QueryClaimableFeesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -713,7 +812,7 @@ func (m *QueryClaimableFeesResponse) Reset() { *m = QueryClaimableFeesRe func (m *QueryClaimableFeesResponse) String() string { return proto.CompactTextString(m) } func (*QueryClaimableFeesResponse) ProtoMessage() {} func (*QueryClaimableFeesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_ce34c1e206115391, []int{15} + return fileDescriptor_ce34c1e206115391, []int{17} } func (m *QueryClaimableFeesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -762,6 +861,8 @@ func init() { proto.RegisterType((*QueryLiquidityDepthsForRangeResponse)(nil), "osmosis.concentratedliquidity.v1beta1.QueryLiquidityDepthsForRangeResponse") proto.RegisterType((*LiquidityDepth)(nil), "osmosis.concentratedliquidity.v1beta1.LiquidityDepth") proto.RegisterType((*LiquidityDepthWithRange)(nil), "osmosis.concentratedliquidity.v1beta1.LiquidityDepthWithRange") + proto.RegisterType((*QueryLiquidityNetInDirectionRequest)(nil), "osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionRequest") + proto.RegisterType((*QueryLiquidityNetInDirectionResponse)(nil), "osmosis.concentratedliquidity.v1beta1.QueryLiquidityNetInDirectionResponse") proto.RegisterType((*QueryTotalLiquidityForRangeRequest)(nil), "osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeRequest") proto.RegisterType((*QueryTotalLiquidityForRangeResponse)(nil), "osmosis.concentratedliquidity.v1beta1.QueryTotalLiquidityForRangeResponse") proto.RegisterType((*QueryClaimableFeesRequest)(nil), "osmosis.concentratedliquidity.v1beta1.QueryClaimableFeesRequest") @@ -773,83 +874,92 @@ func init() { } var fileDescriptor_ce34c1e206115391 = []byte{ - // 1214 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xa6, 0x4d, 0x8a, 0x27, 0x4d, 0xa0, 0x43, 0x28, 0x89, 0x05, 0x76, 0x35, 0xd0, 0x12, - 0xd1, 0x7a, 0x57, 0x09, 0x58, 0x85, 0x88, 0x42, 0xe2, 0x54, 0xa1, 0x6e, 0x11, 0xa2, 0x4b, 0x2a, - 0xa4, 0x52, 0x69, 0xb5, 0xeb, 0x9d, 0x38, 0xab, 0xac, 0x77, 0x9c, 0x9d, 0x75, 0x5a, 0x0b, 0xf5, - 0xc2, 0x0d, 0x24, 0x10, 0x12, 0x9c, 0xf8, 0x18, 0x08, 0xf1, 0x19, 0x22, 0x4e, 0x91, 0x7a, 0xa9, - 0x40, 0xb2, 0x50, 0xc2, 0x27, 0x88, 0xc4, 0x81, 0x03, 0x12, 0xda, 0xd9, 0x37, 0xfb, 0x27, 0x71, - 0x13, 0xff, 0x49, 0x4f, 0xf1, 0x74, 0xde, 0xfb, 0xfd, 0xde, 0xef, 0xbd, 0x37, 0x6f, 0x66, 0x8b, - 0xca, 0x8c, 0x37, 0x18, 0x77, 0xb8, 0x56, 0x63, 0x5e, 0x8d, 0x7a, 0x81, 0x6f, 0x06, 0xd4, 0x2e, - 0xb9, 0xce, 0x56, 0xcb, 0xb1, 0x9d, 0xa0, 0xad, 0x35, 0x19, 0x73, 0x4b, 0x0d, 0x66, 0x53, 0x57, - 0xdb, 0x6a, 0x51, 0xbf, 0xad, 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 0x76, 0x1f, 0x57, 0xb8, 0xda, 0x4f, 0x84, 0xc7, 0x8e, 0xd1, 0xfc, 0xed, 0xd3, 0x80, 0x02, - 0xd5, 0xb7, 0x84, 0xea, 0x0a, 0x5e, 0xea, 0x51, 0x75, 0x10, 0xc2, 0x19, 0x49, 0x75, 0x93, 0xb2, - 0x3e, 0x51, 0xd0, 0x64, 0x66, 0x92, 0xf5, 0x57, 0xd6, 0x6e, 0xa3, 0xb5, 0xbf, 0xb2, 0x76, 0x1d, - 0xa3, 0xe4, 0x86, 0x10, 0x78, 0x1d, 0x97, 0x7b, 0x14, 0x98, 0x1d, 0x9a, 0x78, 0x57, 0x41, 0xe7, - 0xd3, 0x5f, 0x27, 0xf8, 0xa3, 0xfe, 0xe6, 0xdc, 0x91, 0xaf, 0xa5, 0xfc, 0xd2, 0xe0, 0x00, 0x03, - 0x4a, 0x8a, 0x2f, 0x20, 0xab, 0x6d, 0x38, 0x76, 0xc5, 0xda, 0xd9, 0x2b, 0x28, 0xbb, 0x7b, 0x05, - 0xe5, 0xaf, 0xbd, 0x82, 0xf2, 0xc3, 0x7e, 0x61, 0x64, 0x77, 0xbf, 0x30, 0xf2, 0x74, 0xbf, 0x30, - 0x72, 0xff, 0x56, 0xea, 0x1d, 0x00, 0xd0, 0x25, 0xd7, 0xb4, 0x78, 0xcc, 0xb3, 0x3d, 0x5f, 0xd6, - 0x1e, 0x3d, 0xeb, 0xcb, 0x59, 0xbc, 0x13, 0xa2, 0xff, 0x13, 0xb0, 0xc6, 0xc5, 0x17, 0xcc, 0x3b, - 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xf6, 0xdd, 0x52, 0xf0, 0x10, 0x00, 0x00, + // 1350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0x1b, 0x45, + 0x1c, 0xcf, 0xa6, 0x6d, 0x5a, 0x4f, 0x9a, 0x3e, 0xa6, 0xa1, 0x24, 0x16, 0xd8, 0xd5, 0x40, 0x4b, + 0x44, 0xeb, 0x5d, 0x25, 0x60, 0x15, 0x22, 0x0a, 0x89, 0x13, 0xa5, 0x75, 0x8a, 0x0a, 0x5d, 0x52, + 0x21, 0x95, 0x4a, 0xab, 0x7d, 0x4c, 0x9c, 0x95, 0xd7, 0x33, 0xce, 0xee, 0x38, 0xa9, 0x85, 0x7a, + 0x81, 0x03, 0x02, 0x09, 0x84, 0x04, 0x27, 0x3e, 0x06, 0x42, 0x7c, 0x86, 0x88, 0x53, 0xa4, 0x5e, + 0x2a, 0x90, 0x2c, 0x94, 0x20, 0x3e, 0x80, 0x6f, 0x08, 0x21, 0xa1, 0x9d, 0x9d, 0x7d, 0x39, 0x6e, + 0xe2, 0x47, 0xe0, 0x64, 0x8f, 0xff, 0xcf, 0xdf, 0xff, 0x35, 0xff, 0x31, 0x28, 0x52, 0xaf, 0x46, + 0x3d, 0xdb, 0x53, 0x4c, 0x4a, 0x4c, 0x4c, 0x98, 0xab, 0x33, 0x6c, 0x15, 0x1c, 0x7b, 0xb3, 0x61, + 0x5b, 0x36, 0x6b, 0x2a, 0x75, 0x4a, 0x9d, 0x42, 0x8d, 0x5a, 0xd8, 0x51, 0x36, 0x1b, 0xd8, 0x6d, + 0xca, 0x75, 0x97, 0x32, 0x0a, 0xaf, 0x0a, 0x31, 0x39, 0x29, 0x16, 0x49, 0xc9, 0x5b, 0xb3, 0x06, + 0x66, 0xfa, 0x6c, 0x76, 0xb2, 0x42, 0x2b, 0x94, 0x4b, 0x28, 0xfe, 0xb7, 0x40, 0x38, 0x7b, 0xfd, + 0x28, 0x9b, 0xba, 0xab, 0xd7, 0x3c, 0xc1, 0x9c, 0x33, 0x39, 0xb7, 0x62, 0xe8, 0x1e, 0x56, 0x84, + 0x5e, 0xc5, 0xa4, 0x36, 0x11, 0xf4, 0xd7, 0x93, 0x74, 0xee, 0x62, 0xc4, 0x55, 0xd7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23, 0xbb, 0xfb, 0xb9, 0x91, 0x67, 0xfb, 0xb9, 0x91, 0x87, 0x77, 0x12, 0x1b, 0x92, 0x50, 0x5d, + 0x70, 0x74, 0xc3, 0x8b, 0xec, 0x6c, 0xcd, 0x16, 0x95, 0xc7, 0xcf, 0xfb, 0xcb, 0x88, 0x6f, 0x50, + 0x41, 0x9d, 0x18, 0x63, 0xfc, 0xe9, 0xfe, 0xc6, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x5b, + 0x6b, 0xb5, 0xe9, 0x13, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -874,6 +984,10 @@ type QueryClient interface { UserPositions(ctx context.Context, in *QueryUserPositionsRequest, opts ...grpc.CallOption) (*QueryUserPositionsResponse, error) // TotalLiquidityForRange the amount of liquidity existing within given range. TotalLiquidityForRange(ctx context.Context, in *QueryTotalLiquidityForRangeRequest, opts ...grpc.CallOption) (*QueryTotalLiquidityForRangeResponse, error) + // LiquidityNetInDirection returns liquidity net in the direction given. + // Uses the bound if specified, if not uses either min tick / max tick + // depending on the direction. + LiquidityNetInDirection(ctx context.Context, in *QueryLiquidityNetInDirectionRequest, opts ...grpc.CallOption) (*QueryLiquidityNetInDirectionResponse, error) // ClaimableFees returns the amount of fees that can be claimed by a position // with the given id. ClaimableFees(ctx context.Context, in *QueryClaimableFeesRequest, opts ...grpc.CallOption) (*QueryClaimableFeesResponse, error) @@ -934,6 +1048,15 @@ func (c *queryClient) TotalLiquidityForRange(ctx context.Context, in *QueryTotal return out, nil } +func (c *queryClient) LiquidityNetInDirection(ctx context.Context, in *QueryLiquidityNetInDirectionRequest, opts ...grpc.CallOption) (*QueryLiquidityNetInDirectionResponse, error) { + out := new(QueryLiquidityNetInDirectionResponse) + err := c.cc.Invoke(ctx, "/osmosis.concentratedliquidity.v1beta1.Query/LiquidityNetInDirection", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) ClaimableFees(ctx context.Context, in *QueryClaimableFeesRequest, opts ...grpc.CallOption) (*QueryClaimableFeesResponse, error) { out := new(QueryClaimableFeesResponse) err := c.cc.Invoke(ctx, "/osmosis.concentratedliquidity.v1beta1.Query/ClaimableFees", in, out, opts...) @@ -964,6 +1087,10 @@ type QueryServer interface { UserPositions(context.Context, *QueryUserPositionsRequest) (*QueryUserPositionsResponse, error) // TotalLiquidityForRange the amount of liquidity existing within given range. TotalLiquidityForRange(context.Context, *QueryTotalLiquidityForRangeRequest) (*QueryTotalLiquidityForRangeResponse, error) + // LiquidityNetInDirection returns liquidity net in the direction given. + // Uses the bound if specified, if not uses either min tick / max tick + // depending on the direction. + LiquidityNetInDirection(context.Context, *QueryLiquidityNetInDirectionRequest) (*QueryLiquidityNetInDirectionResponse, error) // ClaimableFees returns the amount of fees that can be claimed by a position // with the given id. ClaimableFees(context.Context, *QueryClaimableFeesRequest) (*QueryClaimableFeesResponse, error) @@ -990,6 +1117,9 @@ func (*UnimplementedQueryServer) UserPositions(ctx context.Context, req *QueryUs func (*UnimplementedQueryServer) TotalLiquidityForRange(ctx context.Context, req *QueryTotalLiquidityForRangeRequest) (*QueryTotalLiquidityForRangeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TotalLiquidityForRange not implemented") } +func (*UnimplementedQueryServer) LiquidityNetInDirection(ctx context.Context, req *QueryLiquidityNetInDirectionRequest) (*QueryLiquidityNetInDirectionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LiquidityNetInDirection not implemented") +} func (*UnimplementedQueryServer) ClaimableFees(ctx context.Context, req *QueryClaimableFeesRequest) (*QueryClaimableFeesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ClaimableFees not implemented") } @@ -1091,6 +1221,24 @@ func _Query_TotalLiquidityForRange_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_LiquidityNetInDirection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLiquidityNetInDirectionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LiquidityNetInDirection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/osmosis.concentratedliquidity.v1beta1.Query/LiquidityNetInDirection", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LiquidityNetInDirection(ctx, req.(*QueryLiquidityNetInDirectionRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_ClaimableFees_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryClaimableFeesRequest) if err := dec(in); err != nil { @@ -1151,6 +1299,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TotalLiquidityForRange", Handler: _Query_TotalLiquidityForRange_Handler, }, + { + MethodName: "LiquidityNetInDirection", + Handler: _Query_LiquidityNetInDirection_Handler, + }, { MethodName: "ClaimableFees", Handler: _Query_ClaimableFees_Handler, @@ -1618,6 +1770,100 @@ func (m *LiquidityDepthWithRange) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *QueryLiquidityNetInDirectionRequest) 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 *QueryLiquidityNetInDirectionRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidityNetInDirectionRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.BoundTick != nil { + { + size := m.BoundTick.Size() + i -= size + if _, err := m.BoundTick.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.TokenIn) > 0 { + i -= len(m.TokenIn) + copy(dAtA[i:], m.TokenIn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.TokenIn))) + i-- + dAtA[i] = 0x12 + } + if m.PoolId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PoolId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryLiquidityNetInDirectionResponse) 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 *QueryLiquidityNetInDirectionResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidityNetInDirectionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.CurrentLiquidity.Size() + i -= size + if _, err := m.CurrentLiquidity.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.LiquidityDepths) > 0 { + for iNdEx := len(m.LiquidityDepths) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LiquidityDepths[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 *QueryTotalLiquidityForRangeRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1924,6 +2170,43 @@ func (m *LiquidityDepthWithRange) Size() (n int) { return n } +func (m *QueryLiquidityNetInDirectionRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PoolId != 0 { + n += 1 + sovQuery(uint64(m.PoolId)) + } + l = len(m.TokenIn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.BoundTick != nil { + l = m.BoundTick.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLiquidityNetInDirectionResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.LiquidityDepths) > 0 { + for _, e := range m.LiquidityDepths { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + l = m.CurrentLiquidity.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryTotalLiquidityForRangeRequest) Size() (n int) { if m == nil { return 0 @@ -3151,6 +3434,261 @@ func (m *LiquidityDepthWithRange) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLiquidityNetInDirectionRequest) 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: QueryLiquidityNetInDirectionRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidityNetInDirectionRequest: 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 + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenIn", 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.TokenIn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BoundTick", 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 + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.BoundTick = &v + if err := m.BoundTick.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 *QueryLiquidityNetInDirectionResponse) 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: QueryLiquidityNetInDirectionResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidityNetInDirectionResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidityDepths", 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.LiquidityDepths = append(m.LiquidityDepths, LiquidityDepth{}) + if err := m.LiquidityDepths[len(m.LiquidityDepths)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentLiquidity", 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.CurrentLiquidity.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 *QueryTotalLiquidityForRangeRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/concentrated-liquidity/types/query/query.pb.gw.go b/x/concentrated-liquidity/types/query/query.pb.gw.go index 2592e550679..1c25f23f21f 100644 --- a/x/concentrated-liquidity/types/query/query.pb.gw.go +++ b/x/concentrated-liquidity/types/query/query.pb.gw.go @@ -231,6 +231,42 @@ func local_request_Query_TotalLiquidityForRange_0(ctx context.Context, marshaler } +var ( + filter_Query_LiquidityNetInDirection_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_LiquidityNetInDirection_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidityNetInDirectionRequest + 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_LiquidityNetInDirection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LiquidityNetInDirection(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LiquidityNetInDirection_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidityNetInDirectionRequest + 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_LiquidityNetInDirection_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LiquidityNetInDirection(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_ClaimableFees_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -424,6 +460,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LiquidityNetInDirection_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_LiquidityNetInDirection_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_LiquidityNetInDirection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ClaimableFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -611,6 +670,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LiquidityNetInDirection_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_LiquidityNetInDirection_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_LiquidityNetInDirection_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_ClaimableFees_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -665,6 +744,8 @@ var ( pattern_Query_TotalLiquidityForRange_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "concentratedliquidity", "v1beta1", "total_liquidity_for_range"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_LiquidityNetInDirection_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "concentratedliquidity", "v1beta1", "query_liquidity_net_in_direction"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_ClaimableFees_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "concentratedliquidity", "v1beta1", "claimable_fees"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_PositionById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"osmosis", "concentratedliquidity", "v1beta1", "position_by_id"}, "", runtime.AssumeColonVerbOpt(false))) @@ -681,6 +762,8 @@ var ( forward_Query_TotalLiquidityForRange_0 = runtime.ForwardResponseMessage + forward_Query_LiquidityNetInDirection_0 = runtime.ForwardResponseMessage + forward_Query_ClaimableFees_0 = runtime.ForwardResponseMessage forward_Query_PositionById_0 = runtime.ForwardResponseMessage