Infrastructure liveaitradingriskexecution

How an AI Agent Should Handle Partial Fills

Learn practical steps for AI trading agents to detect, reconcile, and act on partial order fills while preserving risk controls and data integrity.

By the Felix team6 min read

Produced with automation, then checked by deterministic quality rules and an independent source-grounded review before publication.

Key takeaways
  • 01Detect partial fills by comparing filled quantity against the original order size using authoritative market data.
  • 02Reconcile partial fills against the agent’s internal state before taking further actions.
  • 03Apply owner‑signed risk limits to each fill, not just the full order, to prevent limit breaches.
  • 04Log explicit error states and timestamps for every fill to support durable mutation identity.
  • 05Use an emergency stop to halt further activity while reviewing open positions after unexpected partial fills.

When an order is only partially filled, an AI agent must treat the fill as a distinct execution event and update its internal state accordingly. It should verify the filled amount against the original order, reconcile the change with risk limits, and log the event with full provenance.

Why do partial fills happen?

Partial fills occur when market liquidity cannot satisfy the full order size at the requested price. The exchange may execute the available quantity and leave the remainder open, or it may split execution across multiple price levels. Understanding this behavior prevents the agent from assuming an order is complete when it is not.

How can an AI agent reliably detect a partial fill?

  1. 01The agent receives a fill notification from the normalized market interface.
  2. 02The notification includes the filled quantity, price, and a unique execution identifier.
  3. 03The agent compares the filled quantity to the outstanding order size recorded in its state.
  4. 04If the filled quantity is less than the outstanding size, the fill is partial.

What steps should follow a detected partial fill?

  • Update the internal order record to reflect the reduced outstanding quantity.
  • Re‑apply owner‑signed risk limits (size, daily notional, loss) to the remaining portion.
  • Log the fill with source, timestamp, and any data‑quality warnings.
  • Trigger a reconciliation routine to ensure the agent’s view matches the authoritative account state.

How does reconciliation work after a partial fill?

Reconciliation compares the agent’s internal position and order book against the authoritative account snapshot. Any discrepancy must be resolved before the agent proceeds with new orders. See How an AI Agent Can Reconcile Orders, Fills, and Positions for a deeper dive. For related context, see What Should an AI Agent’s Money Map Include?.

When should the agent pause or stop after repeated partial fills?

If partial fills repeatedly trigger risk‑limit breaches or expose data‑quality issues, the agent should enter a pause state. An emergency stop can cancel further activity while the owner reviews open positions. For guidance on pause logic, refer to When Should an AI Trading Agent Pause After Repeated Errors?.

What are the risks and uncertainties of handling partial fills?

  • The agent may misinterpret a stale quote as a fill, leading to incorrect state updates.
  • Network latency can cause out‑of‑order fill notifications, requiring robust ordering logic.
  • Risk limits applied per fill may still allow cumulative exposure to exceed intended thresholds if not aggregated correctly.

How can an agent design a robust partial‑fill workflow?

  1. 01Start each order with a unique identifier and store the intended total size.
  2. 02On every fill, record the execution ID, quantity, price, source, and timestamp.
  3. 03Immediately reconcile the updated position against the authoritative account snapshot.
  4. 04Re‑evaluate all active risk limits against the new aggregate exposure.
  5. 05If any limit is breached, either reduce the remaining order size or cancel it.
A partial fill is not a failure; it is a data point that must be treated with the same rigor as a full execution.

Frequently asked questions

What is the difference between a partial fill and a cancelled order?

A partial fill means some quantity was executed and the remainder stays open, while a cancelled order has no executed quantity.

Can an AI agent rely on a single fill notification?

No. The agent should verify the fill against the authoritative account state to guard against missed or duplicate messages.

How should risk limits be applied to partial fills?

Each fill must be checked against the same owner‑signed limits that apply to full orders, and the cumulative exposure must be tracked.

What should an agent do if a fill arrives with missing data fields?

Treat the fill as uncertain, log a warning, and pause further execution until the missing information is resolved or verified.

Is it safe to assume that a timeout means the order failed?

No. A timeout only indicates no response; the order may still be pending or partially filled. Reconciliation is required.

Sources and verification

Product claims in this article were checked against these first-party references. Runtime status remains authoritative for current availability.

Build with Felix now.

Felix infrastructure is live through MCP and the API. The full trading app launches September 17.

Keep reading

Not a brokerage, exchange, or investment adviser. Not investment advice. Trading involves risk, including total loss.