Hello fellow devs,
I’m hitting a margin/cost_basis calculation that appears to contradict your (Alpaca) own documented formula for multi-leg orders, and I’d appreciate if anyone can explain this to me… as I can’t find a pattern.
The order (rejected):
- Order ID:
c38b9d62-6a4e-4ca3-a28b-6068d9218d47 - Timestamp: 2026-09-14T17:20:54Z
- Type: Call credit spread,
order_class: mleg, SPXW 0DTE (index option, European, cash-settled) - Leg 1: SELL
SPXW260914C07635000(sell_to_open) - Leg 2: BUY
SPXW260914C07640000(buy_to_open) - Width: 5 points, limit_price (credit): 2.15
The rejection:
"code": 40310000,
"message": "insufficient options buying power",
"cost_basis": "10400",
"options_buying_power": "3000"
Why this seems wrong — per your own documentation (Options Level 3 Trading → “How do we calculate order cost basis?”):
cost_basis = maintenance_margin + net_price
For this defined-risk 5-wide call credit spread:
- maintenance_margin = strike_diff × multiplier = 5 × 100 = $500
- net_price = −(2.15 × 100) = −$215 (credit received)
- cost_basis = 500 − 215 = $285
Yet the order was charged $10,400 — roughly the margin of a naked short call, not a defined-risk spread. This is a $10,115 discrepancy from your documented formula.
Both legs are same underlying, same expiration, submitted together in a single MLeg order with covered legs — which per your docs should be recognized under the “universal spread rule” with margin capped at the spread width ($500).
My questions:
- Why is the maintenance margin being calculated as ~$10,600 instead of the $500 the universal spread rule specifies for a 5-wide spread?
- Is the short leg being treated as uncovered/naked despite the long protective leg being present in the same MLeg order?
- Does this behavior differ when the short leg is ITM at submission time? (SPX was ~7639 when the short 7635 strike was ITM.)
I can reproduce this and provide additional order IDs if helpful. I’d like to understand the correct expectation before scaling automated activity.
Thank you <3