Skip to main content

resolve_commission

Function resolve_commission 

Source
pub fn resolve_commission(
    order: &OrderUpdateData,
    last_qty: f64,
    last_px: f64,
    taker_fee: Option<Decimal>,
    quote_currency: Option<Currency>,
) -> Money
Expand description

Resolves the commission for a Binance fill event.

Uses the venue-provided commission fields (N/n) when present. Falls back to estimating taker_fee * qty * price when the venue omits them, matching the Python adapter behavior for exchange-generated fills (liquidation, ADL). Returns zero USDT when neither source is available.