Skip to content

​What Is the Scaled UI Amount Extension?

The Token Extension Program’s ScaledUiAmount mint extension lets a mint apply an updatable multiplier to the UI amount displayed for token balances. This is useful when a token represents a real-world asset or instrument, such as a stock split or dividend. For example, a stock split doubles the number of shares for all holders. Without changing every token account balance, ScaledUiAmount lets wallets and applications display a new UI amount using the mint’s multiplier. This feature can also be used for dividends or distributing yield. No new tokens are created. The token amount stored in token accounts stays the same. Only the displayed UI amount changes.
Incompatible ExtensionDo not enable ScaledUiAmount and InterestBearingConfig on the same mint. The Token Extension Program rejects that extension combination.

​How Scaled UI Amount Works

  • ScaledUiAmountConfig stores the update authority, multiplier, new_multiplier, and new_multiplier_effective_timestamp.
  • Before new_multiplier_effective_timestamp, conversions use multiplier. At or after that timestamp, conversions use new_multiplier.
  • UpdateMultiplier can apply a new multiplier immediately or schedule it for a future Unix timestamp.
  • AmountToUiAmount, UiAmountToAmount, and the extension conversion helpers use floating-point arithmetic for scaled UI amount mints, so conversions are not guaranteed to round-trip exactly.

​Before you start

The examples on this page run against a local validator at http://localhost:8899 (WebSocket ws://localhost:8900) and fund their accounts with airdrops from it. Start one in a separate terminal with Surfpool (surfpool start) or solana-test-validator. Each code section below lists the packages or crates it needs. The TypeScript examples use top-level await, so run them as ES modules, for example with npx tsx index.ts in a project whose package.json sets "type": "module".

​How to Use Scaled UI Amount

To use scaled UI amount:
  1. Calculate the mint account size and rent needed for the mint and the ScaledUiAmount extension.
  2. Create the mint account with CreateAccount, initialize ScaledUiAmount, and initialize the mint with InitializeMint.
  3. Use AmountToUiAmount, UiAmountToAmount, or client helpers when displaying balances or converting UI amounts.
  4. Use UpdateMultiplier to update the displayed multiplier immediately or at a future Unix timestamp.
Instruction OrderScaledUiAmountMintInstruction::Initialize must come before InitializeMint. CreateAccount, ScaledUiAmountMintInstruction::Initialize, and InitializeMint must be included in the same transaction.

​Guides

​Source Reference

ItemDescriptionSource
ScaledUiAmountConfigMint extension state that stores the authority, current multiplier, next multiplier, and the timestamp when it takes effect.Source
ScaledUiAmountMintInstruction::InitializeInstruction that initializes ScaledUiAmount on a mint before InitializeMint.Source
ScaledUiAmountMintInstruction::UpdateMultiplierInstruction that sets a new multiplier and the Unix timestamp when it takes effect.Source
amount_to_ui_amountHelper that converts a token amount to a UI amount string using the current multiplier, decimals, and timestamp.Source
try_ui_amount_into_amountHelper that converts a UI amount string back into a token amount using the current multiplier, decimals, and timestamp.Source
process_initializeProcessor that initializes ScaledUiAmountConfig and stores the initial multiplier on an uninitialized mint.Source
process_update_multiplierProcessor that validates the authority, updates the scheduled multiplier, and applies it immediately when appropriate.Source
process_amount_to_ui_amountToken program conversion path that uses ScaledUiAmountConfig when a mint has the extension enabled.Source
process_ui_amount_to_amountToken program conversion path that converts a UI amount back into a token amount for scaled UI amount mints.Source

​Kit

These examples use the generated Token-2022 instructions directly.
Terminal
Instructions

​Web3.js v3

These examples use the class-based @solana/web3.js v3 API with @solana-program instruction builders.
Terminal
Instructions

​Rust

Add these dependencies to Cargo.toml (tested with Rust 1.89, 1.98, and 1.99):
Cargo.toml
Rust

​Web3.js (legacy)

These examples use legacy @solana/web3.js with @solana/spl-token.
@solana/web3.js 1.x is no longer actively maintainedIt receives critical fixes only. Use Kit for new code. To migrate existing code, follow the Kit upgrade guide, or the web3.js v3 migration guide to keep the class-based API.To run this code, install 1.x with npm install @solana/web3.js@1. A plain npm install @solana/web3.js installs v3, which this code doesn’t run on.
Terminal
Instructions