Stablecoin supply dashboard
A cross-issuer view of stablecoin supply on Solana: read each mint's supply with one call, store snapshots in SQLite, and print every issuer's share of the set and its change since the last row, with a Token-2022 mint included.
Supply is a mint field
Every SPL token mint account stores its own supply, the total base units in existence, next to its decimals. The number changes only when the mint authority mints or a holder burns, so a single read of the mint answers how much of a token exists. You never add up holder balances. getTokenSupply returns that field as amount, a string of base units, with decimals and a ready-made uiAmountString. The response also carries a context.slot, the slot the node answered at.
A stablecoin supply dashboard is that read repeated for several mints and written down. One row per mint per run gives you a series for each issuer, and from the series you can work out each issuer's share of the set at every point. Questions about holders are a different job. Carbium does not serve getTokenLargestAccounts, which answers -32601, and a supply chart has no use for it anyway.
Every supply read names finalized, so a stored row never needs correcting later.
Choosing the mints
The tracked set is a list of mint addresses. The script starts with three, and adding an issuer means adding one line.
| Symbol | Mint | Token program | Decimals |
|---|---|---|---|
| USDC | EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v | Token | 6 |
| USDT | Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB | Token | 6 |
| PYUSD | 2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo | Token-2022 | 6 |
The address is the one input you have to get right. A look-alike token with the same ticker has its own mint and its own supply, and the chart would happily plot it. Copy each address from the issuer's own list of Solana mints and open it in an explorer before you trust it. The script stores the decimals the node returns beside every amount, so a wrong assumption about decimals cannot hide in the data.
PYUSD is a Token-2022 mint, and getTokenSupply answers for either token program in the same shape, so the script has no branch for it. Token-2022 mints can carry extensions, and two of them touch a supply reading. An interest-bearing or scaled-amount mint turns raw base units into a displayed amount through a rate, so compare the raw amount between runs and treat uiAmountString as a display value. A transfer-fee mint keeps its withheld fees inside token accounts, and those fees stay part of the supply. For a first look at one mint and its authorities, Token mint supply and authorities goes through the mint account field by field.
Reading issuance and burns from deltas
Between two rows, a positive change means more was minted than burned in that interval, and a negative change means the reverse. The net is all the supply field can tell you. A mint of 50 million and a burn of 50 million between two rows looks like zero.
- Rows far apart hide churn. Rows closer together expose more of it, down to single mint and burn events, and cost more calls.
- A share can fall while the mint behind it is unchanged, because another tracked mint grew. Read the supply column before you blame the issuer whose share moved.
- Compare changes on the same footing. The script prints the span of finalized slots each run read, and a row taken far from the others should be flagged in your chart.
- To see the transaction behind a jump, list the mint's recent transactions with getSignaturesForAddress on the mint address, then read them with getTransaction and maxSupportedTransactionVersion: 1, since mainnet carries v1 transactions and Carbium answers -32015 for one when the value is absent or 0. A mint or burn lists the mint account, and so does every checked transfer, so filter by instruction type.
Carbium keeps those signature pages in its own address index, which reaches back 30 days. A page that comes back empty past that is the index's age limit, and the mint may have older transactions. Your own table is therefore the long record: an issuance event from last quarter is visible only as a step between two of your rows.
Where it ends
- On-chain supply is the Solana slice of an issuer. The same stablecoin on other chains is a separate supply, and this chart cannot add it.
- Supply says nothing about reserves. It counts tokens that exist, and whether an issuer holds assets behind them is a question for its own attestations.
- Supply is not circulation. Tokens sitting in issuer or treasury accounts count in full.
- A wrapped version of a stablecoin has its own mint and is invisible until you add that mint to the list.
- The call answers for the present. History before your first row has to come from your own earlier snapshots.
- A freeze, a pause or a blocked account leaves the supply number untouched.
- The script is read-only. It signs and sends nothing.
When it goes wrong
| what goes wrong | what to do |
|---|---|
| A holder concentration view is attempted with getTokenLargestAccounts and every call fails. | Carbium does not serve it and answers -32601. Do not retry. A supply chart only needs getTokenSupply on the mint. |
| One mint's call fails and the shares of the others look inflated. | The script sums only the mints that answered and prints how many it covered. Shares come from the amounts read in that run, so rerun once the missing mint answers and read the covered count first. |
| Supply is compared as a float, or two mints with different decimals are compared in raw base units. | Keep the amount as a BigInt of base units, store it as text, and scale to a common number of decimals before computing a share. |
| The chart plots the wrong token because a mint address came from a search result. | Copy the address from the issuer's own list of Solana mints, then check it in an explorer. A look-alike with the same ticker has a different mint. |
| A longer list of mints starts to return 429. | Promise.allSettled sends every mint at once, so a long list can pass the rate limit together. Split the list into groups, and when a call gets 429 wait the retry-after hint it carries before sending the next group. |
Questions
How do I read the supply of a stablecoin on Solana?
Call getTokenSupply with the mint address. It returns the raw amount, the decimals and the slot it answered at. One call per mint is enough.
Is on-chain supply the same as circulating supply?
No. It counts every token that exists, including those held in issuer or treasury accounts, and it covers Solana only. Circulation and reserves come from the issuer.
How do I add an issuer or a wrapped mint to the tracked set?
Add one line to the MINTS list with a symbol and the mint address copied from the issuer's own list of Solana mints. The new mint prints first row on its first run, and every other share shifts because a share is a slice of the set.
Does a Token-2022 mint need different code?
Not for supply. getTokenSupply answers for either token program in the same shape. Compare the raw amount between runs, since an interest-bearing or scaled-amount extension changes the displayed value.
Can I get the supply as it was last month?
Not from this call, which reports the present. Store a row each run and the history is yours from the first row on.