- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.8k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
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
- Open and hold a position for a long time (>10 days).
- Start node with reconciliation enabled (config below).
- 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):
- The mismatch appears only after the position has been open for a long period (>10 days).
- 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.
- 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_traderversion: 1.221.0a20251020
cjdsellers
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog