nx_fin_taxlot.nx
buildroot/runtime/nx_fin_taxlot.nx
about
nx_fin_taxlot.nx -- R7 (Nishi Accounting): tax-lot accounting = the machinery to PARK gains legally. Exact
integer date math (Hinnant's civil-days algorithm) for holding periods, short/long-term classification (the
difference between ordinary-income and the lower long-term cap-gains rate), realized gain/loss, WASH-SALE
detection (a loss re-bought within +/-30 days is DISALLOWED), and the tax saved by harvesting a real loss.
Pure, i64 (cents/bps/days), NO floats. AI drafts + models; a licensed CPA signs the return. Pairs with the
additive nx_fin_ledger. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_fin_taxlot_gate.nx
structs
| none |
consts
| 8 | const TL_MAGIC_146097: i64 = 146097 |
| 9 | const TL_MAGIC_719468: i64 = 719468 |
| 10 | const TL_MAGIC_10000: i64 = 10000 |
| 12 | const TL_LONGTERM_DAYS: i64 = 365 // held MORE than this (>1 year) = long-term |
| 13 | const TL_WASH_WINDOW: i64 = 30 // +/- 30 days = the wash-sale window |
functions
| 16 | func tl_days_from_civil(y0: i64, m: i64, d: i64) -> i64 called by 1: tl_days_between |
| 31 | func tl_days_between(d1_key: i64, d2_key: i64) -> i64 |
| 38 | func tl_is_longterm(holding_days: i64) -> i64 { if holding_days > TL_LONGTERM_DAYS { return 1 } return 0 } called by 1: main |
| 41 | func tl_realized_cents(sale_px_cents: i64, cost_px_cents: i64, shares: i64) -> i64 { return (sale_px_cents - cost_px_cents) * shares } called by 1: main |
| 45 | func tl_is_wash(realized_cents: i64, days_to_repurchase: i64) -> i64 called by 1: main |
| 53 | func tl_harvest_benefit(realized_cents: i64, tax_rate_bps: i64) -> i64 called by 1: main |