Why a wallet has empty accounts
Where empty token accounts come from, why they hold SOL, and how a cleanup closes them and returns it.
Most wallets that have traded a few tokens hold SOL they can't see: the rent in accounts that hold nothing. This guide explains where they come from, and how Burn & Claim gets the SOL back.
One account per token
A Solana wallet doesn't hold tokens itself. Each token it holds sits in a token account of its own, made the first time the wallet received that token. Solana keeps a deposit of SOL, called rent, in every account for as long as it exists, so each token account holds some of the wallet's SOL.
How an account ends up empty
When a wallet sells, swaps or sends away all of a token, the balance goes to zero, but the account usually stays open, and its rent stays in it. Whether it's closed depends on the app that moved the token: some close the account in the same transaction, and many leave it open. That's why the same NFT can leave an empty account behind when it's sent from a wallet, and none when it's sold through a marketplace that closes the account as it sells.
An empty account does nothing for the wallet. If the wallet receives that token again, a new account is made for it; whoever sends the token usually pays that account's rent.
Getting the SOL back
Closing an empty account returns its rent to the wallet. The account must hold nothing first, which is why a token the wallet no longer wants is burned (or compressed) before its account closes.
The Burn & Claim app finds every empty account in a wallet and closes them together, in as few wallet approvals as it can. Through the API:
GET /v1/wallets/{address}/assetslists them as assets of kindempty_account, each with acloseaction and what it returns (reclaimLamports), costs (feeLamports) and leaves in the wallet (netLamports).- Select them, quote, and run the rounds as How a cleanup works describes. The scan a wallet and reclaim SOL recipes do it with the SDK.
Burn & Claim's fee is a share of what each close returns, shown in the quote before the wallet signs: see Fees and donations. Solana also charges its own network fee for each transaction.
Accounts that hold extra SOL
Solana lowered rent, so a token account opened before holds more SOL than today's rent-exempt minimum: extra SOL. The scan says how much in excessLamports, and the withdraw_excess action gives it back and keeps the account open, for a token the wallet still wants. How extra SOL works explains it, and the get extra SOL back recipe shows it.
Accounts that can't be closed
A token's issuer can freeze its token accounts. A frozen account can't be closed until the issuer thaws it, so the scan offers no action for it and says why (blockedReason: frozen).
Prove your payout wallet
Prove the wallet your organization's donations and fee share go to, from a wallet app, with one Squads member's signature, or from any multisig with a memo.
Developer leftovers
Unfinished program uploads, programs, their IDLs, lookup tables and durable nonces a wallet can close, what each returns, and what no wallet can close.