What Is a Special Memorandum Account (SMA)?
One margin account through four events: equity, requirement, and SMAtable ·
2026-08-19 · 5×8
One margin account through four events: equity, requirement, and SMA
One margin account through four events: equity, requirement, and SMA
| event | market_value | debit_balance | equity | reg_t_requirement | margin_excess | sma | buying_power |
|---|---|---|---|---|---|---|---|
| Start | 40000 | 20000 | 20000 | 20000 | 0 | 0 | 0 |
| Deposit 5k cash | 40000 | 15000 | 25000 | 20000 | 5000 | 5000 | 10000 |
| Stock gains 8k | 48000 | 15000 | 33000 | 24000 | 9000 | 9000 | 18000 |
| Stock gives 8k back | 40000 | 15000 | 25000 | 20000 | 5000 | 9000 | 18000 |
| Buy 12k on margin | 52000 | 27000 | 25000 | 26000 | -1000 | 3000 | 6000 |
the exact SQL behind every number
WITH ledger AS (
SELECT 1 AS step, 'Start' AS event, 40000 AS market_value, 20000 AS debit_balance, 0 AS sma_entry
UNION ALL
SELECT 2, 'Deposit 5k cash', 40000, 15000, 5000
UNION ALL
SELECT 3, 'Stock gains 8k', 48000, 15000, 4000
UNION ALL
SELECT 4, 'Stock gives 8k back', 40000, 15000, 0
UNION ALL
SELECT 5, 'Buy 12k on margin', 52000, 27000, -6000
)
SELECT
event,
market_value,
debit_balance,
market_value - debit_balance AS equity,
0.50 * market_value AS reg_t_requirement,
market_value - debit_balance - 0.50 * market_value AS margin_excess,
SUM(sma_entry) OVER (ORDER BY step) AS sma,
2 * SUM(sma_entry) OVER (ORDER BY step) AS buying_power
FROM ledger
ORDER BY step
Related queries
Symbols closing the month below $5 and below $1, past two years
series 24×3
→
Symbol count and average daily range, by price bucket
ranking 6×3
→
Average daily range of recent listings, by age since listing
ranking 5×3
→
Where each margin call line falls: 200 shares carried against a $10,000 debit
table 3×5
→
See all 3,256 queries →