kendra-koepp

How Do Token Decimals Change a Swap Quote?

If you swap only a few times a year, decimals help you check whether a quoted amount is precise enough to send. They tell you how small a piece of an asset can be recorded, so a displayed number may hide a tiny remainder. On a cross-chain swap such as Chainflip, the source and destination assets can use different smallest units.

Decimals set the smallest amount a network can record

A token’s decimals count how many digits can sit after the decimal point in its usual display. One ETH has 18 decimal places, so the network records it in wei: 0.1 ETH equals 100,000,000,000,000,000 wei. SOL has 9 decimal places; 0.123456789 SOL is exactly 123,456,789 lamports.

These smallest units are often called base units: the integer amounts stored and moved by the network. A quote may show a friendly amount such as 0.1 ETH, while the transaction uses its full base-unit value. The Ethereum ERC-20 standard describes a token’s decimal count as information for displaying amounts; Solana’s token documentation says each token mint stores its decimal count.

Decimals vary by asset. Do not assume every token uses 18, or that two assets with the same ticker have the same precision. For a token, its contract or mint record is the source for the decimal count.

A quote converts between display amounts and base units

A swap quote starts with an input amount, converts it to the source asset’s base units, then estimates the destination amount and displays it using that asset’s decimals. The two sides can therefore show very different numbers of decimal places, even when the quote is internally consistent.

For example, imagine a quote for 0.123456789 SOL. That amount is exactly representable because SOL supports nine decimal places. If an amount is more precise than the asset allows, the excess cannot be sent as a fraction of a base unit. Depending on the system, the amount may be rejected or rounded down; the final valid amount is set by the asset’s precision.

Rounding affects only the smallest unit, but that unit’s value differs across assets. A quote for BTC cannot pay a fraction of a satoshi, just as a SOL transfer cannot include a fraction of a lamport. The rate, fees, and price movement can also change the destination amount; those are separate from decimal precision.

Check the final digits before you confirm

Suppose you are swapping a small amount of ETH to SOL before a trip. Read the input as the amount you intend to spend, then look at the output’s final displayed digits. Check that the output is plausible for SOL’s nine-place precision, and compare the quoted amount again if you change the input or wait before confirming.

The key edge case is a tiny output: rounding down by one base unit may be a noticeable fraction of the amount when the swap is very small. If a quote’s final digits matter to you, use an amount that the asset can represent exactly and review the refreshed quote before proceeding. Chainflip is one way to swap native assets across networks; its relevance here is that each side’s own precision still shapes how a quoted amount is expressed.

In short, decimals determine valid precision, while the quote estimates value across two assets. Check each side in its own units, confirm the destination amount is sensible, and use Chainflip as a concrete example of a native cross-chain swap.