{"record":{"id":"0515c024f1fb4d5b","repo":"nautechsystems/nautilus_trader","slug":"target-maker-order-is-not-owned-by-the-account","errorCode":null,"errorMessage":"target maker order {} is not owned by the account","messagePattern":"target maker order (.+?) is not owned by the account","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/polymarket/src/execution/reconciliation.rs","lineNumber":832,"sourceCode":"    instrument_id: Option<InstrumentId>,\n    venue_order_id: VenueOrderId,\n    expected_order_side: Option<OrderSide>,\n) -> anyhow::Result<TargetTradeAdmission<'a>> {\n    if !validate_target_trade_role(trade, venue_order_id)? {\n        return Ok(TargetTradeAdmission {\n            class: TargetTradeClass::Unrelated,\n            confirmed_fill: None,\n        });\n    }\n\n    let (participant, instrument, quantity, price, quantity_field, price_field) =\n        if trade.trader_side == PolymarketLiquiditySide::Maker {\n            let maker_order = trade\n                .maker_orders\n                .iter()\n                .find(|order| order.order_id == venue_order_id.as_str())\n                .context(\"validated target maker occurrence is missing\")?;\n            anyhow::ensure!(\n                maker_order.is_owned_by(ctx.user_address, ctx.api_key),\n                \"target maker order {} is not owned by the account\",\n                maker_order.order_id,\n            );\n            let identifiers = validate_maker_report_identifiers(trade, maker_order)?;\n            let instrument = resolve_target_instrument(\n                instruments,\n                maker_order.asset_id,\n                instrument_id,\n                &format!(\n                    \"target maker trade {} order {}\",\n                    trade.id, maker_order.order_id\n                ),\n            )?;\n            validate_instrument_binding(&instrument, trade.market.as_str(), maker_order.outcome)?;\n            let order_side = validate_maker_order_side(trade, maker_order)?;\n            validate_expected_order_side(\n                expected_order_side,","sourceCodeStart":814,"sourceCodeEnd":850,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/polymarket/src/execution/reconciliation.rs#L814-L850","documentation":"When classifying a trade for reconciliation, if the account acted as maker, the adapter looks up the maker order leg matching the target venue order id and verifies that the maker order is owned by the configured account (user address / API key). This error means the maker order leg that should correspond to the target order is registered under a different owner, so the fill cannot be attributed to this account.","triggerScenarios":"Running fill reconciliation (build_fill_reports_from_trades -> classify_target_trade) on a trade where `trade.trader_side == Maker` and the matching `maker_orders` entry's `is_owned_by(user_address, api_key)` is false. Occurs when credentials/address configured in the adapter do not match the account that placed the order, or the venue-order-id accidentally matches another account's order in the trade payload.","commonSituations":"Wrong wallet address or API key/creds in adapter config (or switched accounts without restarting); trading through a proxy/secondary Polymarket account while the adapter is configured with the primary; stale trade data fetched for a target order id that collides with another account's order.","solutions":["Confirm the adapter's user address and API key/creds match the account that actually placed the maker order.","Restart the node after changing credentials so the FillContext picks up the right identity.","Verify the venue_order_id belongs to your account by querying the provider's open/confirmed orders for your address.","If running multiple Polymarket accounts, configure one adapter instance per account and route reconciliation per account."],"exampleFix":"// before: mismatched creds in config\nuser_address = \"0xAAAA...\" // orders placed from 0xBBBB...\n// after: align credentials with the trading account\nuser_address = \"0xBBBB...\"\napi_key = \"<key for 0xBBBB...>\"","handlingStrategy":"validation","validationCode":"let open = client.get_orders(&user_address).await?;\nif !open.iter().any(|o| o.id == venue_order_id.as_str()) {\n    return Err(anyhow!(\"venue order {venue_order_id} not owned by {user_address}\"));\n}","typeGuard":"fn maker_leg_owned<'a>(trade: &'a PolymarketTradeReport, venue_order_id: &VenueOrderId, ctx: &FillContext) -> Option<&'a PolymarketMakerOrder> {\n    trade.maker_orders.iter().find(|m| m.order_id == venue_order_id.as_str() && m.is_owned_by(ctx.user_address, ctx.api_key))\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"target maker order\") && e.to_string().contains(\"not owned\") => {\n        log::error!(\"maker order belongs to another account; check adapter credentials\");\n        // do not retry; fix config or skip this trade\n    }\n    other => other?,\n}","preventionTips":["Configure one adapter instance per wallet/API key pair and never share venue order ids across them.","Restart the trader after changing credentials so the ownership context is rebuilt.","Before reconciling, list your account's orders and confirm the target order id appears."],"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"}