1

Here's a common scenario: Suppose an associated token account has 100 tokens of a token whose Decimal is 8. If we scale up the balance wrt the decimals of the token, the balance is 100 * 10^8, or plainly: 10000000000.

Now lets assume this account interacts with some smart contract such that it needs to make 5 token transfers of equal amounts. This is easy since the division is neat and clean. 100/5 = 20. Therefore, you would transfer 2000000000 of the token account balance in each transfer instruction.

Now lets assume this account once again holds it's original balance and now needs to make 9 transfers of equal amounts. The division is no longer so simple: 100/9 = 11.1111111111 and decimals are now involved in the scaled up version of the token balance.

How should this situation be handled (9 equal transfers that total up to 100 tokens with 8 decimal places)? Should we simply ignore the decimals portion in the scaled up token balance number?

1 Answer 1

3

Solana tokens are not infinitely divisible.
The smallest amount of token is defined by the decimals option. You simply can't divide the token any further.

So if you have 10*100,000,000 tokens and you want to divide it equally among three people, it simply isn't possible.

You'll have to send the three people 333,333,333 tokens each and give the remaining 1 to someone else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.