Skip to main content

parse_quote_from_best_bid_ask

Function parse_quote_from_best_bid_ask 

Source
pub fn parse_quote_from_best_bid_ask(
    bba: &PolymarketBestBidAsk,
    instrument_id: InstrumentId,
    price_precision: u8,
    size_precision: u8,
    price_increment: Price,
    drop_quotes_missing_side: bool,
    bid_top: Option<(Price, Quantity)>,
    ask_top: Option<(Price, Quantity)>,
    ts_event: UnixNanos,
    ts_init: UnixNanos,
) -> Result<Option<QuoteTick>>
Expand description

Parses a quote tick from a best bid/ask message.

The payload carries top-of-book prices only. Each side’s size comes from the supplied known level when its price matches the message and is zero otherwise.

Returns None when a side is missing and drop_quotes_missing_side is enabled. When missing sides are allowed, the quote uses the current tick-relative venue bounds. Returns None for locked, crossed, out-of-range, or off-grid prices.