Core Candy Machine
Withdrawing a Core Candy Machine
Last updated March 10, 2026
Summary
The deleteCandyMachine instruction permanently removes a Core Candy Machine from the Solana blockchain and returns all stored rent-exempt SOL to the authority wallet.
- Deletes the Candy Machine account data and reclaims the full rent deposit back to the authority
- This operation is irreversible -- the Candy Machine cannot be reinstated or recovered after withdrawal
- Only the Candy Machine authority can execute this instruction
Withdrawing a Core Candy Machine Account
The deleteCandyMachine function closes the on-chain Candy Machine account, erases all stored data (config lines, settings, item entries), and transfers the rent-exempt SOL balance back to the authority wallet.
This operation is irreversible so only withdraw your Core Candy Machine when you are 100% finished with the minting process. Your Core Candy Machine can not be reinstated or recovered.
Withdraw a Core Candy Machine
import { deleteCandyMachine } from '@metaplex-foundation/mpl-core-candy-machine'
import { publicKey } from '@metaplex-foundation/umi'
const candyMachineId = '11111111111111111111111111111111'
await deleteCandyMachine(umi, {
candyMachine: publicKey(candyMachineId),
}).sendAndConfirm(umi)
Notes
- This operation is irreversible. Once withdrawn, the Candy Machine account and all its data are permanently deleted from the blockchain.
- Withdrawal reclaims the full rent-exempt SOL deposit that was allocated when the Candy Machine was created. Larger collections with more config lines will return more SOL.
- Only withdraw after all minting activity is complete and you no longer need the Candy Machine for any purpose.
- The caller must be the Candy Machine authority; no other wallet can execute the delete instruction.
- If a Candy Guard is associated with the Candy Machine, it must be handled separately -- deleting the Candy Machine does not automatically close the Candy Guard account.
