{"record":{"id":"74dc44a13ce52959","repo":"nautechsystems/nautilus_trader","slug":"no-wallet-credentials-found-set-wallet-address-or","errorCode":null,"errorMessage":"No wallet credentials found: set wallet_address or private_key in config, or use environment variables (DYDX_WALLET_ADDRESS/DYDX_PRIVATE_KEY for mainnet, DYDX_TESTNET_* for testnet)","messagePattern":"No wallet credentials found: set wallet_address or private_key in config, or use environment variables \\(DYDX_WALLET_ADDRESS/DYDX_PRIVATE_KEY for mainnet, DYDX_TESTNET_\\* for testnet\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"critical","filePath":"crates/adapters/dydx/src/factories.rs","lineNumber":271,"sourceCode":"            resolve_wallet_address(dydx_config.wallet_address.clone(), dydx_config.network)\n        {\n            log::debug!(\"Using wallet address from config/env: {addr}\");\n            addr\n        } else if let Some(credential) = DydxCredential::resolve(\n            dydx_config\n                .private_key\n                .as_ref()\n                .map(|value| value.expose_secret()),\n            dydx_config.network,\n            dydx_config.authenticator_ids.clone(),\n        )? {\n            log::debug!(\n                \"Derived wallet address from private key: {}\",\n                credential.address\n            );\n            credential.address\n        } else {\n            anyhow::bail!(\n                \"No wallet credentials found: set wallet_address or private_key in config, or use environment variables (DYDX_WALLET_ADDRESS/DYDX_PRIVATE_KEY for mainnet, DYDX_TESTNET_* for testnet)\"\n            )\n        };\n\n        let client = DydxExecutionClient::new(\n            core,\n            adapter_config,\n            wallet_address,\n            dydx_config.subaccount_number,\n        )?;\n\n        Ok(Box::new(client))\n    }\n\n    fn name(&self) -> &'static str {\n        DYDX\n    }\n","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/factories.rs#L253-L289","documentation":"The dYdX client factory (`create`) requires wallet credentials — a `wallet_address`/`private_key` in config or the DYDX_WALLET_ADDRESS/DYDX_PRIVATE_KEY (mainnet) / DYDX_TESTNET_* (testnet) environment variables. If none can be resolved or derived from a private key, it bails with this message.","triggerScenarios":"Constructing a DydxExecutionClient via the factory with a config lacking both wallet_address and private_key, and none of the relevant environment variables set in the process.","commonSituations":"Deploying to an environment where env vars were not injected (CI, Docker without -e flags); .env file not loaded; misspelled variable names; using mainnet vars on a testnet config (or vice versa) so the lookup misses.","solutions":["Set private_key (or wallet_address plus key) in the adapter config","Export DYDX_PRIVATE_KEY and DYDX_WALLET_ADDRESS for mainnet, or DYDX_TESTNET_PRIVATE_KEY/DYDX_TESTNET_WALLET_ADDRESS for testnet","Verify the environment actually loads them (print presence, not the value, at startup)","Ensure the testnet flag in config matches which DYDX_TESTNET_* variables you provided"],"exampleFix":"// before\nDydxExecutionClient::new(core, config_without_credentials);\n// after\nexport DYDX_PRIVATE_KEY=0x...\nexport DYDX_WALLET_ADDRESS=dydx1...\n// then build config from env\nlet config = DydxExecClientConfig::from_env()?;\nDydxExecutionClient::new(core, config);","handlingStrategy":"validation","validationCode":"let creds_ok = config.private_key.is_some()\n    || config.wallet_address.is_some()\n    || std::env::var(\"DYDX_PRIVATE_KEY\").is_ok()\n    || std::env::var(\"DYDX_TESTNET_PRIVATE_KEY\").is_ok();\nif !creds_ok { return Err(anyhow!(\"no dYdX wallet credentials configured\")); }","typeGuard":null,"tryCatchPattern":"match DydxExecClientFactory::create(core, config) {\n    Err(e) if e.to_string().contains(\"No wallet credentials\") => configure_credentials_and_retry(),\n    r => r?,\n}","preventionTips":["Validate credential presence at process startup, before trading","Use a secret manager or .env loaded deterministically in deployments","Match mainnet vs testnet env var names to the config's testnet flag","Never commit keys; inject via CI/CD secrets"],"tags":["dydx","credentials","configuration","wallet"],"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"}