nautechsystems/nautilus_trader · error

client-bound Polymarket reports require a cached base-denomi

Error message

client-bound Polymarket reports require a cached base-denominated Limit order

What it means

`require_cached_base_limit` resolves the cached Nautilus order backing a client-bound Polymarket report. Polymarket adapter accounting only supports base-denominated Limit orders for report processing, so if the cached order is missing, not a `Limit` order, or uses quote-quantity denomination, the adapter raises this error via `anyhow::ensure!`.

Source

Thrown at crates/adapters/polymarket/src/execution/reports.rs:75

};

#[derive(Clone)]
struct TargetOrderAuthority {
    client_order_id: Option<ClientOrderId>,
    cached_order: Option<OrderAny>,
    instrument_id: Option<InstrumentId>,
    order_side: Option<OrderSide>,
}

impl TargetOrderAuthority {
    fn require_cached_base_limit(&self, venue_order_id: VenueOrderId) -> anyhow::Result<&OrderAny> {
        let client_order_id = self.client_order_id.with_context(|| {
            format!("venue order {venue_order_id} has no known client association")
        })?;
        let cached_order = self.cached_order.as_ref().with_context(|| {
            format!("client-bound order report requires cached order {client_order_id}")
        })?;
        anyhow::ensure!(
            cached_order.order_type() == OrderType::Limit && !cached_order.is_quote_quantity(),
            "client-bound Polymarket reports require a cached base-denominated Limit order",
        );
        Ok(cached_order)
    }
}

impl PolymarketExecutionClient {
    pub(super) fn fill_context(&self) -> FillContext<'_> {
        let user_address = self
            .secrets
            .funder
            .as_deref()
            .unwrap_or(&self.secrets.address);
        FillContext {
            account_id: self.core.account_id,
            user_address,
            api_key: self.secrets.credential.api_key_str(),

View on GitHub (pinned to 18893faf8b)

Solutions

  1. Submit only base-denominated Limit orders when the strategy relies on client-bound Polymarket reports: use OrderFactory.limit with default (base) quantity denomination and `quote_quantity=False`.
  2. Ensure the execution cache is warm — restore persisted cache state or run reconciliation after restart before requesting order status/fill reports.
  3. Verify the order type of the cached order for the given client_order_id; Market or other order types are unsupported here, so re-route those queries to venue-only (non client-bound) report generation.
  4. Check adapter version: if a strategy legitimately needs quote-denominated orders, upgrade to a build that supports the required denomination or change strategy sizing to base units.

Example fix

// before: quote-denominated limit order breaks report generation
order = self.order_factory.limit(
    instrument_id,
    order_side=OrderSide.BUY,
    quantity=self.instrument.make_qty(100.0),  # interpreted as quote qty via make_qty with quote_quantity=True
    price=self.instrument.make_price(0.55),
    quote_quantity=True,
)
// after: base-denominated limit order required by Polymarket reports
order = self.order_factory.limit(
    instrument_id,
    order_side=OrderSide.BUY,
    quantity=self.instrument.make_qty(100.0),
    price=self.instrument.make_price(0.55),
)
Defensive patterns

Strategy: type-guard

Validate before calling

order = self.cache.order(client_order_id)
if order is None:
    raise ValueError(f"order {client_order_id} not in cache; restore cache before report generation")
if order.order_type != OrderType.LIMIT or order.is_quote_quantity:
    raise ValueError(
        f"order {client_order_id} must be a base-denominated Limit order "
        f"(got {order.order_type}, quote_quantity={order.is_quote_quantity})"
    )

Type guard

def is_base_denominated_limit(order) -> bool:
    return (
        order is not None
        and order.order_type == OrderType.LIMIT
        and not order.is_quote_quantity
    )

Try / catch

try:
    report = client.generate_order_status_reports(...)
except Exception as e:
    if "base-denominated Limit order" in str(e):
        log.error("Polymarket reports need cached base-denominated Limit orders; "
                  "check OrderFactory settings and cache warm-up")
    raise

Prevention

When it happens

Trigger: Raised in `require_cached_base_limit` when generating client-bound order status or fill reports (e.g. generate_order_status_report / generate_fill_reports) where: (a) the order for the resolved client_order_id is not in the execution cache, (b) the order was submitted as Market, or (c) the Limit order was submitted with `quote_quantity=true`.

Common situations: Submitting Market orders to Polymarket and later querying their status/fills through report generation; creating Limit orders with quote-denominated quantities (wrong OrderFactory settings); cache lost after a node restart without reconciliation of persisted state; mixing adapters where the cached order type differs from the venue order.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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