Skip to content

Commit

Permalink
fns taker order status protos
Browse files Browse the repository at this point in the history
  • Loading branch information
jonfung-dydx committed Jul 31, 2024
1 parent 181aad3 commit 2c09963
Show file tree
Hide file tree
Showing 4 changed files with 1,172 additions and 153 deletions.
20 changes: 20 additions & 0 deletions proto/dydxprotocol/clob/order.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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;
}
33 changes: 33 additions & 0 deletions proto/dydxprotocol/clob/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,36 @@ 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 match information for 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.
uint32 order_status = 1;

// The amount of remaining (non-matched) base quantums of this taker order.
uint64 remainingQuantums = 2;

// The amount of base quantums that were optimistically filled (from this current
// matching cycle) of this taker order. Note that if any quantums of this order
// were optimistically filled or filled in state before the current matching cycle,
// this value will not include them.
uint64 optimistically_filled_quantums = 3;
}
Loading

0 comments on commit 2c09963

Please sign in to comment.