nautechsystems/nautilus_trader · error · anyhow::Error

invalid commission='{raw_commission}': {e}

Error message

invalid commission='{raw_commission}': {e}

What it means

Error "invalid commission='{raw_commission}': {e}" thrown in nautechsystems/nautilus_trader.

Source

Thrown at crates/adapters/binance/src/futures/websocket/streams/dispatch.rs:780

        }
    };

    Ok((last_qty, last_px, commission_currency, commission))
}

fn parse_order_commission(
    order: &OrderUpdateData,
    bnfcr_currency: Currency,
) -> anyhow::Result<(Currency, Option<Money>)> {
    let currency = order_commission_currency(order, bnfcr_currency);

    let Some(raw_commission) = order.commission.as_deref() else {
        return Ok((currency, None));
    };

    let amount = parse_required_decimal(raw_commission, "commission")?;
    let commission = Money::from_decimal(amount, currency)
        .map_err(|e| anyhow::anyhow!("invalid commission='{raw_commission}': {e}"))?;

    Ok((currency, Some(commission)))
}

fn order_commission_currency(order: &OrderUpdateData, bnfcr_currency: Currency) -> Currency {
    order
        .commission_asset
        .as_ref()
        .map_or(bnfcr_currency, |asset| {
            normalize_futures_asset(asset.as_str(), bnfcr_currency)
        })
}

fn parse_order_terminal_quantities(order: &OrderUpdateData) -> anyhow::Result<(Decimal, Decimal)> {
    let original_qty = parse_required_decimal(&order.original_qty, "original_qty")?;
    let cumulative_filled_qty =
        parse_required_decimal(&order.cumulative_filled_qty, "cumulative_filled_qty")?;

View on GitHub (pinned to a4b06ed870)

When it happens

Trigger: Thrown at crates/adapters/binance/src/futures/websocket/streams/dispatch.rs:780 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nautechsystems/nautilus_trader@a4b06ed870 (2026-08-16). Data as JSON: /api/errors/b0837c91bfc19c99. Report an issue: GitHub.