{"record":{"id":"70018dbe935b0c1c","repo":"nautechsystems/nautilus_trader","slug":"ax-whoami-returned-no-accounts-to-resolve-fees-fro","errorCode":null,"errorMessage":"AX whoami returned no accounts to resolve fees from","messagePattern":"AX whoami returned no accounts to resolve fees from","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/architect_ax/src/http/client.rs","lineNumber":1383,"sourceCode":"    /// including the periodic refresh, keep reporting them.\n    ///\n    /// Requires an authenticated client.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the request fails, the response carries no accounts, or the selected\n    /// account supplies no fee rates. An absent rate is not treated as zero, because a zero rate\n    /// is itself valid and a silent zero would outlive the response that caused it.\n    pub async fn request_account_fees(&self) -> anyhow::Result<(Decimal, Decimal)> {\n        let whoami = self\n            .inner\n            .get_whoami()\n            .await\n            .map_err(|e| anyhow::anyhow!(e))\n            .context(\"failed to request AX whoami\")?;\n\n        let Some(account) = whoami.accounts.first() else {\n            anyhow::bail!(\"AX whoami returned no accounts to resolve fees from\");\n        };\n\n        if whoami.accounts.len() > 1 {\n            log::warn!(\n                \"AX credentials cover {} accounts, using fee rates from {}\",\n                whoami.accounts.len(),\n                account.id,\n            );\n        }\n\n        let (Some(maker_fee), Some(taker_fee)) = (account.maker_fee, account.taker_fee) else {\n            anyhow::bail!(\"AX whoami account {} supplied no fee rates\", account.id);\n        };\n\n        let fees = (maker_fee, taker_fee);\n        self.account_fees.store(Some(Arc::new(fees)));\n\n        Ok(fees)","sourceCodeStart":1365,"sourceCodeEnd":1401,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/architect_ax/src/http/client.rs#L1365-L1401","documentation":"request_account_fees resolves maker/taker fee rates from the first account returned by the AX whoami endpoint. If whoami succeeds but returns an empty accounts list, there is no account to resolve fees from, so this error is raised.","triggerScenarios":"Calling request_account_fees when the authenticated AX user has zero accounts — whoami returns successfully with accounts: [].","commonSituations":"API keys created before an account was provisioned; credentials scoped to a user with no trading accounts; misconfigured environment pointing at a sandbox/test user with no accounts.","solutions":["Verify the API credentials belong to a user with at least one AX account","Check the AX console/dashboard that the account is active and linked to the key","Confirm you are pointing at the intended environment (production vs test) with the right keys"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-check by calling whoami before relying on fee resolution\nlet whoami = client.get_whoami().await?;\nif whoami.accounts.is_empty() {\n    return Err(anyhow::anyhow!(\"AX account has no accounts; cannot resolve fees\"));\n}","typeGuard":null,"tryCatchPattern":"match client.request_account_fees().await {\n    Err(e) if e.to_string().contains(\"no accounts\") => {\n        log::error!(\"AX credentials have no accounts; check provisioning/env\");\n        // stop or run without cached fees\n    }\n    other => other?,\n}","preventionTips":["Provision and verify an AX account before using its API keys","Smoke-test whoami at startup to fail fast on bad credential scopes","Confirm environment (prod vs test) matches the key set in use"],"tags":["fees","account-resolution","empty-response"],"backgroundTag":"empty-result-set","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}