> ## Documentation Index
> Fetch the complete documentation index at: https://docs.groundtech.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Redeem MicroVault shares

> Execute an instant redemption or request underlying liquidation.

Preview immediately before asking the shareholder to sign. The preview returns either an instant transaction or a requested redemption.

| Parameter | Meaning |
| - | - |
| `owner` | Share owner whose MicroVault shares will be redeemed and who submits the transaction returned by the preview. |
| `receiver` | Receiving wallet for the redeemed base asset. This is usually the same address as the share owner, but it may differ. |
| `shares` | Share amount in the share token's 18-decimal base units. |
| `minAssetsOut` | Minimum base-asset amount accepted for an instant redemption, expressed using the base asset's decimals. |

The receiver is fixed when a requested redemption is created. A later claim always sends the proceeds to that receiving wallet, even if another wallet submits the claim transaction.

## Prerequisites

* An active `VAULT_ID` and vault contract address
* A connected shareholder wallet on Ethereum Sepolia
* The share amount in 18-decimal base units
* A Viem `publicClient` and `walletClient`

## 1. Preview the redemption

```javascript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const response = await fetch(
  `${process.env.BASE_URL}/v3/microvaults/vaults/${vaultId}/redemptions/preview`,
  {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.GROUND_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ owner, receiver: owner, shares, minAssetsOut: "990000" }),
  },
);
if (!response.ok) throw new Error(await response.text());
const { plan } = await response.json();
```

`minAssetsOut` protects only the instant route. A requested redemption settles at the USDC and source proceeds attributable to that request; the preview is an estimate, not a guarantee.

| Preview mode | What the wallet signs | When the receiver gets the base asset |
| - | - | - |
| `instant` | One redemption transaction | In that transaction |
| `requested` | A request transaction, followed later by a claim transaction | When the claim transaction confirms |

## 2. Submit the wallet transaction

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const hash = await walletClient.sendTransaction({
  to: plan.directTransaction.to,
  data: plan.directTransaction.data,
  value: BigInt(plan.directTransaction.value ?? "0"),
});
const receipt = await publicClient.waitForTransactionReceipt({ hash });
if (receipt.status !== "success") throw new Error("Redemption transaction reverted");
```

An instant redemption transfers USDC in this transaction. A requested redemption escrows the shares while Ground exits the underlying sources.

## 3. Track a requested redemption

Extract the onchain request ID from the confirmed request receipt using the deployed vault ABI, and save it with the vault address, owner, receiver, and transaction hash. Use that ID as `REQUEST_ID` below.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -sS \
  "$BASE_URL/v3/microvaults/vaults/$VAULT_ID/redemptions/$REQUEST_ID" \
  -H "$AUTH" | jq
```

Poll until `status` is `claimable`. Use the source progress and expected timing in the response to explain what remains.

### Requested-redemption states

| State | Meaning |
| - | - |
| `pending` | Shares are reserved and one or more underlying source exits remain. |
| `fulfilling` | Source proceeds are being assigned to the redemption. |
| `claimable` | Liquidation is complete and the fixed receiver can receive the actual proceeds. |
| `claimed` | The base asset has been transferred to the receiver. |
| `cancelled` | The request was cancelled and its reserved shares were returned to the owner. |

`processingEstimate` uses integer `min` and `max` values with a `unit` of `seconds` or `banking_days`, matching the asset and withdrawal APIs. Ranges come from the underlying sources and the selected route. They support planning and UI messaging; they are not settlement guarantees. `null` means no reliable range is available.

### Balances during processing

`totalAssetsUnits` measures NAV net of redemption liabilities. `idleAssetsUnits` includes reserved idle assets; `freeIdleAssetsUnits` excludes those reservations. Assets in flight remain part of the valuation where applicable. A source position can decrease before its proceeds become claimable; inspect source in-flight amounts and redemption activity alongside NAV.

The share owner submits the request. Another wallet may submit the claim, but the proceeds always go to the fixed receiver. Ground manages the underlying source exit while it remains authorized to manage the vault.

## 4. Claim actual proceeds

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
const claimHash = await walletClient.writeContract({
  address: vaultAddress,
  abi: microVaultAbi,
  functionName: "claimRedeemRequest",
  args: [BigInt(requestId)],
});
const claimReceipt = await publicClient.waitForTransactionReceipt({ hash: claimHash });
if (claimReceipt.status !== "success") throw new Error("Redemption claim reverted");
```

## Confirm the redemption

An instant redemption completes with its first receipt. A requested redemption completes after the claim receipt succeeds and the redemption endpoint reports `claimed`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.