{"record":{"id":"d0be20346fbb3d75","repo":"nautechsystems/nautilus_trader","slug":"credentials-required-for-execution-client","errorCode":null,"errorMessage":"Credentials required for execution client","messagePattern":"Credentials required for execution client","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/adapters/dydx/src/execution/mod.rs","lineNumber":221,"sourceCode":"            config\n                .proxy_url\n                .as_ref()\n                .map(|value| value.expose_secret().to_owned()),\n            config.network,\n            Some(retry_config),\n        )?;\n\n        let instrument_cache = http_client.instrument_cache().clone();\n\n        let credential = DydxCredential::resolve(\n            config\n                .private_key\n                .as_ref()\n                .map(|value| value.expose_secret()),\n            config.network,\n            config.authenticator_ids.clone(),\n        )?\n        .ok_or_else(|| anyhow::anyhow!(\"Credentials required for execution client\"))?;\n\n        let ws_client = DydxWebSocketClient::new_private_with_cache(\n            config.ws_url.clone(),\n            credential,\n            core.account_id,\n            instrument_cache.clone(),\n            Some(20),\n            config.transport_backend,\n            config\n                .proxy_url\n                .as_ref()\n                .map(|value| value.expose_secret().to_owned()),\n        )\n        .with_socket_factory(SocketControlFactory::new(core.client_id, Some(*DYDX_VENUE)));\n\n        let grpc_client = Arc::new(tokio::sync::RwLock::new(None));\n\n        let session_tasks = TaskGroup::new();","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/dydx/src/execution/mod.rs#L203-L239","documentation":"The dYdX execution client requires exchange credentials (a private key) to sign and submit on-chain transactions. During DydxExecClient::new the client builds credentials from config.private_key (and authenticator_ids/network); if the credentials construction returns None, the client refuses to create an execution client and throws this error. Execution (trading) against dYdX cannot proceed without a signing key.","triggerScenarios":"Constructing the dYdX execution client with a config whose private_key is None (or whose underlying credential material cannot produce a credential), i.e. running in an execution/live context with only market-data (public) credentials.","commonSituations":"Config built for data-client-only use reused for an execution client; private_key field omitted or empty in the client config JSON/TOML; key loaded from an env var that is unset; accidentally constructing an exec client in backtest or sandbox where credentials were never provided.","solutions":["Set private_key in the dYdX execution client config (a valid dYdX-compatible private key), e.g. load from an environment variable at config-build time","Verify the credential builder (private key + network + authenticator_ids) actually returns Some — check the key format/decoding for the configured network","If you only need market data, instantiate a data client instead of an execution client"],"exampleFix":"// before\nlet config = DydxExecClientConfig::new(None, network); // private_key missing\n// after\nlet config = DydxExecClientConfig::new(\n    Some(SecretString::new(std::env::var(\"DYDX_PRIVATE_KEY\")?).into()),\n    network,\n);","handlingStrategy":"validation","validationCode":"if config.private_key.as_ref().map(|k| k.expose_secret().is_empty()).unwrap_or(true) {\n    return Err(\"dYdX execution client requires a private_key in config\".into());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Load the private key from an env var or secret store at config construction and fail fast there","Use separate configs for data-only vs execution clients and never share the data config with an exec client","Smoke-test client construction in CI with dummy credentials to catch config gaps early"],"tags":["rust","credentials","config","dydx"],"backgroundTag":"missing-credentials","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"}