code wiki / (root) / nx_fin_datasource.nx

nx_fin_datasource.nx

buildroot/runtime/nx_fin_datasource.nx

2704 B44 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic fin
docsdependenciesstructsconstsfunctions

about

nx_fin_datasource.nx -- the DATA-ACQUISITION doctrine as verified logic: how to get raw financial data LEGALLY and POLITELY, free-first, and when we genuinely must license. Catalog SSOT = knowledge/finance/fin_datasources.conf; human doc = knowledge/finance/DATA_SOURCES.md. Access tiers: 0=FREE_RAW (public-domain primary: SEC EDGAR, FRED, gov), 1=FREE_TIER (keyed + rate-limited), 2=PAID (proprietary license). "Polite" = robots.txt respected + an honest User-Agent where required + within the rate limit (throttle + cache). The HARD WALL: paid data without a license is NEVER allowed (license it or use a free-raw alternative -- Cardinal 26 for data). Pure, i64. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_fin_datasource.nx nx_fin_datasource_gate.nx

imports: nx_syscalls.nx

imported by: nx_fin_datasource_gate.nx

structs

none

consts

10const DS_FREE_RAW: i64 = 0 // public-domain / primary, free, no license
11const DS_FREE_TIER: i64 = 1 // free but keyed + rate-limited
12const DS_PAID: i64 = 2 // proprietary license required -- do NOT circumvent

functions

15func ds_is_free(tier: i64) -> i64 { if tier <= DS_FREE_TIER { return 1 } return 0 }
18func ds_prefer(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: main
22func ds_polite_ok(robots_ok: i64, requires_ua: i64, ua_sent: i64, req_count: i64, rate_limit: i64) -> i64
31func ds_access_allowed(tier: i64, has_license: i64, robots_ok: i64, requires_ua: i64, ua_sent: i64, req_count: i64, rate_limit: i64) -> i64
called by 1: main calls 2: ds_polite_okds_is_free
40func ds_must_license(tier: i64, free_alt_exists: i64) -> i64
called by 1: main