{"record":{"id":"c01f503e3b37b1b5","repo":"nautechsystems/nautilus_trader","slug":"target-taker-order-is-not-owned-by-the-account","errorCode":null,"errorMessage":"target taker order {} is not owned by the account","messagePattern":"target taker order (.+?) is not owned by the account","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/reconciliation.rs","lineNumber":866,"sourceCode":"            let order_side = validate_maker_order_side(trade, maker_order)?;\n            validate_expected_order_side(\n                expected_order_side,\n                order_side,\n                &format!(\"target maker order {}\", maker_order.order_id),\n            )?;\n            (\n                TargetFillParticipant::Maker {\n                    maker_order,\n                    identifiers,\n                },\n                instrument,\n                maker_order.matched_amount,\n                maker_order.price,\n                format!(\"target maker order {} matched amount\", maker_order.order_id),\n                format!(\"target maker order {} price\", maker_order.order_id),\n            )\n        } else {\n            anyhow::ensure!(\n                is_owned_by_account(\n                    &trade.maker_address,\n                    &trade.owner,\n                    ctx.user_address,\n                    ctx.api_key,\n                ),\n                \"target taker order {} is not owned by the account\",\n                trade.taker_order_id,\n            );\n            let venue_order_id =\n                checked_venue_order_id(&trade.taker_order_id, \"target taker trade\")?;\n            let trade_id = checked_trade_id(&trade.id, \"target taker trade\")?;\n            let instrument = resolve_target_instrument(\n                instruments,\n                trade.asset_id,\n                instrument_id,\n                &format!(\"target taker trade {}\", trade.id),\n            )?;","sourceCodeStart":848,"sourceCodeEnd":884,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/reconciliation.rs#L848-L884","documentation":"When classifying a trade where the account acted as taker, the adapter checks that the trade's maker_address/owner attributes match the configured account credentials. This error means the taker-side trade record for the target order id is not owned by the configured account, so the fill cannot be attributed and reconciliation aborts.","triggerScenarios":"Running fill reconciliation (build_fill_reports_from_trades -> classify_target_trade) on a trade where `trader_side != Maker` and `is_owned_by_account(&trade.maker_address, &trade.owner, ctx.user_address, ctx.api_key)` is false for `trade.taker_order_id`. Triggered by misconfigured user address/API key or the target order id resolving to a trade belonging to another account.","commonSituations":"Adapter configured with the wrong wallet/API credentials; switching accounts or API keys without restarting the trader; a duplicated or remapped venue order id colliding with another account's taker order in the fetched trades; importing trade history from a shared/sub-account.","solutions":["Verify ctx user_address and api_key match the account that executed the taker order; correct the adapter config.","Restart the trading node after any credential change so FillContext is rebuilt.","Query the provider for trades owned by your address to confirm the taker_order_id actually belongs to your account.","If multiple accounts are in play, isolate reconciliation per account instead of sharing venue order ids across adapters."],"exampleFix":"// before: taker trade attributed to another owner\n// trade.owner = 0xDDDD..., ctx.user_address = 0xCCCC...\n// after: configure adapter with the executing account\nuser_address = \"0xDDDD...\"\napi_key = \"<matching api key>\"","handlingStrategy":"validation","validationCode":"let trades = client.get_trades(&user_address).await?;\nif !trades.iter().any(|t| t.taker_order_id == venue_order_id.as_str()\n    && is_owned_by_account(&t.maker_address, &t.owner, &user_address, &api_key)) {\n    return Err(anyhow!(\"taker trade for {venue_order_id} not owned by {user_address}\"));\n}","typeGuard":"fn taker_trade_owned(trade: &PolymarketTradeReport, ctx: &FillContext) -> bool {\n    is_owned_by_account(&trade.maker_address, &trade.owner, ctx.user_address, ctx.api_key)\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"target taker order\") && e.to_string().contains(\"not owned\") => {\n        log::error!(\"taker trade owned by another account; verify adapter user_address/api_key\");\n        // abort reconciliation for this trade; no retry\n    }\n    other => other?,\n}","preventionTips":["Keep user_address and api_key in one place and verify them at startup with an account info call.","Avoid remapping or copying venue order ids between accounts.","Fetch trades scoped to your own address instead of global market trade feeds for reconciliation."],"tags":["reconciliation","ownership","authentication","polymarket"],"backgroundTag":"permission-denied","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"}