# 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="https://1720360561-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtADuWgc4JGmrr5PM54yT%2Fuploads%2FmlzImmUimXgatAylYXqc%2Fimage%20(73).png?alt=media&#x26;token=5210d7b1-e154-4ddb-a4a3-887e0a058e61" media="(prefers-color-scheme: dark)"><img src="https://1720360561-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtADuWgc4JGmrr5PM54yT%2Fuploads%2F6mAvlshunI0MRl9dCJEW%2Fimage%20(72).png?alt=media&#x26;token=76bd5ae2-9c5f-4969-91a0-681a33489404" 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).

***
