Multi-row shop quote and live Computer Literacy audit
Read-only REA Step6 follow-up using retained original evidence and maintained C only. No fresh binary open/export, runtime, database or tracked edit.
Targets: original14.9.1 KKR SHA256 a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0; DDR SHA2563c937161de8f690351c3c08e158431417cee9ced77a41b677e7123b61a8c9883. Original base10000000; maintained KKR36000000 and DDR2b000000.
The parent's narrower follow-up about completion debit, signed aggregate underflow and quote-refresh delivery is answered in completion-and-repricing.md.
Three different sale totals, summed per row
Let T truncate toward zero, F025=float32(0.025), F01=float32(0.01), D01=binary64(0.01), P=item stat74 (sentinel1234567890 becomes0), N=native offered row count, S=terminal stat426, CL=actor stat161/mode0. For charge normalization:
U = float32(P)
if positive stat212 exists and item type != 51018:
U = float32(U / stat212)
M = T(CL * F025)
Accepted-transfer100a99d0 processes each occupied TradeInv row independently:
B = T(N * U * S * D01)
acceptedLine = max(0, B + T(M * F01 * B))
acceptedTotal = sum(acceptedLine for each row)
Staged displayed sale100a9e20 instead does:
displayLine = T((U + T(M * U * F01)) * N * S * D01)
displayTotal = sum(displayLine for each row)
There is no aggregate round after summing raw row values. Moving truncation outside the row loop changes behavior. Neither sale calculation has the buy function's90% CL cap. Display has no corresponding per-row zero clamp in the retained assembly; accepted transfer does. These are separate original client contracts, not recovered historical server accounting.
Pending funding100a9f60 iterates the offered inventory list and credits EACH SALE ROW ONCE, without its count or stat212 normalization:
fundingBase = T(P * S * D01)
pendingSaleCredit = fundingBase + T(M * fundingBase * F01)
net = sum(currentBuyQuote(entry) * signed16(selectedCount))
- sum(pendingSaleCredit for each offered row)
100781c0(candidate) returns net + candidateBuyQuote - currentCash61. Catalog Add checks a positive shortfall both before request1001fb50 and on received Add10077aa0. This admission calculation is NOT the displayed charge-aware sale quote and NOT the accepted-transfer value. It can over-credit partially used stacks. Server Accept still needs an independent authoritative funds check.
Native assembly evidence (copied here): accepted ev_50d5389d0e78c2195155c556727b2150c1289263a204747719239d648fbcbf99; display ev_8824c58f2355519e447ea2d309084fd940705d3afb6bc4638ca93b8a1c2e0f8f; pending ev_49207891b4790064b76a2a743f4f5c4c750a8a63f8d5f775ef55f43980c0ad96; shortfall ev_a70b7e186cea6e95a86485b1a5102851ac6e9bee91dcbc5c4532058a9badb360. Exact constants and interpolation are in docs/research-notes/shop-research/pricing/findings.md.
Derived charged-stack example
Synthetic arithmetic example, NOT a native execution or historical item: P10000, max charges50, S70, CL40, type other than51018.
| Offered rows | Displayed sale | Accepted-transfer sum | Pending funding credit |
|---|---|---|---|
| One row count25 | 3517 | 3534 | 7069 |
| Two rows count25 each | 7034 | 7068 | 14138 |
| One row count50 | 7035 | 7069 | 7069 |
| Count25 plus a zero-price row | 3517 | 3534 | 7069 |
The quote/accepted discrepancy need not be limited to one credit. Per-unit rounding can accumulate across25 charges. Splitting equivalent total charges across rows also changes the rounding result. tmp_arithmetic.py and arithmetic-examples.json preserve derivation using exact imported constant values and float32 unit stores; they do not execute the original x87 code.
Zero-value sale rows
Accepted100a99d0 moves/consumes a valid offered row before reading its price: static branch100a9a8f..100a9a9b calls1002d620; dynamic branch100a9ba3..100a9baf calls1002d940 after its TimeExist8=-1 check. A price of0 or missing-price sentinel contributes0; it does not stop the loop, cancel another row, or restore that row. The next row is still processed. Display and pending arithmetic likewise add0 for price0/sentinel. Native Add's known NoDrop/timespan/ownership gates do not add a positive-price requirement.
DDR shop Accept10048870 checks cachedBUY-cachedSELL-currentCash <=0. It has no positive-proceeds or nonzero-sale-row requirement. Thus a mixed positive and zero-valued offer, or an otherwise valid zero-value offer, is not rejected by those particular native checks. Original-server admission is not recovered.
Removing a sale that funded selected purchases
Public Remove sender1001ff50 checks ordinary inventory room for own offers, then sends action5; no affordability check. Received own Remove10077cc0 calls inventory helper10060090, restoring that row first-free and notifying local inventory/trade UI. It does NOT clear or scan the vending purchase list and does not call100781c0. A vending purchase Remove instead goes through100a97b0 and1001e2e0 for that selected catalog row only.
TradeUpdated event171 -> DDR10049380 ->10048f50 clears/rebuilds visible BUY/SELL grids from their existing inventories, then10048d50 recomputes the sale quote. Clearing a grid here does not erase the underlying machine transaction list. There is no automatic removal of newly unaffordable purchases in these paths.
Subsequent Add revalidates current pending funding through100781c0. Accept 10048870 compares view caches+a8BUY / +acSELL to current cash61; on shortfall it prints "Sorry you lack ...", changes the button state and returns without sending Accept1. The basket remains available for removing purchases or adding sales. SetCash6 has already been submitted before that Accept check; this does not itself make the purchase affordable or commit anything.
Sources: local/player-trade-research/native/reused-0x1001ff50.c.txt and reused-0x10077aa0.c.txt; Remove ev_3b068fe016d29c9c6d60176e86341dcd106df72df90b32492a9c956186bf61c7; grids/price ev_f5717956dbc1f446ae83949a01f62f1535d4e2f743295d46fb199db6490f039e; Accept ev_54f573e7f808a88dcbfa7bd04148f5d080b9b5e15b33b89b502baa39c4dea19f. Maintained restore body copied as generated-36060090.txt.
Computer Literacy changes while the shop is open
Every call to buyQuote100a9610 or saleQuote100a9e20 rereads actor stat161/mode0. The buy wrapper100262c0 and shop-stat74 accessor10027060 therefore obtain current quotes when called. This does not mean all displayed basket values are recomputed automatically.
Displayed SELL cost is fresh10020040(player)->10078060->100a9e20 at refresh. Displayed BUY cost is10020040(machine)->100a9490->transaction inventory+0x14, an accumulated integer cost. Add100a96b0 gets current buyQuote then1001e210 adds it to+0x14; Remove100a97b0(-1) gets current buyQuote and1001e2e0 subtracts it from+0x14. The selected row stores a count, not its historical unit quote. 100a9490 simply returns that cached total; it does not reprice each row.
Consequently a CL change can produce old/mixed cached BUY prices even when the sale total refreshes. Removing an old selection after a CL change subtracts the CURRENT quote, rather than a stored original unit quote. For example, derived base10000: add atCL0 caches10000, remove atCL40 subtracts9901, leaving 99 cached cost with no selection. This is an implication of the retained paths, not a runtime reproduction or a desirable server accounting policy.
Pending affordability100a9f60 separately reprices all selected purchases using current CL. Accepted-transfer sale100a99d0 also rereads current CL. The visible BUY cache, fresh admission calculation and accepted-transfer sale total can therefore disagree after in-place stat changes.
Known display refresh entry points:
- Start100485b0, then10048f50 after identities are established.
- TradeUpdated171 receiver10049380 ->10048f50 ->10048d50.
- Drag/drop10048b40 ends in10048f50.
- OpponentCash173 receiver100493d0 ->10048f00 ->10048d50.
Accept10048870 does NOT call10048d50 or10048f50 before its funds check. Its initial10049090 parses/clamps offered cash and signals the cash-input display; it does not reprice baskets. A later server Cash6 echo can cause opponent-cash notification, but is asynchronous with the current Accept callback.
TradeViewModule10049170 registers trade events170/171/172/173/174/175/176/177, cash-input16e, completion16f, item-dropped8f and init/shutdown5/6. It contains no stat161 notification subscription or per-frame quote hook. The retained direct generated callsites for10048d50 are start, refresh and opponent-cash update. This establishes EVENT-DRIVEN refresh in the recovered paths. It does not prove that every inherited UI/vtable route has been inspected. No complete generic CL-stat-notification-to-TradeView path is recovered; do not claim an automatic per-frame refresh or that a CL change alone refreshes the view.
Sources: cached Add/Remove ev_d975751d3e08996e446dae5c8d38729be2881957763cac0c6acba52a822e6951; 10048f00 ev_14ec02170beb079a5d02c4fd0900fa29e4fbf2ad9cc7b1f22a080eb443932971; module/173 receiver ev_c377df0a78b0a09634426321e7c2edd319bad2630359ebf2582069822a6b2017; price refresh ev_f5717956dbc1f446ae83949a01f62f1535d4e2f743295d46fb199db6490f039e. 10020040 maintained source is lifted-0013.c:5138;100a9490 is retained in local/player-trade-research/native/reused-0x100a9490.c.txt.
Open coverage
This worker performed no game test. Inherited UI refresh hooks, a full stat161 notification chain, original-server CL-change pricing policy, all dynamic-item quote branches, extreme integer overflow and original x87 executable replay remain open. Parent owns runtime verification and any current server policy. No native evidence here requires silently deleting selected purchases merely because sale funding or CL changed. Server authority still must prevent an unfunded atomic completion regardless of the client's inconsistent quote paths.