Candy Machine is Metaplex’s minting program for NFT collections on Solana: a temporary on-chain “vending machine” that a creator loads with items and buyers mint from. The current version, Core Candy Machine, mints Metaplex Core assets, which use a single account per NFT and cost less than the legacy Token Metadata NFTs minted by Candy Machine V3. To launch, you create a Core collection, create the Candy Machine, insert your items, add guards for price and timing, and open the mint.
Key Facts
- Program: Core Candy Machine by Metaplex; it mints Core assets with a single-account model (Metaplex docs).
- Legacy version: Candy Machine V3 and its Sugar CLI are marked deprecated; Metaplex tells new projects to use Core Candy Machine (Metaplex docs).
- SDK: the JavaScript package is
@metaplex-foundation/mpl-core-candy-machine, used with Metaplex’s Umi framework. - Prerequisite: a Core collection must exist before the Candy Machine can be created.
- Guards: 23+ composable rules, such as Sol Payment, Start Date, End Date, Mint Limit, Bot Tax, Allow List and Token Gate.
- Cost: the Candy Machine account pays rent that grows with the number of items loaded; you can withdraw it after the launch to reclaim that rent.
How Candy Machine Works
Think of the machine as a list of slots. Each slot holds the name and metadata URI of one future NFT. Nothing exists on-chain as an NFT until a buyer mints; at that moment the program creates a Core asset from the next slot and adds it to your collection. Guards sit in front of the machine and decide who can mint, when, and at what price. If you are new to the Metaplex stack, start with what Metaplex is.
Step 1: Prepare Art and Metadata
Upload each image and a JSON metadata file (name, description, image link, attributes) to permanent storage such as Arweave or IPFS. You need one URI per item. Keep names short and consistent, because Core Candy Machine can compress repeated name and URI prefixes to save on-chain space.
Step 2: Create a Core Collection
Create the collection asset first with the Core program. It holds the collection name, image and, if you want, a Royalties plugin. Your wallet becomes the collection update authority, and it must sign the next step.
Step 3: Create the Candy Machine
Call create from the Core Candy Machine package with:
- a new keypair for the Candy Machine;
- the address of your Core collection, with the collection update authority signing;
itemsAvailable, the total number of NFTs;isMutable, whether minted assets can be updated later;- either
configLineSettings(store each item’s name and URI) orhiddenSettings(mint identical placeholders and reveal later). You must choose one, not both.
Step 4: Insert Items
With config lines, add the name and URI of every item to the machine in batches. The mint cannot sell out correctly until all itemsAvailable slots are filled. With hidden settings you skip this step and update metadata at reveal.
Step 5: Add Guards
Guards can be attached at creation or later. A simple public mint uses three:
| Guard | What it does |
|---|---|
| Sol Payment | charges a set price in SOL and sends it to your treasury wallet |
| Start Date | blocks minting before a chosen time |
| Mint Limit | caps how many NFTs one wallet can mint |
Add Bot Tax to charge a small penalty to transactions that fail other guards, and Allow List or Token Gate for presales. Guard groups let you run several phases, for example a holders-only window and then a public window.
Step 6: Mint and Close
Buyers mint through your site or a launchpad that reads the machine. Test the full flow on devnet before mainnet; free devnet SOL is enough for every step. After the mint ends, withdraw the Candy Machine to delete the account and get its rent back. The rent model is explained in Solana rent.
Limits and Common Mistakes
- Wrong version: most old tutorials use Sugar and Candy Machine V3; the commands do not apply to Core Candy Machine.
- Mutable metadata: with
isMutableset to true, you keep the power to change NFTs after the sale, and buyers know it. - Royalties are not automatic: royalties live in the collection’s Royalties plugin, and enforcement depends on the rule set; see the trade-offs in how to create an NFT on Solana.
- No code, no machine: if you only need one NFT, a Candy Machine is overkill; mint it directly.
Candy Machine and $DOLAN
A Candy Machine can sell NFTs for any SPL token through the Token Payment guard, not only SOL. A community could price a mint in DOLAN Duck ($DOLAN), a fair-launch SPL token with a fixed 98.3M supply and about 10,700 holders, contract address 4YK1njyeCkBuXG6phNtidJWKCbBhB659iwGkUJx98P5Z. The guard checks the mint address, so a copycat token with the same ticker would not be accepted, which is the same rule buyers should follow, as explained in what a contract address is.
It is Metaplex's minting program for NFT collections. Creators load it with items, and buyers mint NFTs from it under rules called guards.
Core Candy Machine. Metaplex marks Candy Machine V3 and the Sugar CLI as deprecated and recommends Core for new projects.
Yes, at a basic level. You call the JavaScript SDK with Umi to create the collection, the machine and the guards.
Modular rules that control minting, such as the price in SOL, the start date, a per-wallet limit, an allowlist or a bot tax.
Yes. Withdrawing the Candy Machine deletes its account and returns the rent to your wallet.
Yes. Run the whole flow on Solana devnet with free devnet SOL before you deploy on mainnet.