pub trait FillModel {
// Required methods
fn is_limit_filled(&mut self) -> bool;
fn is_slipped(&mut self) -> bool;
fn get_orderbook_for_fill_simulation(
&mut self,
instrument: &InstrumentAny,
order: &OrderAny,
best_bid: Price,
best_ask: Price,
) -> Option<OrderBook>;
}Required Methods§
Sourcefn is_limit_filled(&mut self) -> bool
fn is_limit_filled(&mut self) -> bool
Returns true if a limit order should be filled based on the model.
Sourcefn is_slipped(&mut self) -> bool
fn is_slipped(&mut self) -> bool
Returns true if an order fill should slip by one tick.
Sourcefn get_orderbook_for_fill_simulation(
&mut self,
instrument: &InstrumentAny,
order: &OrderAny,
best_bid: Price,
best_ask: Price,
) -> Option<OrderBook>
fn get_orderbook_for_fill_simulation( &mut self, instrument: &InstrumentAny, order: &OrderAny, best_bid: Price, best_ask: Price, ) -> Option<OrderBook>
Returns a simulated OrderBook for fill simulation.
Custom fill models provide their own liquidity simulation by returning an
OrderBook that represents expected market liquidity. The matching engine
uses this to determine fills.
Returns None to use the matching engine’s standard fill logic.