Copy-paste Python recipes for common equity-compensation tax questions: incentive stock options (ISOs) and the alternative minimum tax (AMT), non-qualified stock options (NSOs), restricted stock units (RSUs), qualified small business stock (QSBS), single-stock concentration, protective puts, and funding a cash goal from stock.
Each recipe is one self-contained file that calls the keyless OptionsAhoy REST API
(no API key) with nothing but requests. The financial math is deterministic and
independently verified against Internal Revenue Service publications and open-source
tax engines: https://optionsahoy.com/verification.
pip install requests
python optimize_iso_amt_exercise_schedule.pyoptimize_iso_amt_exercise_schedule.py
from optimize_iso_amt_exercise_schedule import optimize_iso_exercise_schedule
result = optimize_iso_exercise_schedule(
shares=20000, strike=2, fmv=200, filing_status="married_joint",
ordinary_income=300000, state_code="CA", horizon_years=4,
)
print(result["schedules"]["optimized"]["nfv"])from calculate_nso_exercise_tax import calculate_nso_exercise_tax
result = calculate_nso_exercise_tax(
shares=10000, strike=5, current_price=80, ordinary_income=250000,
filing_status="single", state_code="CA", hold_years=2, ticker="NVDA",
)from rsu_sell_vs_hold_after_tax import rsu_sell_vs_hold
result = rsu_sell_vs_hold(shares=2000, current_price=80, ordinary_income=250000,
filing_status="single", state_code="CA", ticker="NVDA")analyze_single_stock_concentration.py
from analyze_single_stock_concentration import analyze_concentration
result = analyze_concentration(position_value=800000, cost_basis=100000,
sector="tech_software", total_assets=1200000, ticker="NVDA")price_protective_put_or_collar.py
from price_protective_put_or_collar import price_protective_put
result = price_protective_put(position_value=500000, sector="semiconductors",
protection_level=0.10, tenor_years=1, ticker_label="NVDA")check_qsbs_section_1202_eligibility.py
from check_qsbs_section_1202_eligibility import check_qsbs_eligibility
result = check_qsbs_eligibility(acquisition_date="2018-01-01", sale_date="2025-06-01",
expected_gain=2000000, state_code="CA", filing_status="single")plan_stock_sales_for_cash_goal.py
from plan_stock_sales_for_cash_goal import plan_equity_sales_for_cash_goal
result = plan_equity_sales_for_cash_goal(target_after_tax=200000, target_date="2027-06-01",
ordinary_income=250000, state_code="CA")A published five-model benchmark on the same multi-year ISO problem found all fifteen
trials overshot the achievable after-tax outcome by two to twenty times. The API's
answer is deterministic and verifiable. The same calculators are also available as an
agent tool over the Model Context Protocol
(https://optionsahoy.com/mcp) and as a Python client (pip install optionsahoy).
pip install requests pytest
pytest tests # offline structure checks
OA_LIVE=1 pytest tests # also runs each recipe live