Skip to content

[Reconciliation] LiveExecEngine fails to reconcile long-lived Binance Futures positions for HEDGING #3104

@willjay97

Description

@willjay97

Bug Report

Expected Behavior

With reconciliation=True, restarting should reconcile execution state even for positions open >10 days. Local position net quantity should match the venue’s report, and the strategy will not be started.

Actual Behavior

Reconciliation fails on restart for a SHORT position on CTKUSDT-PERP (Binance USDT-M) (maybe others, log in this symbol for example). Engine reports a net-qty mismatch and the strategy does not start.

[ERROR] ExecEngine: Cannot reconcile CTKUSDT-PERP.BINANCE PositionId('CTKUSDT-PERP.BINANCE-SHORT'):
position net qty 75 != reported net qty -65,
PositionStatusReport(... position_side=SHORT, quantity=65, signed_decimal_qty=-65, ...)
... ...
[ERROR] TradingNode: Execution state could not be reconciled
😭 The program is paused, will not be started...

The -65 is correct, and the recon result 75 is not accurate.

Steps to Reproduce the Problem

  1. Open and hold a position for a long time (>10 days).
  2. Start node with reconciliation enabled (config below).
  3. Restart the process and observe reconciliation failure.

Code Snippets or Logs

exec_engine = LiveExecEngineConfig(
    reconciliation=True,
    # reconciliation_lookback_mins=1440*10,  # tried larger values; still fails
)
data_engine = LiveDataEngineConfig(
    time_bars_timestamp_on_close=False,
    validate_data_sequence=False,
)
cache = CacheConfig()

Additional Notes / Hypotheses (for maintainers):

  1. The mismatch appears only after the position has been open for a long period (>10 days).
  2. My understanding is that reconciliation rebuilds local state from a lookback window of executions/fills; if a portion of the historical executions falls outside the window or cannot be fetched, local reconstruction could diverge from the venue’s reported net quantity.
  3. I attempted to increase reconciliation_lookback_mins (e.g., 10 days and even larger windows), but the mismatch persists.

Thank you very much for your time for this excellent project! I would greatly appreciate guidance on the reconciliation problem.

Specifications

  • OS platform: Ubuntu
  • Python version: 3.12
  • nautilus_trader version: 1.221.0a20251020

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions