nautechsystems/nautilus_trader · error

Lighter active-market seed exceeded {MAX_RECONCILIATION_PAGE

Error message

Lighter active-market seed exceeded {MAX_RECONCILIATION_PAGES} pages

What it means

The active-market seed routine pages through a Lighter account's inactive orders to discover which markets are active. Pagination is capped at MAX_RECONCILIATION_PAGES; exceeding the cap aborts with this error to prevent unbounded looping while seeding.

Source

Thrown at crates/adapters/lighter/src/execution.rs:5566

            | OrderType::LimitIfTouched
    )
}

async fn seed_active_markets_from_inactive_orders(
    http_client: &LighterHttpClient,
    dispatch: &WsDispatchState,
    credential: &Credential,
    auth: &SecretString,
    between_timestamps: Option<String>,
) -> anyhow::Result<()> {
    let mut cursor: Option<String> = None;
    let mut seen_cursors = AHashSet::new();
    let mut orders_seen = 0_usize;
    let mut pages = 0_usize;

    loop {
        pages += 1;
        anyhow::ensure!(
            pages <= MAX_RECONCILIATION_PAGES,
            "Lighter active-market seed exceeded {MAX_RECONCILIATION_PAGES} pages",
        );
        let query = Zeroizing::new(LighterAccountInactiveOrdersQuery {
            authorization: None,
            auth: Some(auth.clone()),
            account_index: credential.account_index(),
            market_id: None,
            ask_filter: None,
            between_timestamps: between_timestamps.clone(),
            cursor: cursor.clone(),
            limit: LIGHTER_REST_PAGE_SIZE,
        });
        let response = http_client
            .get_account_inactive_orders(&query)
            .await
            .context("failed to seed Lighter active markets from inactive orders")?;

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Re-run seeding periodically so accumulated inactive orders fit within the cap.
  2. Purge or archive old orders on the account if possible, or use a dedicated account for testing with less history.
  3. Verify Lighter API cursor behavior; a non-terminating stream indicates an exchange issue.
  4. Raise MAX_RECONCILIATION_PAGES in the adapter if the account legitimately needs more pages.
Defensive patterns

Strategy: validation

Validate before calling

if account_inactive_order_estimate() > MAX_RECONCILIATION_PAGES * PAGE_SIZE {
    // archive history or raise the cap before seeding
}

Try / catch

if let Err(e) = seed_active_markets().await {
    if e.to_string().contains("active-market seed exceeded") { seed_in_batches().await?; }
}

Prevention

When it happens

Trigger: An account with more historical inactive orders than can be paginated within MAX_RECONCILIATION_PAGES, or a cursor stream from LighterAccountInactiveOrdersQuery that never terminates.

Common situations: Long-lived accounts with very large order history being seeded for the first time; exchange cursor anomalies.

Related errors


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