# Minting & Redemption

### Overview

Deploy's minting and redemption process governs the full lifecycle of its synthetic yield-bearing tokens (“dAssets”), such as dUSD.

Both operations are conducted through an permissioned flow that ensures:

* Every dAsset is 1:1 backed by verifiable collateral.
* All actions are KYC/KYB-gated and EIP-712 signed.
* Custody remains under institutional MPC control at all times.

Minting is automated and instant, while redemptions follow a two-phase settlement; custodians must first prefund the contract before redemptions are executed on-chain.

### High Level Flow:

<figure><picture><source srcset="/files/xfUeHsYk1Fe3UE8Odx49" media="(prefers-color-scheme: dark)"><img src="/files/al5GxgxEJfWREaCPkrsC" alt=""></picture><figcaption></figcaption></figure>

### Detailed Flow:

**Step 1 — Quote**

* Backend returns a binding quote with fees, route (custodian), and caps.

**Step 2 — User Signature (EIP-712 Order)**

* User signs an order with: `benefactor`, `beneficiary`, `token`, `amount`, `expectedOut`, `expiry`, `nonce`, `route`.
  * **(Mint):** collateral token & `amountIn` → dAsset `amountOut`.
  * **(Redeem):** dAsset `amountIn` → collateral `amountOut`.

**Step 3 — Backend Validation**

* Verify signature, KYC/KYB status, nonce/expiry, whitelists, and per-block caps.
* Select authorized operational wallet: `MINTER` **or** `REDEEMER`.

**Step 4 — Preconditions on Balances**

* **(Mint):** User grants ERC-20 allowance; contract will `transferFrom()` collateral.
* **(Redeem):** Custodian prefunds the redemption contract balance first (required).

**Step 5 — On-Chain Execution (DeployMinting.sol)**

* Validate signature & route (must be whitelisted custodian).
* Enforce per-block ceilings / circuit breakers.
* Execute asset movement:
  * **(Mint):** Pull collateral from user → route to MPC custodian → mint dAssets to beneficiary.
  * **(Redeem):** burn dAssets from redeemer → transfer prefunded collateral to beneficiary.
* Emit `MintExecuted` / `RedeemExecuted` event.

**Step 6 — Post-Trade Accounting**

* **Custodian:**
  * (Mint): Allocates collateral to on-chain DN strategies.

**Settlement Timing**

* **Mint:** immediate (on-chain finality in the same transaction/block).
* **Redeem:** \~1 week standard operational window (prefunding + execution schedule).

***


---

# 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://docs.deploy.finance/flows/minting-and-redemption.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.
