# Redeemed Amount Guard

This guard becomes more interesting when used with [Guard Groups](https://developers.metaplex.com/core-candy-machine/guard-groups) since it allows us to add global minting thresholds to our groups.

once that amount of

Assets have been minted

Minting will fail

Core Candy Machine

Owner: Core Candy Machine Core Program

Core Candy Guard

Owner: Core Candy Guard Program

GuardsRedeemedAmount- maximum...

Mint from

*Core Candy Guard Program*

Access Control

Mint from

*Core Candy Machine Program*

Mint Logic

Asset

[React Flow](https://reactflow.dev/)

### Guard Settings <a href="#guard-settings" id="guard-settings"></a>

The Redeemed Amount guard contains the following settings:

* **Maximum**: The maximum amount of NFTs that can be minted.

Set up a Core Candy Machine using the Redeemed Amount Guard

JavaScript

```
create(umi, {
  // ...
  itemsAvailable: 500,
  guards: {
    redeemedAmount: some({ maximum: 300 }),
  },
});
```

Notice that, even if the Candy Machine contains 500 items, only 300 of these items will be mintable because of this guard.

Thus, this guard becomes more useful when using [Guard Groups](https://developers.metaplex.com/core-candy-machine/guard-groups). Here’s another example using two groups such that the first 300 Assets can be minted for 1 SOL but the last 200 will need 2 SOL to mint.

Using the Redeemed Amount Guard with groups example

JavaScript

```
create(umi, {
  // ...
  itemsAvailable: 500,
  groups: [
    {
      label: "early",
      guards: {
        redeemedAmount: some({ maximum: 300 }),
        solPayment: some({ lamports: sol(1), destination: treasury }),
      },
    },
    {
      label: "late",
      guards: {
        solPayment: some({ lamports: sol(2), destination: treasury }),
      },
    },
  ],
});
```

### Mint Settings <a href="#mint-settings" id="mint-settings"></a>

*The Redeemed Amount guard does not need Mint Settings.*

### Route Instruction <a href="#route-instruction" id="route-instruction"></a>

*The Redeemed Amount guard does not support the route instruction.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://8bit-1.gitbook.io/solibrary/redeemed-amount-guard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
