Skip to content

Commit f3f08af

Browse files
committed
fix: process trade with mkt
1 parent 3dd972e commit f3f08af

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

forge/src/dispatcher.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,13 @@ impl OperationDispatcher {
208208
match order {
209209
Some(order) => {
210210
let (status, amount) = match trade.limit_type {
211-
LimitType::GTC | LimitType::FOK if order.amount > trade.size => (
212-
OrderStatus::PartiallyMatched,
213-
Some(order.amount - trade.size),
214-
),
211+
LimitType::GTC | LimitType::MKT => {
212+
if order.amount > trade.size {
213+
(OrderStatus::PartiallyMatched, Some(order.amount - trade.size))
214+
} else {
215+
(OrderStatus::Matched, None)
216+
}
217+
}
215218
// FOK or IOC as fully matched
216219
_ => (OrderStatus::Matched, None),
217220
};

0 commit comments

Comments
 (0)