{"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":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/adapters/architect_ax/src/http/client.rs","lineNumber":1397,"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":1379,"sourceCodeEnd":1415,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/architect_ax/src/http/client.rs#L1379-L1415","documentation":"The whoami call in request_account_fees succeeded but the response contained zero accounts. The doc comment is explicit: fee rates are resolved from the first account, and an absent account cannot supply them - the adapter bails rather than inventing a zero fee rate, because a wrong zero would silently misprice every fill estimate from then on. Effectively your API key is not associated with any trading account.","triggerScenarios":"API key created without account membership (e.g. an org-level or read-only key); key issued for a different environment (testnet key against prod endpoint or vice versa); account recently closed or suspended; Architect provisioning lag after account creation.","commonSituations":"Freshly issued keys whose account linking had not completed; environment mismatch between the key and the configured base URL; using a key generated for market-data-only access.","solutions":["Log in to the Architect dashboard and confirm the API key is attached to an active trading account","Verify the environment matches: testnet credentials must point at the testnet base URL, prod keys at prod","If the account was just created, wait and retry connect - provisioning can lag","Contact Architect support if the dashboard shows an account but whoami still returns none"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-start check: the key must cover at least one account\nlet whoami = raw_client.get_whoami().await?;\nif whoami.accounts.is_empty() {\n    anyhow::bail!(\n        \"AX key has no accounts; check key-account linking and environment\"\n    );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision API keys only from the account context in the Architect dashboard so linkage is guaranteed","Match key environment to the configured base URL (testnet vs prod) as a startup assertion","Re-verify account linkage with a whoami call whenever keys are rotated"],"tags":["architect-ax","whoami","account","fees","connect","rust"],"backgroundTag":"account-not-linked-to-api-key","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}