Jump to content
Tareom

News from across crypto

Empty Solana token accounts: reclaim SOL from rent

How to close empty Solana token accounts to reclaim SOL: empty each account, close it, and return its rent deposit to your wallet—about 0.002 SOL per account.

The Tareom Editors5 min read

Empty Solana token accounts: reclaim SOL from rent

You can reclaim SOL from empty Solana token accounts by closing each account with your wallet or the spl-token CLI; its rent-exempt deposit is sent to the address named in the closing transaction.

  • An SPL token account is 165 bytes and holds about 0.002 SOL as a rent-exempt deposit.
  • The exact deposit depends on the network’s rent rate.
  • CloseAccount requires a zero token balance and sends the account’s lamports to a specified destination.

Every token you have held can leave a separate account behind, including airdropped dust or tokens you sold after a rugcheck flagged them. A rugcheck is a review for token risks that may point to a scam or rug pull. The linked topic adds context on locked liquidity, a separate risk signal to weigh during a rugcheck: rugcheck LP locked.

What to have ready

Have access to the wallet that owns the token accounts, and keep a little SOL in it for network fees. You can use a wallet interface with a close-account option, or Solana CLI with the spl-token command-line tool.

You are closing a token account, not deleting the token itself or your wallet. The token account is the on-chain account that holds a particular token for your wallet. Closing it returns the rent deposit to a destination in the transaction. Make sure you control that destination.

To find accounts, look at your wallet’s token list or search your wallet address on Solscan. With the CLI, run spl-token accounts to list token accounts. The list can include accounts with tiny balances, so identify those you want to empty and close before signing anything.

Close the empty accounts

  1. List your token accounts. Use Solscan or run spl-token accounts. You should see the accounts associated with your wallet and their token balances.
  2. Empty any account with a balance. Burn the remaining tokens or transfer them to another address you control. A token account with a non-zero balance cannot be closed with CloseAccount. After the burn or transfer completes, the account should show a zero balance.
  3. Close each zero-balance account. In your wallet, choose its close-account action. For the CLI, run spl-token close --address <ACCOUNT>, replacing the placeholder with the account address. CLI users can also run spl-token gc to close all empty accounts in one go. The transaction should show the account being closed and the destination for its SOL.
  4. Confirm the destination, then sign. Read the transaction preview before approving it. Confirm that the SOL is going to your own wallet address, especially if you are using a third-party cleanup tool. Once the transaction completes, compare your SOL balance with its earlier value; it should rise by roughly the rent returned for each account, less network fees.

Why closing returns SOL

Solana requires these token accounts to keep a rent-exempt deposit. That deposit is not a fee paid when you first create the account. It remains held in the account while the account exists, and closing the account returns its lamports—the smallest unit of SOL—to the destination specified by the transaction.

The CloseAccount instruction is the operation that closes an SPL Token account. Its zero-balance requirement is why you must burn or transfer leftover tokens first. A token account holding even a small amount of dust is not ready to close. After emptying it, the closing transaction can release the deposit.

The amount you recover is approximate because the rent-exempt deposit is set by the network’s rent rate. The 165-byte account size gives a useful reference, and the planned recovery is about 0.002 SOL per account. Your wallet balance change may be lower after transaction fees, and the total depends on how many accounts you close.

Token-2022 accounts follow the same basic idea: empty the account, then close it so its deposit can return to the chosen destination. Available close options can depend on the account and token, so use the transaction preview to verify the destination and details before approving.

Avoid sending the recovery elsewhere

CloseAccount sends the SOL to the destination named in the transaction. That makes the destination check essential: a valid close can still send the recovered SOL somewhere other than your wallet if the transaction names another address. In a third-party cleanup tool, treat the preview as the final check before you sign, and confirm that the receiving address is yours.

Close accounts you no longer need, but do not rush through a batch transaction. Keep the list of accounts and the preview in view so you can spot a balance that has not been emptied or an unexpected destination. The practical check is simple: the account is at zero, the preview names your address, and the SOL balance rises after confirmation.

When cleaning up dust from a token you sold after a rugcheck, verify that each account is actually empty before closing it. That catches the common mistake of trying to close an account while a tiny token balance still blocks the transaction.