diff --git a/proto/dydxprotocol/clob/order.proto b/proto/dydxprotocol/clob/order.proto index ac80fec3c1..4357913474 100644 --- a/proto/dydxprotocol/clob/order.proto +++ b/proto/dydxprotocol/clob/order.proto @@ -3,6 +3,7 @@ package dydxprotocol.clob; import "gogoproto/gogo.proto"; import "dydxprotocol/subaccounts/subaccount.proto"; +import "dydxprotocol/clob/liquidations.proto"; option go_package = "github.com/dydxprotocol/v4-chain/protocol/x/clob/types"; @@ -227,3 +228,22 @@ message TransactionOrdering { // Within the block, the unique transaction index. uint32 transaction_index = 2; } + +// StreamLiquidationOrder represents an protocol-generated IOC liquidation order. +// Used in full node streaming. +message StreamLiquidationOrder { + // Information about this liquidation order. + PerpetualLiquidationInfo liquidation_info = 1; + + // CLOB pair ID of the CLOB pair the liquidation order will be matched against. + uint32 clob_pair_id = 2; + + // True if this is a buy order liquidating a short position, false if vice versa. + bool is_buy = 3; + + // The number of base quantums for this liquidation order. + uint64 quantums = 4; + + // The subticks this liquidation order will be submitted at. + uint64 subticks = 5; +} \ No newline at end of file diff --git a/proto/dydxprotocol/clob/query.proto b/proto/dydxprotocol/clob/query.proto index cca523bcc6..c7eb3d3aba 100644 --- a/proto/dydxprotocol/clob/query.proto +++ b/proto/dydxprotocol/clob/query.proto @@ -220,3 +220,38 @@ message StreamOrderbookFill { // Resulting fill amounts for each order in the orders array. repeated uint64 fill_amounts = 3; } + +// StreamTakerOrder provides information on a taker order that was attempted +// to be matched on the orderbook. +// It is intended to be used only in full node streaming. +message StreamTakerOrder { + // The taker order that was matched on the orderbook. Can be a + // regular order or a liquidation order. + oneof taker_order { + Order order = 1; + StreamLiquidationOrder liquidation_order = 2; + } + + // Information on the taker order after it is matched on the book, + // either successfully or unsuccessfully. + StreamTakerOrderStatus taker_order_status = 3; +} + +// StreamTakerOrderStatus is a representation of a taker order +// after it is attempted to be matched on the orderbook. +// It is intended to be used only in full node streaming. +message StreamTakerOrderStatus { + // The state of the taker order after attempting to match it against the orderbook. + // Possible enum values can be found here: + // https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105 + uint32 order_status = 1; + + // The amount of remaining (non-matched) base quantums of this taker order. + uint64 remaining_quantums = 2; + + // The amount of base quantums that were *optimistically* filled for this taker order + // when the order is matched against the orderbook. Note that if any quantums of this order + // were optimistically filled or filled in state before this invocation of the matching loop, + // this value will not include them. + uint64 optimistically_filled_quantums = 3; +} diff --git a/protocol/x/clob/types/liquidation_order.go b/protocol/x/clob/types/liquidation_order.go index 182c0e84f8..20aa56fe3d 100644 --- a/protocol/x/clob/types/liquidation_order.go +++ b/protocol/x/clob/types/liquidation_order.go @@ -51,6 +51,18 @@ func NewLiquidationOrder( } } +// ToStreamLiquidationOrder converts the LiquidationOrder to a StreamLiquidationOrder +// to be emitted by full node streaming. +func (lo *LiquidationOrder) ToStreamLiquidationOrder() *StreamLiquidationOrder { + return &StreamLiquidationOrder{ + LiquidationInfo: &lo.perpetualLiquidationInfo, + ClobPairId: uint32(lo.clobPairId), + IsBuy: lo.isBuy, + Quantums: lo.quantums.ToUint64(), + Subticks: lo.subticks.ToUint64(), + } +} + // IsBuy returns true if this is a buy order, false if not. // This function is necessary for the `LiquidationOrder` type to implement the `MatchableOrder` interface. func (lo *LiquidationOrder) IsBuy() bool { diff --git a/protocol/x/clob/types/order.pb.go b/protocol/x/clob/types/order.pb.go index f1e239d1bd..ad17410e45 100644 --- a/protocol/x/clob/types/order.pb.go +++ b/protocol/x/clob/types/order.pb.go @@ -807,6 +807,89 @@ func (m *TransactionOrdering) GetTransactionIndex() uint32 { return 0 } +// StreamLiquidationOrder represents an protocol-generated IOC liquidation order. +// Used in full node streaming. +type StreamLiquidationOrder struct { + // Information about this liquidation order. + LiquidationInfo *PerpetualLiquidationInfo `protobuf:"bytes,1,opt,name=liquidation_info,json=liquidationInfo,proto3" json:"liquidation_info,omitempty"` + // CLOB pair ID of the CLOB pair the liquidation order will be matched against. + ClobPairId uint32 `protobuf:"varint,2,opt,name=clob_pair_id,json=clobPairId,proto3" json:"clob_pair_id,omitempty"` + // True if this is a buy order liquidating a short position, false if vice versa. + IsBuy bool `protobuf:"varint,3,opt,name=is_buy,json=isBuy,proto3" json:"is_buy,omitempty"` + // The number of base quantums for this liquidation order. + Quantums uint64 `protobuf:"varint,4,opt,name=quantums,proto3" json:"quantums,omitempty"` + // The subticks this liquidation order will be submitted at. + Subticks uint64 `protobuf:"varint,5,opt,name=subticks,proto3" json:"subticks,omitempty"` +} + +func (m *StreamLiquidationOrder) Reset() { *m = StreamLiquidationOrder{} } +func (m *StreamLiquidationOrder) String() string { return proto.CompactTextString(m) } +func (*StreamLiquidationOrder) ProtoMessage() {} +func (*StreamLiquidationOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_673c6f4faa93736b, []int{9} +} +func (m *StreamLiquidationOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamLiquidationOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamLiquidationOrder.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 *StreamLiquidationOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamLiquidationOrder.Merge(m, src) +} +func (m *StreamLiquidationOrder) XXX_Size() int { + return m.Size() +} +func (m *StreamLiquidationOrder) XXX_DiscardUnknown() { + xxx_messageInfo_StreamLiquidationOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamLiquidationOrder proto.InternalMessageInfo + +func (m *StreamLiquidationOrder) GetLiquidationInfo() *PerpetualLiquidationInfo { + if m != nil { + return m.LiquidationInfo + } + return nil +} + +func (m *StreamLiquidationOrder) GetClobPairId() uint32 { + if m != nil { + return m.ClobPairId + } + return 0 +} + +func (m *StreamLiquidationOrder) GetIsBuy() bool { + if m != nil { + return m.IsBuy + } + return false +} + +func (m *StreamLiquidationOrder) GetQuantums() uint64 { + if m != nil { + return m.Quantums + } + return 0 +} + +func (m *StreamLiquidationOrder) GetSubticks() uint64 { + if m != nil { + return m.Subticks + } + return 0 +} + func init() { proto.RegisterEnum("dydxprotocol.clob.Order_Side", Order_Side_name, Order_Side_value) proto.RegisterEnum("dydxprotocol.clob.Order_TimeInForce", Order_TimeInForce_name, Order_TimeInForce_value) @@ -820,75 +903,82 @@ func init() { proto.RegisterType((*ConditionalOrderPlacement)(nil), "dydxprotocol.clob.ConditionalOrderPlacement") proto.RegisterType((*Order)(nil), "dydxprotocol.clob.Order") proto.RegisterType((*TransactionOrdering)(nil), "dydxprotocol.clob.TransactionOrdering") + proto.RegisterType((*StreamLiquidationOrder)(nil), "dydxprotocol.clob.StreamLiquidationOrder") } func init() { proto.RegisterFile("dydxprotocol/clob/order.proto", fileDescriptor_673c6f4faa93736b) } var fileDescriptor_673c6f4faa93736b = []byte{ - // 996 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xdd, 0x6e, 0xe3, 0x44, - 0x14, 0x8e, 0xdb, 0xec, 0x36, 0x3d, 0xf9, 0x59, 0xef, 0x74, 0x17, 0xdc, 0x94, 0xa6, 0xc1, 0x42, - 0xa5, 0x08, 0x91, 0x88, 0xb2, 0x42, 0x42, 0x88, 0x8b, 0x6d, 0x9b, 0xa8, 0x56, 0xd3, 0x3a, 0xd8, - 0x2e, 0x52, 0x57, 0x88, 0x91, 0x63, 0x4f, 0xdd, 0xd1, 0x4e, 0x3c, 0xc1, 0x1e, 0xa3, 0xe6, 0x9e, - 0x07, 0xe0, 0x25, 0x78, 0x0b, 0x1e, 0x60, 0x2f, 0xf7, 0x92, 0x2b, 0x84, 0xda, 0x67, 0xe0, 0x8a, - 0x1b, 0x34, 0x63, 0x37, 0x4d, 0xba, 0x5b, 0x21, 0xb4, 0x37, 0xdc, 0x79, 0xbe, 0xf3, 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e, 0xb2, 0x06, 0x03, 0x7d, 0xb9, 0xb9, 0x54, 0xd1, - 0xcc, 0x31, 0xd4, 0x17, 0xda, 0x85, 0x5a, 0xd0, 0xdc, 0xb7, 0x4f, 0x0e, 0x2c, 0xcf, 0xb2, 0x4f, - 0xb0, 0x77, 0x36, 0xbc, 0x9b, 0xc8, 0x07, 0x60, 0xdc, 0x89, 0xbb, 0x9e, 0x3d, 0xc4, 0x03, 0xdb, - 0x75, 0x75, 0xed, 0x2d, 0xbb, 0xbd, 0xe7, 0x47, 0x3d, 0x3c, 0x74, 0xec, 0xbe, 0xe5, 0xe9, 0x4b, - 0x7b, 0xfa, 0x9c, 0x73, 0x79, 0x4c, 0xf8, 0xb9, 0x49, 0x60, 0xed, 0x2d, 0x23, 0x8a, 0x3e, 0x84, - 0xda, 0xc2, 0xeb, 0xad, 0x29, 0x6f, 0x54, 0x47, 0xb7, 0xaf, 0x36, 0xfa, 0x14, 0x1e, 0x8b, 0xdb, - 0x9d, 0x73, 0xaf, 0x4b, 0xdd, 0xd1, 0xe7, 0x02, 0x6a, 0xc8, 0xf7, 0x86, 0xaf, 0xae, 0x5a, 0xda, - 0xeb, 0xab, 0x96, 0xf6, 0xe7, 0x55, 0x4b, 0xfb, 0xe5, 0xba, 0x55, 0x7a, 0x7d, 0xdd, 0x2a, 0xfd, - 0x7e, 0xdd, 0x2a, 0xbd, 0xf8, 0x32, 0xa2, 0xe2, 0x22, 0x1b, 0x75, 0x02, 0x3e, 0xee, 0x2e, 0xfc, - 0x14, 0xfc, 0xf4, 0xec, 0xb3, 0xe0, 0xc2, 0xa7, 0x71, 0x77, 0x86, 0x5c, 0xe6, 0x3f, 0x1c, 0xd2, - 0x84, 0xe9, 0xe8, 0xa1, 0x82, 0xbf, 0xf8, 0x27, 0x00, 0x00, 0xff, 0xff, 0x85, 0x48, 0x2a, 0xbd, - 0x92, 0x08, 0x00, 0x00, + // 1091 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x6e, 0xdb, 0xc6, + 0x13, 0x17, 0x65, 0xd9, 0x96, 0x47, 0x1f, 0x61, 0x36, 0x1f, 0x7f, 0x45, 0xf9, 0x5b, 0x56, 0x85, + 0xc0, 0x75, 0x11, 0x54, 0x42, 0xdd, 0xa0, 0x40, 0x51, 0xf4, 0x10, 0xd9, 0x12, 0x4c, 0x58, 0x36, + 0x55, 0x92, 0x0e, 0xe0, 0xa0, 0xe8, 0x82, 0x22, 0x57, 0xf2, 0x22, 0x2b, 0x52, 0x21, 0x97, 0x85, + 0x75, 0xef, 0x03, 0xf4, 0x25, 0xfa, 0x16, 0x7d, 0x80, 0x1c, 0x73, 0xec, 0xa9, 0x68, 0xed, 0x67, + 0xe8, 0xa9, 0x97, 0x62, 0x97, 0xb4, 0x44, 0xfa, 0xa3, 0x45, 0x91, 0x4b, 0x6f, 0xdc, 0xdf, 0xfc, + 0xf6, 0xb7, 0x33, 0xb3, 0x33, 0xb3, 0x84, 0x4d, 0x77, 0xee, 0x9e, 0xcf, 0x02, 0x9f, 0xfb, 0x8e, + 0xcf, 0x3a, 0x0e, 0xf3, 0x47, 0x1d, 0x3f, 0x70, 0x49, 0xd0, 0x96, 0x18, 0xba, 0x9f, 0x36, 0xb7, + 0x85, 0xb9, 0xfe, 0x70, 0xe2, 0x4f, 0x7c, 0x09, 0x75, 0xc4, 0x57, 0x4c, 0xac, 0x7f, 0x92, 0xd1, + 0x09, 0xa3, 0x91, 0xed, 0x38, 0x7e, 0xe4, 0xf1, 0x30, 0xf5, 0x9d, 0x50, 0x9f, 0xdd, 0x3c, 0x92, + 0xd1, 0xb7, 0x11, 0x75, 0x6d, 0x4e, 0x7d, 0x2f, 0x8c, 0x59, 0xad, 0x9f, 0x15, 0x58, 0xd7, 0x85, + 0x27, 0x9a, 0x8b, 0xbe, 0x81, 0xca, 0x52, 0x05, 0x53, 0xb7, 0xa6, 0x34, 0x95, 0x9d, 0xd2, 0xee, + 0x76, 0x3b, 0xe3, 0x5d, 0xea, 0xd0, 0xb6, 0xb9, 0xf8, 0xd6, 0xdc, 0x6e, 0xe1, 0xdd, 0xaf, 0x5b, + 0x39, 0xa3, 0x1c, 0xa6, 0x30, 0xf4, 0x14, 0x36, 0x1c, 0x46, 0x49, 0x2c, 0x97, 0x6f, 0x2a, 0x3b, + 0xeb, 0x46, 0x31, 0x06, 0x34, 0x17, 0x6d, 0x41, 0x49, 0x26, 0x01, 0x8f, 0x99, 0x3d, 0x09, 0x6b, + 0x2b, 0x4d, 0x65, 0xa7, 0x62, 0x80, 0x84, 0xfa, 0x02, 0x41, 0x4d, 0x28, 0x0b, 0xbf, 0xf1, 0xcc, + 0xa6, 0x81, 0x10, 0x28, 0xc4, 0x0c, 0x81, 0x0d, 0x6d, 0x1a, 0x68, 0x6e, 0xeb, 0x3b, 0xd8, 0x94, + 0xde, 0x87, 0x7d, 0xca, 0x18, 0x71, 0xf7, 0xa3, 0x80, 0x7a, 0x93, 0x81, 0xcd, 0x49, 0xc8, 0xbb, + 0xcc, 0x77, 0xde, 0xa0, 0xaf, 0x61, 0x23, 0x3e, 0x83, 0xba, 0x61, 0x4d, 0x69, 0xae, 0xec, 0x94, + 0x76, 0xeb, 0xed, 0x1b, 0xd9, 0x6e, 0x27, 0x29, 0x48, 0x62, 0x28, 0xfa, 0xf1, 0x32, 0x6c, 0xbd, + 0x86, 0x27, 0x43, 0x9f, 0x13, 0x8f, 0x53, 0x9b, 0xb1, 0xf9, 0x30, 0x88, 0x3c, 0x7b, 0xc4, 0x48, + 0x7c, 0xe4, 0x87, 0x6a, 0x13, 0xa8, 0x4a, 0x93, 0x70, 0xdd, 0xe4, 0x36, 0x27, 0x22, 0x21, 0x63, + 0xca, 0x18, 0xb6, 0xa7, 0x22, 0x7d, 0x32, 0xfd, 0x05, 0x03, 0x04, 0xf4, 0x52, 0x22, 0x68, 0x17, + 0x1e, 0xcd, 0x12, 0x1f, 0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xd3, 0x5b, 0x91, 0xb5, 0x51, 0x1a, 0x2d, 0xa7, 0x36, 0x7a, 0x0e, 0xf7, + 0xf9, 0x72, 0x67, 0x6a, 0xba, 0x54, 0x0c, 0x35, 0x65, 0x88, 0x9b, 0xfc, 0x77, 0x05, 0x1e, 0x9b, + 0x3c, 0x20, 0xf6, 0x74, 0xb0, 0x7c, 0xe1, 0xe3, 0xae, 0x7f, 0x05, 0x6a, 0xea, 0xd5, 0xc7, 0xd4, + 0x1b, 0xfb, 0x49, 0xf7, 0x3f, 0xbf, 0xa5, 0xc4, 0x86, 0x24, 0x98, 0x11, 0x1e, 0xd9, 0x2c, 0xa5, + 0xa3, 0x79, 0x63, 0xdf, 0xb8, 0xc7, 0xb2, 0xc0, 0x8d, 0xa7, 0x39, 0x7f, 0xfd, 0x69, 0x46, 0x8f, + 0x60, 0x8d, 0x86, 0x78, 0x14, 0xcd, 0x65, 0xf7, 0x17, 0x8d, 0x55, 0x1a, 0x76, 0xa3, 0x79, 0x66, + 0x2c, 0x14, 0xfe, 0x66, 0x2c, 0xac, 0x66, 0xc7, 0x42, 0x77, 0xf8, 0xee, 0xa2, 0xa1, 0xbc, 0xbf, + 0x68, 0x28, 0xbf, 0x5d, 0x34, 0x94, 0x1f, 0x2f, 0x1b, 0xb9, 0xf7, 0x97, 0x8d, 0xdc, 0x2f, 0x97, + 0x8d, 0xdc, 0xeb, 0x2f, 0x26, 0x94, 0x9f, 0x45, 0xa3, 0xb6, 0xe3, 0x4f, 0x3b, 0x99, 0x7f, 0x9e, + 0xef, 0x5f, 0x7c, 0xea, 0x9c, 0xd9, 0xd4, 0xeb, 0x2c, 0x90, 0xf3, 0xf8, 0x3f, 0x48, 0x34, 0x5a, + 0x38, 0x5a, 0x93, 0xf0, 0xe7, 0x7f, 0x05, 0x00, 0x00, 0xff, 0xff, 0x9c, 0x15, 0xc3, 0x1c, 0x9c, + 0x09, 0x00, 0x00, } func (m *OrderId) Marshal() (dAtA []byte, err error) { @@ -1327,6 +1417,66 @@ func (m *TransactionOrdering) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StreamLiquidationOrder) 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 *StreamLiquidationOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamLiquidationOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Subticks != 0 { + i = encodeVarintOrder(dAtA, i, uint64(m.Subticks)) + i-- + dAtA[i] = 0x28 + } + if m.Quantums != 0 { + i = encodeVarintOrder(dAtA, i, uint64(m.Quantums)) + i-- + dAtA[i] = 0x20 + } + if m.IsBuy { + i-- + if m.IsBuy { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.ClobPairId != 0 { + i = encodeVarintOrder(dAtA, i, uint64(m.ClobPairId)) + i-- + dAtA[i] = 0x10 + } + if m.LiquidationInfo != nil { + { + size, err := m.LiquidationInfo.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintOrder(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintOrder(dAtA []byte, offset int, v uint64) int { offset -= sovOrder(v) base := offset @@ -1519,6 +1669,31 @@ func (m *TransactionOrdering) Size() (n int) { return n } +func (m *StreamLiquidationOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LiquidationInfo != nil { + l = m.LiquidationInfo.Size() + n += 1 + l + sovOrder(uint64(l)) + } + if m.ClobPairId != 0 { + n += 1 + sovOrder(uint64(m.ClobPairId)) + } + if m.IsBuy { + n += 2 + } + if m.Quantums != 0 { + n += 1 + sovOrder(uint64(m.Quantums)) + } + if m.Subticks != 0 { + n += 1 + sovOrder(uint64(m.Subticks)) + } + return n +} + func sovOrder(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2619,6 +2794,169 @@ func (m *TransactionOrdering) Unmarshal(dAtA []byte) error { } return nil } +func (m *StreamLiquidationOrder) 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 ErrIntOverflowOrder + } + 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: StreamLiquidationOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamLiquidationOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationInfo", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthOrder + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthOrder + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LiquidationInfo == nil { + m.LiquidationInfo = &PerpetualLiquidationInfo{} + } + if err := m.LiquidationInfo.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ClobPairId", wireType) + } + m.ClobPairId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ClobPairId |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsBuy", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsBuy = bool(v != 0) + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Quantums", wireType) + } + m.Quantums = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Quantums |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Subticks", wireType) + } + m.Subticks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowOrder + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Subticks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipOrder(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthOrder + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipOrder(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/protocol/x/clob/types/orderbook.go b/protocol/x/clob/types/orderbook.go index 7650c2869b..ef4cf65e93 100644 --- a/protocol/x/clob/types/orderbook.go +++ b/protocol/x/clob/types/orderbook.go @@ -102,6 +102,16 @@ type TakerOrderStatus struct { OrderOptimisticallyFilledQuantums satypes.BaseQuantums } +// ToStreamingTakerOrderStatus converts the TakerOrderStatus to a StreamTakerOrderStatus +// to be emitted by full node streaming. +func (tos *TakerOrderStatus) ToStreamingTakerOrderStatus() *StreamTakerOrderStatus { + return &StreamTakerOrderStatus{ + OrderStatus: uint32(tos.OrderStatus), + RemainingQuantums: tos.RemainingQuantums.ToUint64(), + OptimisticallyFilledQuantums: tos.OrderOptimisticallyFilledQuantums.ToUint64(), + } +} + // OrderStatus represents the status of an order after attempting to place it on the orderbook. type OrderStatus uint diff --git a/protocol/x/clob/types/query.pb.go b/protocol/x/clob/types/query.pb.go index b4c4596eae..1d66576185 100644 --- a/protocol/x/clob/types/query.pb.go +++ b/protocol/x/clob/types/query.pb.go @@ -1095,6 +1095,179 @@ func (m *StreamOrderbookFill) GetFillAmounts() []uint64 { return nil } +// StreamTakerOrder provides information on a taker order that was attempted +// to be matched on the orderbook. +// It is intended to be used only in full node streaming. +type StreamTakerOrder struct { + // The taker order that was matched on the orderbook. Can be a + // regular order or a liquidation order. + // + // Types that are valid to be assigned to TakerOrder: + // + // *StreamTakerOrder_Order + // *StreamTakerOrder_LiquidationOrder + TakerOrder isStreamTakerOrder_TakerOrder `protobuf_oneof:"taker_order"` + // Information on the taker order after it is matched on the book, + // either successfully or unsuccessfully. + TakerOrderStatus *StreamTakerOrderStatus `protobuf:"bytes,3,opt,name=taker_order_status,json=takerOrderStatus,proto3" json:"taker_order_status,omitempty"` +} + +func (m *StreamTakerOrder) Reset() { *m = StreamTakerOrder{} } +func (m *StreamTakerOrder) String() string { return proto.CompactTextString(m) } +func (*StreamTakerOrder) ProtoMessage() {} +func (*StreamTakerOrder) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{19} +} +func (m *StreamTakerOrder) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamTakerOrder) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamTakerOrder.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 *StreamTakerOrder) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamTakerOrder.Merge(m, src) +} +func (m *StreamTakerOrder) XXX_Size() int { + return m.Size() +} +func (m *StreamTakerOrder) XXX_DiscardUnknown() { + xxx_messageInfo_StreamTakerOrder.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamTakerOrder proto.InternalMessageInfo + +type isStreamTakerOrder_TakerOrder interface { + isStreamTakerOrder_TakerOrder() + MarshalTo([]byte) (int, error) + Size() int +} + +type StreamTakerOrder_Order struct { + Order *Order `protobuf:"bytes,1,opt,name=order,proto3,oneof" json:"order,omitempty"` +} +type StreamTakerOrder_LiquidationOrder struct { + LiquidationOrder *StreamLiquidationOrder `protobuf:"bytes,2,opt,name=liquidation_order,json=liquidationOrder,proto3,oneof" json:"liquidation_order,omitempty"` +} + +func (*StreamTakerOrder_Order) isStreamTakerOrder_TakerOrder() {} +func (*StreamTakerOrder_LiquidationOrder) isStreamTakerOrder_TakerOrder() {} + +func (m *StreamTakerOrder) GetTakerOrder() isStreamTakerOrder_TakerOrder { + if m != nil { + return m.TakerOrder + } + return nil +} + +func (m *StreamTakerOrder) GetOrder() *Order { + if x, ok := m.GetTakerOrder().(*StreamTakerOrder_Order); ok { + return x.Order + } + return nil +} + +func (m *StreamTakerOrder) GetLiquidationOrder() *StreamLiquidationOrder { + if x, ok := m.GetTakerOrder().(*StreamTakerOrder_LiquidationOrder); ok { + return x.LiquidationOrder + } + return nil +} + +func (m *StreamTakerOrder) GetTakerOrderStatus() *StreamTakerOrderStatus { + if m != nil { + return m.TakerOrderStatus + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StreamTakerOrder) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StreamTakerOrder_Order)(nil), + (*StreamTakerOrder_LiquidationOrder)(nil), + } +} + +// StreamTakerOrderStatus is a representation of a taker order +// after it is attempted to be matched on the orderbook. +// It is intended to be used only in full node streaming. +type StreamTakerOrderStatus struct { + // The state of the taker order after attempting to match it against the orderbook. + // Possible enum values can be found here: + // https://github.com/dydxprotocol/v4-chain/blob/main/protocol/x/clob/types/orderbook.go#L105 + OrderStatus uint32 `protobuf:"varint,1,opt,name=order_status,json=orderStatus,proto3" json:"order_status,omitempty"` + // The amount of remaining (non-matched) base quantums of this taker order. + RemainingQuantums uint64 `protobuf:"varint,2,opt,name=remaining_quantums,json=remainingQuantums,proto3" json:"remaining_quantums,omitempty"` + // The amount of base quantums that were *optimistically* filled for this taker order + // when the order is matched against the orderbook. Note that if any quantums of this order + // were optimistically filled or filled in state before this invocation of the matching loop, + // this value will not include them. + OptimisticallyFilledQuantums uint64 `protobuf:"varint,3,opt,name=optimistically_filled_quantums,json=optimisticallyFilledQuantums,proto3" json:"optimistically_filled_quantums,omitempty"` +} + +func (m *StreamTakerOrderStatus) Reset() { *m = StreamTakerOrderStatus{} } +func (m *StreamTakerOrderStatus) String() string { return proto.CompactTextString(m) } +func (*StreamTakerOrderStatus) ProtoMessage() {} +func (*StreamTakerOrderStatus) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{20} +} +func (m *StreamTakerOrderStatus) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamTakerOrderStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamTakerOrderStatus.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 *StreamTakerOrderStatus) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamTakerOrderStatus.Merge(m, src) +} +func (m *StreamTakerOrderStatus) XXX_Size() int { + return m.Size() +} +func (m *StreamTakerOrderStatus) XXX_DiscardUnknown() { + xxx_messageInfo_StreamTakerOrderStatus.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamTakerOrderStatus proto.InternalMessageInfo + +func (m *StreamTakerOrderStatus) GetOrderStatus() uint32 { + if m != nil { + return m.OrderStatus + } + return 0 +} + +func (m *StreamTakerOrderStatus) GetRemainingQuantums() uint64 { + if m != nil { + return m.RemainingQuantums + } + return 0 +} + +func (m *StreamTakerOrderStatus) GetOptimisticallyFilledQuantums() uint64 { + if m != nil { + return m.OptimisticallyFilledQuantums + } + return 0 +} + func init() { proto.RegisterType((*QueryGetClobPairRequest)(nil), "dydxprotocol.clob.QueryGetClobPairRequest") proto.RegisterType((*QueryClobPairResponse)(nil), "dydxprotocol.clob.QueryClobPairResponse") @@ -1116,100 +1289,112 @@ func init() { proto.RegisterType((*StreamUpdate)(nil), "dydxprotocol.clob.StreamUpdate") proto.RegisterType((*StreamOrderbookUpdate)(nil), "dydxprotocol.clob.StreamOrderbookUpdate") proto.RegisterType((*StreamOrderbookFill)(nil), "dydxprotocol.clob.StreamOrderbookFill") + proto.RegisterType((*StreamTakerOrder)(nil), "dydxprotocol.clob.StreamTakerOrder") + proto.RegisterType((*StreamTakerOrderStatus)(nil), "dydxprotocol.clob.StreamTakerOrderStatus") } func init() { proto.RegisterFile("dydxprotocol/clob/query.proto", fileDescriptor_3365c195b25c5bc0) } var fileDescriptor_3365c195b25c5bc0 = []byte{ - // 1407 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6f, 0xdc, 0xc4, - 0x17, 0x5f, 0x27, 0xf9, 0xb6, 0x9b, 0x97, 0xfe, 0xfa, 0x4e, 0x9a, 0x76, 0xeb, 0xa4, 0x9b, 0xd4, - 0xd0, 0x74, 0x93, 0xd2, 0x75, 0x93, 0x56, 0x55, 0x69, 0x50, 0x51, 0x12, 0xd1, 0x1f, 0x52, 0x43, - 0x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da, 0xd1, 0x92, 0x9e, 0xad, - 0x2e, 0xec, 0xc3, 0x42, 0x00, 0xb8, 0xac, 0xac, 0xac, 0x3f, 0x7f, 0x59, 0x55, 0x5e, 0xbc, 0xac, - 0x2a, 0x7f, 0xbf, 0xac, 0x2a, 0x5f, 0xbf, 0xaa, 0x96, 0x5e, 0xbc, 0xaa, 0x96, 0xfe, 0x78, 0x55, - 0x2d, 0x7d, 0x70, 0xcd, 0x71, 0xd9, 0x46, 0xbb, 0x51, 0xb7, 0xa8, 0x9f, 0x4e, 0x5e, 0xe7, 0xea, - 0x25, 0xde, 0x50, 0xf4, 0xae, 0x64, 0x4b, 0x24, 0x94, 0x6d, 0xb7, 0x48, 0xd4, 0x38, 0xc4, 0xc5, - 0x57, 0xfe, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xd1, 0xc6, 0xcc, 0x0a, 0xf6, 0x10, 0x00, 0x00, + // 1557 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x5e, 0x6f, 0xd2, 0x36, 0x79, 0xdb, 0xb4, 0xe9, 0xa4, 0x69, 0xb7, 0x9b, 0x74, 0x93, 0x1a, + 0x9a, 0x26, 0x29, 0x5d, 0x27, 0x69, 0x55, 0x95, 0x06, 0x15, 0x25, 0x81, 0x36, 0x95, 0x1a, 0x9a, + 0xba, 0x69, 0x1b, 0x41, 0x25, 0x6b, 0xd6, 0x9e, 0x38, 0x56, 0x6c, 0xcf, 0xc6, 0x1e, 0xaf, 0x12, + 0x21, 0x04, 0xe2, 0xd0, 0x0b, 0x20, 0x21, 0x71, 0xe0, 0x80, 0xc4, 0x85, 0x33, 0x12, 0x17, 0x8e, + 0x08, 0xb8, 0xf5, 0x58, 0x89, 0x0b, 0x07, 0x84, 0x50, 0xcb, 0x99, 0xbf, 0x01, 0x79, 0x66, 0xbc, + 0xd9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2, 0x12, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2383,6 +2568,130 @@ func (m *StreamOrderbookFill) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *StreamTakerOrder) 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 *StreamTakerOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamTakerOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TakerOrderStatus != nil { + { + size, err := m.TakerOrderStatus.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.TakerOrder != nil { + { + size := m.TakerOrder.Size() + i -= size + if _, err := m.TakerOrder.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StreamTakerOrder_Order) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamTakerOrder_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Order != nil { + { + size, err := m.Order.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 *StreamTakerOrder_LiquidationOrder) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamTakerOrder_LiquidationOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.LiquidationOrder != nil { + { + size, err := m.LiquidationOrder.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *StreamTakerOrderStatus) 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 *StreamTakerOrderStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamTakerOrderStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.OptimisticallyFilledQuantums != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.OptimisticallyFilledQuantums)) + i-- + dAtA[i] = 0x18 + } + if m.RemainingQuantums != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.RemainingQuantums)) + i-- + dAtA[i] = 0x10 + } + if m.OrderStatus != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.OrderStatus)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2704,6 +3013,64 @@ func (m *StreamOrderbookFill) Size() (n int) { return n } +func (m *StreamTakerOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TakerOrder != nil { + n += m.TakerOrder.Size() + } + if m.TakerOrderStatus != nil { + l = m.TakerOrderStatus.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *StreamTakerOrder_Order) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Order != nil { + l = m.Order.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} +func (m *StreamTakerOrder_LiquidationOrder) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LiquidationOrder != nil { + l = m.LiquidationOrder.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} +func (m *StreamTakerOrderStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OrderStatus != 0 { + n += 1 + sovQuery(uint64(m.OrderStatus)) + } + if m.RemainingQuantums != 0 { + n += 1 + sovQuery(uint64(m.RemainingQuantums)) + } + if m.OptimisticallyFilledQuantums != 0 { + n += 1 + sovQuery(uint64(m.OptimisticallyFilledQuantums)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4645,6 +5012,269 @@ func (m *StreamOrderbookFill) Unmarshal(dAtA []byte) error { } return nil } +func (m *StreamTakerOrder) 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: StreamTakerOrder: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamTakerOrder: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Order", 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 + } + v := &Order{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.TakerOrder = &StreamTakerOrder_Order{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LiquidationOrder", 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 + } + v := &StreamLiquidationOrder{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.TakerOrder = &StreamTakerOrder_LiquidationOrder{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TakerOrderStatus", 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 + } + if m.TakerOrderStatus == nil { + m.TakerOrderStatus = &StreamTakerOrderStatus{} + } + if err := m.TakerOrderStatus.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 *StreamTakerOrderStatus) 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: StreamTakerOrderStatus: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamTakerOrderStatus: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderStatus", wireType) + } + m.OrderStatus = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OrderStatus |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RemainingQuantums", wireType) + } + m.RemainingQuantums = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RemainingQuantums |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OptimisticallyFilledQuantums", wireType) + } + m.OptimisticallyFilledQuantums = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OptimisticallyFilledQuantums |= 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 skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0