code wiki / (root) / nx_fin_finance.nx

nx_fin_finance.nx

buildroot/runtime/nx_fin_finance.nx

4635 B86 linesdepth 4pulls 4 transitivereach 10 importersview sourcekind librarytopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_finance.nx -- R7 (financing-cost optimizer) of THE NISHI FINANCIAL ECOSYSTEM: find AFFORDABLE funding by ranking options on TRUE TOTAL COST + screening RISK. Operator's crisis: the US system isn't offering an affordable rate; the answer is NOT a fantasy "cheap international loan" (that space is mostly ADVANCE-FEE FRAUD), it is (1) exact apples-to-apples total-cost ranking of REAL options (credit unions, CDFIs, balance transfers, debt-management plans, member/microfinance) and (2) a SCAM/PREDATORY shield. TRUE COST (#11 no magic, exact no-float via nx_debt amortization): an option's cost = origination fee + total interest to pay off `balance` at `payment`/month. Headline APR alone is a LIE -- fees + term decide the real cost; this compares them honestly on ONE scenario. RISK (the never-brick analog #26: the system must NEVER lead a desperate borrower into a scam): flags ADVANCE_FEE (lender demands money BEFORE disbursing -> the #1 loan-scam tell; a real lender never does) PREDATORY (APR above the usury line -- payday/loan-shark territory) UNLICENSED (no recognized regulator -- offshore/"international" cold-offers) An option carrying ADVANCE_FEE or UNLICENSED is EXCLUDED from ranking even if its ADVERTISED rate is the lowest -- the scam's bait rate must never win. Data-driven: options + the usury line are DATA (any lender, any country). No floats, no hardware writes, no auto-apply (emit ranking; the operator decides). license_tier: ORIGINAL

dependencies 3 imports · 4 importers

nx_syscalls.nx nx_money.nx nx_debt_payoff.nx nx_fin_finance.nx nx_climbout_real.nx nx_climbout_real_gate.nx nx_fin_finance_gate.nx nx_finance_web.nx

imports: nx_syscalls.nxnx_money.nxnx_debt_payoff.nx

imported by: nx_climbout_real.nxnx_climbout_real_gate.nxnx_fin_finance_gate.nxnx_finance_web.nx

structs

none

consts

21const FE_ADVANCE_FEE: i64 = 1
22const FE_PREDATORY: i64 = 2
23const FE_UNLICENSED: i64 = 4

functions

27func fe_total_cost(balance: i64, payment: i64, apr_scaled: i64, orig_fee: i64, out_months: *i64) -> i64
36func fe_risk(apr_scaled: i64, upfront_required: i64, licensed: i64, usury_apr_scaled: i64) -> i64
called by 2: fe_rank_bestmain
46func fe_is_safe(flags: i64) -> i64
called by 2: fe_rank_bestmain
54func fe_rank_best(balance: i64, payment: i64, aprs: *i64, fees: *i64, upfronts: *i64, lic: *i64, n: i64, usury: i64, out_idx: *i64) -> i64
78func fe_runway_months(savings: i64, monthly_obligations: i64) -> i64
called by 2: mainfw_render
83func fe_runway_days(savings: i64, monthly_obligations: i64) -> i64
called by 2: mainfw_render