nautechsystems/nautilus_trader · error
target taker order {} is not owned by the account
Error message
target taker order {} is not owned by the account What it means
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.
Source
Thrown at crates/adapters/polymarket/src/execution/reconciliation.rs:866
let order_side = validate_maker_order_side(trade, maker_order)?;
validate_expected_order_side(
expected_order_side,
order_side,
&format!("target maker order {}", maker_order.order_id),
)?;
(
TargetFillParticipant::Maker {
maker_order,
identifiers,
},
instrument,
maker_order.matched_amount,
maker_order.price,
format!("target maker order {} matched amount", maker_order.order_id),
format!("target maker order {} price", maker_order.order_id),
)
} else {
anyhow::ensure!(
is_owned_by_account(
&trade.maker_address,
&trade.owner,
ctx.user_address,
ctx.api_key,
),
"target taker order {} is not owned by the account",
trade.taker_order_id,
);
let venue_order_id =
checked_venue_order_id(&trade.taker_order_id, "target taker trade")?;
let trade_id = checked_trade_id(&trade.id, "target taker trade")?;
let instrument = resolve_target_instrument(
instruments,
trade.asset_id,
instrument_id,
&format!("target taker trade {}", trade.id),
)?;View on GitHub (pinned to 18893faf8b)
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.
Example fix
// before: taker trade attributed to another owner // trade.owner = 0xDDDD..., ctx.user_address = 0xCCCC... // after: configure adapter with the executing account user_address = "0xDDDD..." api_key = "<matching api key>"
Defensive patterns
Strategy: validation
Validate before calling
let trades = client.get_trades(&user_address).await?;
if !trades.iter().any(|t| t.taker_order_id == venue_order_id.as_str()
&& is_owned_by_account(&t.maker_address, &t.owner, &user_address, &api_key)) {
return Err(anyhow!("taker trade for {venue_order_id} not owned by {user_address}"));
} Type guard
fn taker_trade_owned(trade: &PolymarketTradeReport, ctx: &FillContext) -> bool {
is_owned_by_account(&trade.maker_address, &trade.owner, ctx.user_address, ctx.api_key)
} Try / catch
match result {
Err(e) if e.to_string().contains("target taker order") && e.to_string().contains("not owned") => {
log::error!("taker trade owned by another account; verify adapter user_address/api_key");
// abort reconciliation for this trade; no retry
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
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
- target maker order {} is not owned by the account
- unmapped_in_scope_message("open order", instrument_id, Some(
- unmapped_in_scope_message("position", instrument_id, None, c
- expected Polymarket BinaryOption instrument, found {instrume
- provider venue order {} is not owned by the account
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/c01f503e3b37b1b5.
Report an issue: GitHub.