Available Guards
Mint Limit Guard
Last updated March 10, 2026
The Mint Limit guard restricts the number of Assets each wallet can mint from a Core Candy Machine, tracked per wallet, per Candy Machine, and per configurable identifier.
Overview
The Mint Limit guard allows specifying a limit on the number of Assets each wallet can mint.
The limit is set per wallet, per candy machine and per identifier — provided in the settings — to allow multiple mint limits within the same Core Candy Machine.
Guard Settings
The Mint Limit guard contains the following settings:
- ID: A unique identifier for this guard. Different identifiers will use different counters to track how many items were minted by a given wallet. This is particularly useful when using groups of guards as we may want each of them to have a different mint limit.
- Limit: The maximum number of mints allowed per wallet for that identifier.
Set up a Candy Machine using the Mint Limit guard
Mint Settings
The Mint Limit guard contains the following Mint Settings:
- ID: A unique identifier for this guard.
Note that, if you're planning on constructing instructions without the help of our SDKs, you will need to provide these Mint Settings and more as a combination of instruction arguments and remaining accounts. See the Core Candy Guard's program documentation for more details.
Mint with the Mint Limit Guard
You may pass the Mint Settings of the Mint Limit guard using the mintArgs argument like so.
mintV1(umi, {
// ...
mintArgs: {
mintLimit: some({ id: 1 }),
},
});
Route Instruction
The Mint Limit guard does not support the route instruction.
MintLimit Accounts
When the MintLimit Guard is used a MintCounter Account is created for each Wallet, CandyMachine and id combination. For validation purposes it can be fetched like this:
import { safeFetchMintCounterFromSeeds } from "@metaplex-foundation/mpl-core-candy-machine";
import { umi } from "@metaplex-foundation/mpl-core-candy-machine";
const mintCounter = await safeFetchMintCounterFromSeeds(umi, {
id: 1, // The mintLimit id you set in your guard config
user: umi.identity.publicKey,
candyMachine: candyMachine.publicKey,
// or candyMachine: publicKey("Address") with your CM Address
candyGuard: candyMachine.mintAuthority,
// or candyGuard: publicKey("Address") with your candyGuard Address
});
// Amount already minted
console.log(mintCounter.count)
Notes
- The Mint Limit counter is tracked on-chain via a
MintCounterPDA derived from the wallet address, the Candy Machine address, and the guardid. Each unique combination creates a separate counter account. - Using different
idvalues in separate guard groups allows each group to enforce its own independent mint limit for the same wallet. - The
MintCounteraccount persists on-chain even after the Candy Machine is fully minted out. You can fetch it withsafeFetchMintCounterFromSeedsto check how many Assets a given wallet has minted.
