How does Alpaca generate the 1099

Hi all,

I’m running an algorithmic trading strategy that generates a high volume of fills daily (1,000+ share scalps across multiple symbols). I’m trying to reconcile my local trade logs with my official account statement and I’m seeing a significant discrepancy in realized P&L.

A few specific questions:

1. What lot matching method does Alpaca use for the 1099-B? Does Alpaca use strict FIFO on individual fills, or does it compress/aggregate intraday fills into weighted-average lots before applying FIFO? My local script uses strict per-fill FIFO and arrives at a very different number than my statement.

2. How are intraday round-trips handled for cost basis purposes? If I buy 1,000 shares across 4 fills and sell 1,000 shares across 3 fills within the same session, does the 1099 treat that as individual fill-level lots, or as a single aggregated position with a weighted average cost?

3. Is there documentation on Alpaca’s cost basis methodology? Is there a whitepaper or support article that explains exactly how the clearinghouse calculates realized gains for active/algorithmic accounts? Specifically how it handles partial fills, same-day round-trips, and wash sale adjustments across rapid re-entries.

4. Can I request a detailed lot-level report? Is there a way to pull the exact lot-matching data that feeds into my 1099-B — i.e., which specific buy fill was matched to which sell fill — so I can reconcile against my local records?

Thanks in advance. Just trying to make sure my local tracking tools align with what gets reported to the IRS. @Dan_Whitnable_Alpaca