nautechsystems/nautilus_trader · error

provider venue order {} is not owned by the account

Error message

provider venue order {} is not owned by the account

What it means

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.

Source

Thrown at crates/adapters/polymarket/src/execution/reconciliation.rs:608

        );
    }

    if !is_owned_by_account(
        &order.maker_address,
        &order.owner,
        ctx.user_address,
        ctx.api_key,
    ) {
        return match scope {
            OrderEvidenceScope::Collection { .. } => {
                log::debug!("Dropping open order {} not owned by the account", order.id);
                Ok(OrderRowResult {
                    report: None,
                    counted_filtered: true,
                })
            }
            OrderEvidenceScope::Target { .. } => {
                anyhow::bail!(
                    "provider venue order {} is not owned by the account",
                    order.id
                )
            }
        };
    }

    let instrument = match scope {
        OrderEvidenceScope::Target { instrument_id, .. } => resolve_target_instrument(
            instruments,
            order.asset_id,
            Some(instrument_id),
            &format!("provider venue order {}", order.id),
        )?,
        OrderEvidenceScope::Collection { instrument_filter } => match instruments
            .get_cloned(&order.asset_id)
        {
            Some(instrument) => instrument,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Verify the adapter's account credentials (wallet address, API key, passphrase) match the account that actually owns the order on Polymarket.
  2. Clear stale execution state/caches so reconciliation does not look up order ids belonging to another account.
  3. Confirm you are on the intended environment (mainnet vs testnet) and using consistent account configuration.
  4. 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.

Example fix

// before: reconciling with credentials from account A against order ids of account B
let exec = PolymarketExecutionClient::new(account_a_credentials, ...);
exec.build_order_reports_from_orders(&orders_from_account_b)?;
// after: ensure credentials and orders come from the same account
assert_eq!(order.owner_address, account_a_credentials.wallet_address);
exec.build_order_reports_from_orders(&orders_from_account_a)?;
Defensive patterns

Strategy: validation

Validate before calling

// Rust: check order ownership before reconciliation
fn is_owned_by_account(order: &OrderRow, account_address: &str) -> bool {
    order.owner_address.eq_ignore_ascii_case(account_address)
}
if !orders.iter().all(|o| is_owned_by_account(o, &account.wallet_address)) {
    // filter out foreign orders or abort before build_order_reports_from_orders
}

Type guard

fn owned_order(order: &OrderRow, account: &str) -> Option<&OrderRow> {
    (order.owner_address.eq_ignore_ascii_case(account)).then_some(order)
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Understand the failure class

Background: Permission denied / not authorized / 403 Forbidden: access-control rejections when the caller lacks the required role, grant, or ownership — this error's family across 18 libraries.

Related errors


AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08). Data as JSON: /api/errors/f2959e47a728da49. Report an issue: GitHub.