Cancel account orders by ID batch, market or outcome asset

This commit is contained in:
2026-12-03 04:23:08 +08:00
parent 67426ae617
commit c27bb60fd2
8 changed files with 221 additions and 2 deletions
+9
View File
@@ -143,6 +143,15 @@ pub(crate) fn apply(tx: &Transaction, books: &Books, command: Command) -> Result
let qty = book::release(tx, order, &account, book::CancelReason::Cancelled)?;
Ok(json!({"cancelled":qty}))
}
Command::CancelOrders { account, orders } => {
crate::cancellation::by_id(tx, &account, &orders)
}
Command::CancelMarketOrders {
account,
market,
outcome,
} => crate::cancellation::in_scope(tx, &account, Some(&market), outcome.as_deref()),
Command::CancelAll { account } => crate::cancellation::in_scope(tx, &account, None, None),
Command::Open { market } => {
phase(tx, &market, &["preopen"])?;
// Run one auction. Using the earliest order's outcome as the quote unit