{"record":{"id":"0faf487f9feb0c01","repo":"nautechsystems/nautilus_trader","slug":"lighter-account-detail-returned-an-empty-l1-addres","errorCode":null,"errorMessage":"Lighter account detail returned an empty L1 address","messagePattern":"Lighter account detail returned an empty L1 address","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/lighter/src/execution.rs","lineNumber":717,"sourceCode":"            None\n        }\n    }\n\n    async fn apply_referral_attribution(\n        &self,\n        detail: &LighterAccountDetail,\n    ) -> anyhow::Result<()> {\n        let Some(referral_code) =\n            deployment::referral_code(self.config.deployment, self.config.environment)\n        else {\n            return Ok(());\n        };\n\n        let Some(credential) = &self.credential else {\n            return Ok(());\n        };\n\n        anyhow::ensure!(\n            !detail.l1_address.trim().is_empty(),\n            \"Lighter account detail returned an empty L1 address\"\n        );\n\n        let auth_token = build_auth_token_for(credential)\n            .context(\"failed to mint Lighter auth token for referral attribution\")?;\n        let referral_code = Zeroizing::new(referral_code.to_string());\n\n        self.http_client\n            .use_referral(&detail.l1_address, referral_code.as_str(), &auth_token)\n            .await\n            .context(\"failed to apply Lighter referral code\")?;\n\n        log::debug!(\"Applied Robinhood Chain referral attribution\");\n        Ok(())\n    }\n\n    /// Returns `Ok(true)` if this credential's `api_key_index` is maker-only.","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/lighter/src/execution.rs#L699-L735","documentation":"During referral attribution (apply_referral_attribution, invoked from connect), the account detail response must contain a non-empty l1_address; an empty/whitespace-only address means the venue returned incomplete account details, so the adapter aborts rather than minting an auth token with bad identity data.","triggerScenarios":"Calling connect() on a LighterExecutionClient with a credential set, where the account-detail API response contains an empty or blank l1_address.","commonSituations":"Account not fully provisioned on the venue yet; API returning a partial/empty account payload due to venue-side outage; wrong account_index resolving to an empty record.","solutions":["Verify the account exists and is fully set up on Lighter (check l1 address on the venue).","Check the account detail API response manually for the same account to see if it's empty server-side.","Confirm account_index/credentials point at the intended account.","Retry later if the venue is returning partial data during an incident."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// after fetching account detail, before connect-time attribution\nif detail.l1_address.trim().is_empty() {\n    return Err(anyhow!(\"venue returned empty l1_address; account not provisioned?\"));\n}","typeGuard":null,"tryCatchPattern":"match client.connect().await {\n    Err(e) if e.to_string().contains(\"empty L1 address\") => {\n        // verify account provisioning, retry later\n    }\n    r => r?,\n}","preventionTips":["Confirm the Lighter account is fully provisioned before connecting.","Verify credentials resolve to the intended account_index.","Retry on venue-side incidents returning partial payloads."],"tags":["account-detail","empty-field","api-response","connect"],"backgroundTag":"empty-required-field","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}