diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts index 4b5ccc331b..0c7757ed00 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.rpc.Query.ts @@ -22,7 +22,10 @@ export interface Query { /** Queries LiquidationsConfiguration. */ liquidationsConfiguration(request?: QueryLiquidationsConfigurationRequest): Promise; - /** Streams orderbook updates. */ + /** + * Streams orderbook updates. Updates contain orderbook data + * such as order placements, updates, and fills. + */ streamOrderbookUpdates(request: StreamOrderbookUpdatesRequest): Promise; } diff --git a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts index aa31787820..d9e318e6b0 100644 --- a/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts +++ b/indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts @@ -5,6 +5,8 @@ import { EquityTierLimitConfiguration, EquityTierLimitConfigurationSDKType } fro import { BlockRateLimitConfiguration, BlockRateLimitConfigurationSDKType } from "./block_rate_limit_config"; import { LiquidationsConfig, LiquidationsConfigSDKType } from "./liquidations_config"; import { OffChainUpdateV1, OffChainUpdateV1SDKType } from "../indexer/off_chain_updates/off_chain_updates"; +import { ClobMatch, ClobMatchSDKType } from "./matches"; +import { Order, OrderSDKType } from "./order"; import * as _m0 from "protobufjs/minimal"; import { DeepPartial, Long } from "../../helpers"; /** QueryGetClobPairRequest is request type for the ClobPair method. */ @@ -224,15 +226,7 @@ export interface StreamOrderbookUpdatesRequestSDKType { export interface StreamOrderbookUpdatesResponse { /** Orderbook updates for the clob pair. */ - updates: OffChainUpdateV1[]; - /** - * Snapshot indicates if the response is from a snapshot of the orderbook. - * This is true for the initial response and false for all subsequent updates. - * Note that if the snapshot is true, then all previous entries should be - * discarded and the orderbook should be resynced. - */ - - snapshot: boolean; + updates: StreamUpdate[]; /** * ---Additional fields used to debug issues--- * Block height of the updates. @@ -250,6 +244,65 @@ export interface StreamOrderbookUpdatesResponse { export interface StreamOrderbookUpdatesResponseSDKType { /** Orderbook updates for the clob pair. */ + updates: StreamUpdateSDKType[]; + /** + * ---Additional fields used to debug issues--- + * Block height of the updates. + */ + + block_height: number; + /** Exec mode of the updates. */ + + exec_mode: number; +} +/** + * StreamUpdate is an update that will be pushed through the + * GRPC stream. + */ + +export interface StreamUpdate { + orderbookUpdate?: StreamOrderbookUpdate; + orderFill?: StreamOrderbookFill; +} +/** + * StreamUpdate is an update that will be pushed through the + * GRPC stream. + */ + +export interface StreamUpdateSDKType { + orderbook_update?: StreamOrderbookUpdateSDKType; + order_fill?: StreamOrderbookFillSDKType; +} +/** + * StreamOrderbookUpdate provides information on an orderbook update. Used in + * the full node GRPC stream. + */ + +export interface StreamOrderbookUpdate { + /** + * Orderbook updates for the clob pair. Can contain order place, removals, + * or updates. + */ + updates: OffChainUpdateV1[]; + /** + * Snapshot indicates if the response is from a snapshot of the orderbook. + * This is true for the initial response and false for all subsequent updates. + * Note that if the snapshot is true, then all previous entries should be + * discarded and the orderbook should be resynced. + */ + + snapshot: boolean; +} +/** + * StreamOrderbookUpdate provides information on an orderbook update. Used in + * the full node GRPC stream. + */ + +export interface StreamOrderbookUpdateSDKType { + /** + * Orderbook updates for the clob pair. Can contain order place, removals, + * or updates. + */ updates: OffChainUpdateV1SDKType[]; /** * Snapshot indicates if the response is from a snapshot of the orderbook. @@ -259,15 +312,48 @@ export interface StreamOrderbookUpdatesResponseSDKType { */ snapshot: boolean; +} +/** + * StreamOrderbookFill provides information on an orderbook fill. Used in + * the full node GRPC stream. + */ + +export interface StreamOrderbookFill { /** - * ---Additional fields used to debug issues--- - * Block height of the updates. + * Clob match. Provides information on which orders were matched + * and the type of order. Fill amounts here are relative. + */ + clobMatch?: ClobMatch; + /** + * All orders involved in the specified clob match. Used to look up + * price of a match through a given maker order id. */ - block_height: number; - /** Exec mode of the updates. */ + orders: Order[]; + /** Resulting fill amounts for each order in the orders array. */ - exec_mode: number; + fillAmounts: Long[]; +} +/** + * StreamOrderbookFill provides information on an orderbook fill. Used in + * the full node GRPC stream. + */ + +export interface StreamOrderbookFillSDKType { + /** + * Clob match. Provides information on which orders were matched + * and the type of order. Fill amounts here are relative. + */ + clob_match?: ClobMatchSDKType; + /** + * All orders involved in the specified clob match. Used to look up + * price of a match through a given maker order id. + */ + + orders: OrderSDKType[]; + /** Resulting fill amounts for each order in the orders array. */ + + fill_amounts: Long[]; } function createBaseQueryGetClobPairRequest(): QueryGetClobPairRequest { @@ -922,7 +1008,6 @@ export const StreamOrderbookUpdatesRequest = { function createBaseStreamOrderbookUpdatesResponse(): StreamOrderbookUpdatesResponse { return { updates: [], - snapshot: false, blockHeight: 0, execMode: 0 }; @@ -931,19 +1016,15 @@ function createBaseStreamOrderbookUpdatesResponse(): StreamOrderbookUpdatesRespo export const StreamOrderbookUpdatesResponse = { encode(message: StreamOrderbookUpdatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { for (const v of message.updates) { - OffChainUpdateV1.encode(v!, writer.uint32(10).fork()).ldelim(); - } - - if (message.snapshot === true) { - writer.uint32(16).bool(message.snapshot); + StreamUpdate.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.blockHeight !== 0) { - writer.uint32(24).uint32(message.blockHeight); + writer.uint32(16).uint32(message.blockHeight); } if (message.execMode !== 0) { - writer.uint32(32).uint32(message.execMode); + writer.uint32(24).uint32(message.execMode); } return writer; @@ -959,18 +1040,14 @@ export const StreamOrderbookUpdatesResponse = { switch (tag >>> 3) { case 1: - message.updates.push(OffChainUpdateV1.decode(reader, reader.uint32())); + message.updates.push(StreamUpdate.decode(reader, reader.uint32())); break; case 2: - message.snapshot = reader.bool(); - break; - - case 3: message.blockHeight = reader.uint32(); break; - case 4: + case 3: message.execMode = reader.uint32(); break; @@ -985,11 +1062,197 @@ export const StreamOrderbookUpdatesResponse = { fromPartial(object: DeepPartial): StreamOrderbookUpdatesResponse { const message = createBaseStreamOrderbookUpdatesResponse(); - message.updates = object.updates?.map(e => OffChainUpdateV1.fromPartial(e)) || []; - message.snapshot = object.snapshot ?? false; + message.updates = object.updates?.map(e => StreamUpdate.fromPartial(e)) || []; message.blockHeight = object.blockHeight ?? 0; message.execMode = object.execMode ?? 0; return message; } +}; + +function createBaseStreamUpdate(): StreamUpdate { + return { + orderbookUpdate: undefined, + orderFill: undefined + }; +} + +export const StreamUpdate = { + encode(message: StreamUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.orderbookUpdate !== undefined) { + StreamOrderbookUpdate.encode(message.orderbookUpdate, writer.uint32(10).fork()).ldelim(); + } + + if (message.orderFill !== undefined) { + StreamOrderbookFill.encode(message.orderFill, writer.uint32(18).fork()).ldelim(); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamUpdate(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.orderbookUpdate = StreamOrderbookUpdate.decode(reader, reader.uint32()); + break; + + case 2: + message.orderFill = StreamOrderbookFill.decode(reader, reader.uint32()); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): StreamUpdate { + const message = createBaseStreamUpdate(); + message.orderbookUpdate = object.orderbookUpdate !== undefined && object.orderbookUpdate !== null ? StreamOrderbookUpdate.fromPartial(object.orderbookUpdate) : undefined; + message.orderFill = object.orderFill !== undefined && object.orderFill !== null ? StreamOrderbookFill.fromPartial(object.orderFill) : undefined; + return message; + } + +}; + +function createBaseStreamOrderbookUpdate(): StreamOrderbookUpdate { + return { + updates: [], + snapshot: false + }; +} + +export const StreamOrderbookUpdate = { + encode(message: StreamOrderbookUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.updates) { + OffChainUpdateV1.encode(v!, writer.uint32(10).fork()).ldelim(); + } + + if (message.snapshot === true) { + writer.uint32(16).bool(message.snapshot); + } + + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamOrderbookUpdate { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookUpdate(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.updates.push(OffChainUpdateV1.decode(reader, reader.uint32())); + break; + + case 2: + message.snapshot = reader.bool(); + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): StreamOrderbookUpdate { + const message = createBaseStreamOrderbookUpdate(); + message.updates = object.updates?.map(e => OffChainUpdateV1.fromPartial(e)) || []; + message.snapshot = object.snapshot ?? false; + return message; + } + +}; + +function createBaseStreamOrderbookFill(): StreamOrderbookFill { + return { + clobMatch: undefined, + orders: [], + fillAmounts: [] + }; +} + +export const StreamOrderbookFill = { + encode(message: StreamOrderbookFill, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.clobMatch !== undefined) { + ClobMatch.encode(message.clobMatch, writer.uint32(10).fork()).ldelim(); + } + + for (const v of message.orders) { + Order.encode(v!, writer.uint32(18).fork()).ldelim(); + } + + writer.uint32(26).fork(); + + for (const v of message.fillAmounts) { + writer.uint64(v); + } + + writer.ldelim(); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): StreamOrderbookFill { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseStreamOrderbookFill(); + + while (reader.pos < end) { + const tag = reader.uint32(); + + switch (tag >>> 3) { + case 1: + message.clobMatch = ClobMatch.decode(reader, reader.uint32()); + break; + + case 2: + message.orders.push(Order.decode(reader, reader.uint32())); + break; + + case 3: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + + while (reader.pos < end2) { + message.fillAmounts.push((reader.uint64() as Long)); + } + } else { + message.fillAmounts.push((reader.uint64() as Long)); + } + + break; + + default: + reader.skipType(tag & 7); + break; + } + } + + return message; + }, + + fromPartial(object: DeepPartial): StreamOrderbookFill { + const message = createBaseStreamOrderbookFill(); + message.clobMatch = object.clobMatch !== undefined && object.clobMatch !== null ? ClobMatch.fromPartial(object.clobMatch) : undefined; + message.orders = object.orders?.map(e => Order.fromPartial(e)) || []; + message.fillAmounts = object.fillAmounts?.map(e => Long.fromValue(e)) || []; + return message; + } + }; \ No newline at end of file diff --git a/proto/dydxprotocol/clob/query.proto b/proto/dydxprotocol/clob/query.proto index 3745756894..de80d26e4a 100644 --- a/proto/dydxprotocol/clob/query.proto +++ b/proto/dydxprotocol/clob/query.proto @@ -7,6 +7,8 @@ import "cosmos/base/query/v1beta1/pagination.proto"; import "dydxprotocol/clob/block_rate_limit_config.proto"; import "dydxprotocol/clob/clob_pair.proto"; import "dydxprotocol/clob/equity_tier_limit_config.proto"; +import "dydxprotocol/clob/order.proto"; +import "dydxprotocol/clob/matches.proto"; import "dydxprotocol/clob/liquidations_config.proto"; import "dydxprotocol/clob/mev.proto"; import "dydxprotocol/indexer/off_chain_updates/off_chain_updates.proto"; @@ -54,7 +56,8 @@ service Query { // GRPC Streams - // Streams orderbook updates. + // Streams orderbook updates. Updates contain orderbook data + // such as order placements, updates, and fills. rpc StreamOrderbookUpdates(StreamOrderbookUpdatesRequest) returns (stream StreamOrderbookUpdatesResponse); } @@ -145,6 +148,32 @@ message StreamOrderbookUpdatesRequest { // StreamOrderbookUpdates method. message StreamOrderbookUpdatesResponse { // Orderbook updates for the clob pair. + repeated StreamUpdate updates = 1 [ (gogoproto.nullable) = false ]; + + // ---Additional fields used to debug issues--- + // Block height of the updates. + uint32 block_height = 2; + + // Exec mode of the updates. + uint32 exec_mode = 3; +} + +// StreamUpdate is an update that will be pushed through the +// GRPC stream. +message StreamUpdate { + // Contains one of an StreamOrderbookUpdate, + // StreamOrderbookFill. + oneof update_message { + StreamOrderbookUpdate orderbook_update = 1; + StreamOrderbookFill order_fill = 2; + } +} + +// StreamOrderbookUpdate provides information on an orderbook update. Used in +// the full node GRPC stream. +message StreamOrderbookUpdate { + // Orderbook updates for the clob pair. Can contain order place, removals, + // or updates. repeated dydxprotocol.indexer.off_chain_updates.OffChainUpdateV1 updates = 1 [ (gogoproto.nullable) = false ]; @@ -153,11 +182,19 @@ message StreamOrderbookUpdatesResponse { // Note that if the snapshot is true, then all previous entries should be // discarded and the orderbook should be resynced. bool snapshot = 2; +} - // ---Additional fields used to debug issues--- - // Block height of the updates. - uint32 block_height = 3; +// StreamOrderbookFill provides information on an orderbook fill. Used in +// the full node GRPC stream. +message StreamOrderbookFill { + // Clob match. Provides information on which orders were matched + // and the type of order. Fill amounts here are relative. + ClobMatch clob_match = 1; - // Exec mode of the updates. - uint32 exec_mode = 4; + // All orders involved in the specified clob match. Used to look up + // price of a match through a given maker order id. + repeated Order orders = 2 [ (gogoproto.nullable) = false ]; + + // Resulting fill amounts for each order in the orders array. + repeated uint64 fill_amounts = 3 [ (gogoproto.nullable) = false ]; } diff --git a/protocol/streaming/grpc/grpc_streaming_manager.go b/protocol/streaming/grpc/grpc_streaming_manager.go index 60a00e7bdc..5aa7cad587 100644 --- a/protocol/streaming/grpc/grpc_streaming_manager.go +++ b/protocol/streaming/grpc/grpc_streaming_manager.go @@ -122,10 +122,17 @@ func (sm *GrpcStreamingManagerImpl) SendOrderbookUpdates( } if len(updatesToSend) > 0 { + streamUpdates := clobtypes.StreamUpdate{ + UpdateMessage: &clobtypes.StreamUpdate_OrderbookUpdate{ + OrderbookUpdate: &clobtypes.StreamOrderbookUpdate{ + Updates: updatesToSend, + Snapshot: snapshot, + }, + }, + } if err := subscription.srv.Send( &clobtypes.StreamOrderbookUpdatesResponse{ - Updates: updatesToSend, - Snapshot: snapshot, + Updates: []clobtypes.StreamUpdate{streamUpdates}, BlockHeight: blockHeight, ExecMode: uint32(execMode), }, diff --git a/protocol/x/clob/types/query.pb.go b/protocol/x/clob/types/query.pb.go index ee500746b5..18ff69a570 100644 --- a/protocol/x/clob/types/query.pb.go +++ b/protocol/x/clob/types/query.pb.go @@ -705,17 +705,12 @@ func (m *StreamOrderbookUpdatesRequest) GetClobPairId() []uint32 { // StreamOrderbookUpdates method. type StreamOrderbookUpdatesResponse struct { // Orderbook updates for the clob pair. - Updates []types.OffChainUpdateV1 `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"` - // Snapshot indicates if the response is from a snapshot of the orderbook. - // This is true for the initial response and false for all subsequent updates. - // Note that if the snapshot is true, then all previous entries should be - // discarded and the orderbook should be resynced. - Snapshot bool `protobuf:"varint,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` + Updates []StreamUpdate `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"` // ---Additional fields used to debug issues--- // Block height of the updates. - BlockHeight uint32 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` + BlockHeight uint32 `protobuf:"varint,2,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` // Exec mode of the updates. - ExecMode uint32 `protobuf:"varint,4,opt,name=exec_mode,json=execMode,proto3" json:"exec_mode,omitempty"` + ExecMode uint32 `protobuf:"varint,3,opt,name=exec_mode,json=execMode,proto3" json:"exec_mode,omitempty"` } func (m *StreamOrderbookUpdatesResponse) Reset() { *m = StreamOrderbookUpdatesResponse{} } @@ -751,20 +746,13 @@ func (m *StreamOrderbookUpdatesResponse) XXX_DiscardUnknown() { var xxx_messageInfo_StreamOrderbookUpdatesResponse proto.InternalMessageInfo -func (m *StreamOrderbookUpdatesResponse) GetUpdates() []types.OffChainUpdateV1 { +func (m *StreamOrderbookUpdatesResponse) GetUpdates() []StreamUpdate { if m != nil { return m.Updates } return nil } -func (m *StreamOrderbookUpdatesResponse) GetSnapshot() bool { - if m != nil { - return m.Snapshot - } - return false -} - func (m *StreamOrderbookUpdatesResponse) GetBlockHeight() uint32 { if m != nil { return m.BlockHeight @@ -779,6 +767,224 @@ func (m *StreamOrderbookUpdatesResponse) GetExecMode() uint32 { return 0 } +// StreamUpdate is an update that will be pushed through the +// GRPC stream. +type StreamUpdate struct { + // Contains one of an StreamOrderbookUpdate, + // StreamOrderbookFill. + // + // Types that are valid to be assigned to UpdateMessage: + // + // *StreamUpdate_OrderbookUpdate + // *StreamUpdate_OrderFill + UpdateMessage isStreamUpdate_UpdateMessage `protobuf_oneof:"update_message"` +} + +func (m *StreamUpdate) Reset() { *m = StreamUpdate{} } +func (m *StreamUpdate) String() string { return proto.CompactTextString(m) } +func (*StreamUpdate) ProtoMessage() {} +func (*StreamUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{14} +} +func (m *StreamUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamUpdate.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 *StreamUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamUpdate.Merge(m, src) +} +func (m *StreamUpdate) XXX_Size() int { + return m.Size() +} +func (m *StreamUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_StreamUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamUpdate proto.InternalMessageInfo + +type isStreamUpdate_UpdateMessage interface { + isStreamUpdate_UpdateMessage() + MarshalTo([]byte) (int, error) + Size() int +} + +type StreamUpdate_OrderbookUpdate struct { + OrderbookUpdate *StreamOrderbookUpdate `protobuf:"bytes,1,opt,name=orderbook_update,json=orderbookUpdate,proto3,oneof" json:"orderbook_update,omitempty"` +} +type StreamUpdate_OrderFill struct { + OrderFill *StreamOrderbookFill `protobuf:"bytes,2,opt,name=order_fill,json=orderFill,proto3,oneof" json:"order_fill,omitempty"` +} + +func (*StreamUpdate_OrderbookUpdate) isStreamUpdate_UpdateMessage() {} +func (*StreamUpdate_OrderFill) isStreamUpdate_UpdateMessage() {} + +func (m *StreamUpdate) GetUpdateMessage() isStreamUpdate_UpdateMessage { + if m != nil { + return m.UpdateMessage + } + return nil +} + +func (m *StreamUpdate) GetOrderbookUpdate() *StreamOrderbookUpdate { + if x, ok := m.GetUpdateMessage().(*StreamUpdate_OrderbookUpdate); ok { + return x.OrderbookUpdate + } + return nil +} + +func (m *StreamUpdate) GetOrderFill() *StreamOrderbookFill { + if x, ok := m.GetUpdateMessage().(*StreamUpdate_OrderFill); ok { + return x.OrderFill + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StreamUpdate) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StreamUpdate_OrderbookUpdate)(nil), + (*StreamUpdate_OrderFill)(nil), + } +} + +// StreamOrderbookUpdate provides information on an orderbook update. Used in +// the full node GRPC stream. +type StreamOrderbookUpdate struct { + // Orderbook updates for the clob pair. Can contain order place, removals, + // or updates. + Updates []types.OffChainUpdateV1 `protobuf:"bytes,1,rep,name=updates,proto3" json:"updates"` + // Snapshot indicates if the response is from a snapshot of the orderbook. + // This is true for the initial response and false for all subsequent updates. + // Note that if the snapshot is true, then all previous entries should be + // discarded and the orderbook should be resynced. + Snapshot bool `protobuf:"varint,2,opt,name=snapshot,proto3" json:"snapshot,omitempty"` +} + +func (m *StreamOrderbookUpdate) Reset() { *m = StreamOrderbookUpdate{} } +func (m *StreamOrderbookUpdate) String() string { return proto.CompactTextString(m) } +func (*StreamOrderbookUpdate) ProtoMessage() {} +func (*StreamOrderbookUpdate) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{15} +} +func (m *StreamOrderbookUpdate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamOrderbookUpdate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamOrderbookUpdate.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 *StreamOrderbookUpdate) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamOrderbookUpdate.Merge(m, src) +} +func (m *StreamOrderbookUpdate) XXX_Size() int { + return m.Size() +} +func (m *StreamOrderbookUpdate) XXX_DiscardUnknown() { + xxx_messageInfo_StreamOrderbookUpdate.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamOrderbookUpdate proto.InternalMessageInfo + +func (m *StreamOrderbookUpdate) GetUpdates() []types.OffChainUpdateV1 { + if m != nil { + return m.Updates + } + return nil +} + +func (m *StreamOrderbookUpdate) GetSnapshot() bool { + if m != nil { + return m.Snapshot + } + return false +} + +// StreamOrderbookFill provides information on an orderbook fill. Used in +// the full node GRPC stream. +type StreamOrderbookFill struct { + // Clob match. Provides information on which orders were matched + // and the type of order. Fill amounts here are relative. + ClobMatch *ClobMatch `protobuf:"bytes,1,opt,name=clob_match,json=clobMatch,proto3" json:"clob_match,omitempty"` + // All orders involved in the specified clob match. Used to look up + // price of a match through a given maker order id. + Orders []Order `protobuf:"bytes,2,rep,name=orders,proto3" json:"orders"` + // Resulting fill amounts for each order in the orders array. + FillAmounts []uint64 `protobuf:"varint,3,rep,packed,name=fill_amounts,json=fillAmounts,proto3" json:"fill_amounts,omitempty"` +} + +func (m *StreamOrderbookFill) Reset() { *m = StreamOrderbookFill{} } +func (m *StreamOrderbookFill) String() string { return proto.CompactTextString(m) } +func (*StreamOrderbookFill) ProtoMessage() {} +func (*StreamOrderbookFill) Descriptor() ([]byte, []int) { + return fileDescriptor_3365c195b25c5bc0, []int{16} +} +func (m *StreamOrderbookFill) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StreamOrderbookFill) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StreamOrderbookFill.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 *StreamOrderbookFill) XXX_Merge(src proto.Message) { + xxx_messageInfo_StreamOrderbookFill.Merge(m, src) +} +func (m *StreamOrderbookFill) XXX_Size() int { + return m.Size() +} +func (m *StreamOrderbookFill) XXX_DiscardUnknown() { + xxx_messageInfo_StreamOrderbookFill.DiscardUnknown(m) +} + +var xxx_messageInfo_StreamOrderbookFill proto.InternalMessageInfo + +func (m *StreamOrderbookFill) GetClobMatch() *ClobMatch { + if m != nil { + return m.ClobMatch + } + return nil +} + +func (m *StreamOrderbookFill) GetOrders() []Order { + if m != nil { + return m.Orders + } + return nil +} + +func (m *StreamOrderbookFill) GetFillAmounts() []uint64 { + if m != nil { + return m.FillAmounts + } + return nil +} + func init() { proto.RegisterType((*QueryGetClobPairRequest)(nil), "dydxprotocol.clob.QueryGetClobPairRequest") proto.RegisterType((*QueryClobPairResponse)(nil), "dydxprotocol.clob.QueryClobPairResponse") @@ -795,82 +1001,96 @@ func init() { proto.RegisterType((*QueryLiquidationsConfigurationResponse)(nil), "dydxprotocol.clob.QueryLiquidationsConfigurationResponse") proto.RegisterType((*StreamOrderbookUpdatesRequest)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesRequest") proto.RegisterType((*StreamOrderbookUpdatesResponse)(nil), "dydxprotocol.clob.StreamOrderbookUpdatesResponse") + proto.RegisterType((*StreamUpdate)(nil), "dydxprotocol.clob.StreamUpdate") + proto.RegisterType((*StreamOrderbookUpdate)(nil), "dydxprotocol.clob.StreamOrderbookUpdate") + proto.RegisterType((*StreamOrderbookFill)(nil), "dydxprotocol.clob.StreamOrderbookFill") } func init() { proto.RegisterFile("dydxprotocol/clob/query.proto", fileDescriptor_3365c195b25c5bc0) } var fileDescriptor_3365c195b25c5bc0 = []byte{ - // 1112 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x4f, 0x24, 0x45, - 0x14, 0xa7, 0x00, 0x77, 0xe1, 0xb1, 0x6b, 0xb4, 0x58, 0xd8, 0x71, 0x80, 0x01, 0x5a, 0xf9, 0xdc, - 0xd8, 0x0d, 0xec, 0xc6, 0xac, 0xac, 0xd9, 0x04, 0x88, 0xa2, 0xc9, 0xe2, 0x62, 0xbb, 0xa2, 0xd1, - 0x4d, 0x3a, 0x35, 0xdd, 0xc5, 0x4c, 0x85, 0xee, 0xae, 0xa1, 0xbb, 0xa6, 0x03, 0x31, 0xc6, 0xc4, - 0x83, 0x17, 0x3d, 0x98, 0x78, 0xf0, 0xe0, 0xd1, 0xbb, 0xff, 0x81, 0x51, 0x6f, 0x7b, 0xdc, 0xc4, - 0xc4, 0x78, 0x30, 0xc6, 0x80, 0x67, 0xff, 0x86, 0x4d, 0x57, 0xd7, 0xcc, 0xce, 0xd0, 0x1f, 0x03, - 0x5c, 0x66, 0xba, 0x5f, 0xfd, 0xde, 0xeb, 0xdf, 0xfb, 0xa8, 0x5f, 0x15, 0x4c, 0x39, 0xc7, 0xce, - 0x51, 0x23, 0xe0, 0x82, 0xdb, 0xdc, 0x35, 0x6c, 0x97, 0x57, 0x8d, 0xc3, 0x26, 0x0d, 0x8e, 0x75, - 0x69, 0xc3, 0x2f, 0x77, 0x2e, 0xeb, 0xf1, 0x72, 0xf9, 0x46, 0x8d, 0xd7, 0xb8, 0x34, 0x19, 0xf1, - 0x53, 0x02, 0x2c, 0x4f, 0xd6, 0x38, 0xaf, 0xb9, 0xd4, 0x20, 0x0d, 0x66, 0x10, 0xdf, 0xe7, 0x82, - 0x08, 0xc6, 0xfd, 0x50, 0xad, 0x2e, 0xdb, 0x3c, 0xf4, 0x78, 0x68, 0x54, 0x49, 0x48, 0x93, 0xf8, - 0x46, 0xb4, 0x5a, 0xa5, 0x82,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38, 0x6e, 0xd0, 0xb0, 0x7a, 0x45, 0x9a, 0x6f, 0x3f, 0x0b, 0x00, 0x00, 0xff, 0xff, - 0xf1, 0xed, 0x1e, 0x02, 0x67, 0x0d, 0x00, 0x00, + // 1281 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0x41, 0x6f, 0xdc, 0x44, + 0x14, 0xde, 0xc9, 0x96, 0x36, 0x79, 0x49, 0x4b, 0x98, 0x34, 0xe9, 0xb2, 0x49, 0x36, 0x1b, 0x43, + 0x92, 0x4d, 0x2a, 0xec, 0x24, 0xad, 0xaa, 0x92, 0xa0, 0xa2, 0x24, 0xa2, 0x09, 0x52, 0x43, 0x83, + 0x69, 0x03, 0x82, 0x4a, 0x96, 0xd7, 0x9e, 0xdd, 0xb5, 0x62, 0x7b, 0x36, 0xb6, 0x77, 0x95, 0x08, + 0x21, 0x24, 0x0e, 0x5c, 0x00, 0x09, 0x89, 0x03, 0x07, 0x4e, 0x88, 0x3b, 0x17, 0xce, 0x88, 0x72, + 0xeb, 0xb1, 0x12, 0x17, 0x0e, 0x08, 0xa1, 0x84, 0x33, 0xbf, 0x01, 0x79, 0x66, 0xbc, 0xdd, 0x5d, + 0xdb, 0xbb, 0x49, 0x2e, 0xbb, 0xf6, 0x9b, 0xef, 0xbd, 0xf9, 0xde, 0x9b, 0x37, 0xf3, 0x8d, 0x61, + 0xda, 0x3c, 0x36, 0x8f, 0xea, 0x1e, 0x0d, 0xa8, 0x41, 0x6d, 0xc5, 0xb0, 0x69, 0x59, 0x39, 0x6c, + 0x10, 0xef, 0x58, 0x66, 0x36, 0xfc, 0x4a, 0xfb, 0xb0, 0x1c, 0x0e, 0xe7, 0xaf, 0x57, 0x69, 0x95, + 0x32, 0x93, 0x12, 0x3e, 0x71, 0x60, 0x7e, 0xaa, 0x4a, 0x69, 0xd5, 0x26, 0x8a, 0x5e, 0xb7, 0x14,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0xec, 0x98, 0x57, 0x5a, 0x96, 0x23, 0x9e, 0x60, 0x70, 0x5c, 0x27, 0x7e, 0xf9, + 0x32, 0x33, 0xdf, 0xfa, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x5c, 0x97, 0xf2, 0x13, 0x7b, 0x0f, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -897,7 +1117,8 @@ type QueryClient interface { BlockRateLimitConfiguration(ctx context.Context, in *QueryBlockRateLimitConfigurationRequest, opts ...grpc.CallOption) (*QueryBlockRateLimitConfigurationResponse, error) // Queries LiquidationsConfiguration. LiquidationsConfiguration(ctx context.Context, in *QueryLiquidationsConfigurationRequest, opts ...grpc.CallOption) (*QueryLiquidationsConfigurationResponse, error) - // Streams orderbook updates. + // Streams orderbook updates. Updates contain orderbook data + // such as order placements, updates, and fills. StreamOrderbookUpdates(ctx context.Context, in *StreamOrderbookUpdatesRequest, opts ...grpc.CallOption) (Query_StreamOrderbookUpdatesClient, error) } @@ -1009,7 +1230,8 @@ type QueryServer interface { BlockRateLimitConfiguration(context.Context, *QueryBlockRateLimitConfigurationRequest) (*QueryBlockRateLimitConfigurationResponse, error) // Queries LiquidationsConfiguration. LiquidationsConfiguration(context.Context, *QueryLiquidationsConfigurationRequest) (*QueryLiquidationsConfigurationResponse, error) - // Streams orderbook updates. + // Streams orderbook updates. Updates contain orderbook data + // such as order placements, updates, and fills. StreamOrderbookUpdates(*StreamOrderbookUpdatesRequest, Query_StreamOrderbookUpdatesServer) error } @@ -1711,21 +1933,11 @@ func (m *StreamOrderbookUpdatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, if m.ExecMode != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.ExecMode)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if m.BlockHeight != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.BlockHeight)) i-- - dAtA[i] = 0x18 - } - if m.Snapshot { - i-- - if m.Snapshot { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- dAtA[i] = 0x10 } if len(m.Updates) > 0 { @@ -1745,82 +1957,270 @@ func (m *StreamOrderbookUpdatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, return len(dAtA) - i, nil } -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ +func (m *StreamUpdate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err } - dAtA[offset] = uint8(v) - return base + return dAtA[:n], nil } -func (m *QueryGetClobPairRequest) Size() (n int) { - if m == nil { - return 0 - } + +func (m *StreamUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.Id != 0 { - n += 1 + sovQuery(uint64(m.Id)) + if m.UpdateMessage != nil { + { + size := m.UpdateMessage.Size() + i -= size + if _, err := m.UpdateMessage.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return n + return len(dAtA) - i, nil } -func (m *QueryClobPairResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.ClobPair.Size() - n += 1 + l + sovQuery(uint64(l)) - return n +func (m *StreamUpdate_OrderbookUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryAllClobPairRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *StreamUpdate_OrderbookUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.OrderbookUpdate != nil { + { + size, err := m.OrderbookUpdate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return n + return len(dAtA) - i, nil +} +func (m *StreamUpdate_OrderFill) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryClobPairAllResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.ClobPair) > 0 { - for _, e := range m.ClobPair { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) +func (m *StreamUpdate_OrderFill) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.OrderFill != nil { + { + size, err := m.OrderFill.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0x12 } - if m.Pagination != nil { - l = m.Pagination.Size() - n += 1 + l + sovQuery(uint64(l)) + return len(dAtA) - i, nil +} +func (m *StreamOrderbookUpdate) 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 n + return dAtA[:n], nil } -func (m *MevNodeToNodeCalculationRequest) Size() (n int) { - if m == nil { - return 0 - } +func (m *StreamOrderbookUpdate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamOrderbookUpdate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i var l int _ = l - if m.BlockProposerMatches != nil { - l = m.BlockProposerMatches.Size() - n += 1 + l + sovQuery(uint64(l)) - } + if m.Snapshot { + i-- + if m.Snapshot { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Updates) > 0 { + for iNdEx := len(m.Updates) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Updates[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *StreamOrderbookFill) 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 *StreamOrderbookFill) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StreamOrderbookFill) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FillAmounts) > 0 { + dAtA14 := make([]byte, len(m.FillAmounts)*10) + var j13 int + for _, num := range m.FillAmounts { + for num >= 1<<7 { + dAtA14[j13] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j13++ + } + dAtA14[j13] = uint8(num) + j13++ + } + i -= j13 + copy(dAtA[i:], dAtA14[:j13]) + i = encodeVarintQuery(dAtA, i, uint64(j13)) + i-- + dAtA[i] = 0x1a + } + if len(m.Orders) > 0 { + for iNdEx := len(m.Orders) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Orders[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.ClobMatch != nil { + { + size, err := m.ClobMatch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryGetClobPairRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Id != 0 { + n += 1 + sovQuery(uint64(m.Id)) + } + return n +} + +func (m *QueryClobPairResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.ClobPair.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryAllClobPairRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryClobPairAllResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.ClobPair) > 0 { + for _, e := range m.ClobPair { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *MevNodeToNodeCalculationRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.BlockProposerMatches != nil { + l = m.BlockProposerMatches.Size() + n += 1 + l + sovQuery(uint64(l)) + } if m.ValidatorMevMetrics != nil { l = m.ValidatorMevMetrics.Size() n += 1 + l + sovQuery(uint64(l)) @@ -1949,9 +2349,6 @@ func (m *StreamOrderbookUpdatesResponse) Size() (n int) { n += 1 + l + sovQuery(uint64(l)) } } - if m.Snapshot { - n += 2 - } if m.BlockHeight != 0 { n += 1 + sovQuery(uint64(m.BlockHeight)) } @@ -1961,6 +2358,86 @@ func (m *StreamOrderbookUpdatesResponse) Size() (n int) { return n } +func (m *StreamUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UpdateMessage != nil { + n += m.UpdateMessage.Size() + } + return n +} + +func (m *StreamUpdate_OrderbookUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OrderbookUpdate != nil { + l = m.OrderbookUpdate.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} +func (m *StreamUpdate_OrderFill) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.OrderFill != nil { + l = m.OrderFill.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} +func (m *StreamOrderbookUpdate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Updates) > 0 { + for _, e := range m.Updates { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Snapshot { + n += 2 + } + return n +} + +func (m *StreamOrderbookFill) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClobMatch != nil { + l = m.ClobMatch.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Orders) > 0 { + for _, e := range m.Orders { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if len(m.FillAmounts) > 0 { + l = 0 + for _, e := range m.FillAmounts { + l += sovQuery(uint64(e)) + } + n += 1 + sovQuery(uint64(l)) + l + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -3213,32 +3690,12 @@ func (m *StreamOrderbookUpdatesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Updates = append(m.Updates, types.OffChainUpdateV1{}) + m.Updates = append(m.Updates, StreamUpdate{}) if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.Snapshot = bool(v != 0) - case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field BlockHeight", wireType) } @@ -3257,7 +3714,7 @@ func (m *StreamOrderbookUpdatesResponse) Unmarshal(dAtA []byte) error { break } } - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field ExecMode", wireType) } @@ -3297,6 +3754,426 @@ func (m *StreamOrderbookUpdatesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *StreamUpdate) 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: StreamUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderbookUpdate", 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 := &StreamOrderbookUpdate{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.UpdateMessage = &StreamUpdate_OrderbookUpdate{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OrderFill", 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 := &StreamOrderbookFill{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.UpdateMessage = &StreamUpdate_OrderFill{v} + 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 *StreamOrderbookUpdate) 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: StreamOrderbookUpdate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamOrderbookUpdate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Updates", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Updates = append(m.Updates, types.OffChainUpdateV1{}) + if err := m.Updates[len(m.Updates)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Snapshot = bool(v != 0) + 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 *StreamOrderbookFill) 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: StreamOrderbookFill: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StreamOrderbookFill: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClobMatch", 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.ClobMatch == nil { + m.ClobMatch = &ClobMatch{} + } + if err := m.ClobMatch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Orders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Orders = append(m.Orders, Order{}) + if err := m.Orders[len(m.Orders)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType == 0 { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FillAmounts = append(m.FillAmounts, v) + } else if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + packedLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var elementCount int + var count int + for _, integer := range dAtA[iNdEx:postIndex] { + if integer < 128 { + count++ + } + } + elementCount = count + if elementCount != 0 && len(m.FillAmounts) == 0 { + m.FillAmounts = make([]uint64, 0, elementCount) + } + for iNdEx < postIndex { + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FillAmounts = append(m.FillAmounts, v) + } + } else { + return fmt.Errorf("proto: wrong wireType = %d for field FillAmounts", wireType) + } + 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