Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion x/dex/contract/market_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ func getUnfulfilledPlacedMarketOrderIds(
continue
}
if order.OrderType == types.OrderType_MARKET || order.OrderType == types.OrderType_LIQUIDATION ||
order.OrderType == types.OrderType_FOKMARKET || order.OrderType == types.OrderType_FOKMARKETBYVALUE {
order.OrderType == types.OrderType_FOKMARKET {
if settledQuantity, ok := orderIDToSettledQuantities[order.Id]; !ok || settledQuantity.LT(order.Quantity) {
res = append(res, order.Id)
}
} else if order.OrderType == types.OrderType_FOKMARKETBYVALUE {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe worth to add a test case where the FOKMARKETBYVALUE order has a non-zero settlement quantity but the settled quantity is < order quantity

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sg, will create a separate ticket to add the test for FOKMARKETBYVALUE and FOKMARKET after the dex module_test.go is updated

// cancel market order by nominal if zero quantity is executed
if _, ok := orderIDToSettledQuantities[order.Id]; !ok {
res = append(res, order.Id)
}
}
}
return res
Expand Down