{"record":{"id":"b87cf90e524c8c55","repo":"nautechsystems/nautilus_trader","slug":"lighter-execution-client-cannot-modify-without-cre","errorCode":null,"errorMessage":"Lighter execution client cannot modify without credentials","messagePattern":"Lighter execution client cannot modify without credentials","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":4361,"sourceCode":"                    Err(e) => {\n                        let reason = OrderDeniedReason::SubmitFailed {\n                            detail: format!(\"Lighter submit_order_list failed: {e}\"),\n                        };\n                        context\n                            .emitter\n                            .emit_order_denied(&order, &reason.to_string());\n                    }\n                }\n            }\n            Ok(())\n        });\n\n        Ok(())\n    }\n\n    fn modify_order(&self, cmd: ModifyOrder) -> anyhow::Result<()> {\n        let credential = self.credential.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"Lighter execution client cannot modify without credentials\")\n        })?;\n        self.dispatch_signed_modify_order(&cmd, credential);\n        Ok(())\n    }\n\n    fn cancel_order(&self, cmd: CancelOrder) -> anyhow::Result<()> {\n        let credential = self.credential.as_ref().ok_or_else(|| {\n            anyhow::anyhow!(\"Lighter execution client cannot cancel without credentials\")\n        })?;\n        self.dispatch_signed_cancel_order(&cmd, credential);\n        Ok(())\n    }\n\n    fn cancel_all_orders(&self, cmd: CancelAllOrders) -> anyhow::Result<()> {\n        // Iterate over open orders for the instrument and cancel each. The\n        // venue offers a `CancelAllOrders` tx but it spans the whole account\n        // rather than a single market; doing per-order cancels keeps scope\n        // tight and avoids cancelling positions in unrelated markets.","sourceCodeStart":4343,"sourceCodeEnd":4379,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L4343-L4379","documentation":"modify_order was invoked while the Lighter execution client holds no API credential; order modification requires signing with account credentials, and without them the command cannot be dispatched, so the handler errors immediately.","triggerScenarios":"Calling modify_order (amend price/quantity) on a Lighter execution client constructed without credentials.","commonSituations":"Credential omitted from adapter config; using the same client for read-only queries and trading; environment variables for the signing key not set in the deployment.","solutions":["Add the Lighter signing credential to the client config (api/private key and indexes)","Confirm the env/config in the running process actually contains the key material","Route modifications through a credentialed client"],"exampleFix":"// before\nexport LIGHTER_API_KEY=  # empty\n// after\nexport LIGHTER_API_KEY=... LIGHTER_PRIVATE_KEY=...","handlingStrategy":"validation","validationCode":"if client.credential().is_none() {\n    return Err(anyhow!(\"cannot modify order: credentials missing\"));\n}","typeGuard":"fn has_credential(c: &LighterExecutionClient) -> bool {\n    c.credential().is_some()\n}","tryCatchPattern":"match client.modify_order(cmd) {\n    Err(e) if e.to_string().contains(\"cannot modify without credentials\") => { /* load creds, retry */ }\n    other => other?,\n}","preventionTips":["Fail fast at startup if credentials are absent but trading is enabled","Verify signing key env vars in the deployment manifest","Route all order mutations through a credentialed client"],"tags":["rust","lighter","credentials","modify-order"],"backgroundTag":"missing-credentials","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"}