From dd2167632910ec308145994b98bb46cdc3528fa7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 10 Oct 2023 15:28:12 +0200 Subject: [PATCH] feat: wire settlement cmd --- proto/nibiru/perp/v2/tx.proto | 17 ++ x/perp/v2/client/cli/tx.go | 46 ++++ x/perp/v2/keeper/msg_server.go | 18 ++ x/perp/v2/types/msgs.go | 28 ++ x/perp/v2/types/msgs_test.go | 42 +++ x/perp/v2/types/tx.pb.go | 476 ++++++++++++++++++++++++++------- 6 files changed, 535 insertions(+), 92 deletions(-) diff --git a/proto/nibiru/perp/v2/tx.proto b/proto/nibiru/perp/v2/tx.proto index 29bf3a6a2..261c4feef 100644 --- a/proto/nibiru/perp/v2/tx.proto +++ b/proto/nibiru/perp/v2/tx.proto @@ -24,10 +24,27 @@ service Msg { rpc PartialClose(MsgPartialClose) returns (MsgPartialCloseResponse) {} + rpc SettlePosition(MsgSettlePosition) returns (MsgClosePositionResponse) {} + rpc DonateToEcosystemFund(MsgDonateToEcosystemFund) returns (MsgDonateToEcosystemFundResponse) {} } +// -------------------------- Settle Position -------------------------- + +/* MsgSettlePosition: Msg to remove margin. */ +message MsgSettlePosition { + string sender = 1; + + string pair = 2 [ + (gogoproto.customtype) = + "github.com/NibiruChain/nibiru/x/common/asset.Pair", + (gogoproto.nullable) = false + ]; + + uint64 version = 3; +} + // -------------------------- RemoveMargin -------------------------- /* MsgRemoveMargin: Msg to remove margin. */ diff --git a/x/perp/v2/client/cli/tx.go b/x/perp/v2/client/cli/tx.go index bebd31c58..d45b81696 100644 --- a/x/perp/v2/client/cli/tx.go +++ b/x/perp/v2/client/cli/tx.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "strconv" "strings" "github.com/cosmos/cosmos-sdk/client" @@ -29,6 +30,7 @@ func GetTxCmd() *cobra.Command { AddMarginCmd(), MarketOrderCmd(), ClosePositionCmd(), + SettlePositionCmd(), PartialCloseCmd(), MultiLiquidateCmd(), DonateToEcosystemFundCmd(), @@ -315,6 +317,50 @@ func AddMarginCmd() *cobra.Command { return cmd } +func SettlePositionCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "settle [market] [version]", + Short: "Settle position in a specific market version when the market is disabled", + Long: strings.TrimSpace( + fmt.Sprintf(` + $ %s tx perp settle osmo:nusd 1 + `, version.AppName), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + version, err := strconv.ParseUint(args[1], 10, 64) + if err != nil { + return err + } + + pair, err := asset.TryNewPair(args[0]) + if err != nil { + return err + } + + msg := &types.MsgSettlePosition{ + Sender: clientCtx.GetFromAddress().String(), + Pair: pair, + Version: version, + } + if err = msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + func DonateToEcosystemFundCmd() *cobra.Command { cmd := &cobra.Command{ Use: "donate-ef [amount]", diff --git a/x/perp/v2/keeper/msg_server.go b/x/perp/v2/keeper/msg_server.go index 9c0bfb61e..efa5a38f3 100644 --- a/x/perp/v2/keeper/msg_server.go +++ b/x/perp/v2/keeper/msg_server.go @@ -108,6 +108,24 @@ func (m msgServer) MultiLiquidate(goCtx context.Context, req *types.MsgMultiLiqu return &types.MsgMultiLiquidateResponse{Liquidations: resp}, nil } +func (m msgServer) SettlePosition(ctx context.Context, msg *types.MsgSettlePosition) (*types.MsgClosePositionResponse, error) { + // These fields should have already been validated by MsgSettlePosition.ValidateBasic() prior to being sent to the msgServer. + traderAddr := sdk.MustAccAddressFromBech32(msg.Sender) + resp, err := m.k.SettlePosition(sdk.UnwrapSDKContext(ctx), msg.Pair, msg.Version, traderAddr) + + if err != nil { + return nil, err + } + + return &types.MsgClosePositionResponse{ + ExchangedNotionalValue: resp.ExchangedNotionalValue, + ExchangedPositionSize: resp.ExchangedPositionSize, + FundingPayment: resp.FundingPayment, + RealizedPnl: resp.RealizedPnl, + MarginToTrader: resp.MarginToVault.Neg(), + }, nil +} + func (m msgServer) DonateToEcosystemFund(ctx context.Context, msg *types.MsgDonateToEcosystemFund) (*types.MsgDonateToEcosystemFundResponse, error) { if err := m.k.BankKeeper.SendCoinsFromAccountToModule( sdk.UnwrapSDKContext(ctx), diff --git a/x/perp/v2/types/msgs.go b/x/perp/v2/types/msgs.go index 8eda3d24c..3378b0bc4 100644 --- a/x/perp/v2/types/msgs.go +++ b/x/perp/v2/types/msgs.go @@ -198,6 +198,34 @@ func (m MsgClosePosition) GetSigners() []sdk.AccAddress { return []sdk.AccAddress{signer} } +// MsgSettlePosition + +func (m MsgSettlePosition) Route() string { return "perp" } +func (m MsgSettlePosition) Type() string { return "settle_position_msg" } + +func (m MsgSettlePosition) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Sender); err != nil { + return sdkerrors.Wrapf(errors.ErrInvalidAddress, "invalid sender address (%s)", err) + } + if err := m.Pair.Validate(); err != nil { + return err + } + + return nil +} + +func (m MsgSettlePosition) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func (m MsgSettlePosition) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(m.Sender) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + // MsgDonateToEcosystemFund func (m MsgDonateToEcosystemFund) Route() string { return "perp" } diff --git a/x/perp/v2/types/msgs_test.go b/x/perp/v2/types/msgs_test.go index d06c612cf..8a3a146fe 100644 --- a/x/perp/v2/types/msgs_test.go +++ b/x/perp/v2/types/msgs_test.go @@ -243,6 +243,36 @@ func TestMsgValidateBasic(t *testing.T) { true, "decoding bech32 failed", }, + // MsgSettlePosition test cases + { + "Test MsgSettlePosition: Valid input", + &MsgSettlePosition{ + Sender: validSender, + Pair: validPair, + Version: 1, + }, + false, + "", + }, + { + "Test MsgSettlePosition: Invalid pair", + &MsgSettlePosition{ + Sender: validSender, + Pair: invalidPair, + Version: 1, + }, + true, + "invalid base asset", + }, + { + "Test MsgSettlePosition: Invalid sender", + &MsgSettlePosition{ + Sender: "invalid", + Pair: validPair, + }, + true, + "decoding bech32 failed", + }, // MsgPartialClose test cases { "Test MsgPartialClose: Valid input", @@ -385,6 +415,7 @@ func TestMsg_GetSigners(t *testing.T) { &MsgRemoveMargin{Sender: validSender}, &MsgMarketOrder{Sender: validSender}, &MsgClosePosition{Sender: validSender}, + &MsgSettlePosition{Sender: validSender}, &MsgPartialClose{Sender: validSender}, &MsgDonateToEcosystemFund{Sender: validSender}, &MsgMultiLiquidate{Sender: validSender}, @@ -394,6 +425,7 @@ func TestMsg_GetSigners(t *testing.T) { &MsgRemoveMargin{Sender: invalidSender}, &MsgMarketOrder{Sender: invalidSender}, &MsgClosePosition{Sender: invalidSender}, + &MsgSettlePosition{Sender: invalidSender}, &MsgPartialClose{Sender: invalidSender}, &MsgDonateToEcosystemFund{Sender: invalidSender}, &MsgMultiLiquidate{Sender: invalidSender}, @@ -457,6 +489,12 @@ func TestMsg_RouteAndType(t *testing.T) { expectedRoute: "perp", expectedType: "close_position_msg", }, + { + name: "MsgSettlePosition", + msg: &MsgSettlePosition{}, + expectedRoute: "perp", + expectedType: "settle_position_msg", + }, { name: "MsgPartialClose", msg: &MsgPartialClose{}, @@ -511,6 +549,10 @@ func TestMsg_GetSignBytes(t *testing.T) { name: "MsgClosePosition", msg: &MsgClosePosition{}, }, + { + name: "MsgSettlePosition", + msg: &MsgSettlePosition{}, + }, { name: "MsgPartialClose", msg: &MsgPartialClose{}, diff --git a/x/perp/v2/types/tx.pb.go b/x/perp/v2/types/tx.pb.go index a6993682b..77abdd52c 100644 --- a/x/perp/v2/types/tx.pb.go +++ b/x/perp/v2/types/tx.pb.go @@ -32,6 +32,60 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgSettlePosition: Msg to remove margin. +type MsgSettlePosition struct { + Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` + Pair github_com_NibiruChain_nibiru_x_common_asset.Pair `protobuf:"bytes,2,opt,name=pair,proto3,customtype=github.com/NibiruChain/nibiru/x/common/asset.Pair" json:"pair"` + Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"` +} + +func (m *MsgSettlePosition) Reset() { *m = MsgSettlePosition{} } +func (m *MsgSettlePosition) String() string { return proto.CompactTextString(m) } +func (*MsgSettlePosition) ProtoMessage() {} +func (*MsgSettlePosition) Descriptor() ([]byte, []int) { + return fileDescriptor_b95cda40bf0a0f91, []int{0} +} +func (m *MsgSettlePosition) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSettlePosition) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSettlePosition.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 *MsgSettlePosition) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSettlePosition.Merge(m, src) +} +func (m *MsgSettlePosition) XXX_Size() int { + return m.Size() +} +func (m *MsgSettlePosition) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSettlePosition.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSettlePosition proto.InternalMessageInfo + +func (m *MsgSettlePosition) GetSender() string { + if m != nil { + return m.Sender + } + return "" +} + +func (m *MsgSettlePosition) GetVersion() uint64 { + if m != nil { + return m.Version + } + return 0 +} + // MsgRemoveMargin: Msg to remove margin. type MsgRemoveMargin struct { Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` @@ -43,7 +97,7 @@ func (m *MsgRemoveMargin) Reset() { *m = MsgRemoveMargin{} } func (m *MsgRemoveMargin) String() string { return proto.CompactTextString(m) } func (*MsgRemoveMargin) ProtoMessage() {} func (*MsgRemoveMargin) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{0} + return fileDescriptor_b95cda40bf0a0f91, []int{1} } func (m *MsgRemoveMargin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -99,7 +153,7 @@ func (m *MsgRemoveMarginResponse) Reset() { *m = MsgRemoveMarginResponse func (m *MsgRemoveMarginResponse) String() string { return proto.CompactTextString(m) } func (*MsgRemoveMarginResponse) ProtoMessage() {} func (*MsgRemoveMarginResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{1} + return fileDescriptor_b95cda40bf0a0f91, []int{2} } func (m *MsgRemoveMarginResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -153,7 +207,7 @@ func (m *MsgAddMargin) Reset() { *m = MsgAddMargin{} } func (m *MsgAddMargin) String() string { return proto.CompactTextString(m) } func (*MsgAddMargin) ProtoMessage() {} func (*MsgAddMargin) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{2} + return fileDescriptor_b95cda40bf0a0f91, []int{3} } func (m *MsgAddMargin) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -205,7 +259,7 @@ func (m *MsgAddMarginResponse) Reset() { *m = MsgAddMarginResponse{} } func (m *MsgAddMarginResponse) String() string { return proto.CompactTextString(m) } func (*MsgAddMarginResponse) ProtoMessage() {} func (*MsgAddMarginResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{3} + return fileDescriptor_b95cda40bf0a0f91, []int{4} } func (m *MsgAddMarginResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -250,7 +304,7 @@ func (m *MsgMultiLiquidate) Reset() { *m = MsgMultiLiquidate{} } func (m *MsgMultiLiquidate) String() string { return proto.CompactTextString(m) } func (*MsgMultiLiquidate) ProtoMessage() {} func (*MsgMultiLiquidate) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{4} + return fileDescriptor_b95cda40bf0a0f91, []int{5} } func (m *MsgMultiLiquidate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,7 +356,7 @@ func (m *MsgMultiLiquidate_Liquidation) Reset() { *m = MsgMultiLiquidate func (m *MsgMultiLiquidate_Liquidation) String() string { return proto.CompactTextString(m) } func (*MsgMultiLiquidate_Liquidation) ProtoMessage() {} func (*MsgMultiLiquidate_Liquidation) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{4, 0} + return fileDescriptor_b95cda40bf0a0f91, []int{5, 0} } func (m *MsgMultiLiquidate_Liquidation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,7 +400,7 @@ func (m *MsgMultiLiquidateResponse) Reset() { *m = MsgMultiLiquidateResp func (m *MsgMultiLiquidateResponse) String() string { return proto.CompactTextString(m) } func (*MsgMultiLiquidateResponse) ProtoMessage() {} func (*MsgMultiLiquidateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{5} + return fileDescriptor_b95cda40bf0a0f91, []int{6} } func (m *MsgMultiLiquidateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +453,7 @@ func (m *MsgMultiLiquidateResponse_LiquidationResponse) String() string { } func (*MsgMultiLiquidateResponse_LiquidationResponse) ProtoMessage() {} func (*MsgMultiLiquidateResponse_LiquidationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{5, 0} + return fileDescriptor_b95cda40bf0a0f91, []int{6, 0} } func (m *MsgMultiLiquidateResponse_LiquidationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -476,7 +530,7 @@ func (m *MsgMarketOrder) Reset() { *m = MsgMarketOrder{} } func (m *MsgMarketOrder) String() string { return proto.CompactTextString(m) } func (*MsgMarketOrder) ProtoMessage() {} func (*MsgMarketOrder) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{6} + return fileDescriptor_b95cda40bf0a0f91, []int{7} } func (m *MsgMarketOrder) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -546,7 +600,7 @@ func (m *MsgMarketOrderResponse) Reset() { *m = MsgMarketOrderResponse{} func (m *MsgMarketOrderResponse) String() string { return proto.CompactTextString(m) } func (*MsgMarketOrderResponse) ProtoMessage() {} func (*MsgMarketOrderResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{7} + return fileDescriptor_b95cda40bf0a0f91, []int{8} } func (m *MsgMarketOrderResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -591,7 +645,7 @@ func (m *MsgClosePosition) Reset() { *m = MsgClosePosition{} } func (m *MsgClosePosition) String() string { return proto.CompactTextString(m) } func (*MsgClosePosition) ProtoMessage() {} func (*MsgClosePosition) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{8} + return fileDescriptor_b95cda40bf0a0f91, []int{9} } func (m *MsgClosePosition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -647,7 +701,7 @@ func (m *MsgClosePositionResponse) Reset() { *m = MsgClosePositionRespon func (m *MsgClosePositionResponse) String() string { return proto.CompactTextString(m) } func (*MsgClosePositionResponse) ProtoMessage() {} func (*MsgClosePositionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{9} + return fileDescriptor_b95cda40bf0a0f91, []int{10} } func (m *MsgClosePositionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -686,7 +740,7 @@ func (m *MsgPartialClose) Reset() { *m = MsgPartialClose{} } func (m *MsgPartialClose) String() string { return proto.CompactTextString(m) } func (*MsgPartialClose) ProtoMessage() {} func (*MsgPartialClose) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{10} + return fileDescriptor_b95cda40bf0a0f91, []int{11} } func (m *MsgPartialClose) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -742,7 +796,7 @@ func (m *MsgPartialCloseResponse) Reset() { *m = MsgPartialCloseResponse func (m *MsgPartialCloseResponse) String() string { return proto.CompactTextString(m) } func (*MsgPartialCloseResponse) ProtoMessage() {} func (*MsgPartialCloseResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{11} + return fileDescriptor_b95cda40bf0a0f91, []int{12} } func (m *MsgPartialCloseResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -781,7 +835,7 @@ func (m *MsgDonateToEcosystemFund) Reset() { *m = MsgDonateToEcosystemFu func (m *MsgDonateToEcosystemFund) String() string { return proto.CompactTextString(m) } func (*MsgDonateToEcosystemFund) ProtoMessage() {} func (*MsgDonateToEcosystemFund) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{12} + return fileDescriptor_b95cda40bf0a0f91, []int{13} } func (m *MsgDonateToEcosystemFund) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -831,7 +885,7 @@ func (m *MsgDonateToEcosystemFundResponse) Reset() { *m = MsgDonateToEco func (m *MsgDonateToEcosystemFundResponse) String() string { return proto.CompactTextString(m) } func (*MsgDonateToEcosystemFundResponse) ProtoMessage() {} func (*MsgDonateToEcosystemFundResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_b95cda40bf0a0f91, []int{13} + return fileDescriptor_b95cda40bf0a0f91, []int{14} } func (m *MsgDonateToEcosystemFundResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -861,6 +915,7 @@ func (m *MsgDonateToEcosystemFundResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDonateToEcosystemFundResponse proto.InternalMessageInfo func init() { + proto.RegisterType((*MsgSettlePosition)(nil), "nibiru.perp.v2.MsgSettlePosition") proto.RegisterType((*MsgRemoveMargin)(nil), "nibiru.perp.v2.MsgRemoveMargin") proto.RegisterType((*MsgRemoveMarginResponse)(nil), "nibiru.perp.v2.MsgRemoveMarginResponse") proto.RegisterType((*MsgAddMargin)(nil), "nibiru.perp.v2.MsgAddMargin") @@ -882,82 +937,85 @@ func init() { func init() { proto.RegisterFile("nibiru/perp/v2/tx.proto", fileDescriptor_b95cda40bf0a0f91) } var fileDescriptor_b95cda40bf0a0f91 = []byte{ - // 1200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0xda, 0x4e, 0x9a, 0x3c, 0xa7, 0x4e, 0x3a, 0xdf, 0x34, 0x71, 0xad, 0xca, 0xc9, 0x77, - 0x85, 0x4a, 0x38, 0x64, 0x97, 0x1a, 0x24, 0x04, 0x12, 0xa0, 0xa4, 0x3f, 0x10, 0xa8, 0x6e, 0xdd, - 0xa5, 0x6a, 0x51, 0x01, 0x6d, 0x27, 0xf6, 0x78, 0x33, 0xea, 0x7a, 0xc6, 0xdd, 0x99, 0xb5, 0x9a, - 0x1c, 0xf9, 0x0b, 0xf8, 0x17, 0x38, 0x70, 0x45, 0xe2, 0x00, 0x5c, 0xf8, 0x03, 0x7a, 0xec, 0x11, - 0x71, 0x88, 0x50, 0x72, 0xe1, 0x4a, 0xc5, 0x1f, 0x80, 0x66, 0x7f, 0x79, 0xed, 0x6e, 0x12, 0xc7, - 0xa4, 0x91, 0x40, 0x9c, 0xec, 0xdd, 0xf7, 0xde, 0xe7, 0xfd, 0xf8, 0xbc, 0x79, 0x33, 0xb3, 0xb0, - 0xcc, 0xe8, 0x16, 0xf5, 0x7c, 0xb3, 0x47, 0xbc, 0x9e, 0xd9, 0xaf, 0x9b, 0xf2, 0xa9, 0xd1, 0xf3, - 0xb8, 0xe4, 0xa8, 0x1c, 0x0a, 0x0c, 0x25, 0x30, 0xfa, 0xf5, 0xea, 0x65, 0x87, 0x73, 0xc7, 0x25, - 0x26, 0xee, 0x51, 0x13, 0x33, 0xc6, 0x25, 0x96, 0x94, 0x33, 0x11, 0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x11, 0x94, 0x47, 0xae, 0x73, 0xff, 0x3f, 0xf6, 0xe6, - 0x52, 0x7d, 0x63, 0xec, 0xcb, 0x8d, 0x9e, 0x43, 0x0f, 0xa0, 0x94, 0x3e, 0x80, 0xd7, 0xb2, 0x6c, - 0x07, 0xf2, 0xea, 0x95, 0xa3, 0xe5, 0x29, 0xe0, 0x2f, 0xe1, 0xfc, 0xf0, 0xd6, 0xb9, 0x9a, 0x61, - 0x3a, 0xa4, 0x51, 0x5d, 0x3b, 0x4e, 0x23, 0x05, 0xff, 0x10, 0xe6, 0x86, 0x06, 0x65, 0x16, 0x91, - 0x69, 0x85, 0x4c, 0x22, 0xb3, 0x66, 0x95, 0x9e, 0x43, 0x3e, 0x5c, 0xcc, 0xee, 0xe8, 0xac, 0x00, - 0x33, 0x35, 0xab, 0x6f, 0x8e, 0xab, 0x39, 0x70, 0xbb, 0xf9, 0xd1, 0xb3, 0xfd, 0x9a, 0xf6, 0x7c, - 0xbf, 0xa6, 0xfd, 0xb6, 0x5f, 0xd3, 0xbe, 0x3e, 0xa8, 0xe5, 0x9e, 0x1f, 0xd4, 0x72, 0xbf, 0x1c, - 0xd4, 0x72, 0x0f, 0xd7, 0x8f, 0x9b, 0xeb, 0xc9, 0x37, 0x38, 0xb5, 0x52, 0xb7, 0xa6, 0x83, 0xef, - 0x60, 0x6f, 0xfd, 0x15, 0x00, 0x00, 0xff, 0xff, 0x1f, 0xd0, 0xb3, 0xf4, 0xa2, 0x13, 0x00, 0x00, + // 1234 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x58, 0x4d, 0x6f, 0x1b, 0xc5, + 0x1b, 0xf7, 0xda, 0xae, 0x9b, 0x3c, 0x4e, 0x9d, 0x74, 0xfe, 0x69, 0xe2, 0x5a, 0x95, 0x93, 0xff, + 0x0a, 0x95, 0x70, 0xc8, 0x2e, 0x35, 0x48, 0x08, 0x24, 0x40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x0a, 0x55, 0xb3, + 0x4e, 0x0d, 0xc5, 0xae, 0x10, 0x82, 0x3e, 0x86, 0xb2, 0x72, 0xcb, 0x26, 0xdd, 0x00, 0xa4, 0x38, + 0x19, 0xc8, 0xbc, 0x92, 0xb9, 0xdc, 0x55, 0x00, 0xc3, 0x48, 0x9f, 0x48, 0x47, 0x3a, 0x49, 0x68, + 0xe9, 0x48, 0x12, 0xaa, 0xff, 0x54, 0x80, 0x8a, 0x8a, 0x3b, 0xf6, 0xee, 0x13, 0x79, 0xdd, 0x53, + 0x1a, 0x8e, 0x69, 0x14, 0x6c, 0x42, 0x51, 0xd0, 0x4e, 0x18, 0xdf, 0x4a, 0xe3, 0xec, 0x78, 0x31, + 0x5c, 0xa2, 0x1e, 0x69, 0x07, 0xa9, 0x0c, 0xd8, 0xd0, 0x97, 0x80, 0x1e, 0xf8, 0x5c, 0x12, 0x3b, + 0x00, 0xb2, 0x71, 0x8f, 0xfb, 0x4c, 0x06, 0x71, 0x9d, 0xae, 0xd5, 0x3f, 0x65, 0xd2, 0x5a, 0x0a, + 0x90, 0xb6, 0x14, 0xd0, 0x56, 0x80, 0x83, 0x3e, 0x83, 0x39, 0x97, 0x0c, 0x88, 0x87, 0x1d, 0x12, + 0xc6, 0x7b, 0xea, 0xf1, 0x91, 0xc8, 0x23, 0x02, 0xab, 0x2a, 0xbf, 0x23, 0x86, 0xda, 0x2e, 0xed, + 0x51, 0x19, 0x25, 0x6d, 0x5a, 0x73, 0x97, 0x15, 0x5c, 0xca, 0xda, 0xab, 0x0a, 0x4b, 0xdf, 0x3f, + 0x01, 0x2b, 0xa3, 0x99, 0x4b, 0x8a, 0x3e, 0x3d, 0xba, 0xb4, 0x49, 0x47, 0x17, 0xda, 0x85, 0x2a, + 0x79, 0xd8, 0xde, 0xc5, 0xcc, 0x21, 0x1d, 0x9b, 0x71, 0xf5, 0x0d, 0xbb, 0xf6, 0x00, 0xbb, 0x3e, + 0x99, 0x71, 0xaf, 0x5a, 0x49, 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0c, 0xca, 0xac, 0x44, 0xa6, 0x19, 0x32, 0x13, 0x99, 0x35, 0xab, 0xf4, 0x1c, 0xb2, 0xa1, + 0x32, 0xf6, 0xa6, 0x95, 0x15, 0xf5, 0x51, 0x96, 0xa9, 0x8c, 0xf7, 0xe1, 0x4c, 0x76, 0xcb, 0x64, + 0x81, 0x64, 0x72, 0xd6, 0xde, 0x9e, 0x94, 0x73, 0xa8, 0x76, 0xfb, 0x93, 0x27, 0xcf, 0xeb, 0xda, + 0xd3, 0xe7, 0x75, 0xed, 0xb7, 0xe7, 0x75, 0xed, 0xeb, 0xfd, 0x7a, 0xee, 0xe9, 0x7e, 0x3d, 0xf7, + 0xcb, 0x7e, 0x3d, 0x77, 0x77, 0xf3, 0xb0, 0x8d, 0x23, 0x79, 0x7b, 0x54, 0xa3, 0x60, 0xa7, 0x14, + 0xbc, 0xff, 0xbd, 0xf3, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x63, 0xdb, 0xdc, 0xe2, 0x9a, 0x14, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -978,6 +1036,7 @@ type MsgClient interface { MarketOrder(ctx context.Context, in *MsgMarketOrder, opts ...grpc.CallOption) (*MsgMarketOrderResponse, error) ClosePosition(ctx context.Context, in *MsgClosePosition, opts ...grpc.CallOption) (*MsgClosePositionResponse, error) PartialClose(ctx context.Context, in *MsgPartialClose, opts ...grpc.CallOption) (*MsgPartialCloseResponse, error) + SettlePosition(ctx context.Context, in *MsgSettlePosition, opts ...grpc.CallOption) (*MsgClosePositionResponse, error) DonateToEcosystemFund(ctx context.Context, in *MsgDonateToEcosystemFund, opts ...grpc.CallOption) (*MsgDonateToEcosystemFundResponse, error) } @@ -1043,6 +1102,15 @@ func (c *msgClient) PartialClose(ctx context.Context, in *MsgPartialClose, opts return out, nil } +func (c *msgClient) SettlePosition(ctx context.Context, in *MsgSettlePosition, opts ...grpc.CallOption) (*MsgClosePositionResponse, error) { + out := new(MsgClosePositionResponse) + err := c.cc.Invoke(ctx, "/nibiru.perp.v2.Msg/SettlePosition", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) DonateToEcosystemFund(ctx context.Context, in *MsgDonateToEcosystemFund, opts ...grpc.CallOption) (*MsgDonateToEcosystemFundResponse, error) { out := new(MsgDonateToEcosystemFundResponse) err := c.cc.Invoke(ctx, "/nibiru.perp.v2.Msg/DonateToEcosystemFund", in, out, opts...) @@ -1060,6 +1128,7 @@ type MsgServer interface { MarketOrder(context.Context, *MsgMarketOrder) (*MsgMarketOrderResponse, error) ClosePosition(context.Context, *MsgClosePosition) (*MsgClosePositionResponse, error) PartialClose(context.Context, *MsgPartialClose) (*MsgPartialCloseResponse, error) + SettlePosition(context.Context, *MsgSettlePosition) (*MsgClosePositionResponse, error) DonateToEcosystemFund(context.Context, *MsgDonateToEcosystemFund) (*MsgDonateToEcosystemFundResponse, error) } @@ -1085,6 +1154,9 @@ func (*UnimplementedMsgServer) ClosePosition(ctx context.Context, req *MsgCloseP func (*UnimplementedMsgServer) PartialClose(ctx context.Context, req *MsgPartialClose) (*MsgPartialCloseResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method PartialClose not implemented") } +func (*UnimplementedMsgServer) SettlePosition(ctx context.Context, req *MsgSettlePosition) (*MsgClosePositionResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SettlePosition not implemented") +} func (*UnimplementedMsgServer) DonateToEcosystemFund(ctx context.Context, req *MsgDonateToEcosystemFund) (*MsgDonateToEcosystemFundResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DonateToEcosystemFund not implemented") } @@ -1201,6 +1273,24 @@ func _Msg_PartialClose_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_SettlePosition_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSettlePosition) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SettlePosition(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/nibiru.perp.v2.Msg/SettlePosition", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SettlePosition(ctx, req.(*MsgSettlePosition)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_DonateToEcosystemFund_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgDonateToEcosystemFund) if err := dec(in); err != nil { @@ -1247,6 +1337,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "PartialClose", Handler: _Msg_PartialClose_Handler, }, + { + MethodName: "SettlePosition", + Handler: _Msg_SettlePosition_Handler, + }, { MethodName: "DonateToEcosystemFund", Handler: _Msg_DonateToEcosystemFund_Handler, @@ -1256,6 +1350,51 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "nibiru/perp/v2/tx.proto", } +func (m *MsgSettlePosition) 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 *MsgSettlePosition) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSettlePosition) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Version != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.Version)) + i-- + dAtA[i] = 0x18 + } + { + size := m.Pair.Size() + i -= size + if _, err := m.Pair.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sender) > 0 { + i -= len(m.Sender) + copy(dAtA[i:], m.Sender) + i = encodeVarintTx(dAtA, i, uint64(len(m.Sender))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *MsgRemoveMargin) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2148,6 +2287,24 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgSettlePosition) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sender) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Pair.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Version != 0 { + n += 1 + sovTx(uint64(m.Version)) + } + return n +} + func (m *MsgRemoveMargin) Size() (n int) { if m == nil { return 0 @@ -2444,6 +2601,141 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgSettlePosition) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSettlePosition: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSettlePosition: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sender", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sender = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pair", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Pair.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + m.Version = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Version |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgRemoveMargin) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0