AgentCap

← Blog

USDC has six decimals: the small unit mistakes in agent spend math

GetAgentCap team · published 10/17/2026

USDC on Base and on Solana both use six decimal places, while ETH uses eighteen and SOL uses nine. An agent spend ledger that mixes those up is off by orders of magnitude, and the error is quiet because every number still looks like a number.

Raw amounts are integers

On-chain, a USDC transfer carries an integer amount in the token's smallest unit. With six decimals, 1,000,000 raw units is 1 USDC and 10,000 raw units is one cent. Nothing in the event tells you the decimals; they are a property of the token contract or mint.

A tracker has to read the decimals for the specific token, not assume them. Hard-coding 18 because most EVM tokens use it turns a 5 USDC payment into a rounding error.

Where the mistakes creep in

Summing in floating point is the usual one: adding many small payments as floats drifts in the last digits. Keep the raw integer total and convert once, at display time.

The second is mixing assets in one total. ETH or SOL fee amounts use different decimals and different prices, so they cannot be added to a USDC total without conversion, and a budget in USDC should say plainly whether fees are in or out.

A cheap sanity check

Pick one transfer from a block explorer and compare its human-readable amount with what your ledger shows. If the explorer says 0.25 USDC and your ledger says 250000 or 0.00000000000025, the decimals are wrong. One comparison catches the whole class of bug.