code wiki / _hdl_build / nx_price.nx

nx_price.nx

buildroot/runtime/_hdl_build/nx_price.nx

12790 B284 linesdepth 4pulls 5 transitivereach 9 importersview sourcekind librarytopic price
docsdependenciesstructsconstsfunctions

about

nx_price.nx -- LIB: PRICE TRACKING across stores (R-PRICE, pillar 3 of seed-to-feed). Operator: "the tracking of prices but stores in the area for stores across america and how they are doing as far as prices." A sovereign price registry (knowledge/store/price-*, NO TSV, integer cents no-float): stores with an AREA, and date-stamped price OBSERVATIONS per item. "How a store is doing" = a measured competitiveness INDEX vs the area median (100 = exactly the area median; <100 = cheaper than median = better for the shopper). Finds the cheapest store / basket per area = where to buy for least (the affordability arc). HONEST: prices are RECORDED observations with a date + source (rule 23), NOT live-scraped or claimed real-time; the index is computed from those recorded numbers. Ties to [[project-nishi-food-branch-2026-06-22]] affordability. license_tier: ORIGINAL

dependencies 3 imports · 5 importers

nx_food_science.nx nx_seg_store.nx nx_syscalls.nx nx_price.nx nx_link.nx nx_price_gate.nx nx_price_hist.nx nx_rewards_gate.nx nx_swap_reward_gate.nx

imports: nx_food_science.nxnx_seg_store.nxnx_syscalls.nx

imported by: nx_link.nxnx_price_gate.nxnx_price_hist.nxnx_rewards_gate.nxnx_swap_reward_gate.nx

structs

none

consts

none

functions

15func pr_put(prefix: *u8, key: *u8, val: *u8) -> i64
26func pr_split(buf: *u8, len: i64, outtoks: *i64) -> i64
49func pr_list_append(prefix: *u8, key: *u8, token: *u8) -> i64
72func pr_store_key(sid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "price:store:" as *u8); o = as_append(out, o, sid); out[o] = 0 as u8; return o }
73func pr_area_key(area: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "price:area:" as *u8); o = as_append(out, o, area); o = as_append(out, o, ":stores" as *u8); out[o] = 0 as u8; return o }
74func pr_obs_key(sid: *u8, item: *u8, out: *u8) -> i64
81func pr_add_store(prefix: *u8, sid: *u8, name: *u8, chain: *u8, area: *u8, state: *u8, cite: *u8) -> i64
97func pr_store_field(prefix: *u8, sid: *u8, f: i64, out: *u8) -> i64
106func pr_set_price(prefix: *u8, sid: *u8, item: *u8, cents: i64, date: *u8, unit: *u8, source: *u8) -> i64
118func pr_get_price(prefix: *u8, sid: *u8, item: *u8) -> i64
129func pr_obs_field(prefix: *u8, sid: *u8, item: *u8, f: i64, out: *u8) -> i64
138func pr_area_stores(prefix: *u8, area: *u8, outsids: *i64) -> i64
147func pr_area_prices(prefix: *u8, area: *u8, item: *u8, outvals: *i64) -> i64
161func pr_median(prefix: *u8, area: *u8, item: *u8) -> i64
181func pr_cheapest(prefix: *u8, area: *u8, item: *u8, out_sid: *u8) -> i64
202func pr_basket(prefix: *u8, sid: *u8, items: *i64, nitems: i64) -> i64
215func pr_store_index(prefix: *u8, area: *u8, sid: *u8, items: *i64, nitems: i64) -> i64
230func pr_render_area(prefix: *u8, area: *u8, items: *i64, nitems: i64, out: *u8) -> i64
275func im_money_local(dst: *u8, off: i64, cents: i64) -> i64