nautechsystems/nautilus_trader · error

target maker order {} is not owned by the account

Error message

target maker order {} is not owned by the account

What it means

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.

Source

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

    instrument_id: Option<InstrumentId>,
    venue_order_id: VenueOrderId,
    expected_order_side: Option<OrderSide>,
) -> anyhow::Result<TargetTradeAdmission<'a>> {
    if !validate_target_trade_role(trade, venue_order_id)? {
        return Ok(TargetTradeAdmission {
            class: TargetTradeClass::Unrelated,
            confirmed_fill: None,
        });
    }

    let (participant, instrument, quantity, price, quantity_field, price_field) =
        if trade.trader_side == PolymarketLiquiditySide::Maker {
            let maker_order = trade
                .maker_orders
                .iter()
                .find(|order| order.order_id == venue_order_id.as_str())
                .context("validated target maker occurrence is missing")?;
            anyhow::ensure!(
                maker_order.is_owned_by(ctx.user_address, ctx.api_key),
                "target maker order {} is not owned by the account",
                maker_order.order_id,
            );
            let identifiers = validate_maker_report_identifiers(trade, maker_order)?;
            let instrument = resolve_target_instrument(
                instruments,
                maker_order.asset_id,
                instrument_id,
                &format!(
                    "target maker trade {} order {}",
                    trade.id, maker_order.order_id
                ),
            )?;
            validate_instrument_binding(&instrument, trade.market.as_str(), maker_order.outcome)?;
            let order_side = validate_maker_order_side(trade, maker_order)?;
            validate_expected_order_side(
                expected_order_side,

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Confirm the adapter's user address and API key/creds match the account that actually placed the maker order.
  2. Restart the node after changing credentials so the FillContext picks up the right identity.
  3. Verify the venue_order_id belongs to your account by querying the provider's open/confirmed orders for your address.
  4. If running multiple Polymarket accounts, configure one adapter instance per account and route reconciliation per account.

Example fix

// before: mismatched creds in config
user_address = "0xAAAA..." // orders placed from 0xBBBB...
// after: align credentials with the trading account
user_address = "0xBBBB..."
api_key = "<key for 0xBBBB...>"
Defensive patterns

Strategy: validation

Validate before calling

let open = client.get_orders(&user_address).await?;
if !open.iter().any(|o| o.id == venue_order_id.as_str()) {
    return Err(anyhow!("venue order {venue_order_id} not owned by {user_address}"));
}

Type guard

fn maker_leg_owned<'a>(trade: &'a PolymarketTradeReport, venue_order_id: &VenueOrderId, ctx: &FillContext) -> Option<&'a PolymarketMakerOrder> {
    trade.maker_orders.iter().find(|m| m.order_id == venue_order_id.as_str() && m.is_owned_by(ctx.user_address, ctx.api_key))
}

Try / catch

match result {
    Err(e) if e.to_string().contains("target maker order") && e.to_string().contains("not owned") => {
        log::error!("maker order belongs to another account; check adapter credentials");
        // do not retry; fix config or skip this trade
    }
    other => other?,
}

Prevention

When it happens

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

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

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/0515c024f1fb4d5b. Report an issue: GitHub.