Create an Interest-Bearing Token on Solana

Create an Interest-Bearing Token on Solana
Arc theme: SPL Tokens
Web2 bridge: Tokens are like in-app currencies, but interoperable across every application on the network
The Scenario
Every fintech app you have used in Web2 shows you an interest rate. Savings accounts display APY. Lending platforms show accrued interest in real time. The number in your balance ticks upward without you doing anything. It feels like magic, but it is really just math applied to a timestamp.
Solana has this concept built directly into the token layer. The Token Extensions Program includes an interest-bearing extension that attaches a continuous compounding rate to any mint. The balances on-chain do not actually change; instead, any wallet or application that reads the token uses a formula to display an interest-adjusted amount based on how much time has passed. Think of it like a savings account where the “display balance” grows over time, but the ledger entry stays the same until someone explicitly mints or transfers tokens.
Today, you are going to create an interest-bearing token from scratch using the CLI. You will set a rate, check how the UI amount differs from the raw balance, and see how Solana handles time-based calculations at the protocol level.
The Challenge
What You’ll Need
- Solana CLI installed and configured to devnet (
solana config set --url devnet) - A funded devnet wallet (run
solana airdrop 2if your balance is low) - The
spl-tokenCLI (installed alongside the Solana CLI tools) - A terminal
Steps
-
Confirm you are on devnet and have SOL to work with:
solana config get solana balanceYou need at least 0.5 SOL for the rent costs of creating a mint and token account.
-
Create a new token mint with the interest-bearing extension enabled. The rate is specified in basis points, where 100 basis points equals 1%. You will set a 5% annual rate (500 basis points):
spl-token create-token \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb \ --interest-rate 500The
--program-idflag tells the CLI to use the Token-2022 program (Token Extensions) instead of the original SPL Token program. Save the mint address that gets printed; you will need it in the next steps. -
Create a token account for your new mint:
spl-token create-account YOUR_MINT_ADDRESS \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb -
Mint 1000 tokens to your account:
spl-token mint YOUR_MINT_ADDRESS 1000 \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb -
Check your raw token balance:
spl-token balance YOUR_MINT_ADDRESS \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEbThis will show 1000. Now check the interest-adjusted UI amount:
spl-token display YOUR_MINT_ADDRESS \ --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEbLook for the interest-bearing configuration in the output. You should see your rate (500 basis points) and the initialization timestamp.
-
Wait a few minutes, then check the UI amount again using the
amountToUiAmountapproach. You can query this through the Solana RPC:solana account YOUR_MINT_ADDRESS --output jsonThe interest-adjusted display amount will be slightly higher than 1000, because continuous compounding has been applied since the moment you minted. At 5% annual, you will not see a dramatic change in minutes, but the math is running.
-
Update the interest rate to something more dramatic so you can observe the effect more clearly. Set it to 150% (15000 basis points):
spl-token set-interest-rate YOUR_MINT_ADDRESS 15000Now wait another minute or two and check the display amount again. The growth should be noticeably faster.
What Just Happened
You created a token that displays an ever-increasing balance to anyone who reads it through a UI-aware interface. The actual on-chain balance in your token account never changed from 1000. What changed is the formula that wallets and applications use to present that balance to users. The extension stores a rate and a timestamp, and any reader can calculate: “given this rate and this elapsed time, the display amount should be X.”
This is how Solana handles interest at the protocol level without requiring a background process to mint new tokens every second. The formula uses continuous compounding (A = P * e^(rt)), the same math behind compound interest in traditional finance. The rate authority (your wallet, in this case) can update the rate at any time, and the extension preserves the historical average so that past accrual is not lost when the rate changes.
In Web2, showing interest requires a backend service, a database, and a scheduled job. On Solana, it is a property of the token itself. Any application on the network that understands Token-2022 will display the adjusted amount automatically, with no coordination required between services.
Resources
- Interest-Bearing Tokens, Solana Documentation
- Token Extensions Overview, Solana Documentation
- @solana/spl-token on npm (for programmatic usage in JavaScript)
- Interest-Bearing Token Course, Solana Developers
Submission
Take a screenshot showing your terminal output from the spl-token display command, including the interest-bearing configuration with your rate and timestamps. Submit it here!