How does token rounding change a bridge payout?
For a cross-chain payout, plan around the destination token’s smallest unit, and treat extra quoted digits as uncertain until you know the rounding rule. Token decimals set the smallest amount a token can represent. They can make a tiny difference to the payout, but they do not explain larger changes caused by exchange rates or network costs.
Token decimals set the smallest payable step
Decimals tell wallets how to display a token’s smallest units as a human-readable amount. A token with 6 decimals has a smallest step of 0.000001; one with 18 decimals has a step of 0.000000000000000001.
The blockchain records whole numbers of these smallest units, rather than fractions of a unit. For an ERC-20 token, the Ethereum standard EIP-20 describes the decimals value as a way to convert that whole number into a displayed amount. The standard makes this field optional, so a token’s name or symbol alone does not confirm its precision.
That precision belongs to the specific token contract on a specific network. A token with the same name on Polygon and Ethereum can have different contract details. Check that the destination wallet, such as MetaMask, is set to the intended network and token before relying on the number of displayed digits.
A swap quote can contain more digits than the payout
A swap calculation may produce a fractional result that the destination token cannot represent. The payout must be converted to a whole number of the token’s smallest units, which means some rounding rule has to apply.
For example, suppose a quote estimates 12.3456789 of an illustrative token with 6 decimals. The token can represent 12.345678, but not the final 0.0000009. Rounding down gives 12.345678; rounding to the nearest smallest unit gives 12.345679. The service’s calculation determines which result is used.
When planning, use the amount rounded down to the token’s smallest step as a conservative estimate. Do not assume that every service truncates, rounds to the nearest unit, or displays every digit it calculates. Ethereum’s token standard explains how decimals are displayed; it does not set a universal rounding rule for swap payouts.
Rounding affects tiny fractions; other costs affect the total
Rounding usually changes less than one smallest unit of the destination token per calculation. With 6 decimals, that is less than 0.000001 token. The fraction is sometimes called dust, meaning an amount too small to represent or transfer on that token.
That is different from a network fee or a change in the exchange rate. For instance, if the estimated amount moves from 12.3456789 to 12.345678, the missing fraction fits the rounding example above. If it drops by 0.02, decimals alone cannot explain it; the rate, costs, or another part of the quote may have changed.
Repeated conversions can add small rounding differences because each calculation may discard a fraction. For someone swapping only a few times a year, the useful check is simple: compare the quoted and received amounts at the destination token’s actual precision, rather than counting extra digits as guaranteed value.
Check the destination token before sending
Before a swap, confirm the destination network and the token contract or verified asset entry, then check how many decimal places that token uses. If a quote shows more digits than the token supports, ask what rounding rule sets the final amount; if the difference is larger than one smallest unit, look for another explanation.
The Ethereum documentation describes wei as the smallest unit of ETH, while EIP-20 describes the display conversion for tokens. The same basic idea helps when a cross-chain swap starts with Monero and pays out a token: decimals define the payout’s smallest step, while the swap calculation defines how the amount reaches it. For that workflow, a wallet-based XMR bridge is one way to route the swap from your own wallet. Practical tip: judge the payout using the destination token’s smallest unit, not the number of digits shown in a quote.
Comments
Post a Comment