nautechsystems/nautilus_trader · error

Failed to process {position_reports_failed} Binance Futures

Error message

Failed to process {position_reports_failed} Binance Futures position reports

What it means

After querying position risk, the adapter converts each Binance position entry into a PositionStatusReport; individual conversion failures are counted rather than aborting. If any position failed to convert, the method ends with this aggregated error instead of returning a partially complete reconciliation snapshot.

Source

Thrown at crates/adapters/binance/src/futures/execution.rs:2706

            };

            match self.create_position_report(
                &position,
                instrument.id(),
                instrument.size_precision(),
            ) {
                Ok(report) => reports.push(report),
                Err(e) => {
                    log::warn!(
                        "Failed to create Futures position report for symbol={}: {e}",
                        position.symbol
                    );
                    position_reports_failed += 1;
                }
            }
        }

        anyhow::ensure!(
            position_reports_failed == 0,
            "Failed to process {position_reports_failed} Binance Futures position reports",
        );

        Ok(reports)
    }

    async fn generate_mass_status(
        &self,
        lookback_mins: Option<u64>,
    ) -> anyhow::Result<Option<ExecutionMassStatus>> {
        log::info!("Generating ExecutionMassStatus (lookback_mins={lookback_mins:?})");

        let ts_now = self.clock.get_time_ns();

        let requested_start = lookback_mins
            .map(DurationNanos::try_from_mins)
            .transpose()?

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Check the logs just before the error — each failed conversion is logged with its reason.
  2. Ensure all traded instruments are loaded/registered in the cache so conversion can resolve them.
  3. Check position mode: switch the account out of unexpected hedge-mode/dual-side settings or use an adapter version supporting them.
  4. Retry after positions settle (e.g. during liquidation or ADL the data can be transiently inconsistent).
Defensive patterns

Strategy: try-catch

Try / catch

if let Err(e) = client.generate_mass_status().await {
    if e.to_string().contains("position reports") {
        warn!("partial position reconciliation failure: {e}; check cache and position mode");
    } else {
        return Err(e);
    }
}

Prevention

When it happens

Trigger: One or more Binance Futures positions (often zero-balance or unusual positionSide=NONE / hedge-mode entries) fail report conversion during generate_position_status_reports, incrementing position_reports_failed above zero.

Common situations: Positions in instruments that could not be resolved to Nautilus instruments, dust positions with unexpected values, hedge-mode (dual-side) positions the converter doesn't handle, or adapter/instrument-cache version mismatches.

Understand the failure class

Background: "invalid response format", "malformed payload", "missing data field": when an API returns 200 but the response shape is wrong — this error's family across 23 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/9b301f45093863c9. Report an issue: GitHub.