code wiki / _hdl_build / nx_auction_proxybid.nx
nx_auction_proxybid.nx
buildroot/runtime/_hdl_build/nx_auction_proxybid.nx
about
nx_auction_proxybid.nx -- MANHEIM-BUILD-L1: PROXY BIDDING ("set your max" / automatic bidding, the
OVE + Manheim Timed-Sales convenience primitive), COMPOSED on the shared nx_auction_core engine.
Sovereign (nx_cc->nxasm, no gcc), pure integer-exact + deterministic.
MODEL: each dealer submits a standing MAX (a proxy). proxy_resolve settles the eBay-style second-price
outcome: the WINNER is the highest valid max (ties -> earliest submission), and pays the MINIMUM needed
to beat the runner-up = min(top1_max, top2_max + increment), floored to the opening, and JUMPED to the
reserve when the winner's max covers it. A max below the opening is REJECTED.
valid iff start <= t <= end AND max >= opening.
out[]: [winner, price, status(1=SOLD/0=NOSALE), accepted, rejected, runnerup_bidder, runnerup_max]
EXCEED axis (honest, not yet benched): (1) proxy bidding is SNIPE-IMMUNE BY CONSTRUCTION -- maxes are
pre-committed, so there is no last-tick advantage to extend against (the timed channel needs anti-snipe;
the proxy channel eliminates the attack); (2) the winner provably pays the minimum to beat the runner-up
(Vickrey-fair, auditable, no shill ambiguity).
COMPOSITION PROOF: the gate also expands the proxy outcome into the implied concrete 2-bid stream
(runner-up @ their max, winner @ the settling price) and feeds it to the SHARED core at_resolve --
asserting the core settles to the SAME winner+price. One settlement engine, two channels.
GATE (self-validating): A normal 3-proxy sale (cross-checked vs core), B no-sale (top max < reserve),
C neg-control (a below-opening max REJECTED + the reserve-jump when the winner is uncontested). A broken
rule diverges a checked value -> verdict=RED. Evidence -> knowledge/status/auction_proxybid.log.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_auction_core.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 27 | const PX_MAGIC_1100000: i64 = 1100000 |
| 28 | const PX_MAGIC_1050000: i64 = 1050000 |
| 29 | const PX_MAGIC_950000: i64 = 950000 |
| 30 | const PX_MAGIC_900000: i64 = 900000 |
| 31 | const PX_MAGIC_25000: i64 = 25000 |
| 32 | const PX_MAGIC_1000000: i64 = 1000000 |
| 33 | const PX_MAGIC_925000: i64 = 925000 |
| 34 | const PX_MAGIC_800000: i64 = 800000 |
| 35 | const PX_MAGIC_1075000: i64 = 1075000 |
| 37 | const PX_LOG: *u8 = "knowledge/status/auction_proxybid.log" |
functions
| 39 | func px_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } |
| 40 | func px_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 } |
| 43 | func proxy_resolve(opening: i64, increment: i64, reserve: i64, start: i64, end: i64, bidder: *i64, maxamt: *i64, time: *i64, n: i64, out: *i64) -> i64 called by 1: main |
| 102 | func main() -> i64 |