> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abacuslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Executing at a broker

> How an Abacus Labs trade becomes an order, broker by broker.

Abacus Labs gives every trade in one shape. Brokers differ in one place: how you tell them which tax lots to sell. Abacus Labs reads that from the account's `lot_selection` (or from `broker`) and plans for it.

| Broker | `lot_selection` | What your agent does |
| - | - | - |
| Public | `on_order` | Put `taxLotMatchingInstructions: [{taxLotId: lot.id, quantity}]` on the sell. |
| E\*TRADE | `on_order` | Put `Instrument.lots: [{id: lot.id, size: quantity}]` on the order preview and place. |
| Apex-cleared apps | `on_order` | Put `lot_matching_instructions: [{open_lot_id: lot.id, quantity}]` on the order. |
| DriveWealth-cleared apps | `on_order` | Put `taxLotDisposition: [{taxLotID: lot.id}]` on the order. |
| Interactive Brokers | `after_trade` | Place the order; then choose the lots in Tax Optimizer the same day (by 8:30 PM ET). |
| Schwab, Fidelity, Vanguard, Tradier, Webull, Robinhood | `manual` | Set the order's lot method to `fallback_method`, or ask the broker to apply the specific lots before `choose_by` and keep its confirmation. |
| Alpaca | `fifo_only` | Nothing. Alpaca sells the oldest lots first, and Abacus Labs planned the sale that way. |

Why the rules on `lots`:

* **Quantities add up to the trade.** Public and E\*TRADE require it.
* **At most 8 lots.** Public's limit. Abacus Labs splits larger sells.
* **At most one partial lot, last.** DriveWealth takes lot ids without quantities; it sells them in order.
* **`choose_by`.** US tax rules let the person name specific lots until the trade settles. After that the broker's default (usually first in, first out) applies.

Lot ids are the broker's own (`lot.id` as you sent it). Broker lot ids can change after a partial sale or a corporate action, so fetch lots on the day you trade and send them with the request.

Order fields map directly: `side` to the broker's buy/sell, `quantity` in shares, `id` as the client order id, `order.type` and `order.time_in_force`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.