Close program

Close a Solana Program and Recover the Rent

Every upgradeable program you have ever deployed parks its bytecode rent in an on-chain account — several SOL for a typical program — and that deposit stays there until the program is closed. This scans your wallet for every program it is the upgrade authority of, tells you what each one is and when it last processed a transaction, and closes the ones you choose, returning the rent straight to your wallet. Closing is permanent, so the whole surface is built to make sure you recognise a program before you burn it.

Close program

The exact total — platform fee plus the real network cost — is quoted in the console before anything is signed.

Closing burns the program id forever

This is the one operation on this site that cannot be walked back in any way: a closed program id can never be deployed again — not by you, not by anyone — and a small tombstone account stays on-chain to enforce that. Your wallet cannot warn you either, because a close shows up there as SOL received. So the warning lives here instead: before anything is signed, a manifest lists every program being closed with its name, size and last activity — the most recently used first — and asks you to type the count (or the program’s own name) to confirm. If a selected program processes a transaction between your scan and the close, the close is refused until you look again.

Know what you are closing first

The scan does the identification the chain makes possible: the program’s on-chain name when it published one, its bytecode size, when it was last deployed, and when it last processed a transaction — linked to that transaction, so you can verify it yourself. A program whose only transaction ever is its own deploy is flagged plainly: “never used since deploy”, the strongest abandonment signal on-chain. The list is ordered oldest activity first, so the most likely leftovers sit at the top and anything still breathing sits at the bottom, marked.

What a close returns

The rent comes back from the account that holds the program’s bytecode — the figure on each row is read live from that account, and it is the figure your wallet receives. The service fee is 5% of the SOL a close actually returns, so a close that returns nothing costs nothing. One caveat, stated where the numbers are: each closed program leaves a tombstone holding about 0.001 SOL that no one can recover — the totals shown already exclude it.

The honest limits

The Solana CLI closes programs for free, and if you know exactly which program id you are closing and trust yourself to type it, it is a fine tool. What it does not do is the part that prevents mistakes: it will not list every program your wallet can close, name them, show their history, or stop you when one was used an hour ago. Also outside anyone’s reach: a program whose upgrade authority was revoked is immutable and can never be closed — its rent is permanently on-chain. And a deploy that failed partway leaves a different leftover, a buffer, which has its own page.

Questions

Can I get the rent back without destroying the program?
No. The rent is what keeps the program’s bytecode alive on-chain — the only way the deposit comes back is closing the program, and closing is permanent. If the program still serves anything, leave it alone; the scan shows its recent activity so you can tell.
Can a closed program ever be deployed again?
Never, by anyone. The chain keeps a tombstone at the program id specifically so it cannot be reused. A new deploy needs a new id — which is exactly why the confirmation here is deliberately heavy.
What stops me from closing the wrong program?
Four things, in order: nothing is ever pre-selected; a program used in the last 30 days must be selected through its own explicit control; the pre-sign manifest lists every program with its name and last activity and requires a typed confirmation; and the backend refuses the close if a selected program processed a transaction after your scan. What none of them can do is undo a close — that is why they all exist.
The CLI closes programs for free — why pay 5%?
It does, and for a single program you know by heart it is a good option. This page earns its share on everything around the close: finding every closeable program in one scan, naming them, dating their activity, batching the closes into one signing session, and standing in the way when something looks alive. The 5% applies only to SOL actually returned.
Why does a program say “never used since deploy”?
Because its only transaction on-chain is the deploy itself — nothing has ever called it. That is derived from the program’s own signature history, and it is the clearest sign a program was a test or an abandoned experiment.