Match immediate buys against a cash budget and price cap
This commit is contained in:
@@ -138,6 +138,25 @@ pub(crate) fn apply(tx: &Transaction, books: &Books, command: Command) -> Result
|
||||
post_only,
|
||||
},
|
||||
),
|
||||
Command::MarketBuy {
|
||||
market,
|
||||
outcome,
|
||||
account,
|
||||
amount_cents,
|
||||
max_price,
|
||||
tif,
|
||||
} => book::market_buy(
|
||||
tx,
|
||||
books,
|
||||
book::BudgetBuy {
|
||||
market,
|
||||
outcome,
|
||||
account,
|
||||
amount_cents,
|
||||
max_price,
|
||||
tif: tif.unwrap_or(crate::command::TimeInForce::Fak),
|
||||
},
|
||||
),
|
||||
Command::Cancel { order, account } => {
|
||||
identifier(&account)?;
|
||||
let qty = book::release(tx, order, &account, book::CancelReason::Cancelled)?;
|
||||
|
||||
Reference in New Issue
Block a user