From 716dd8066f3476e6f88af5c0905f7d6befc1b226 Mon Sep 17 00:00:00 2001 From: martbost Date: Sat, 17 Oct 2026 10:32:01 -0500 Subject: [PATCH] Override dry run: dollar amounts were 100x (cents shown as dollars); POL amounts were right Co-Authored-By: Claude Opus 5.5 --- override.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/override.js b/override.js index e4a316c..43035ab 100644 --- a/override.js +++ b/override.js @@ -57,7 +57,7 @@ async function report(from, to) { const c = cfg(); const rows = [], per = {}; for (const p of purchases()) { if (p.ts < from || p.ts >= to || (c.goLive && p.ts < c.goLive)) continue; - const wei = BigInt(p.paidWei || '0') * BigInt(PCT) / 100n, cents = Math.round((p.priceCents || 0) * PCT) / 100; + const wei = BigInt(p.paidWei || '0') * BigInt(PCT) / 100n, cents = Math.round((p.priceCents || 0) * PCT) / 10000; // dollars: price cents x 3% / 100 const r = await recipientFor(p.buyerId).catch(e => ({ recipientId: 0, reason: 'read failed: ' + e.message })); rows.push({ tx: p.tx, ts: p.ts, buyerId: p.buyerId, priceCents: p.priceCents, overrideWei: wei.toString(), overrideUsd: cents, recipientId: r.recipientId, hops: r.hops || 0, skipped: r.skipped || [], reason: r.reason || '' }); if (r.recipientId) { const o = per[r.recipientId] = per[r.recipientId] || { recipientId: r.recipientId, purchases: 0, wei: 0n, usd: 0 }; o.purchases++; o.wei += wei; o.usd += cents; }