{"record":{"id":"550d77129e318914","repo":"nautechsystems/nautilus_trader","slug":"lighter-active-market-seed-repeated-cursor-next","errorCode":null,"errorMessage":"Lighter active-market seed repeated cursor `{next}`","messagePattern":"Lighter active-market seed repeated cursor `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":5592,"sourceCode":"            market_id: None,\n            ask_filter: None,\n            between_timestamps: between_timestamps.clone(),\n            cursor: cursor.clone(),\n            limit: LIGHTER_REST_PAGE_SIZE,\n        });\n        let response = http_client\n            .get_account_inactive_orders(&query)\n            .await\n            .context(\"failed to seed Lighter active markets from inactive orders\")?;\n\n        for order in &response.orders {\n            dispatch.note_active_market(order.market_index);\n            orders_seen += 1;\n        }\n\n        match response.next_cursor {\n            Some(next) if !next.is_empty() => {\n                anyhow::ensure!(\n                    seen_cursors.insert(next.clone()),\n                    \"Lighter active-market seed repeated cursor `{next}`\",\n                );\n                cursor = Some(next);\n            }\n            _ => break,\n        }\n    }\n\n    if orders_seen > 0 {\n        log::debug!(\"Seeded Lighter active markets from {orders_seen} inactive order report(s)\");\n    }\n\n    Ok(())\n}\n\nfn cancel_order_from_cancel_all(\n    cmd: &CancelAllOrders,","sourceCodeStart":5574,"sourceCodeEnd":5610,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L5574-L5610","documentation":"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.","triggerScenarios":"Lighter inactive-orders endpoint returning a next_cursor already seen during active-market seed pagination — an exchange-side anomaly rather than a client misconfiguration.","commonSituations":"Lighter API instability where cursor pagination cycles; occurs during the seed phase of reconciliation.","solutions":["Retry the seeding/reconciliation after a short delay.","Check Lighter service status for known pagination problems.","Capture the repeated cursor and report it to Lighter support if it persists.","Reduce reliance on the seed by explicitly configuring the active markets where supported."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match seed_active_markets().await {\n    Err(e) if e.to_string().contains(\"repeated cursor\") => schedule_backoff_retry(),\n    other => other,\n}","preventionTips":["Retry seeding with exponential backoff on cursor cycles","Track Lighter API health; cycles are exchange-side","Persist the offending cursor to aid support reports"],"tags":["pagination","cursor-loop","lighter","seeding"],"backgroundTag":"pagination-cursor-loop","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}