-
Notifications
You must be signed in to change notification settings - Fork 15
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
indexer subaccount order type update #367
Conversation
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.
I defer to @prashanDYDX for typing things in kotlin, but overall looks gouda
order.side.isOppositeOf(currentSide) | ||
} ?: false | ||
} | ||
val stopLossOrders = triggerOrders?.filter { order -> | ||
selectedSubaccountPosition?.side?.current?.let { currentSide -> | ||
(order.type == OrderType.stopMarket || order.type == OrderType.stopLimit) && | ||
(order.type == OrderType.stopMarket || order.type == OrderType.stopLimit) && order.side != null && |
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.
could we simplify this to order.side?.isOppositeOf(currentSide)
?
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.
um kinda! can change to order.side?.isOppositeOf(currentSide) == true
ParsingErrorType.MissingRequiredData, | ||
"no existing order to be cancelled for $orderId", | ||
) | ||
val marketId = existingOrder.marketId | ||
val marketId = existingOrder.marketId!! |
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.
sad that kotlin can't deduce this :'(
603ad00
to
12b47dc
Compare
indexer will soon send ws msg when cancel is received for non existent order, thus we'll need to update the subaccount order type to handle that scenario
those fields should only really be null when the order is already canceled, so most existing code paths can still expect those fields to be nonnull