nautechsystems/nautilus_trader · error

Lighter active-market seed repeated cursor `{next}`

Error message

Lighter active-market seed repeated cursor `{next}`

What it means

While seeding active markets from paginated inactive-order queries, each next_cursor is tracked in seen_cursors. A cursor that repeats would cause an infinite loop, so the adapter aborts with this error. This signals a cursor cycle returned by the Lighter API.

Source

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

            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")?;

        for order in &response.orders {
            dispatch.note_active_market(order.market_index);
            orders_seen += 1;
        }

        match response.next_cursor {
            Some(next) if !next.is_empty() => {
                anyhow::ensure!(
                    seen_cursors.insert(next.clone()),
                    "Lighter active-market seed repeated cursor `{next}`",
                );
                cursor = Some(next);
            }
            _ => break,
        }
    }

    if orders_seen > 0 {
        log::debug!("Seeded Lighter active markets from {orders_seen} inactive order report(s)");
    }

    Ok(())
}

fn cancel_order_from_cancel_all(
    cmd: &CancelAllOrders,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Retry the seeding/reconciliation after a short delay.
  2. Check Lighter service status for known pagination problems.
  3. Capture the repeated cursor and report it to Lighter support if it persists.
  4. Reduce reliance on the seed by explicitly configuring the active markets where supported.
Defensive patterns

Strategy: retry

Try / catch

match seed_active_markets().await {
    Err(e) if e.to_string().contains("repeated cursor") => schedule_backoff_retry(),
    other => other,
}

Prevention

When it happens

Trigger: Lighter inactive-orders endpoint returning a next_cursor already seen during active-market seed pagination — an exchange-side anomaly rather than a client misconfiguration.

Common situations: Lighter API instability where cursor pagination cycles; occurs during the seed phase of reconciliation.

Related errors


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