Skip to main content
An equity token account holds the raw amount. Show the user that amount scaled by the mint’s ScaledUiAmount multiplier.
1

Set Up

Imports, env config, and the user wallet used across every step.
2

Fetch the Equity Mints

Fetch the supported equities and index them by mint.
3

Read Each Mint's Token Program

Read each mint account’s owner to find the token program that holds its balances.
4

Fetch the User's Equity Token Accounts

With jsonParsed encoding, the RPC returns the raw amount and a uiAmountString that already applies the mint’s current multiplier.
Display uiAmountString, and pass the raw amount as the order endpoint’s amount to sell a full balance.
5

Compute the Scaled UI Amount from the Mint

The token program uses newMultiplier from newMultiplierEffectiveTimestamp onward and multiplier before it, and truncates the scaled amount before dividing by 10^decimals.