Max Token Supply Limit
Prerequisite:
- Basic understanding of the Solana blockchain and tokens
Definitions
- Fixed-Point Representation: Representing a decimal number as if it were an integer (e.g., 12.34 as 1234)
The maximum supply for tokens in the Solana Program Library (SPL) is represented using a `u64` integer, an unsigned 64-bit integer. This integer can hold values up to 18,446,744,073,709,551,615 (2^64 - 1), which is the highest possible supply for any SPL token when no decimals are used.
When decimals are added to a token, they impact the maximum supply limit in order to maintain the max # of digits in the fixed-point representation. Each decimal reduces the maximum supply by an order of ten. For instance, with 9 decimals, the maximum supply becomes 18,446,744,073 (take away 9 digits). This relationship between decimals and max supply is shown in the table below:
Decimals | Max Supply |
---|---|
0 | 18,446,744,073,709,551,615 |
1 | 1,844,674,407,370,955,161 |
2 | 184,467,440,737,095,516 |
3 | 18,446,744,073,709,551 |
4 | 1,844,674,407,370,955 |
5 | 184,467,440,737,095 |
6 | 18,446,744,073,709 |
7 | 1,844,674,407,370 |
8 | 184,467,440,737 |
9 | 18,446,744,073 |
This table serves as a guide when creating or minting new tokens on Solana. Verifying transaction amounts to ensure they align with the intended supply and decimal settings is essential, as exceeding these values can lead to errors or failed transactions.