Docs

Reclaiming SOL from leftover program buffers

If you have ever deployed a Solana program, a failed or interrupted deploy may have left a buffer account behind, holding enough SOL to store the whole program — often 1 to 5 SOL. Closing it returns that SOL to the wallet that deployed it.

At a glance

Program buffers
SOL heldThe rent for the program uploaded into it, often 1 to 5 SOL
Listed whenYour wallet is the buffer’s authority
Closing doesThe upgradeable loader’s close instruction, returning the whole balance to your wallet
Our feeA flat 5%, from funded and empty wallets alike (fees)
In "Claim All"Only when you switch the card on, and the card asks you to confirm

How they get left behind

solana program deploy does not write a program straight into place. It first uploads the program into a buffer account, in many small transactions, and only then swaps it in. The buffer has to hold rent for every byte of the program, which for a typical program comes to a couple of SOL.

When the deploy succeeds, the buffer is used up. When it fails partway — an expired blockhash, a dropped connection, too little SOL for the last step — the buffer stays, with its SOL, until its authority closes it. The CLI prints a recovery phrase to resume the upload, which is easy to lose track of, so many of these buffers are simply forgotten.

Before you close one

Only close buffers you no longer need. If a deploy is still running, or you uploaded a buffer on purpose to upgrade a program from it later, closing it means uploading the program again. Nothing on chain tells an abandoned buffer from one kept on purpose, so the card asks you to confirm, and stays out of "Claim All" until you switch it on.

Closing never loses SOL: the whole balance goes back to your wallet, minus our fee. Only buffers whose authority is your wallet are listed, so a buffer handed to a multisig for an upgrade proposal never appears.

Questions

What is a program buffer?

When you run "solana program deploy", the program is first uploaded into a temporary buffer account, which holds enough SOL in rent to store the whole program. A successful deploy uses the buffer up. A deploy that fails or is interrupted leaves it behind, still holding that SOL.

When should I not close one?

If a deploy is still running, or you uploaded the buffer on purpose to upgrade a program from it later. Closing it then means uploading the program again. Nothing on chain says which buffers are abandoned, so the choice is yours, and the card asks you to confirm.

Which buffers are listed?

Only buffers whose authority is your wallet. A buffer handed to a multisig for an upgrade proposal has a different authority, so it never appears here.

Why is the fee lower for buffers?

Buffers hold far more than other accounts, often 1 to 5 SOL, so the fee is a flat 5%, for funded and empty wallets alike.

The other kinds of account: empty token accounts, stake accounts and Serum and OpenBook accounts.

Scan a wallet for program buffers