Sign in

Lamports, rent, and account lifecycle

Every account on Solana has a balance. Every account costs something to keep on the chain. Both numbers are measured in the same tiny unit, and both work the way a security deposit at an apartment works: you pay it up front, the chain holds it while the account exists, and you get it back when the account closes. Once that picture is in place, "rent" stops being a worry and becomes a one-time number you look up.

SOL and lamports

A SOL is a big number split into a billion small pieces called lamports. One lamport is the smallest amount of value the chain knows how to talk about. Everything is measured in lamports underneath: balances, fees, storage deposits, validator rewards. SOL is the friendlier label humans put on top of large lamport numbers.

The conversion is exact. One SOL is one billion lamports. Half a SOL is five hundred million lamports. The base fee for one transaction signature is five thousand lamports, or 0.000005 SOL. Storage deposit for a typical token account is around two million lamports, or 0.00204 SOL. The numbers stay in the thousands and millions for almost everything you'll do day to day.

SOL and lamports at human scale 1 SOL = 1,000,000,000 lamports one lamport is one billionth of a SOL amount in lamports what you'd see this for 1 SOL 1,000,000,000 a meaningful balance 0.01 SOL 10,000,000 storage deposit for a small account 0.00204 SOL 2,039,280 storage deposit for a token account 0.000005 SOL 5,000 base fee for one signature 0.000000001 SOL 1 one lamport, the smallest unit Every balance, fee, and storage cost on Solana is measured in lamports. SOL is just the human-friendly way of writing big lamport numbers. Think of lamports as Solana's cents. Most amounts you'll see fit in a small number of digits.

Rent, and why it is almost always a one-time deposit

Every byte of data on the chain has to be held in memory by every validator on the network. Holding data has a cost, and the chain charges for it. The name for that charge is rent.

In the original design, rent was meant to be ongoing. An account paid a small amount each epoch out of its lamports balance, and if the balance ran out, the account was deleted. In practice, almost nobody uses this mode. The system has a second option called rent-exemption: deposit enough lamports up front to cover roughly two years of rent in advance, and the chain stops charging the account. Every account created on Solana today uses this second option, and the language around rent has shifted accordingly. When a developer says "rent" they almost always mean the one-time deposit rather than an ongoing fee.

The size of the deposit scales with the bytes the account holds. A bigger account needs a bigger deposit. The math is fixed: roughly 6,960 lamports per byte, plus 128 bytes of overhead per account. An empty wallet costs about 890,000 lamports. A 165-byte token account costs about 2,040,000 lamports. A 200-kilobyte program account costs about 1.4 SOL.

The deposit scales with the size of the account an empty wallet 0 bytes deposit needed: ~890,880 lamports ≈ 0.00089 SOL just the bookkeeping overhead, since the data is empty a token account 165 bytes deposit needed: ~2,039,280 lamports ≈ 0.00204 SOL enough room for mint, owner, amount, plus the overhead a deployed program ~200,000 bytes (200 KB) deposit needed: ~1,400,000,000 lamports ≈ 1.4 SOL code is big, so the storage cost is significant The math required deposit = (account size in bytes + 128 overhead) × ~6,960 lamports/byte 128 is fixed per account, the rate per byte is fixed by the network Bigger account, bigger deposit. The deposit is fully refundable when the account closes.

Two consequences fall out of this. The first is that every account on Solana has to be sized at creation time. You can't have an account that grows without bound, because growing it later means paying additional deposit to cover the new bytes. The second is that storage cost is paid by whoever creates the account, which is almost always either the user or the program acting on the user's behalf. The program never pays out of its own pocket. The lamports come from the user's wallet at the moment of creation.

The life of an account

Every account on the chain follows the same three-stage life. It gets created, it sits there being read and written, and eventually it gets closed.

Creating an account takes one instruction from the System Program. That instruction does three things in one step: it allocates the right number of bytes for the account's data, transfers the rent-exempt deposit from a payer into the account's lamports field, and assigns ownership to a target program. After this completes, the new account exists, has the right size, holds the right balance, and the listed owner program can start using it.

Holding an account does not cost anything. As long as the rent-exempt deposit is in place, the account stays on the chain indefinitely. Validators keep it in memory, programs read and write its data field as their logic requires, and nothing on the network ever decides to garbage-collect it. There is no per-block fee, no expiration, no need to top up. The deposit just sits there.

Closing an account is two operations packed into one. The owner program zeros out the data field and transfers the entire lamports balance out to a recipient address you specify. Once the balance hits zero, the runtime considers the account uninitialized and free to be created again at the same address by anybody. The data is gone, the bytes are released, and the deposit you paid at creation is now sitting in whatever wallet received it.

The life of an account: create, hold, close 1. Create payer: Alice's wallet action: allocate bytes, deposit lamports, assign owner Alice pays ~2,040,000 lamports 2. Hold state: the account exists, read and written by its owner program fees: none ongoing the lamports sit on the account 3. Close action: zero the data, drain the lamports to a recipient recipient: usually Alice Alice gets back ~2,040,000 lamports Net cost to Alice paid at create: +2,040,000 lamports refunded at close: -2,040,000 lamports net storage cost: 0 lamports The deposit is a hold rather than a payment. It only costs Alice if the account is never closed. This refund pattern is how applications give users their deposits back when they exit.

The refund part is more useful than it looks at first. It means applications that ask users to deposit funds, like a staking program or a raffle, can give the deposit back when the user exits. The user's net storage cost is zero. They paid to hold space while they were using the application, and when they were done, the space went back to the pool and their money went back to their wallet.

What this means when you write code

When your program creates an account, somebody has to pay the deposit. That somebody is one of the accounts listed in the transaction, marked as the payer. Almost always it is the user whose action triggered the creation, since the user is the one who benefits from the new account existing. Your program does not pay out of its own balance.

When you decide how big an account should be, you decide its cost. A 200-byte account is cheap. A 10,000-byte account is fifty times more expensive. There is no penalty for using small accounts, so most production programs keep their accounts as small as the data they need to store.

When you want to clean up after a user, you close the account and send its lamports back to them. The Anchor framework you'll be using has a close constraint that does this in one line. The user gets their deposit back, the account disappears, and the chain has less garbage in it. Programs that don't bother to clean up leave dust everywhere and force their users to pay for storage they no longer need.