{"record":{"id":"f2959e47a728da49","repo":"nautechsystems/nautilus_trader","slug":"provider-venue-order-is-not-owned-by-the-accoun","errorCode":null,"errorMessage":"provider venue order {} is not owned by the account","messagePattern":"provider venue order (.+?) is not owned by the account","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/reconciliation.rs","lineNumber":608,"sourceCode":"        );\n    }\n\n    if !is_owned_by_account(\n        &order.maker_address,\n        &order.owner,\n        ctx.user_address,\n        ctx.api_key,\n    ) {\n        return match scope {\n            OrderEvidenceScope::Collection { .. } => {\n                log::debug!(\"Dropping open order {} not owned by the account\", order.id);\n                Ok(OrderRowResult {\n                    report: None,\n                    counted_filtered: true,\n                })\n            }\n            OrderEvidenceScope::Target { .. } => {\n                anyhow::bail!(\n                    \"provider venue order {} is not owned by the account\",\n                    order.id\n                )\n            }\n        };\n    }\n\n    let instrument = match scope {\n        OrderEvidenceScope::Target { instrument_id, .. } => resolve_target_instrument(\n            instruments,\n            order.asset_id,\n            Some(instrument_id),\n            &format!(\"provider venue order {}\", order.id),\n        )?,\n        OrderEvidenceScope::Collection { instrument_filter } => match instruments\n            .get_cloned(&order.asset_id)\n        {\n            Some(instrument) => instrument,","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/reconciliation.rs#L590-L626","documentation":"During order reconciliation, build_order_report_from_order refuses to build an OrderStatusReport when a venue order found on Polymarket falls under OrderEvidenceScope::Target. That scope means the order belongs to a different account than the one being reconciled, so treating it as evidence of this account's order state would be wrong and the reconcile fails fast instead of silently mixing accounts.","triggerScenarios":"Running reconciliation (via build_target_order_report or build_order_reports_from_orders) when the venue order fetched by id resolves to a target-scoped evidence — i.e. the order id exists on the venue but is not owned by the configured Polymarket account (wallet/proxy address).","commonSituations":"Pointing the adapter at the wrong wallet/private key while reusing order ids or state snapshots from another account; reconciling a shared/market-maker proxy wallet with the wrong signer; stale persisted state copied between environments (testnet vs mainnet) or between accounts.","solutions":["Verify the adapter's account credentials (wallet address, API key, passphrase) match the account that actually owns the order on Polymarket.","Clear stale execution state/caches so reconciliation does not look up order ids belonging to another account.","Confirm you are on the intended environment (mainnet vs testnet) and using consistent account configuration.","If the order legitimately belongs to another account, exclude it from reconciliation instead of feeding its id into build_target_order_report/build_order_reports_from_orders."],"exampleFix":"// before: reconciling with credentials from account A against order ids of account B\nlet exec = PolymarketExecutionClient::new(account_a_credentials, ...);\nexec.build_order_reports_from_orders(&orders_from_account_b)?;\n// after: ensure credentials and orders come from the same account\nassert_eq!(order.owner_address, account_a_credentials.wallet_address);\nexec.build_order_reports_from_orders(&orders_from_account_a)?;","handlingStrategy":"validation","validationCode":"// Rust: check order ownership before reconciliation\nfn is_owned_by_account(order: &OrderRow, account_address: &str) -> bool {\n    order.owner_address.eq_ignore_ascii_case(account_address)\n}\nif !orders.iter().all(|o| is_owned_by_account(o, &account.wallet_address)) {\n    // filter out foreign orders or abort before build_order_reports_from_orders\n}","typeGuard":"fn owned_order(order: &OrderRow, account: &str) -> Option<&OrderRow> {\n    (order.owner_address.eq_ignore_ascii_case(account)).then_some(order)\n}","tryCatchPattern":null,"preventionTips":["Bind one adapter instance to exactly one wallet and never mix persisted state across accounts.","Label persisted order snapshots with the owning account and environment.","Filter venue orders by owner address before feeding them into reconciliation."],"tags":["polymarket","reconciliation","account-ownership","rust"],"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"}