-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix proto formatting #2020
Fix proto formatting #2020
Conversation
Important Review skippedAuto reviews are limited to specific labels. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe recent updates introduce new interfaces and enhancements for handling liquidation and taker orders within the protocol. Key additions include Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
protocol/x/clob/types/order.pb.go
is excluded by!**/*.pb.go
protocol/x/clob/types/query.pb.go
is excluded by!**/*.pb.go
Files selected for processing (2)
- proto/dydxprotocol/clob/order.proto (1 hunks)
- proto/dydxprotocol/clob/query.proto (1 hunks)
Files skipped from review due to trivial changes (2)
- proto/dydxprotocol/clob/order.proto
- proto/dydxprotocol/clob/query.proto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (7)
indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/order.ts (3)
704-730
: LGTM! Consider adding comments for clarity.The
StreamLiquidationOrder
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface StreamLiquidationOrder { /** Information about this liquidation order. */ liquidationInfo?: PerpetualLiquidationInfo; /** * CLOB pair ID of the CLOB pair the liquidation order will be matched * against. */ clobPairId: number; /** * True if this is a buy order liquidating a short position, false if vice * versa. */ isBuy: boolean; /** The number of base quantums for this liquidation order. */ quantums: Long; /** The subticks this liquidation order will be submitted at. */ subticks: Long; }
736-756
: LGTM! Consider adding comments for clarity.The
StreamLiquidationOrderSDKType
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface StreamLiquidationOrderSDKType { /** Information about this liquidation order. */ liquidation_info?: PerpetualLiquidationInfoSDKType; /** * CLOB pair ID of the CLOB pair the liquidation order will be matched * against. */ clob_pair_id: number; /** * True if this is a buy order liquidating a short position, false if vice * versa. */ is_buy: boolean; /** The number of base quantums for this liquidation order. */ quantums: Long; /** The subticks this liquidation order will be submitted at. */ subticks: Long; }
1344-1426
: LGTM! Consider adding comments for clarity.The
createBaseStreamLiquidationOrder
function is well-implemented. Adding comments for each step can enhance readability and maintainability.function createBaseStreamLiquidationOrder(): StreamLiquidationOrder { return { liquidationInfo: undefined, clobPairId: 0, isBuy: false, quantums: Long.UZERO, subticks: Long.UZERO }; } export const StreamLiquidationOrder = { encode(message: StreamLiquidationOrder, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.liquidationInfo !== undefined) { PerpetualLiquidationInfo.encode(message.liquidationInfo, writer.uint32(10).fork()).ldelim(); } if (message.clobPairId !== 0) { writer.uint32(16).uint32(message.clobPairId); } if (message.isBuy === true) { writer.uint32(24).bool(message.isBuy); } if (!message.quantums.isZero()) { writer.uint32(32).uint64(message.quantums); } if (!message.subticks.isZero()) { writer.uint32(40).uint64(message.subticks); } return writer; }, decode(input: _m0.Reader | Uint8Array, length?: number): StreamLiquidationOrder { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseStreamLiquidationOrder(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.liquidationInfo = PerpetualLiquidationInfo.decode(reader, reader.uint32()); break; case 2: message.clobPairId = reader.uint32(); break; case 3: message.isBuy = reader.bool(); break; case 4: message.quantums = (reader.uint64() as Long); break; case 5: message.subticks = (reader.uint64() as Long); break; default: reader.skipType(tag & 7); break; } } return message; }, fromPartial(object: DeepPartial<StreamLiquidationOrder>): StreamLiquidationOrder { const message = createBaseStreamLiquidationOrder(); message.liquidationInfo = object.liquidationInfo !== undefined && object.liquidationInfo !== null ? PerpetualLiquidationInfo.fromPartial(object.liquidationInfo) : undefined; message.clobPairId = object.clobPairId ?? 0; message.isBuy = object.isBuy ?? false; message.quantums = object.quantums !== undefined && object.quantums !== null ? Long.fromValue(object.quantums) : Long.UZERO; message.subticks = object.subticks !== undefined && object.subticks !== null ? Long.fromValue(object.subticks) : Long.UZERO; return message; } };indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (4)
394-409
: LGTM! Consider adding comments for clarity.The
StreamTakerOrder
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface StreamTakerOrder { /** The order itself. */ order?: Order; /** Potential liquidation order associated with this taker order. */ liquidationOrder?: StreamLiquidationOrder; /** * Information on the taker order after it is matched on the book, * either successfully or unsuccessfully. */ takerOrderStatus?: StreamTakerOrderStatus; }
416-424
: LGTM! Consider adding comments for clarity.The
StreamTakerOrderSDKType
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface StreamTakerOrderSDKType { /** The order itself. */ order?: OrderSDKType; /** Potential liquidation order associated with this taker order. */ liquidation_order?: StreamLiquidationOrderSDKType; /** * Information on the taker order after it is matched on the book, * either successfully or unsuccessfully. */ taker_order_status?: StreamTakerOrderStatusSDKType; }
426-451
: LGTM! Consider adding comments for clarity.The
StreamTakerOrderStatus
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface 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 */ orderStatus: number; /** The amount of remaining (non-matched) base quantums of this taker order. */ remainingQuantums: Long; /** * 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: Long; }
458-476
: LGTM! Consider adding comments for clarity.The
StreamTakerOrderStatusSDKType
interface is well-defined. Adding comments for each property can enhance readability and maintainability.export interface StreamTakerOrderStatusSDKType { /** * 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 */ order_status: number; /** The amount of remaining (non-matched) base quantums of this taker order. */ remaining_quantums: Long; /** * 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. */ optimistically_filled_quantums: Long; }
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/order.ts (3 hunks)
- indexer/packages/v4-protos/src/codegen/dydxprotocol/clob/query.ts (3 hunks)
Summary by CodeRabbit
New Features
StreamLiquidationOrder
,StreamTakerOrder
, andStreamTakerOrderStatus
to enhance order processing in streaming contexts.Chores
StreamLiquidationOrder
message for better clarity.StreamTakerOrderStatus
message to ensure ease of understanding.