DEV Community

Cover image for Rechecking a crypto report's percentages from its own numbers, in 40 lines of JavaScript
Swapcore.Exchange
Swapcore.Exchange

Posted on

Rechecking a crypto report's percentages from its own numbers, in 40 lines of JavaScript

-7.89%

That's what you get when you divide Chainalysis' two totals for Eastern Europe: $697.1 billion in the year to June 2025, $642.1 billion in the year to June 2026. The report, published November 17, 2026, rounds it to 7.9%, the steepest fall of the eight regions it tracks. Cointelegraph covered it the same day.

Reports like this put a dollar figure and a percentage side by side. When both are printed, you can check one against the other in a few lines. I wanted to see whether every headline % follows from the numbers printed next to it.

The script

Node 18+, no dependencies. The figures are copied by hand from the report, and each row holds the before value, the after value and the % the report states (or null when it gives none).

// recheck.mjs
const figures = [
  ['Eastern Europe crypto economy ($B)', 697.1, 642.1, -7.9],
  ['Transfers of $10k+ to services ($B)', 591.5, 488.6, null],
  ['Crypto ATM volume ($M)', 17.3, 33.9, null], // "nearly doubling"
  ['Romania -> instant exchanges ($M)', 26.4, 41.8, 59],
];

const pct = (a, b) => ((b - a) / a) * 100;

for (const [label, a, b, stated] of figures) {
  const calc = pct(a, b);
  // A stated whole-number % should sit within 0.5 points of what its own inputs give.
  const ok = stated === null ? '-' : Math.abs(calc - stated) <= 0.5 ? 'ok' : 'off';
  console.log(label.padEnd(40), calc.toFixed(2).padStart(8), String(stated ?? '').padStart(8), ok);
}

const shares = [
  ['Russia share of the region', 284.1, 642.1, 44],
  ['Romania H2 2025 share of its instant-exchange year', 25.1, 41.8, 60],
];
for (const [label, part, total, stated] of shares) {
  const calc = (part / total) * 100;
  console.log(label.padEnd(52), calc.toFixed(2) + '%', 'stated ' + stated + '%',
    Math.abs(calc - stated) <= 0.5 ? 'ok' : 'off');
}
Enter fullscreen mode Exit fullscreen mode

Output

Eastern Europe crypto economy ($B)          697.1    642.1    -7.89     -7.9  ok
Transfers of $10k+ to services ($B)         591.5    488.6   -17.40           -
Crypto ATM volume ($M)                       17.3     33.9    95.95           -
Romania -> instant exchanges ($M)            26.4     41.8    58.33       59  off

Russia share of the region                             44.25%    stated 44%  ok
Romania H2 2025 share of its instant-exchange year     60.05%    stated 60%  ok
Enter fullscreen mode Exit fullscreen mode

Five of six line up. The 17.4% fall in large transfers matches the figure Cointelegraph quotes, and the ATM rise of 95.95% fits the report's "nearly doubling".

The one that's off

The report says instant-exchange activity in Romania grew 59%, and it gives the inputs as $26.4 million and $41.8 million. Those give 58.33%.

Before calling that an error, check what rounding can hide. The inputs are printed to the nearest $0.1 million, so the true values could be anywhere from 26.35 to 26.45 and from 41.75 to 41.85. The widest growth inside those bounds is 41.85 / 26.35, about 58.8%, and that rounds to 59.

const maxGrowth = (a, b, step = 0.1) => pct(a - step / 2, b + step / 2);
console.log(maxGrowth(26.4, 41.8).toFixed(2)); // 58.82
Enter fullscreen mode Exit fullscreen mode

So the 59% is consistent with the report's own figures if it was computed from unrounded data, which is the usual practice. My 0.5-point tolerance was too tight for inputs with three significant figures. The better test compares the stated % with the range the rounded inputs allow, and flags it only when it falls outside that range.

None of this changes the story. Romania announced a tax rise on crypto gains from 10% to 16% in July 2025, and instant-exchange use jumped for two quarters before returning to the regional average.

Why bother

A percentage is easier to repeat than the two numbers behind it, so it travels further. When a report prints both, recomputing takes a minute and tells you which figures you can quote as they are. When it prints only the percentage, you have nothing to check against.

The full script with aligned output is in a single file; copy the rows from any report that prints before-and-after values and it works the same way.

Sources: Chainalysis, "Refugees, ATMs, and Tax Shifts: What's Driving Crypto in Eastern Europe" (Nov 17, 2026); Cointelegraph, "Eastern Europe crypto flows fall 7.9% as Ukraine draws $12B in stablecoins" (Nov 17, 2026).

Top comments (0)