Skip to content

Commit

Permalink
crazy tesT
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-dydx committed Mar 22, 2024
1 parent e786b7a commit 508ea7a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 44 deletions.
Empty file.
44 changes: 0 additions & 44 deletions protocol/x/clob/memclob/memclob.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,50 +603,6 @@ func (m *MemClobPriceTimePriority) PlaceOrder(
return orderSizeOptimisticallyFilledFromMatchingQuantums, orderStatus, offchainUpdates, nil
}

// The taker order has unfilled size which will be added to the orderbook as a maker order.
// Verify the maker order can be added to the orderbook by performing the add-to-orderbook
// collateralization check.
addOrderOrderStatus := m.addOrderToOrderbookCollateralizationCheck(
ctx,
order,
)

// If the add order to orderbook collateralization check failed, we cannot add the order to the orderbook.
if !addOrderOrderStatus.IsSuccess() {
if m.generateOffchainUpdates {
// Send an off-chain update message indicating the order should be removed from the orderbook
// on the Indexer.
if message, success := off_chain_updates.CreateOrderRemoveMessage(
ctx,
order.OrderId,
addOrderOrderStatus,
nil,
ocutypes.OrderRemoveV1_ORDER_REMOVAL_STATUS_BEST_EFFORT_CANCELED,
); success {
offchainUpdates.AddRemoveMessage(order.OrderId, message)
}
}

// remove stateful orders which fail collateralization check while being added to orderbook
if order.IsStatefulOrder() && !m.operationsToPropose.IsOrderRemovalInOperationsQueue(order.OrderId) {
m.operationsToPropose.MustAddOrderRemovalToOperationsQueue(
order.OrderId,
types.OrderRemoval_REMOVAL_REASON_UNDERCOLLATERALIZED,
)
}
return orderSizeOptimisticallyFilledFromMatchingQuantums, addOrderOrderStatus, offchainUpdates, nil
}

// If this is a Short-Term order and it's not in the operations queue, add the TX bytes to the
// operations to propose.
if order.IsShortTermOrder() &&
!m.operationsToPropose.IsOrderPlacementInOperationsQueue(order) {
m.operationsToPropose.MustAddShortTermOrderTxBytes(
order,
ctx.TxBytes(),
)
}

// Add the order to the orderbook and all other bookkeeping data structures.
m.mustAddOrderToOrderbook(ctx, order, false)

Expand Down

0 comments on commit 508ea7a

Please sign in to comment.