code wiki / (root) / nx_fin_taxopt.nx

nx_fin_taxopt.nx

buildroot/runtime/nx_fin_taxopt.nx

2583 B48 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_taxopt.nx -- R7 tax-OPTIMIZATION / entity modeling = "park gains like the big companies", LEGALLY. Models the §1202 QSBS exclusion (hold >=5yr in qualified small-biz stock -> exclude up to the greater of $10M or 10x basis from federal cap gains), pass-through vs C-corp double-taxation comparison, and the value of DEFERRING a tax bill (compound growth on the retained tax). Pure, i64 (cents/bps/years). AI drafts + MODELS; a licensed CPA/attorney signs anything filed. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_fin_taxopt.nx nx_fin_taxopt_gate.nx

imports: nx_syscalls.nx

imported by: nx_fin_taxopt_gate.nx

structs

none

consts

7const TO_MAGIC_10000: i64 = 10000
9const TO_QSBS_MIN_YEARS: i64 = 5
10const TO_QSBS_FLOOR_CENTS: i64 = 1000000000 // $10,000,000 §1202 floor

functions

12func to_max(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: to_qsbs_exclusion
13func to_min(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: to_qsbs_exclusion
16func to_qsbs_exclusion(gain_cents: i64, basis_cents: i64, held_years: i64, qualifies: i64) -> i64
called by 1: main calls 2: to_maxto_min
24func to_tax_after_qsbs(gain_cents: i64, excluded_cents: i64, rate_bps: i64) -> i64
called by 1: main
31func to_passthrough_tax(profit_cents: i64, individual_rate_bps: i64) -> i64 { return profit_cents * individual_rate_bps / TO_MAGIC_10000 }
called by 1: main
34func to_ccorp_total_tax(profit_cents: i64, corp_rate_bps: i64, div_rate_bps: i64, payout_bps: i64) -> i64
called by 1: main
44func to_deferral_gain(tax_cents: i64, rate_bps: i64, years: i64) -> i64
called by 1: main