{"record":{"id":"0944dd8758ffc988","repo":"nautechsystems/nautilus_trader","slug":"signer-not-initialized-connect-the-client-first","errorCode":null,"errorMessage":"Signer not initialized; connect the client first","messagePattern":"Signer not initialized; connect the client first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/blockchain/src/execution/client.rs","lineNumber":1718,"sourceCode":"                        \"No `quote_spend_limits` entry for BUY token pair {token_in} -> {token_out}\"\n                    )\n                })?;\n\n                if amount_in > ceiling.max_amount {\n                    anyhow::bail!(\n                        \"BUY quote amount {amount_in} exceeds the configured `quote_spend_limits` maximum {} for {token_in} -> {token_out}\",\n                        ceiling.max_amount\n                    );\n                }\n                (amount_in, base_amount)\n            }\n        };\n        let min_amount_out = derive_min_amount_out(quoted_amount_out, slippage_bps)?;\n\n        self.ensure_transaction_ready(TransactionPurpose::Swap)?;\n\n        if self.signer.is_none() {\n            anyhow::bail!(\"Signer not initialized; connect the client first\");\n        }\n\n        let pool_address = pool.address;\n        let factory = self.uniswap_v3_factory()?;\n        anyhow::ensure!(\n            pool.dex.factory == factory,\n            \"Pool {instrument_id} references factory {}, expected registered factory {factory}\",\n            pool.dex.factory\n        );\n\n        Ok(SwapPlan {\n            order: order.clone(),\n            pool,\n            quote_currency,\n            instrument_id,\n            pool_address,\n            router: self.router_addresses[0],\n            factory,","sourceCodeStart":1700,"sourceCodeEnd":1736,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/blockchain/src/execution/client.rs#L1700-L1736","documentation":"This error is raised in prepare_swap (called from submit_order) when the blockchain execution client has no signer configured. A swap transaction cannot be signed or submitted without a signer (private key/wallet), so the client fails fast before building the swap call. Call client.connect(...) with signer credentials before submitting orders that require swaps.","triggerScenarios":"Calling submit_order (which reaches prepare_swap) on a client constructed without a signer, or after the signer was removed/reset; the client reached ensure_transaction_ready but self.signer is still None.","commonSituations":"Forgetting to call connect() before submit_order; constructing the client in read-only/market-data mode and then trading; a config file missing the private key/keystore entry; signer initialization failing silently earlier and leaving signer None.","solutions":["Call client.connect(...) with valid signer credentials before submit_order","Verify the client config includes a private key, keystore, or KMS signer reference","Check that connect() succeeded and did not swallow an error leaving signer unset","Log/inspect whether the signer was dropped or reset between construction and submission"],"exampleFix":"// before\nlet client = ExecutionClient::new(config);\nclient.submit_order(order).await?;\n// after\nlet client = ExecutionClient::new(config);\nclient.connect(signer_credentials).await?;\nassert!(client.has_signer());\nclient.submit_order(order).await?;","handlingStrategy":"validation","validationCode":"if !client.has_signer() {\n    anyhow::bail!(\"call client.connect(credentials) before submit_order\");\n}","typeGuard":"fn signer_ready(client: &ExecutionClient) -> bool {\n    client.has_signer()\n}","tryCatchPattern":null,"preventionTips":["Always call connect() immediately after client construction in setup code","Add an integration smoke test that submits a tiny order on a testnet","Assert signer presence at application startup, not at trade time"],"tags":["signer","blockchain","initialization","swap"],"backgroundTag":"authentication-required","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"}