diff --git a/.github/workflows/rollback.yml b/.github/workflows/rollback.yml new file mode 100644 index 000000000..d98140aa6 --- /dev/null +++ b/.github/workflows/rollback.yml @@ -0,0 +1,22 @@ +name: Rollback Devnet +on: + workflow_dispatch: + inputs: + version: + description: "the version of blockchain to rollback" + type: string + required: true + +jobs: + deploy: + runs-on: ubuntu-latest + environment: devnet + steps: + - name: Rollback Devnet + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.SSH_USERNAME }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + passphrase: ${{ secrets.SSH_PASSPHRASE }} + script: /bin/bash /home/ubuntu/ci-cd-devnet-backup-and-rollback/rollback.sh ${{inputs.version}} diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 3ae12a7d6..a476ce9f7 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -40864,6 +40864,48 @@ paths: type: string tags: - Query + /elys-network/elys/leveragelp/liquidation_price/{position_id}: + get: + summary: Query a liquidation price for a position + operationId: ElysLeveragelpLiquidationPrice + responses: + '200': + description: A successful response. + schema: + type: object + properties: + price: + type: string + default: + description: An unexpected error response. + schema: + type: object + properties: + code: + type: integer + format: int32 + message: + type: string + details: + type: array + items: + type: object + properties: + '@type': + type: string + additionalProperties: {} + parameters: + - name: position_id + in: path + required: true + type: string + format: uint64 + - name: address + in: query + required: false + type: string + tags: + - Query /elys-network/elys/leveragelp/open_estimation: get: summary: Get estimated amount of return value opening a position @@ -87202,6 +87244,11 @@ definitions: type: string leverage_max: type: string + elys.leveragelp.QueryLiquidationPriceResponse: + type: object + properties: + price: + type: string elys.leveragelp.QueryOpenEstResponse: type: object properties: diff --git a/proto/elys/leveragelp/query.proto b/proto/elys/leveragelp/query.proto index 0d3a7dcd2..e55171c40 100644 --- a/proto/elys/leveragelp/query.proto +++ b/proto/elys/leveragelp/query.proto @@ -70,6 +70,11 @@ service Query { "/elys-network/elys/leveragelp/position/{address}/{id}"; } + // Query a liquidation price for a position + rpc LiquidationPrice (QueryLiquidationPriceRequest) returns (QueryLiquidationPriceResponse) { + option (google.api.http).get = "/elys-network/elys/leveragelp/liquidation_price/{position_id}"; + } + // Get estimated amount of return value opening a position rpc OpenEst(QueryOpenEstRequest) returns (QueryOpenEstResponse) { option (google.api.http).get = @@ -169,6 +174,18 @@ message PositionRequest { message PositionResponse { Position position = 1; } +message QueryLiquidationPriceRequest { + string address = 1; + uint64 position_id = 2; +} + +message QueryLiquidationPriceResponse { + string price = 1 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.nullable) = false + ]; +} + message QueryOpenEstRequest { string collateral_asset = 1; string collateral_amount = 2 [ diff --git a/scripts/examples/leveragelp/leveragelp.sh b/scripts/examples/leveragelp/leveragelp.sh index 9e5219851..56d7a6929 100644 --- a/scripts/examples/leveragelp/leveragelp.sh +++ b/scripts/examples/leveragelp/leveragelp.sh @@ -110,4 +110,17 @@ elysd tx gov submit-proposal proposal.json --from=t2a --keyring-backend=test --c ], "deposit": "10000000uelys" } -``` \ No newline at end of file +``` + +elysd query leveragelp liquidation-price elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w 1 +# price: "0.000000000000080000" + +elysd query amm show-pool 1 +# extra_info: +# lp_token_price: "1.000000000000000000" +# tvl: "110000.000000000000000000" +# pool: +# address: elys12857uh2f6fus3x3jh07cp5u7xfg2ypeec27dcp6864xhraa33mdscw660j +# pool_assets: +# - token: +# amount: "10000000000" \ No newline at end of file diff --git a/scripts/examples/leveragelp/proposal.json b/scripts/examples/leveragelp/proposal.json index e4b0ade3c..4c9f944f8 100644 --- a/scripts/examples/leveragelp/proposal.json +++ b/scripts/examples/leveragelp/proposal.json @@ -23,7 +23,7 @@ "leverage_max": "10.0", "max_open_positions": "9999", "pool_open_threshold": "0.200000000000000000", - "safety_factor": "0.100000000000000000", + "safety_factor": "1.100000000000000000", "whitelisting_enabled": false, "epoch_length": "1" } diff --git a/x/leveragelp/client/cli/query.go b/x/leveragelp/client/cli/query.go index 42c957d3f..c974220c1 100644 --- a/x/leveragelp/client/cli/query.go +++ b/x/leveragelp/client/cli/query.go @@ -37,6 +37,7 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdOpenEstimation()) cmd.AddCommand(CmdCloseEstimation()) cmd.AddCommand(CmdRewards()) + cmd.AddCommand(CmdLiquidationPrice()) // this line is used by starport scaffolding # 1 diff --git a/x/leveragelp/client/cli/query_liquidation_price.go b/x/leveragelp/client/cli/query_liquidation_price.go new file mode 100644 index 000000000..8fbe33ccb --- /dev/null +++ b/x/leveragelp/client/cli/query_liquidation_price.go @@ -0,0 +1,55 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/elys-network/elys/x/leveragelp/types" + "github.com/spf13/cobra" +) + +func CmdLiquidationPrice() *cobra.Command { + cmd := &cobra.Command{ + Use: "liquidation-price [address] [position_id]", + Short: "Query liquidation price", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + reqAddress := args[0] + _, err = sdk.AccAddressFromBech32(reqAddress) + if err != nil { + return err + } + + reqId := args[1] + positionId, err := strconv.ParseUint(reqId, 10, 64) + if err != nil { + return err + } + + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryLiquidationPriceRequest{ + Address: reqAddress, + PositionId: positionId, + } + + res, err := queryClient.LiquidationPrice(cmd.Context(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/leveragelp/keeper/query_position.go b/x/leveragelp/keeper/query_position.go index 6f1e20813..e53ace11e 100644 --- a/x/leveragelp/keeper/query_position.go +++ b/x/leveragelp/keeper/query_position.go @@ -4,6 +4,7 @@ import ( "context" sdk "github.com/cosmos/cosmos-sdk/types" + ammtypes "github.com/elys-network/elys/x/amm/types" "github.com/elys-network/elys/x/leveragelp/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -18,8 +19,41 @@ func (k Keeper) Position(goCtx context.Context, req *types.PositionRequest) (*ty position, err := k.GetPosition(ctx, req.Address, req.Id) if err != nil { - return &types.PositionResponse{}, nil + return nil, err } return &types.PositionResponse{Position: &position}, nil } + +func (k Keeper) LiquidationPrice(goCtx context.Context, req *types.QueryLiquidationPriceRequest) (*types.QueryLiquidationPriceResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + position, err := k.GetPosition(ctx, req.Address, req.PositionId) + if err != nil { + return nil, err + } + + params := k.GetParams(ctx) + + debt := k.stableKeeper.UpdateInterestStackedByAddress(ctx, position.GetPositionAddress()) + + // Ensure position.LeveragedLpAmount is not zero to avoid division by zero + if position.LeveragedLpAmount.IsZero() { + return nil, types.ErrAmountTooLow + } + + // lpTokenPrice * lpTokenAmount / totalDebt = params.SafetyFactor + // lpTokenPrice = totalDebt * params.SafetyFactor / lpTokenAmount + totalDebt := debt.Borrowed.Add(debt.InterestStacked).Sub(debt.InterestPaid) + baseCurrency, _ := k.assetProfileKeeper.GetUsdcDenom(ctx) + usdcDenomPrice := k.oracleKeeper.GetAssetPriceFromDenom(ctx, baseCurrency) + liquidationPrice := params.SafetyFactor.MulInt(totalDebt).Mul(usdcDenomPrice).MulInt(ammtypes.OneShare).QuoInt(position.LeveragedLpAmount) + + return &types.QueryLiquidationPriceResponse{ + Price: liquidationPrice, + }, nil +} diff --git a/x/leveragelp/types/params.go b/x/leveragelp/types/params.go index 090c67504..a051d0afe 100644 --- a/x/leveragelp/types/params.go +++ b/x/leveragelp/types/params.go @@ -35,8 +35,8 @@ func NewParams() Params { LeverageMax: sdk.NewDec(10), EpochLength: (int64)(1), MaxOpenPositions: (int64)(9999), - PoolOpenThreshold: sdk.NewDecWithPrec(2, 1), // 0.2 - SafetyFactor: sdk.NewDecWithPrec(1, 1), // 0.1 + PoolOpenThreshold: sdk.NewDecWithPrec(2, 1), // 0.2 + SafetyFactor: sdk.NewDecWithPrec(11, 1), // 1.1 WhitelistingEnabled: false, } } diff --git a/x/leveragelp/types/query.pb.go b/x/leveragelp/types/query.pb.go index 73d85d9d7..ecb05dd58 100644 --- a/x/leveragelp/types/query.pb.go +++ b/x/leveragelp/types/query.pb.go @@ -979,6 +979,95 @@ func (m *PositionResponse) GetPosition() *Position { return nil } +type QueryLiquidationPriceRequest struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + PositionId uint64 `protobuf:"varint,2,opt,name=position_id,json=positionId,proto3" json:"position_id,omitempty"` +} + +func (m *QueryLiquidationPriceRequest) Reset() { *m = QueryLiquidationPriceRequest{} } +func (m *QueryLiquidationPriceRequest) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationPriceRequest) ProtoMessage() {} +func (*QueryLiquidationPriceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_76659893e638cc9b, []int{20} +} +func (m *QueryLiquidationPriceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationPriceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationPriceRequest.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 *QueryLiquidationPriceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationPriceRequest.Merge(m, src) +} +func (m *QueryLiquidationPriceRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationPriceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationPriceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLiquidationPriceRequest proto.InternalMessageInfo + +func (m *QueryLiquidationPriceRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *QueryLiquidationPriceRequest) GetPositionId() uint64 { + if m != nil { + return m.PositionId + } + return 0 +} + +type QueryLiquidationPriceResponse struct { + Price github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,1,opt,name=price,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"price"` +} + +func (m *QueryLiquidationPriceResponse) Reset() { *m = QueryLiquidationPriceResponse{} } +func (m *QueryLiquidationPriceResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLiquidationPriceResponse) ProtoMessage() {} +func (*QueryLiquidationPriceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_76659893e638cc9b, []int{21} +} +func (m *QueryLiquidationPriceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLiquidationPriceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLiquidationPriceResponse.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 *QueryLiquidationPriceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLiquidationPriceResponse.Merge(m, src) +} +func (m *QueryLiquidationPriceResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLiquidationPriceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLiquidationPriceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLiquidationPriceResponse proto.InternalMessageInfo + type QueryOpenEstRequest struct { CollateralAsset string `protobuf:"bytes,1,opt,name=collateral_asset,json=collateralAsset,proto3" json:"collateral_asset,omitempty"` CollateralAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=collateral_amount,json=collateralAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"collateral_amount"` @@ -990,7 +1079,7 @@ func (m *QueryOpenEstRequest) Reset() { *m = QueryOpenEstRequest{} } func (m *QueryOpenEstRequest) String() string { return proto.CompactTextString(m) } func (*QueryOpenEstRequest) ProtoMessage() {} func (*QueryOpenEstRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{20} + return fileDescriptor_76659893e638cc9b, []int{22} } func (m *QueryOpenEstRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1043,7 +1132,7 @@ func (m *QueryOpenEstResponse) Reset() { *m = QueryOpenEstResponse{} } func (m *QueryOpenEstResponse) String() string { return proto.CompactTextString(m) } func (*QueryOpenEstResponse) ProtoMessage() {} func (*QueryOpenEstResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{21} + return fileDescriptor_76659893e638cc9b, []int{23} } func (m *QueryOpenEstResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1082,7 +1171,7 @@ func (m *QueryCloseEstRequest) Reset() { *m = QueryCloseEstRequest{} } func (m *QueryCloseEstRequest) String() string { return proto.CompactTextString(m) } func (*QueryCloseEstRequest) ProtoMessage() {} func (*QueryCloseEstRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{22} + return fileDescriptor_76659893e638cc9b, []int{24} } func (m *QueryCloseEstRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1134,7 +1223,7 @@ func (m *QueryRewardsRequest) Reset() { *m = QueryRewardsRequest{} } func (m *QueryRewardsRequest) String() string { return proto.CompactTextString(m) } func (*QueryRewardsRequest) ProtoMessage() {} func (*QueryRewardsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{23} + return fileDescriptor_76659893e638cc9b, []int{25} } func (m *QueryRewardsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1186,7 +1275,7 @@ func (m *RewardInfo) Reset() { *m = RewardInfo{} } func (m *RewardInfo) String() string { return proto.CompactTextString(m) } func (*RewardInfo) ProtoMessage() {} func (*RewardInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{24} + return fileDescriptor_76659893e638cc9b, []int{26} } func (m *RewardInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1238,7 +1327,7 @@ func (m *QueryRewardsResponse) Reset() { *m = QueryRewardsResponse{} } func (m *QueryRewardsResponse) String() string { return proto.CompactTextString(m) } func (*QueryRewardsResponse) ProtoMessage() {} func (*QueryRewardsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{25} + return fileDescriptor_76659893e638cc9b, []int{27} } func (m *QueryRewardsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1291,7 +1380,7 @@ func (m *QueryCloseEstResponse) Reset() { *m = QueryCloseEstResponse{} } func (m *QueryCloseEstResponse) String() string { return proto.CompactTextString(m) } func (*QueryCloseEstResponse) ProtoMessage() {} func (*QueryCloseEstResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_76659893e638cc9b, []int{26} + return fileDescriptor_76659893e638cc9b, []int{28} } func (m *QueryCloseEstResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1341,6 +1430,8 @@ func init() { proto.RegisterType((*QueryAllPoolResponse)(nil), "elys.leveragelp.QueryAllPoolResponse") proto.RegisterType((*PositionRequest)(nil), "elys.leveragelp.PositionRequest") proto.RegisterType((*PositionResponse)(nil), "elys.leveragelp.PositionResponse") + proto.RegisterType((*QueryLiquidationPriceRequest)(nil), "elys.leveragelp.QueryLiquidationPriceRequest") + proto.RegisterType((*QueryLiquidationPriceResponse)(nil), "elys.leveragelp.QueryLiquidationPriceResponse") proto.RegisterType((*QueryOpenEstRequest)(nil), "elys.leveragelp.QueryOpenEstRequest") proto.RegisterType((*QueryOpenEstResponse)(nil), "elys.leveragelp.QueryOpenEstResponse") proto.RegisterType((*QueryCloseEstRequest)(nil), "elys.leveragelp.QueryCloseEstRequest") @@ -1353,102 +1444,107 @@ func init() { func init() { proto.RegisterFile("elys/leveragelp/query.proto", fileDescriptor_76659893e638cc9b) } var fileDescriptor_76659893e638cc9b = []byte{ - // 1511 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0x3a, 0x9f, 0x7e, 0x69, 0xe2, 0x64, 0x9a, 0xd0, 0xe0, 0x56, 0x4e, 0xba, 0x6a, 0xd3, - 0xd0, 0xc6, 0xde, 0x36, 0x25, 0x2d, 0xa2, 0x42, 0x22, 0x29, 0x34, 0x32, 0x9f, 0x61, 0x2b, 0x51, - 0x54, 0x84, 0xcc, 0xda, 0x3b, 0x71, 0x47, 0x5d, 0xef, 0xb8, 0xbb, 0x93, 0xba, 0x4e, 0x15, 0x84, - 0xb8, 0xa0, 0x1e, 0x80, 0xf2, 0x25, 0x84, 0x40, 0x82, 0x33, 0xff, 0x04, 0x82, 0x53, 0x2f, 0x48, - 0x95, 0xb8, 0x20, 0x0e, 0x05, 0xb5, 0xfc, 0x21, 0x68, 0x67, 0x67, 0xd6, 0xeb, 0x5d, 0xaf, 0xed, - 0x46, 0x01, 0xf5, 0x64, 0x7b, 0xe6, 0x7d, 0xfc, 0xde, 0xef, 0xbd, 0x37, 0xf3, 0xc6, 0x70, 0x18, - 0x5b, 0x4d, 0x57, 0xb3, 0xf0, 0x4d, 0xec, 0x18, 0x55, 0x6c, 0xd5, 0xb5, 0x1b, 0xdb, 0xd8, 0x69, - 0x16, 0xea, 0x0e, 0x65, 0x14, 0x65, 0xbc, 0xcd, 0x42, 0x6b, 0x33, 0x3b, 0x53, 0xa5, 0x55, 0xca, - 0xf7, 0x34, 0xef, 0x9b, 0x2f, 0x96, 0x3d, 0x52, 0xa5, 0xb4, 0x6a, 0x61, 0xcd, 0xa8, 0x13, 0xcd, - 0xb0, 0x6d, 0xca, 0x0c, 0x46, 0xa8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, 0x64, - 0xae, 0x52, 0xcf, 0x73, 0x40, 0x67, 0x90, 0xd6, 0x1d, 0x90, 0x18, 0x9f, 0x5a, 0xa9, 0x5b, 0x2f, - 0xde, 0x7b, 0x98, 0x53, 0xee, 0x3f, 0xcc, 0x29, 0x7f, 0x3f, 0xcc, 0x29, 0x77, 0x1f, 0xe5, 0x06, - 0xee, 0x3f, 0xca, 0x0d, 0xfc, 0xf1, 0x28, 0x37, 0x70, 0x55, 0x0b, 0x8d, 0x05, 0x71, 0xa3, 0xb7, - 0x62, 0xff, 0x8a, 0x96, 0x47, 0xf8, 0x5f, 0x9f, 0x67, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x23, - 0x1f, 0x7c, 0xcf, 0x01, 0x16, 0x00, 0x00, + // 1595 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xdd, 0x6f, 0xdb, 0x54, + 0x14, 0xaf, 0xd3, 0xcf, 0x9c, 0xae, 0x5f, 0x77, 0x2d, 0x2b, 0xd9, 0x48, 0x3b, 0x6b, 0xeb, 0xca, + 0xd6, 0xd8, 0x5b, 0x47, 0x37, 0xc4, 0x34, 0x41, 0xbb, 0x8f, 0x2a, 0x30, 0xa0, 0x78, 0x12, 0x83, + 0x21, 0x14, 0x9c, 0xf8, 0x36, 0xbb, 0x9a, 0xe3, 0xeb, 0xd9, 0xce, 0xb2, 0xb4, 0x2a, 0x42, 0xbc, + 0xa0, 0x3d, 0x00, 0xe3, 0x4b, 0x08, 0x81, 0x04, 0xcf, 0xfc, 0x05, 0xbc, 0x21, 0xde, 0xf6, 0x82, + 0x34, 0x89, 0x17, 0xc4, 0xc3, 0x40, 0x2b, 0xff, 0x06, 0x12, 0xf2, 0xf5, 0xb5, 0xe3, 0xd8, 0x71, + 0x92, 0x45, 0x05, 0xed, 0x29, 0xc9, 0xbd, 0xe7, 0xe3, 0x77, 0x7e, 0x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, + 0xd0, 0xab, 0xb4, 0x13, 0x8f, 0x61, 0x0b, 0xd2, 0xeb, 0xd8, 0xf1, 0x66, 0xa1, 0x16, 0xb9, 0x6d, + 0x9a, 0x9a, 0x5a, 0xe4, 0xb6, 0x79, 0x88, 0xea, 0x36, 0xb7, 0xb6, 0xe7, 0xee, 0x57, 0x01, 0x66, + 0x9b, 0xf9, 0x6b, 0xcc, 0x23, 0xe8, 0x44, 0x32, 0x35, 0xb1, 0xb1, 0x29, 0xb3, 0xd4, 0x9d, 0x70, + 0xaf, 0x5c, 0x6e, 0x52, 0x2b, 0xc7, 0xef, 0x67, 0x79, 0x9b, 0x7f, 0x69, 0xc1, 0xe5, 0xd7, 0x02, + 0xec, 0x5b, 0xc7, 0x4e, 0xd0, 0x67, 0xb7, 0xa8, 0xd4, 0xe8, 0x60, 0xd3, 0xa2, 0x52, 0x63, 0xf3, + 0x49, 0xb7, 0x95, 0x1a, 0x34, 0xfd, 0x71, 0x64, 0x5f, 0x0a, 0x30, 0xd6, 0x34, 0x49, 0xa0, 0xa3, + 0x31, 0xbf, 0xad, 0x66, 0x93, 0xcc, 0x42, 0x27, 0x31, 0x0e, 0xf1, 0x39, 0x06, 0x51, 0x42, 0x4b, + 0xed, 0x21, 0x12, 0x3b, 0x17, 0x1a, 0x4d, 0xd0, 0x47, 0x02, 0x0c, 0xb0, 0x03, 0x73, 0x24, 0xe6, + 0xa6, 0xc5, 0x74, 0x92, 0x39, 0xda, 0x41, 0x8a, 0x63, 0x59, 0x66, 0x58, 0x96, 0xd0, 0xf1, 0x4e, + 0xe9, 0x75, 0x4f, 0x07, 0x9b, 0x70, 0x76, 0xd0, 0x67, 0x02, 0x0c, 0xba, 0x46, 0xec, 0x24, 0x28, + 0xcd, 0x23, 0x4b, 0x12, 0x94, 0xc8, 0xe0, 0x21, 0x9e, 0x63, 0x50, 0x56, 0xd0, 0xe9, 0x6e, 0xa0, + 0x44, 0x93, 0xf6, 0x89, 0x00, 0x23, 0x7e, 0x19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xae, 0xcb, 0xa1, 0x8e, + 0x26, 0x6e, 0xf4, 0x4e, 0xec, 0x2f, 0xe9, 0xe2, 0x10, 0xfb, 0xdf, 0xf9, 0xf4, 0xbf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xc3, 0x56, 0xe2, 0x66, 0x7e, 0x17, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1482,6 +1578,8 @@ type QueryClient interface { Pools(ctx context.Context, in *QueryAllPoolRequest, opts ...grpc.CallOption) (*QueryAllPoolResponse, error) // Queries a list of Position items. Position(ctx context.Context, in *PositionRequest, opts ...grpc.CallOption) (*PositionResponse, error) + // Query a liquidation price for a position + LiquidationPrice(ctx context.Context, in *QueryLiquidationPriceRequest, opts ...grpc.CallOption) (*QueryLiquidationPriceResponse, error) // Get estimated amount of return value opening a position OpenEst(ctx context.Context, in *QueryOpenEstRequest, opts ...grpc.CallOption) (*QueryOpenEstResponse, error) // Get estimated amount of return value closing a position @@ -1588,6 +1686,15 @@ func (c *queryClient) Position(ctx context.Context, in *PositionRequest, opts .. return out, nil } +func (c *queryClient) LiquidationPrice(ctx context.Context, in *QueryLiquidationPriceRequest, opts ...grpc.CallOption) (*QueryLiquidationPriceResponse, error) { + out := new(QueryLiquidationPriceResponse) + err := c.cc.Invoke(ctx, "/elys.leveragelp.Query/LiquidationPrice", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) OpenEst(ctx context.Context, in *QueryOpenEstRequest, opts ...grpc.CallOption) (*QueryOpenEstResponse, error) { out := new(QueryOpenEstResponse) err := c.cc.Invoke(ctx, "/elys.leveragelp.Query/OpenEst", in, out, opts...) @@ -1636,6 +1743,8 @@ type QueryServer interface { Pools(context.Context, *QueryAllPoolRequest) (*QueryAllPoolResponse, error) // Queries a list of Position items. Position(context.Context, *PositionRequest) (*PositionResponse, error) + // Query a liquidation price for a position + LiquidationPrice(context.Context, *QueryLiquidationPriceRequest) (*QueryLiquidationPriceResponse, error) // Get estimated amount of return value opening a position OpenEst(context.Context, *QueryOpenEstRequest) (*QueryOpenEstResponse, error) // Get estimated amount of return value closing a position @@ -1678,6 +1787,9 @@ func (*UnimplementedQueryServer) Pools(ctx context.Context, req *QueryAllPoolReq func (*UnimplementedQueryServer) Position(ctx context.Context, req *PositionRequest) (*PositionResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Position not implemented") } +func (*UnimplementedQueryServer) LiquidationPrice(ctx context.Context, req *QueryLiquidationPriceRequest) (*QueryLiquidationPriceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LiquidationPrice not implemented") +} func (*UnimplementedQueryServer) OpenEst(ctx context.Context, req *QueryOpenEstRequest) (*QueryOpenEstResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method OpenEst not implemented") } @@ -1872,6 +1984,24 @@ func _Query_Position_Handler(srv interface{}, ctx context.Context, dec func(inte return interceptor(ctx, in, info, handler) } +func _Query_LiquidationPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLiquidationPriceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LiquidationPrice(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/elys.leveragelp.Query/LiquidationPrice", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LiquidationPrice(ctx, req.(*QueryLiquidationPriceRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_OpenEst_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryOpenEstRequest) if err := dec(in); err != nil { @@ -1970,6 +2100,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Position", Handler: _Query_Position_Handler, }, + { + MethodName: "LiquidationPrice", + Handler: _Query_LiquidationPrice_Handler, + }, { MethodName: "OpenEst", Handler: _Query_OpenEst_Handler, @@ -2727,6 +2861,74 @@ func (m *PositionResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryLiquidationPriceRequest) 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 *QueryLiquidationPriceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationPriceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.PositionId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.PositionId)) + i-- + dAtA[i] = 0x10 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLiquidationPriceResponse) 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 *QueryLiquidationPriceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLiquidationPriceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.Price.Size() + i -= size + if _, err := m.Price.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryOpenEstRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -3377,6 +3579,33 @@ func (m *PositionResponse) Size() (n int) { return n } +func (m *QueryLiquidationPriceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.PositionId != 0 { + n += 1 + sovQuery(uint64(m.PositionId)) + } + return n +} + +func (m *QueryLiquidationPriceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Price.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryOpenEstRequest) Size() (n int) { if m == nil { return 0 @@ -5383,6 +5612,191 @@ func (m *PositionResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryLiquidationPriceRequest) 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: QueryLiquidationPriceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationPriceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PositionId", wireType) + } + m.PositionId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PositionId |= 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 *QueryLiquidationPriceResponse) 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: QueryLiquidationPriceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLiquidationPriceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Price", 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.Price.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 *QueryOpenEstRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/leveragelp/types/query.pb.gw.go b/x/leveragelp/types/query.pb.gw.go index c278bbf22..376d8aed4 100644 --- a/x/leveragelp/types/query.pb.gw.go +++ b/x/leveragelp/types/query.pb.gw.go @@ -20,7 +20,6 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" ) @@ -31,7 +30,6 @@ var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -var _ = metadata.Join func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq ParamsRequest @@ -639,6 +637,78 @@ func local_request_Query_Position_0(ctx context.Context, marshaler runtime.Marsh } +var ( + filter_Query_LiquidationPrice_0 = &utilities.DoubleArray{Encoding: map[string]int{"position_id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_LiquidationPrice_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationPriceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["position_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "position_id") + } + + protoReq.PositionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "position_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LiquidationPrice(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LiquidationPrice_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLiquidationPriceRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["position_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "position_id") + } + + protoReq.PositionId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "position_id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LiquidationPrice_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LiquidationPrice(ctx, &protoReq) + return msg, metadata, err + +} + var ( filter_Query_OpenEst_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) @@ -786,14 +856,12 @@ func local_request_Query_Rewards_0(ctx context.Context, marshaler runtime.Marsha // 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. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { mux.Handle("GET", pattern_Query_Params_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 { @@ -801,7 +869,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Params_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) @@ -815,8 +882,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueryPositions_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 { @@ -824,7 +889,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueryPositions_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) @@ -838,8 +902,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueryPositionsByPool_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 { @@ -847,7 +909,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueryPositionsByPool_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) @@ -861,8 +922,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetStatus_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 { @@ -870,7 +929,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetStatus_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) @@ -884,8 +942,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_QueryPositionsForAddress_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 { @@ -893,7 +949,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_QueryPositionsForAddress_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) @@ -907,8 +962,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_GetWhitelist_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 { @@ -916,7 +969,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_GetWhitelist_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) @@ -930,8 +982,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_IsWhitelisted_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 { @@ -939,7 +989,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_IsWhitelisted_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) @@ -953,8 +1002,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Pool_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 { @@ -962,7 +1009,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Pool_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) @@ -976,8 +1022,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Pools_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 { @@ -985,7 +1029,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Pools_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) @@ -999,8 +1042,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Position_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 { @@ -1008,7 +1049,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Position_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) @@ -1019,11 +1059,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_LiquidationPrice_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LiquidationPrice_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_LiquidationPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_OpenEst_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 { @@ -1031,7 +1089,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_OpenEst_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) @@ -1045,8 +1102,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_CloseEst_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 { @@ -1054,7 +1109,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_CloseEst_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) @@ -1068,8 +1122,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv mux.Handle("GET", pattern_Query_Rewards_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 { @@ -1077,7 +1129,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv return } resp, md, err := local_request_Query_Rewards_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) @@ -1329,6 +1380,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_LiquidationPrice_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_LiquidationPrice_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_LiquidationPrice_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_OpenEst_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -1413,6 +1484,8 @@ var ( pattern_Query_Position_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"elys-network", "elys", "leveragelp", "position", "address", "id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_LiquidationPrice_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"elys-network", "elys", "leveragelp", "liquidation_price", "position_id"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_OpenEst_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "leveragelp", "open_estimation"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_CloseEst_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"elys-network", "elys", "leveragelp", "close_estimation"}, "", runtime.AssumeColonVerbOpt(true))) @@ -1441,6 +1514,8 @@ var ( forward_Query_Position_0 = runtime.ForwardResponseMessage + forward_Query_LiquidationPrice_0 = runtime.ForwardResponseMessage + forward_Query_OpenEst_0 = runtime.ForwardResponseMessage forward_Query_CloseEst_0 = runtime.ForwardResponseMessage