Trading Infrastructure
Token Decimals Change Screens, Not Onchain Balances
Token decimals tell wallets how to scale integer balances; mistakes can misstate holdings, distort quotes and break minimum-size checks without moving funds.
Since ERC-20 was created on November 19, 2015, token decimals have changed displayed balances by telling interfaces how many places to shift an integer, not by changing the integer held onchain. The standard made decimals optional metadata: a value of 6 means dividing a raw balance by 1,000,000 for display. That design moved denomination handling out of the ledger and into wallets, exchanges and trading interfaces, enabling one integer-based token interface to represent assets with different precision.
How do token decimals change a wallet balance?
A wallet calculates the visible amount as the raw balance divided by 10 raised to the token’s decimals. A contract balance of 1,234,500 therefore displays as 1.2345 tokens when decimals is 6. Read with 18 decimals, the same integer displays as 0.0000000000012345. No assets appeared or vanished; only the unit label changed.
The reverse happens when a user submits a transfer. Sending 1.25 units of a six-decimal token requires the integer 1,250,000. Smart contracts transfer that integer. Front ends parse the human amount before the call and format the returned integer afterward. This is why a wrong decimal setting can show an alarming balance or construct an oversized transaction even though the token contract’s accounting remains internally consistent.
Why do tokens use different decimal counts?
Different decimal counts trade familiar denominations against granularity. OpenZeppelin’s widely used ERC-20 implementation defaults to 18, matching Ether’s relationship to wei, while Circle specifies six decimals for native USDC. Six decimals makes one smallest USDC unit equal to 0.000001 USDC; 18 permits much finer fractions.
Before ERC-20-style metadata, each application could impose its own denomination convention. The optional decimals field gave builders a common query, but not a universal value or a guarantee that metadata exists. That flexibility supports currencies, governance assets and receipt tokens through one interface, while forcing integrations to normalize every asset separately.
- Read decimals from the correct token contract on each chain; never assume 18.
- Keep raw amounts as integers or arbitrary-precision values until display.
- Normalize both assets before calculating prices, slippage or minimum trades.
- Treat missing or contradictory metadata as an integration error, not a cosmetic glitch.
Can token decimals change prices or liquidity?
Decimals do not change economic value when an integration scales both sides correctly, but a scaling error can corrupt a quoted price, deposit ratio or minimum-output check. An automated market maker holds raw integer reserves. Its interface must normalize those reserves before telling a trader how many units one token buys.
The roles are unchanged by presentation: liquidity providers supply both pool assets and bear inventory and impermanent-loss risk; traders take execution and slippage risk and pay the swap fee; providers generally earn that fee, while some protocols direct a configured share to a protocol recipient. The Fraxswap liquidity-provider example shows why reserve movements, not decimal formatting, create the provider’s economic exposure.
Our view: decimals are an integration-risk multiplier, not tokenomics. They let builders reuse integer arithmetic across radically different assets, but one hard-coded assumption can make an otherwise sound market unsafe to use. What remains unknowable from a ticker alone is the authoritative precision: canonical, bridged and wrapped versions may differ, so only the deployed contract and its verified integration settle the question.
Topics in this dispatch
- Trading Infrastructure
- Liquidity and Flows